treewide: Remove now-unneeded LD_LIBRARY_PATH in cmake derivations

Since the setting DCMAKE_SKIP_BUILD_RPATH was disabled, we can now run
the checkPhase of cmake derivations without having to tweak the
LD_LIBRARY_PATH anymore.
This commit is contained in:
Josef Kemetmüller 2021-08-20 17:29:48 +02:00 committed by Artturin
parent 1ca04aa9f1
commit bcd7045998
44 changed files with 3 additions and 191 deletions

View file

@ -44,13 +44,6 @@ in mkDerivation rec {
export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
'';
# During build, binaries are called that rely on freshly built
# libraries. These reside in build/lib, and are not found by
# default.
preBuild = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
'';
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DPARAVIEW_ENABLE_FFMPEG=ON"

View file

@ -16,13 +16,6 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" ]; # headers are just two and very small
preConfigure =
if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}"`pwd`/build/src
'' else ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}"`pwd`/build/src
'';
nativeBuildInputs = [ cmake ];
meta = with lib; {

View file

@ -59,10 +59,6 @@ in stdenv.mkDerivation {
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
'';
preBuild = ''
export LD_LIBRARY_PATH="$PWD/run"
'';
postInstall = ''
# to remove "cycle detected in the references"
mkdir -p $dev/lib/wireshark

View file

@ -154,8 +154,6 @@ stdenv.mkDerivation rec {
test-xml-pricedb \
test-xml-transaction \
test-xml2-is-file
export LD_LIBRARY_PATH="$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test:$PWD/lib/gnucash/test/future"
'';
preFixup = ''

View file

@ -22,10 +22,6 @@ stdenv.mkDerivation rec {
] ++ lib.optionals portaudioSupport [ portaudio ];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD
'';
meta = with lib; {
description = "Digital Speech Decoder";

View file

@ -73,11 +73,6 @@ stdenv.mkDerivation rec {
patchShebangs ..
'';
# needed by tests (so libsimgrid.so is found)
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/build/lib"
'';
doCheck = true;
preCheck = ''
# prevent the execution of tests known to fail

View file

@ -66,7 +66,6 @@ stdenv.mkDerivation rec {
cd "$sourceRoot"
patchPhase
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libXext}/lib"
${stdenv.shell} bootStrap.bash \
--with-core \
${if withQT then "--with-qt" else "--without-qt"} \

View file

@ -32,12 +32,6 @@ llvmPackages.stdenv.mkDerivation rec {
cmakeFlags = [ "-DWARNINGS_AS_ERRORS=OFF" "-DWITH_PYTHON_BINDINGS=OFF" ];
# To handle the lack of 'local' RPATH; required, as they call one of
# their built binaries requiring their libs, in the build process.
preBuild = ''
export LD_LIBRARY_PATH="$(pwd)/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
# Note: only openblas and not atlas part of this Nix expression
# see pkgs/development/libraries/science/math/liblapack/3.5.0.nix
# to get a hint howto setup atlas instead of openblas

View file

@ -90,12 +90,6 @@ let
doCheck = false;
checkPhase = ''
while IFS= read -r -d ''' dir
do
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/$dir
export LD_LIBRARY_PATH
done < <(find . -type d -print0)
pushd ..
# IPC tests need aleth avaliable, so we disable it
sed -i "s/IPC_ENABLED=true/IPC_ENABLED=false\nIPC_FLAGS=\"--no-ipc\"/" ./scripts/tests.sh

View file

@ -14,10 +14,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD
'';
meta = with lib; {
description = "P25 Phase 1 and ProVoice vocoder";

View file

@ -21,10 +21,6 @@ stdenv.mkDerivation rec {
doCheck = true;
checkTarget = "test";
preCheck = ''
export LD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io
export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io
'';
meta = with lib; {
description = "An open source implementation of the actor model in C++";

View file

@ -19,11 +19,6 @@ stdenv.mkDerivation rec {
"-DCPP-NETLIB_BUILD_SHARED_LIBS=ON"
];
# The test driver binary lacks an RPath to the library's libs
preCheck = ''
export LD_LIBRARY_PATH=$PWD/libs/network/src
'';
# Most tests make network GET requests to various websites
doCheck = false;

View file

@ -27,9 +27,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DCTESTS=ON" ];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=`pwd`''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
checkTarget = "criterion_tests test";
outputs = [ "dev" "out" ];

View file

@ -31,14 +31,6 @@ stdenv.mkDerivation rec {
"-DPLUGIN_VIEW_GRANTLEE=ON"
];
preBuild = lib.optionalString stdenv.isLinux ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
'';
postBuild = lib.optionalString stdenv.isLinux ''
unset LD_LIBRARY_PATH
'';
meta = with lib; {
description = "C++ Web Framework built on top of Qt";
homepage = "https://cutelyst.org/";

View file

@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
"@CMAKE_INSTALL_LIBDIR@"
'';
checkPhase = "LD_LIBRARY_PATH=$(pwd) python ./run_tests";
checkPhase = "python ./run_tests";
meta = with lib; {
description = "C++11 port of docopt";

View file

@ -49,7 +49,6 @@ stdenv.mkDerivation rec {
'';
preCheck = ''
${if stdenv.isDarwin then "export DYLD_LIBRARY_PATH=$(pwd)/src/" else "export LD_LIBRARY_PATH=$(pwd)/src/"}
${if enablePython then "sed -i -e 's|^#!.*|#!${stdenv.shell}|' python/py.test.sh" else ""}
'';

View file

@ -87,13 +87,6 @@ stdenv.mkDerivation rec {
doCheck = true;
# needed to find libigraph, and liblas on darwin
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [ blas ]}:$PWD/src"
'' else ''
export LD_LIBRARY_PATH="$PWD/src"
'';
postInstall = ''
mkdir -p "$out/share"
cp -r doc "$out/share"

View file

@ -43,14 +43,6 @@ stdenv.mkDerivation rec {
sed -i 's/#define JSONCPP_USING_SECURE_MEMORY 0/#define JSONCPP_USING_SECURE_MEMORY 1/' include/json/version.h
'';
# Hack to be able to run the test, broken because we use
# CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
preBuild = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$PWD/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'' else ''
export LD_LIBRARY_PATH="$PWD/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
nativeBuildInputs = [ cmake python3 validatePkgConfig ];
cmakeFlags = [

View file

@ -129,16 +129,6 @@ stdenv.mkDerivation rec {
doCheck = !stdenv.hostPlatform.isi686;
# The test driver runs a test `LibraryCLinkageTest` which without
# 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 = 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
'';
meta = with lib; {
homepage = "https://github.com/libjxl/libjxl";
description = "JPEG XL image format reference implementation.";

View file

@ -29,7 +29,6 @@ stdenv.mkDerivation rec {
doCheck = !stdenv.isDarwin;
checkPhase = ''
export LD_LIBRARY_PATH="$(pwd)" # see #22060
ctest -j1 -E 'ezminc_rw_test' --output-on-failure
# -j1: see https://github.com/BIC-MNI/libminc/issues/110
# ezminc_rw_test: can't find libminc_io.so.5.2.0

View file

@ -20,7 +20,6 @@ stdenv.mkDerivation rec {
doCheck = true;
checkPhase = ''
export LD_LIBRARY_PATH=$PWD
./utest/utest --path ../examples/data/
'';

View file

@ -30,10 +30,6 @@ stdenv.mkDerivation rec {
];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
'';
checkTarget = "tests test";
meta = with lib; {

View file

@ -13,9 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
preCheck = ''
export LD_LIBRARY_PATH=/build/source/build/libversion/''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
doCheck = true;
checkTarget = "test";

View file

@ -20,8 +20,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [
"-DENABLE_FORTRAN=ON"
"-DBUILD_SHARED_LIBS=ON"
# needed for tests to link
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
# Force compilation of higher derivatives
"-DDISABLE_VXC=0"
"-DDISABLE_FXC=0"

View file

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
checkPhase = ''
(
cd unittest
LD_LIBRARY_PATH="$(cd ../src; pwd)" TZ=PST8PDT ./unittestcpp ../../unittest/data
TZ=PST8PDT ./unittestcpp ../../unittest/data
)
'';

View file

@ -21,12 +21,6 @@ stdenv.mkDerivation rec {
# Tests fail on some Hydra builders, because they do not support SSE4.2.
doCheck = false;
# The test driver doesn't add an RPath to the build libdir
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src
'';
# The cmake install gets tripped up and installs a nix tree into $out, in
# addition to the correct install; clean it up.
postInstall = ''

View file

@ -18,11 +18,6 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
'';
meta = with lib; {
description = "Potluck with different functions for different purposes that can be shared among C programs";
homepage = "https://github.com/babelouest/orcania";

View file

@ -22,14 +22,6 @@ stdenv.mkDerivation rec {
checkInputs = [ check ];
# Hack to be able to run the test, broken because we use
# CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$(pwd)''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'' else ''
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
preConfigure = ''
# Enable long long support (required for filezilla)
sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' src/pugiconfig.hpp

View file

@ -12,10 +12,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/src
'';
postFixup = ''
substituteInPlace $out/lib/cmake/bpp-core/bpp-core-targets.cmake \
--replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'

View file

@ -15,10 +15,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ bpp-core bpp-seq ];
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/src
'';
postFixup = ''
substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake \
--replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'

View file

@ -15,10 +15,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ bpp-core bpp-seq ];
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/src
'';
postFixup = ''
substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake \
--replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'

View file

@ -15,10 +15,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ bpp-core ];
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/src
'';
postFixup = ''
substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake \
--replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'

View file

@ -24,10 +24,6 @@ stdenv.mkDerivation rec {
doCheck = !stdenv.isDarwin; # usual dynamic linker issues
preCheck = "
export LD_LIBRARY_PATH=$(pwd)/bin
";
meta = with lib; {
homepage = "https://elastix.lumc.nl";
description = "Image registration toolkit based on ITK";

View file

@ -36,11 +36,7 @@ stdenv.mkDerivation rec {
"-DINTERFACE64=${if blas.isILP64 then "1" else "0"}"
];
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib:${blas}/lib:${lapack}/lib
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'' + ''
preCheck = ''
# Prevent tests from using all cores
export OMP_NUM_THREADS=2
'';

View file

@ -39,8 +39,6 @@ stdenv.mkDerivation rec {
doCheck = true;
checkPhase = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/itpp
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/itpp
./gtests/itpp_gtests
'';

View file

@ -67,8 +67,6 @@ stdenv.mkDerivation rec {
# Run single threaded
export OMP_NUM_THREADS=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'';
meta = with lib; {

View file

@ -35,11 +35,6 @@ stdenv.mkDerivation rec {
sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src/
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src/
'';
doCheck = true;
meta = with lib; {

View file

@ -36,11 +36,6 @@ let
'';
doCheck = true;
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$(pwd)''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'' else ''
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
meta = with lib; {
description = "Very fast, header only, C++ logging library";

View file

@ -53,10 +53,6 @@ in stdenv.mkDerivation rec {
patches = map fetchpatch patchesToFetch;
preBuild = ''
export LD_LIBRARY_PATH="$(pwd)/lib";
'';
dontWrapQtApps = true;
# Shared libraries don't work, because of rpath troubles with the current

View file

@ -39,11 +39,6 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
'';
meta = with lib; {
description = "Logging library for C applications";
homepage = "https://github.com/babelouest/yder";

View file

@ -157,10 +157,6 @@ let
touch .git/index .git/modules/library/xml/index
'';
preBuild = ''
export LD_LIBRARY_PATH="$PWD/depends/protobuf''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ]
++ lib.optionals enableStoneSense [ "-DBUILD_STONESENSE=ON" "-DSTONESENSE_INTERNAL_SO=OFF" ];

View file

@ -184,8 +184,6 @@ in rec {
substituteInPlace src/common/module.c --replace "/sbin/modprobe" "modprobe"
substituteInPlace src/common/module.c --replace "/bin/grep" "grep"
# for pybind/rgw to find internal dep
export LD_LIBRARY_PATH="$PWD/build/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
# install target needs to be in PYTHONPATH for "*.pth support" check to succeed
# set PYTHONPATH, so the build system doesn't silently skip installing ceph-volume and others
export PYTHONPATH=${ceph-python-env}/${sitePackages}:$lib/${sitePackages}:$out/${sitePackages}

View file

@ -93,12 +93,6 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/bin
'' + lib.optionalString (stdenv.isDarwin) ''
export DYLD_LIBRARY_PATH=$(pwd)/bin
'';
excludedTests = lib.optionals stdenv.isDarwin [
"MFHDF_TEST-hdftest"
"MFHDF_TEST-hdftest-shared"

View file

@ -13,13 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake python3 ];
# let intermediate tools find intermediate library
preBuild = lib.optionalString stdenv.isLinux ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/src
'' + lib.optionalString stdenv.isDarwin ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$(pwd)/src
'';
meta = with lib; {
homepage = "https://github.com/BYVoid/OpenCC";
license = licenses.asl20;