about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/inkscape
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics/inkscape')
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix37
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch15
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix21
4 files changed, 107 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/default.nix b/nixpkgs/pkgs/applications/graphics/inkscape/default.nix
index e2f27e9a4955..810b19ba90a6 100644
--- a/nixpkgs/pkgs/applications/graphics/inkscape/default.nix
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/default.nix
@@ -3,14 +3,18 @@
 , boost
 , cairo
 , cmake
-, fetchpatch
+, double-conversion
 , fetchurl
 , gettext
+, gdl
 , glib
+, glib-networking
 , glibmm
 , gsl
-, gtkmm2
-, gtkspell2
+, gtk-mac-integration
+, gtkmm3
+, gtkspell3
+, gdk-pixbuf
 , imagemagick
 , lcms
 , libcdr
@@ -19,18 +23,20 @@
 , librevenge
 , librsvg
 , libsigcxx
+, libsoup
 , libvisio
 , libwpg
 , libXft
 , libxml2
 , libxslt
-, makeWrapper
+, ninja
 , perlPackages
 , pkg-config
 , poppler
 , popt
 , potrace
 , python3
+, substituteAll
 , wrapGAppsHook
 , zlib
 }:
@@ -44,11 +50,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "inkscape";
-  version = "0.92.5";
+  version = "1.0.1";
 
   src = fetchurl {
-    url = "https://media.inkscape.org/dl/resources/file/${pname}-${version}.tar.bz2";
-    sha256 = "02wsa66ifycibmgfsrhmhqdv41brg955lffq8drsjr5xw9lpzvl1";
+    url = "https://media.inkscape.org/dl/resources/file/${pname}-${version}.tar.xz";
+    sha256 = "1hjp5nnyx2m3miji6q4lcb6zgbi498v641dc7apkqqvayknrb4ng";
   };
 
   # Inkscape hits the ARGMAX when linking on macOS. It appears to be
@@ -57,21 +63,28 @@ stdenv.mkDerivation rec {
   # will leave us under ARGMAX.
   strictDeps = true;
 
+  patches = [
+    (substituteAll {
+      src = ./fix-python-paths.patch;
+      # Python is used at run-time to execute scripts,
+      # e.g., those from the "Effects" menu.
+      python3 = "${python3Env}/bin/python";
+    })
+  ];
+
   postPatch = ''
     patchShebangs share/extensions
-    patchShebangs fix-roff-punct
-
-    # Python is used at run-time to execute scripts, e.g., those from
-    # the "Effects" menu.
-    substituteInPlace src/extension/implementation/script.cpp \
-      --replace '"python-interpreter", "python"' '"python-interpreter", "${python3Env}/bin/python"'
+    patchShebangs share/templates
+    patchShebangs man/fix-roff-punct
   '';
 
   nativeBuildInputs = [
     pkg-config
     cmake
-    makeWrapper
+    ninja
     python3Env
+    glib # for setup hook
+    gdk-pixbuf # for setup hook
     wrapGAppsHook
   ] ++ (with perlPackages; [
     perl
@@ -81,11 +94,14 @@ stdenv.mkDerivation rec {
   buildInputs = [
     boehmgc
     boost
+    double-conversion
+    gdl
     gettext
     glib
+    glib-networking
     glibmm
     gsl
-    gtkmm2
+    gtkmm3
     imagemagick
     lcms
     libcdr
@@ -94,6 +110,7 @@ stdenv.mkDerivation rec {
     librevenge
     librsvg # for loading icons
     libsigcxx
+    libsoup
     libvisio
     libwpg
     libXft
@@ -106,9 +123,10 @@ stdenv.mkDerivation rec {
     python3Env
     zlib
   ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
-    gtkspell2
+    gtkspell3
   ] ++ stdenv.lib.optionals stdenv.isDarwin [
     cairo
+    gtk-mac-integration
   ];
 
   # Make sure PyXML modules can be found at run-time.
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix b/nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix
new file mode 100644
index 000000000000..66a758f9fe51
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch b/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch
new file mode 100644
index 000000000000..9428ade88630
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch
@@ -0,0 +1,15 @@
+--- a/src/extension/implementation/script.cpp
++++ b/src/extension/implementation/script.cpp
+@@ -77,10 +77,10 @@ const std::map<std::string, Script::inte
+         { "python",  {"python-interpreter",  {"pythonw"           }}},
+ #elif defined __APPLE__
+         { "perl",    {"perl-interpreter",    {"perl"              }}},
+-        { "python",  {"python-interpreter",  {"python3"           }}},
++        { "python",  {"python-interpreter",  {"@python3@"         }}},
+ #else
+         { "perl",    {"perl-interpreter",    {"perl"              }}},
+-        { "python",  {"python-interpreter",  {"python3", "python" }}},
++        { "python",  {"python-interpreter",  {"@python3@"         }}},
+ #endif
+         { "python2", {"python2-interpreter", {"python2", "python" }}},
+         { "ruby",    {"ruby-interpreter",    {"ruby"    }}},
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix b/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
new file mode 100644
index 000000000000..cca7b1fc3a54
--- /dev/null
+++ b/nixpkgs/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;
+}