deskew: ensure libtiff can be found at runtime

This commit is contained in:
Dominik Honnef 2022-11-03 15:22:07 +01:00
parent 100e2c666c
commit 1a185c0b32

View file

@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
buildPhase = ''
runHook preBuild
patchShebangs ./Scripts
# Deskew insists on using dlopen to load libtiff, we insist it links against it.
sed -i -e 's/{$DEFINE DYNAMIC_DLL_LOADING}//' Imaging/LibTiff/LibTiffDynLib.pas
sed -i -e 's/if LibTiffDynLib\.LoadTiffLibrary then//' Imaging/LibTiff/ImagingTiffLib.pas
# Make sure libtiff is in the RPATH, so that Nix can find and track the runtime dependency
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${lib.getLib libtiff}/lib"
pushd Scripts && ./compile.sh && popd
runHook postBuild
'';