From a11763fa36aa7fcb8da75d28adfdc11e9640d2d7 Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Thu, 30 Dec 2021 15:08:48 +0000 Subject: [PATCH] libjxl: Fix tests on darwin This fixes the LibraryCLinkageTest, which was failing to find the built library: 1122/1129 Test #1128: LibraryCLinkageTest .......................................................................................................Subprocess aborted***Exception: 0.32 sec dyld[53579]: Library not loaded: @rpath/libjxl.0.dylib Referenced from: /private/tmp/nix-build-libjxl-0.5.drv-1/source/build/tools/tests/libjxl_test Reason: tried: '/nix/store/82d092jfk2sckailcp5hpb29xsxhk4h2-swift-corefoundation/Library/Frameworks/libjxl.0.dylib' (no such file), '/nix/store/82d092jfk2sckailcp5hpb29xsxhk4h2-swift-corefoundation/Library/Frameworks/libjxl.0.dylib' (no --- pkgs/development/libraries/libjxl/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libjxl/default.nix b/pkgs/development/libraries/libjxl/default.nix index 828090875e86..fa5b53bd4485 100644 --- a/pkgs/development/libraries/libjxl/default.nix +++ b/pkgs/development/libraries/libjxl/default.nix @@ -108,7 +108,9 @@ stdenv.mkDerivation rec { # LD_LIBRARY_PATH setting errors with: # /build/source/build/tools/tests/libjxl_test: error while loading shared libraries: libjxl.so.0 # The required file is in the build directory (`$PWD`). - preCheck = '' + preCheck = if stdenv.isDarwin then '' + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD + '' else '' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD '';