Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inkscape: 0.92.5 -> 1.0 #85169

Merged
merged 4 commits into from Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
133 changes: 133 additions & 0 deletions 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.
'';
};
}
50 changes: 34 additions & 16 deletions pkgs/applications/graphics/inkscape/default.nix
Expand Up @@ -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
Expand All @@ -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
}:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -81,11 +94,14 @@ stdenv.mkDerivation rec {
buildInputs = [
boehmgc
boost
double-conversion
gdl
gettext
glib
glib-networking
glibmm
gsl
gtkmm2
gtkmm3
imagemagick
lcms
libcdr
Expand All @@ -94,6 +110,7 @@ stdenv.mkDerivation rec {
librevenge
librsvg # for loading icons
libsigcxx
libsoup
libvisio
libwpg
libXft
Expand All @@ -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
prusnak marked this conversation as resolved.
Show resolved Hide resolved
];

# Make sure PyXML modules can be found at run-time.
Expand Down
15 changes: 15 additions & 0 deletions 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" }}},
4 changes: 2 additions & 2 deletions pkgs/data/fonts/emojione/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:
{ stdenv, fetchFromGitHub, inkscape_0, imagemagick, potrace, svgo, scfbuild }:

stdenv.mkDerivation rec {
pname = "emojione";
Expand All @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
export HOME="$NIX_BUILD_ROOT"
'';

nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];
nativeBuildInputs = [ inkscape_0 imagemagick potrace svgo scfbuild ];

enableParallelBuilding = true;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/fonts/twemoji-color-font/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:
{ stdenv, fetchFromGitHub, inkscape_0, imagemagick, potrace, svgo, scfbuild }:

stdenv.mkDerivation rec {
pname = "twemoji-color-font";
Expand All @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "00pbgqpkq21wl8fs0q1xp49xb10m48b9sz8cdc58flkd2vqfssw2";
};

nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];
nativeBuildInputs = [ inkscape_0 imagemagick potrace svgo scfbuild ];
# silence inkscape errors about non-writable home
preBuild = "export HOME=\"$NIX_BUILD_ROOT\"";
makeFlags = [ "SCFBUILD=${scfbuild}/bin/scfbuild" ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/icons/bibata-cursors/default.nix
@@ -1,4 +1,4 @@
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape, xcursorgen, python3 }:
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape_0, xcursorgen, python3 }:

let
py = python3.withPackages(ps: [ ps.pillow ]);
Expand All @@ -25,7 +25,7 @@ in stdenvNoCC.mkDerivation rec {

nativeBuildInputs = [
gnome-themes-extra
inkscape
inkscape_0
xcursorgen
py
];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/icons/bibata-cursors/extra.nix
@@ -1,4 +1,4 @@
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape, xcursorgen, python3 }:
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape_0, xcursorgen, python3 }:

let
py = python3.withPackages(ps: [ ps.pillow ]);
Expand All @@ -25,7 +25,7 @@ in stdenvNoCC.mkDerivation rec {

nativeBuildInputs = [
gnome-themes-extra
inkscape
inkscape_0
xcursorgen
py
];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/icons/bibata-cursors/translucent.nix
@@ -1,4 +1,4 @@
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape, xcursorgen }:
{ stdenvNoCC, fetchFromGitHub, gnome-themes-extra, inkscape_0, xcursorgen }:

stdenvNoCC.mkDerivation rec {
pname = "bibata-cursors-translucent";
Expand All @@ -18,7 +18,7 @@ stdenvNoCC.mkDerivation rec {

nativeBuildInputs = [
gnome-themes-extra
inkscape
inkscape_0
xcursorgen
];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/icons/capitaine-cursors/default.nix
@@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub
, inkscape, xcursorgen, bc }:
, inkscape_0, xcursorgen, bc }:

stdenv.mkDerivation rec {
pname = "capitaine-cursors";
Expand All @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
'';

buildInputs =[
inkscape
inkscape_0
xcursorgen
bc
];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/icons/numix-cursor-theme/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inkscape, xcursorgen }:
{ stdenv, fetchFromGitHub, inkscape_0, xcursorgen }:

stdenv.mkDerivation rec {
version = "1.1";
Expand All @@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "0p8h48wsy3z5dz9vdnp01fpn6q8ky0h74l5qgixlip557bsa1spi";
};

nativeBuildInputs = [ inkscape xcursorgen ];
nativeBuildInputs = [ inkscape_0 xcursorgen ];

buildPhase = ''
patchShebangs .
Expand Down