diff --git a/pkgs/applications/graphics/inkscape/0.x.nix b/pkgs/applications/graphics/inkscape/0.x.nix new file mode 100644 index 00000000000..880ecfb9f0b --- /dev/null +++ b/pkgs/applications/graphics/inkscape/0.x.nix @@ -0,0 +1,133 @@ +{ stdenv +, boehmgc +, boost +, cairo +, cmake +, fetchpatch +, fetchurl +, gettext +, glib +, glibmm +, gsl +, gtkmm2 +, gtkspell2 +, imagemagick +, lcms +, libcdr +, libexif +, libpng +, librevenge +, librsvg +, libsigcxx +, libvisio +, libwpg +, libXft +, libxml2 +, libxslt +, makeWrapper +, perlPackages +, pkg-config +, poppler +, popt +, potrace +, python3 +, wrapGAppsHook +, zlib +}: +let + python3Env = python3.withPackages + (ps: with ps; [ + numpy + lxml + scour + ]); +in +stdenv.mkDerivation rec { + pname = "inkscape_0"; + version = "0.92.5"; + + src = fetchurl { + url = "https://media.inkscape.org/dl/resources/file/inkscape-${version}.tar.bz2"; + sha256 = "ge5/aeK9ZKlzQ9g5Wkp6eQWyG4YVZu1eXZF5F41Rmgs="; + }; + + # Inkscape hits the ARGMAX when linking on macOS. It appears to be + # CMake’s ARGMAX check doesn’t offer enough padding for NIX_LDFLAGS. + # Setting strictDeps it avoids duplicating some dependencies so it + # will leave us under ARGMAX. + strictDeps = true; + + 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"' + ''; + + nativeBuildInputs = [ + pkg-config + cmake + makeWrapper + python3Env + wrapGAppsHook + ] ++ (with perlPackages; [ + perl + XMLParser + ]); + + buildInputs = [ + boehmgc + boost + gettext + glib + glibmm + gsl + gtkmm2 + imagemagick + lcms + libcdr + libexif + libpng + librevenge + librsvg # for loading icons + libsigcxx + libvisio + libwpg + libXft + libxml2 + libxslt + perlPackages.perl + poppler + popt + potrace + python3Env + zlib + ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ + gtkspell2 + ] ++ stdenv.lib.optionals stdenv.isDarwin [ + cairo + ]; + + # Make sure PyXML modules can be found at run-time. + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape + install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview + ''; + + meta = with stdenv.lib; { + description = "Legacy version of vector graphics editor"; + homepage = "https://www.inkscape.org"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.jtojnar ]; + platforms = platforms.all; + longDescription = '' + Inkscape is a feature-rich vector graphics editor that edits + files in the W3C SVG (Scalable Vector Graphics) file format. + + If you want to import .eps files install ps2edit. + ''; + }; +} diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix index e2f27e9a495..3f8b306acf8 100644 --- a/pkgs/applications/graphics/inkscape/default.nix +++ b/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"; 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 = "1fwl7yjkykqb86555k4fm24inhc40mrvxqwgl2v2vi9alv8j7hc9"; }; # 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/pkgs/applications/graphics/inkscape/fix-python-paths.patch b/pkgs/applications/graphics/inkscape/fix-python-paths.patch new file mode 100644 index 00000000000..9428ade8863 --- /dev/null +++ b/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 imagemagick != null && transfig != null && - inkscape != null && + inkscape_0 != null && fontconfig != null && ghostscript != null; @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { -e 's|Popen("pdflatex|Popen("${tex}/bin/pdflatex|g' \ -e 's|"fc-match"|"${fontconfig.bin}/bin/fc-match"|g' \ -e 's|"fc-list"|"${fontconfig.bin}/bin/fc-list"|g' \ - -e 's|cmd = "inkscape|cmd = "${inkscape}/bin/inkscape|g' \ + -e 's|cmd = "inkscape|cmd = "${inkscape_0}/bin/inkscape|g' \ -e 's|cmd = "fig2dev|cmd = "${transfig}/bin/fig2dev|g' \ -e 's|cmd = \["ps2pdf|cmd = ["${ghostscript}/bin/ps2pdf|g' \ -e 's|cmd = "convert|cmd = "${imagemagick.out}/bin/convert|g' \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d8759cb7bd6..0c3a450031f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20623,6 +20623,10 @@ in lcms = lcms2; }; + inkscape_0 = callPackage ../applications/graphics/inkscape/0.x.nix { + lcms = lcms2; + }; + inspectrum = libsForQt5.callPackage ../applications/radio/inspectrum { }; ion3 = callPackage ../applications/window-managers/ion-3 {