Skip to content

Commit

Permalink
inkscape: fix on Darwin
Browse files Browse the repository at this point in the history
Fixes #39175
  • Loading branch information
matthewbauer committed Apr 25, 2018
1 parent 04e13de commit a276d51
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions pkgs/applications/graphics/inkscape/default.nix
Expand Up @@ -2,9 +2,15 @@
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper
, gsl, python2, poppler, imagemagick, libwpg, librevenge
, libvisio, libcdr, libexif, potrace, cmake
, libvisio, libcdr, libexif, potrace, autoreconfHook
, intltool
, lib
}:

# Note that originally this Nix expression used CMake to build but
# this led to errors on MacOS of "Too many arguments". Inkscape
# supports autoconf and we will use this for now on.

This comment has been minimized.

Copy link
@aszlig

aszlig Apr 25, 2018

Member

I don't think it's a good idea to switch back to autoconf, because the upstream repository uses CMake (and I think Meson soon) and only generates autotools files in their tarball. Besides of that, now the build fails to link GNU/Linux and thus NixOS as well. Another problem with the generated autotools files is that it also randomly fails with parallel building. For example building with 48 cores I get to the linking phase in about 1 of 10 builds.

The linking error:

/nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/ld: cannot find -licui18n
/nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/ld: cannot find -licuuc
/nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/ld: cannot find -licudata

This comment has been minimized.

Copy link
@aszlig

aszlig Apr 25, 2018

Member

Actually I was wrong and they don't generate it, but they still have it in the 0.92.x branch. All the autotools files are already gone in master, so sooner or later we will need to switch back to CMake again.

This comment has been minimized.

Copy link
@aszlig

aszlig Apr 25, 2018

Member

Fixed in 6c748ae and I tried to make the changes as minimal as possible to hopefully not break anything on OS X.

This comment has been minimized.

Copy link
@Mic92

Mic92 May 14, 2018

Member

It looks like inkscape is currently broken on linux on both x86_64 and aarch64: because helper/sp-marshal.h is not generated in time. I suspect parallel building is the problem here. @matthewbauer which command received too many arguments on darwin?

This comment has been minimized.

Copy link
@Mic92

Mic92 May 14, 2018

Member

Ah clang it is according to the issue.


let
python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
in
Expand All @@ -17,12 +23,6 @@ stdenv.mkDerivation rec {
sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6";
};

unpackPhase = ''
cp $src ${name}.tar.bz2
tar xvjf ${name}.tar.bz2 > /dev/null
cd ${name}
'';

postPatch = ''
patchShebangs share/extensions
patchShebangs fix-roff-punct
Expand All @@ -33,25 +33,26 @@ stdenv.mkDerivation rec {
--replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
'';

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig autoreconfHook intltool ];
buildInputs = [
perl perlXMLParser libXft libpng zlib popt boehmgc
libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
makeWrapper gsl poppler imagemagick libwpg librevenge
libvisio libcdr libexif potrace cmake python2Env
libvisio libcdr libexif potrace python2Env
];

enableParallelBuilding = true;

preConfigure = ''
intltoolize -f
'';

postInstall = ''
# Make sure PyXML modules can be found at run-time.
rm "$out/share/icons/hicolor/icon-theme.cache"
'' + 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; {
meta = with lib; {
license = "GPL";
homepage = https://www.inkscape.org;
description = "Vector graphics editor";
Expand All @@ -62,5 +63,6 @@ stdenv.mkDerivation rec {
If you want to import .eps files install ps2edit.
'';
maintainers = with maintainters; [ matthewbauer ];
};
}

0 comments on commit a276d51

Please sign in to comment.