Skip to content

Commit

Permalink
treewide: Remove now-unneeded LD_LIBRARY_PATH in cmake derivations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
knedlsepp authored and Artturin committed Jul 4, 2022
1 parent 1ca04aa commit bcd7045
Show file tree
Hide file tree
Showing 44 changed files with 3 additions and 191 deletions.
7 changes: 0 additions & 7 deletions pkgs/applications/graphics/paraview/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 0 additions & 7 deletions pkgs/applications/misc/audio/soxr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; {
Expand Down
4 changes: 0 additions & 4 deletions pkgs/applications/networking/sniffers/wireshark/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pkgs/applications/office/gnucash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
4 changes: 0 additions & 4 deletions pkgs/applications/radio/dsd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 0 additions & 5 deletions pkgs/applications/science/misc/simgrid/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pkgs/applications/video/avidemux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"} \
Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/compilers/halide/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/compilers/solc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/libraries/audio/mbelib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/libraries/caf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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++";
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/libraries/cpp-netlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/libraries/criterion/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/libraries/cutelyst/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/docopt_cpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/galario/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""}
'';

Expand Down
7 changes: 0 additions & 7 deletions pkgs/development/libraries/igraph/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/libraries/jsoncpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 0 additions & 10 deletions pkgs/development/libraries/libjxl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/libminc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/libpointmatcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ stdenv.mkDerivation rec {

doCheck = true;
checkPhase = ''
export LD_LIBRARY_PATH=$PWD
./utest/utest --path ../examples/data/
'';

Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/libraries/libtins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; {
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/libraries/libversion/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/libxc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/mailcore2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
'';

Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/libraries/oneDNN/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/libraries/orcania/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/libraries/pugixml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 1 addition & 5 deletions pkgs/development/libraries/science/math/arpack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/science/math/itpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';

Expand Down
Loading

0 comments on commit bcd7045

Please sign in to comment.