inkscape: work around ARGMAX limit

This uses strictDeps to get our args passed to the linker low enough
to enable building inkscape. With strictDeps we need to correctly use
nativeBuildInputs to avoid an issue.
This commit is contained in:
Matthew Bauer 2018-06-18 18:41:17 -04:00
parent 06ab7d8e59
commit 1f8f89d309

View File

@ -17,6 +17,12 @@ stdenv.mkDerivation rec {
sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6"; sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6";
}; };
# Inkscape hits the ARGMAX when linking on macOS. It appears to be
# CMakes ARGMAX check doesnt offer enough padding for NIX_LDFLAGS.
# Setting strictDeps it avoids duplicating some dependencies so it
# will leave us under ARGMAX.
strictDeps = true;
unpackPhase = '' unpackPhase = ''
cp $src ${name}.tar.bz2 cp $src ${name}.tar.bz2
tar xvjf ${name}.tar.bz2 > /dev/null tar xvjf ${name}.tar.bz2 > /dev/null
@ -33,19 +39,19 @@ stdenv.mkDerivation rec {
--replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"' --replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
''; '';
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig cmake makeWrapper python2Env ];
buildInputs = [ buildInputs = [
perl perlXMLParser libXft libpng zlib popt boehmgc perl perlXMLParser libXft libpng zlib popt boehmgc
libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
makeWrapper gsl poppler imagemagick libwpg librevenge gsl poppler imagemagick libwpg librevenge
libvisio libcdr libexif potrace cmake python2Env libvisio libcdr libexif potrace
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = '' postInstall = ''
# Make sure PyXML modules can be found at run-time. # Make sure PyXML modules can be found at run-time.
rm "$out/share/icons/hicolor/icon-theme.cache" rm -f "$out/share/icons/hicolor/icon-theme.cache"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + 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/inkscape
install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview