git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #95114 from raboof/inkscape-extensions

inkscape: allow loading external extensions

commit20e90aac2e5ce9b44398faaf5cc971e4d09d305a authorRobert Scott <code@humanleg.org.uk> dateThu 10 Sep 2020, 19:26 (6 years ago) parent23e06e62e0a15f
3 files changed+62
pkgs/applications/graphics/inkscape/extensions.nix+37 pkgs/applications/graphics/inkscape/with-extensions.nix+21 pkgs/top-level/all-packages.nix+4
pkgs/applications/graphics/inkscape/extensions.nixnew file+37
@@ -0,0 +1,37 @@
1+{ stdenv
2+, fetchFromGitHub
3+}:
4+
5+{
6+ hexmap = stdenv.mkDerivation {
7+ name = "hexmap";
8+ version = "2020-06-06";
9+
10+ src = fetchFromGitHub {
11+ owner = "lifelike";
12+ repo = "hexmapextension";
13+ rev = "11401e23889318bdefb72df6980393050299d8cc";
14+ sha256 = "1a4jhva624mbljj2k43wzi6hrxacjz4626jfk9y2fg4r4sga22mm";
15+ };
16+
17+ preferLocalBuild = true;
18+
19+ installPhase = ''
20+ runHook preInstall
21+
22+ mkdir -p "$out/share/inkscape/extensions"
23+ cp -p *.inx *.py "$out/share/inkscape/extensions/"
24+ find "$out/share/inkscape/extensions/" -name "*.py" -exec chmod +x {} \;
25+
26+ runHook postInstall
27+ '';
28+
29+ meta = with stdenv.lib; {
30+ description = "This is an extension for creating hex grids in Inkscape. It can also be used to make brick patterns of staggered rectangles";
31+ homepage = "https://github.com/lifelike/hexmapextension";
32+ license = licenses.gpl2Plus;
33+ maintainers = [ maintainers.raboof ];
34+ platforms = platforms.all;
35+ };
36+ };
37+}
pkgs/applications/graphics/inkscape/with-extensions.nixnew file+21
@@ -0,0 +1,21 @@
1+{ lib
2+, inkscape
3+, symlinkJoin
4+, makeWrapper
5+, inkscapeExtensions ? []
6+}:
7+
8+symlinkJoin {
9+ name = "inkscape-with-extensions-${lib.getVersion inkscape}";
10+
11+ paths = [ inkscape ] ++ inkscapeExtensions;
12+
13+ buildInputs = [ makeWrapper ];
14+
15+ postBuild = ''
16+ rm -f $out/bin/inkscape
17+ makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
18+ '';
19+
20+ inherit (inkscape) meta;
21+}
pkgs/top-level/all-packages.nix+4
@@ -21202,6 +21202,10 @@ in
2120221202 lcms = lcms2;
2120321203 };
2120421204
21205+ inkscape-with-extensions = callPackage ../applications/graphics/inkscape/with-extensions.nix { };
21206+
21207+ inkscape-extensions = recurseIntoAttrs (callPackages ../applications/graphics/inkscape/extensions.nix {});
21208+
2120521209 inkscape_0 = callPackage ../applications/graphics/inkscape/0.x.nix {
2120621210 lcms = lcms2;
2120721211 };