netpbm: Fix cross-compilation
Co-Authored-By: Christian Kampka <christian@kampka.net>
This commit is contained in:
parent
d509c583fc
commit
43ea7e011d
|
@ -13,6 +13,7 @@
|
||||||
, libtiff
|
, libtiff
|
||||||
, enableX11 ? false
|
, enableX11 ? false
|
||||||
, libX11
|
, libX11
|
||||||
|
, buildPackages
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
@ -44,12 +45,22 @@ stdenv.mkDerivation {
|
||||||
jbigkit
|
jbigkit
|
||||||
] ++ lib.optional enableX11 libX11;
|
] ++ lib.optional enableX11 libX11;
|
||||||
|
|
||||||
|
|
||||||
|
strictDeps = true;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
STRIPPROG = "${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Install libnetpbm.so symlink to correct destination
|
# Install libnetpbm.so symlink to correct destination
|
||||||
substituteInPlace lib/Makefile \
|
substituteInPlace lib/Makefile \
|
||||||
--replace '/sharedlink' '/lib'
|
--replace '/sharedlink' '/lib'
|
||||||
|
|
||||||
|
# TODO: move to config.mk in 10.91.4
|
||||||
|
substituteInPlace GNUmakefile \
|
||||||
|
--replace 'pkg-config' '${buildPackages.pkgconfig}/bin/${buildPackages.pkgconfig.targetPrefix}pkg-config'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
|
@ -60,6 +71,13 @@ stdenv.mkDerivation {
|
||||||
# Disable building static library
|
# Disable building static library
|
||||||
echo "STATICLIB_TOO = N" >> config.mk
|
echo "STATICLIB_TOO = N" >> config.mk
|
||||||
|
|
||||||
|
# Enable cross-compilation
|
||||||
|
echo 'AR = ${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar' >> config.mk
|
||||||
|
echo 'CC = ${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' >> config.mk
|
||||||
|
echo 'CC_FOR_BUILD = ${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc' >> config.mk
|
||||||
|
echo 'LD_FOR_BUILD = $(CC_FOR_BUILD)' >> config.mk
|
||||||
|
echo 'RANLIB = ${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib' >> config.mk
|
||||||
|
|
||||||
# Use libraries from Nixpkgs
|
# Use libraries from Nixpkgs
|
||||||
echo "TIFFLIB = libtiff.so" >> config.mk
|
echo "TIFFLIB = libtiff.so" >> config.mk
|
||||||
echo "TIFFLIB_NEEDS_JPEG = N" >> config.mk
|
echo "TIFFLIB_NEEDS_JPEG = N" >> config.mk
|
||||||
|
|
Loading…
Reference in New Issue