Skip to content

Commit

Permalink
Merge pull request #108496 from knedlsepp/cmake-rpath
Browse files Browse the repository at this point in the history
cmake/setup-hook.sh: Don't skip build-RPATH
  • Loading branch information
ttuegel committed Jul 11, 2022
2 parents de1ff46 + bcd7045 commit e1e0d5d
Show file tree
Hide file tree
Showing 80 changed files with 14 additions and 252 deletions.
1 change: 0 additions & 1 deletion pkgs/applications/gis/qgis/unwrapped-ltr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ in mkDerivation rec {
'';

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DWITH_3D=True"
"-DWITH_PDAL=TRUE"
"-DPYQT5_SIP_DIR=${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings"
Expand Down
1 change: 0 additions & 1 deletion pkgs/applications/gis/qgis/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ in mkDerivation rec {
'';

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DWITH_3D=True"
"-DWITH_PDAL=TRUE"
"-DPYQT5_SIP_DIR=${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings"
Expand Down
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
4 changes: 0 additions & 4 deletions pkgs/applications/kde/dolphin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ mkDerivation {
wayland qtwayland
];
outputs = [ "out" "dev" ];
# We need the RPATH for linking, because the `libkdeinit5_dolphin.so` links
# private against its dependencies and without the correct RPATH, these
# dependencies are not found.
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ stdenv.mkDerivation rec {
"-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON"
"-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON"
"-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'" # Sporadic segfault
"-DENABLE_TESTING=${enableIf doCheck}"
"-DDISABLE_META_INTEGRATION_TESTS=ON"
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
1 change: 0 additions & 1 deletion pkgs/desktops/gnome/core/evolution-data-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ stdenv.mkDerivation rec {
"-DENABLE_UOA=OFF"
"-DENABLE_VALA_BINDINGS=ON"
"-DENABLE_INTROSPECTION=ON"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
"-DWITH_PHONENUMBER=ON"
"-DWITH_GWEATHER4=ON"
Expand Down
1 change: 0 additions & 1 deletion pkgs/desktops/plasma-5/kwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mkDerivation {
CXXFLAGS = [
''-DNIXPKGS_XWAYLAND=\"${lib.getBin xwayland}/bin/Xwayland\"''
];
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
postInstall = ''
# Some package(s) refer to these service types by the wrong name.
# I would prefer to patch those packages, but I cannot find them!
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
1 change: 0 additions & 1 deletion pkgs/development/libraries/arrow-cpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ stdenv.mkDerivation rec {
] ++ lib.optionals (!enableShared) [
"-DARROW_TEST_LINKAGE=static"
] ++ lib.optionals stdenv.isDarwin [
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
"-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"
++ lib.optional enableS3 "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp}/include/aws/core/Aws.h";
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/libraries/audio/libkeyfinder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ stdenv.mkDerivation rec {
sha256 = "sha256-7w/Wc9ncLinbnM2q3yv5DBtFoJFAM2e9xAUTsqvE9mg=";
};

# needed for finding libkeyfinder.so to link it into keyfinder-tests executable
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];

nativeBuildInputs = [ cmake ];

buildInputs = [ fftw ];
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
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-auth/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ stdenv.mkDerivation rec {

cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
] ++ lib.optionals stdenv.hostPlatform.isRiscV [
"-DCMAKE_C_FLAGS=-fasynchronous-unwind-tables"
];
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-compression/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-http/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-mqtt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-s3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-c-sdkutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ stdenv.mkDerivation rec {
];

cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-crt-cpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ stdenv.mkDerivation rec {

cmakeFlags = [
"-DBUILD_DEPS=OFF"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/aws-sdk-cpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ stdenv.mkDerivation rec {

cmakeFlags = [
"-DBUILD_DEPS=OFF"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
] ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-DENABLE_TESTING=OFF"
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
2 changes: 0 additions & 2 deletions pkgs/development/libraries/crc32c/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ stdenv.mkDerivation rec {
"-DCRC32C_BUILD_BENCHMARKS=0"
"-DCRC32C_USE_GLOG=0"
"-DBUILD_SHARED_LIBS=${if staticOnly then "0" else "1"}"
] ++ lib.optionals stdenv.isDarwin [
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
];

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
7 changes: 6 additions & 1 deletion pkgs/development/libraries/fcppt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ boost catch2 metal ];

cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=false" "-DENABLE_BOOST=true" "-DENABLE_EXAMPLES=true" "-DENABLE_CATCH=true" "-DENABLE_TEST=true" ];
cmakeFlags = [
"-DENABLE_BOOST=true"
"-DENABLE_EXAMPLES=true"
"-DENABLE_CATCH=true"
"-DENABLE_TEST=true"
];

meta = with lib; {
description = "Freundlich's C++ toolkit";
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/fmt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let

cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
];

doCheck = true;
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
3 changes: 0 additions & 3 deletions pkgs/development/libraries/glog/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ stdenv.mkDerivation rec {

cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
# Mak CMake place RPATHs such that tests will find the built libraries.
# See https://github.com/NixOS/nixpkgs/pull/144561#discussion_r742468811 and https://github.com/NixOS/nixpkgs/pull/108496
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
];

# TODO: Re-enable Darwin tests once we're on a release that has https://github.com/google/glog/issues/709#issuecomment-960381653 fixed
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/grpc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ stdenv.mkDerivation rec {
"-DgRPC_PROTOBUF_PROVIDER=package"
"-DgRPC_ABSL_PROVIDER=package"
"-DBUILD_SHARED_LIBS=ON"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc"
] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0") [
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
Loading

0 comments on commit e1e0d5d

Please sign in to comment.