Merge pull request #199353 from dominikh/deskew

deskew: ensure libtiff can be found at runtime
This commit is contained in:
Doron Behar 2023-06-28 12:03:03 +00:00 committed by GitHub
commit 9d20946e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
'';