summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-09-10 19:26:03 +0100
committerGitHub <noreply@github.com>2020-09-10 19:26:03 +0100
commit20e90aac2e5ce9b44398faaf5cc971e4d09d305a (patch)
tree8fc2c94bcb3350913cae51652fc87952d37b68e4 /pkgs/applications/graphics
parent23e06e611ae4185ce4d35611e51b7a2a8ca7cd06 (diff)
parent2e0a15fce1780ccd74e023a59b7f23a4f47fa666 (diff)
downloadnixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar.gz
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar.bz2
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar.lz
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar.xz
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.tar.zst
nixpkgs-20e90aac2e5ce9b44398faaf5cc971e4d09d305a.zip
Merge pull request #95114 from raboof/inkscape-extensions
inkscape: allow loading external extensions
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/inkscape/extensions.nix37
-rw-r--r--pkgs/applications/graphics/inkscape/with-extensions.nix21
2 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/inkscape/extensions.nix b/pkgs/applications/graphics/inkscape/extensions.nix
new file mode 100644
index 00000000000..66a758f9fe5
--- /dev/null
+++ b/pkgs/applications/graphics/inkscape/extensions.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, fetchFromGitHub
+}:
+
+{
+  hexmap = stdenv.mkDerivation {
+    name = "hexmap";
+    version = "2020-06-06";
+
+    src = fetchFromGitHub {
+      owner = "lifelike";
+      repo = "hexmapextension";
+      rev = "11401e23889318bdefb72df6980393050299d8cc";
+      sha256 = "1a4jhva624mbljj2k43wzi6hrxacjz4626jfk9y2fg4r4sga22mm";
+    };
+
+    preferLocalBuild = true;
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p "$out/share/inkscape/extensions"
+      cp -p *.inx *.py "$out/share/inkscape/extensions/"
+      find "$out/share/inkscape/extensions/" -name "*.py" -exec chmod +x {} \;
+
+      runHook postInstall
+    '';
+
+    meta = with stdenv.lib; {
+      description = "This is an extension for creating hex grids in Inkscape. It can also be used to make brick patterns of staggered rectangles";
+      homepage = "https://github.com/lifelike/hexmapextension";
+      license = licenses.gpl2Plus;
+      maintainers = [ maintainers.raboof ];
+      platforms = platforms.all;
+    };
+  };
+}
diff --git a/pkgs/applications/graphics/inkscape/with-extensions.nix b/pkgs/applications/graphics/inkscape/with-extensions.nix
new file mode 100644
index 00000000000..cca7b1fc3a5
--- /dev/null
+++ b/pkgs/applications/graphics/inkscape/with-extensions.nix
@@ -0,0 +1,21 @@
+{ lib
+, inkscape
+, symlinkJoin
+, makeWrapper
+, inkscapeExtensions ? []
+}:
+
+symlinkJoin {
+  name = "inkscape-with-extensions-${lib.getVersion inkscape}";
+
+  paths = [ inkscape ] ++ inkscapeExtensions;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    rm -f $out/bin/inkscape
+    makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
+  '';
+
+  inherit (inkscape) meta;
+}