From 67b4880faa39b71356c6a085d4addce61a4f454d Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 10 Aug 2020 23:24:20 +0200 Subject: [PATCH 1/2] inkscape: introduce a way to add external extensions Co-Authored-By: Stefan Siegl --- .../graphics/inkscape/with-extensions.nix | 21 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/applications/graphics/inkscape/with-extensions.nix 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; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5b0985e7839..658e7f38e9a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20927,6 +20927,8 @@ in lcms = lcms2; }; + inkscape-with-extensions = callPackage ../applications/graphics/inkscape/with-extensions.nix { }; + inkscape_0 = callPackage ../applications/graphics/inkscape/0.x.nix { lcms = lcms2; }; From 2e0a15fce1780ccd74e023a59b7f23a4f47fa666 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 10 Aug 2020 23:30:04 +0200 Subject: [PATCH 2/2] inkscape-extensions.hexmap: init at 2020-06-06 --- .../graphics/inkscape/extensions.nix | 37 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/applications/graphics/inkscape/extensions.nix 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 658e7f38e9a..6448719aabf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20929,6 +20929,8 @@ in inkscape-with-extensions = callPackage ../applications/graphics/inkscape/with-extensions.nix { }; + inkscape-extensions = recurseIntoAttrs (callPackages ../applications/graphics/inkscape/extensions.nix {}); + inkscape_0 = callPackage ../applications/graphics/inkscape/0.x.nix { lcms = lcms2; };