mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
treewide: Fix unsafe concatenation of $LD_LIBRARY_PATH
Naive concatenation of $LD_LIBRARY_PATH can result in an empty colon-delimited segment; this tells glibc to load libraries from the current directory, which is definitely wrong, and may be a security vulnerability if the current directory is untrusted. (See #67234, for example.) Fix this throughout the tree. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
2e5051e223
commit
3cd8ce3bce
@ -30,7 +30,7 @@ mkDerivation rec {
|
||||
# libraries. These reside in build/lib, and are not found by
|
||||
# default.
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
@ -11,9 +11,9 @@ 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:"`pwd`/build/src
|
||||
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}"`pwd`/build/src
|
||||
'' else ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/build/src
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}"`pwd`/build/src
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
preConfigure = ''
|
||||
# autotools check tries to dlopen libpython as a requirement for the python plugin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${python}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${python}/lib
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
|
@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
|
||||
# 80 - test-gnc-module-scm-module (Failed)
|
||||
# 81 - test-gnc-module-scm-multi (Failed)
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
|
||||
'';
|
||||
doCheck = false;
|
||||
|
@ -177,7 +177,7 @@ writeTextFile rec {
|
||||
export SAGE_EXTCODE='${sagelib.src}/src/ext'
|
||||
|
||||
# for find_library
|
||||
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}:$DYLD_LIBRARY_PATH"
|
||||
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
|
||||
'';
|
||||
} // {
|
||||
lib = sagelib; # equivalent of `passthru`, which `writeTextFile` doesn't support
|
||||
|
@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
|
||||
cd "$sourceRoot"
|
||||
patchPhase
|
||||
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libXext}/lib"
|
||||
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"} \
|
||||
|
@ -52,7 +52,7 @@ let
|
||||
etcProfile = writeText "profile" ''
|
||||
export PS1='${name}-chrootenv:\u@\h:\w\$ '
|
||||
export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
|
||||
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export PATH="/run/wrappers/bin:/usr/bin:/usr/sbin:$PATH"
|
||||
export TZDIR='/etc/zoneinfo'
|
||||
|
||||
|
@ -228,8 +228,8 @@ mkDerivation rec {
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${zlib}/lib";
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libX11}/lib";
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${zlib}/lib";
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libX11}/lib";
|
||||
'';
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
@ -123,7 +123,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
preConfigure = ''
|
||||
# allow ecore_con to find libcurl.so, which is a runtime dependency (it is dlopened)
|
||||
export LD_LIBRARY_PATH="${curl.out}/lib:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="${curl.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
|
||||
source "$setupHook"
|
||||
'';
|
||||
|
@ -29,7 +29,7 @@ in llvmPackages.stdenv.mkDerivation {
|
||||
# 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)/lib:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$(pwd)/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
@ -143,7 +143,7 @@ stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = stdenv.lib.optionalString enableSharedLibraries ''
|
||||
|
@ -119,7 +119,7 @@ stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
@ -120,7 +120,7 @@ stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
@ -141,7 +141,7 @@ in stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
@ -117,7 +117,7 @@ in stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
@ -134,7 +134,7 @@ in stdenv.mkDerivation (rec {
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
|
||||
chmod u+x $(pwd)/../${usr_prefix}/bin/mlton
|
||||
|
||||
# So the builder runs the binary compiler with gmp.
|
||||
export LD_LIBRARY_PATH=${gmp.out}/lib:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=${gmp.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
|
||||
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
||||
# Patch ELF interpreter.
|
||||
|
@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
|
||||
checkPhase = ''
|
||||
while IFS= read -r -d ''' dir
|
||||
do
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$dir
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/$dir
|
||||
export LD_LIBRARY_PATH
|
||||
done < <(find . -type d -print0)
|
||||
|
||||
|
@ -21,7 +21,7 @@ in stdenv.mkDerivation {
|
||||
preCheck = ''
|
||||
# Make `libgcc_s.so' visible for `pthread_cancel'.
|
||||
export LD_LIBRARY_PATH=\
|
||||
"$(dirname $(echo ${stdenv.cc.cc.lib}/lib*/libgcc_s.so)):$LD_LIBRARY_PATH"
|
||||
"$(dirname $(echo ${stdenv.cc.cc.lib}/lib*/libgcc_s.so))''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||
configureFlags = [ "--enable-release" ];
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${llvm}/lib make check
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${llvm}/lib make check
|
||||
'';
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${llvm}/lib
|
||||
|
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
doCheck = true;
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=`pwd`''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
'';
|
||||
|
||||
outputs = [ "dev" "out" ];
|
||||
|
@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
|
||||
doCheck = true;
|
||||
checkTarget = "test";
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
|
||||
cmakeFlags = [ "-DCTESTS=ON" ];
|
||||
doCheck = true;
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=`pwd`''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
'';
|
||||
checkTarget = "criterion_tests test";
|
||||
|
||||
|
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
|
@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
|
||||
''}
|
||||
|
||||
${stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
|
||||
# Removing tests depending on charset conversion
|
||||
substituteInPlace ../test/Makefile --replace "conversions.sh" ""
|
||||
rm -f ../tests/bugfixes/redmine/test_issue_460.py
|
||||
|
@ -160,7 +160,7 @@ stdenv.mkDerivation rec {
|
||||
checkInputs = [ tzdata libxml2 desktop-file-utils shared-mime-info ];
|
||||
|
||||
preCheck = optionalString doCheck ''
|
||||
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export TZDIR="${tzdata}/share/zoneinfo"
|
||||
export XDG_CACHE_HOME="$TMP"
|
||||
export XDG_RUNTIME_HOME="$TMP"
|
||||
|
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
'';
|
||||
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";
|
||||
|
@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
|
||||
# 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`/src/lib_json:$DYLD_LIBRARY_PATH"
|
||||
export DYLD_LIBRARY_PATH="`pwd`/src/lib_json''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
|
||||
'' else ''
|
||||
export LD_LIBRARY_PATH="`pwd`/src/lib_json:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="`pwd`/src/lib_json''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake python ];
|
||||
|
@ -32,8 +32,8 @@ stdenv.mkDerivation rec {
|
||||
enableParallelBuilding = true;
|
||||
doCheck = true;
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD${placeholder "out"}/lib
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD${placeholder "out"}/lib
|
||||
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";
|
||||
|
||||
|
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
|
||||
doCheck = true;
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
|
@ -125,7 +125,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="`pwd`/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
configureFlags+="
|
||||
-docdir $out/share/doc/${name}
|
||||
-plugindir $out/lib/qt4/plugins
|
||||
|
@ -164,7 +164,7 @@ stdenv.mkDerivation {
|
||||
|
||||
setOutputFlags = false;
|
||||
preConfigure = ''
|
||||
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
${lib.optionalString (compareVersion "5.9.0" < 0) ''
|
||||
# We need to set LD to CXX or otherwise we get nasty compile errors
|
||||
export LD=$CXX
|
||||
|
@ -30,9 +30,9 @@ stdenv.mkDerivation {
|
||||
];
|
||||
|
||||
preCheck = if stdenv.isDarwin then ''
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib
|
||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
|
||||
'' else ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
|
||||
'' + ''
|
||||
# Prevent tests from using all cores
|
||||
export OMP_NUM_THREADS=2
|
||||
|
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
|
||||
# Run single threaded
|
||||
export OMP_NUM_THREADS=1
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
|
||||
doCheck = true;
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
|
@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
|
||||
cat > "$out/bin/${cmd}" <<EOF
|
||||
#!${runtimeShell}
|
||||
set -f
|
||||
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@"
|
||||
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$libs" exec $out/pharo "\$@"
|
||||
EOF
|
||||
chmod +x "$out/bin/${cmd}"
|
||||
ln -s ${libgit2}/lib/libgit2.so* "$out/"
|
||||
|
@ -105,7 +105,7 @@ let
|
||||
path = "${cudatoolkit}/lib/stubs/libcuda.so";
|
||||
}];
|
||||
cudaStubEnv = lib.optionalString cudaSupport
|
||||
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ";
|
||||
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH ";
|
||||
|
||||
in buildPythonPackage rec {
|
||||
version = "1.2.0";
|
||||
|
@ -109,7 +109,7 @@ let
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$PWD/depends/protobuf''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
'';
|
||||
|
||||
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ]
|
||||
|
@ -7,5 +7,5 @@ for i in dfhack.init-example dfhack-config/default hack/* stonesense/*; do
|
||||
done
|
||||
|
||||
cd "$DF_DIR"
|
||||
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH" \
|
||||
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
|
||||
LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD" exec $env_dir/libs/Dwarf_Fortress "$@"
|
||||
|
@ -53,7 +53,7 @@ let
|
||||
echo "$runtime_paths"
|
||||
exit 0
|
||||
fi
|
||||
export LD_LIBRARY_PATH="$runtime_paths:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH="$runtime_paths''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
exec "$@"
|
||||
'';
|
||||
|
||||
@ -260,7 +260,7 @@ in buildFHSUserEnv rec {
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}:$LD_LIBRARY_PATH"}
|
||||
${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"}
|
||||
exec -- "$run" "$@"
|
||||
'';
|
||||
};
|
||||
|
@ -285,7 +285,7 @@ if test -z "$libsOnly"; then
|
||||
for prog in $BIN/*; do
|
||||
cp -f $prog $out/bin &&
|
||||
patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $out/bin/$(basename $prog) &&
|
||||
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/:$LD_LIBRARY_PATH
|
||||
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
|
||||
# dependency on `libtcam` (which itself is built as part of this build). In order to allow
|
||||
# that, we set the dynamic linker's path to point on the build time location of the library.
|
||||
preBuild = ''
|
||||
export LD_LIBRARY_PATH=$PWD/src:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$PWD/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -97,6 +97,6 @@ buildFHSUserEnv {
|
||||
|
||||
# Actually run Plex, prepending LD_LIBRARY_PATH with the libraries from
|
||||
# the Plex package.
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root exec "$root/Plex Media Server"
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$root exec "$root/Plex Media Server"
|
||||
'';
|
||||
}
|
||||
|
@ -26,4 +26,4 @@ index e280e86..b2dd42b 100755
|
||||
-# Execute the strangled program under a clean environment
|
||||
# pass through the FPS and overriden LD_PRELOAD environment variables
|
||||
-exec env FPS="${FPS}" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" "$@"
|
||||
+FPS="${FPS}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@out@/lib/libstrangle/lib64:@out@/lib/libstrangle/lib32" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" exec "$@"
|
||||
+FPS="${FPS}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@out@/lib/libstrangle/lib64:@out@/lib/libstrangle/lib32" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" exec "$@"
|
||||
|
@ -27,7 +27,7 @@ let
|
||||
|
||||
in writeScriptBin "primusrun" ''
|
||||
#!${runtimeShell}
|
||||
export LD_LIBRARY_PATH=${ldPath}:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=${ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
||||
# https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243
|
||||
export __GLVND_DISALLOW_PATCHING=1
|
||||
exec "$@"
|
||||
|
@ -134,7 +134,7 @@ in rec {
|
||||
substituteInPlace src/common/module.c --replace "/sbin/modprobe" "modprobe"
|
||||
|
||||
# for pybind/rgw to find internal dep
|
||||
export LD_LIBRARY_PATH="$PWD/build/lib:$LD_LIBRARY_PATH"
|
||||
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
|
||||
|
||||
patchShebangs src/script src/spdk src/test src/tools
|
||||
|
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
|
||||
dontUseCmakeBuildDir = true;
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/3rdparty/googletest/googletest:$(pwd)/neopg
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/3rdparty/googletest/googletest:$(pwd)/neopg
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
||||
|
||||
makeFlags = [
|
||||
# let intermediate tools find intermediate library
|
||||
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(CURDIR)/src"
|
||||
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH\${LD_LIBRARY_PATH:+:}$(CURDIR)/src"
|
||||
];
|
||||
|
||||
# Parallel building occasionaly fails with: Error copying file "/tmp/nix-build-opencc-1.0.5.drv-0/OpenCC-ver.1.0.5/build/src/libopencc.so.1.0.0" to "/tmp/nix-build-opencc-1.0.5.drv-0/OpenCC-ver.1.0.5/build/src/tools".
|
||||
|
Loading…
Reference in New Issue
Block a user