From 1a185c0b32fc76ad995cb013a4bc87a22595af13 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Thu, 3 Nov 2022 15:22:07 +0100 Subject: [PATCH] deskew: ensure libtiff can be found at runtime --- pkgs/applications/graphics/deskew/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/graphics/deskew/default.nix b/pkgs/applications/graphics/deskew/default.nix index c19b5de2b69c..ad3a20d2431c 100644 --- a/pkgs/applications/graphics/deskew/default.nix +++ b/pkgs/applications/graphics/deskew/default.nix @@ -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 '';