diff --git a/pkgs/tools/filesystems/irods/common.nix b/pkgs/tools/filesystems/irods/common.nix index 33edc0e4a05b..c2e09220a957 100644 --- a/pkgs/tools/filesystems/irods/common.nix +++ b/pkgs/tools/filesystems/irods/common.nix @@ -27,15 +27,13 @@ "-DCPACK_GENERATOR=TGZ" "-DCMAKE_CXX_FLAGS=-I${lib.getDev libcxx}/include/c++/v1" "-DPAM_LIBRARY=${pam}/lib/libpam.so" + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" + "-DIRODS_HOME_DIRECTORY=${placeholder "out"}" + "-DCMAKE_INSTALL_SBINDIR=${placeholder "out"}/sbin" ]; postPatch = '' patchShebangs ./packaging ./scripts - export cmakeFlags="$cmakeFlags - -DCMAKE_INSTALL_PREFIX=$out - -DIRODS_HOME_DIRECTORY=$out - -DCMAKE_INSTALL_SBINDIR=$out/sbin - " ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix index 5db0ed453eab..beddb6959ba4 100644 --- a/pkgs/tools/filesystems/irods/default.nix +++ b/pkgs/tools/filesystems/irods/default.nix @@ -32,6 +32,12 @@ rec { # fix build with recent llvm versions env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations"; + cmakeFlags = common.cmakeFlags or [ ] ++ [ + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib" + "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib" + "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib" + ]; + postPatch = common.postPatch + '' patchShebangs ./test substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp" @@ -39,11 +45,6 @@ rec { do substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2" done - export cmakeFlags="$cmakeFlags - -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib - -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib - " substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID "" '';