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