···1818 buildPhase = ''
1919 runHook preBuild
2020 patchShebangs ./Scripts
2121+2222+ # Deskew insists on using dlopen to load libtiff, we insist it links against it.
2323+ sed -i -e 's/{$DEFINE DYNAMIC_DLL_LOADING}//' Imaging/LibTiff/LibTiffDynLib.pas
2424+ sed -i -e 's/if LibTiffDynLib\.LoadTiffLibrary then//' Imaging/LibTiff/ImagingTiffLib.pas
2525+ # Make sure libtiff is in the RPATH, so that Nix can find and track the runtime dependency
2626+ export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${lib.getLib libtiff}/lib"
2127 pushd Scripts && ./compile.sh && popd
2228 runHook postBuild
2329 '';