lib.systems.elaborate: add libDir attribute
This commit is contained in:
parent
ab59f0dacc
commit
94a3c17582
2 changed files with 9 additions and 6 deletions
|
@ -89,6 +89,13 @@ rec {
|
|||
# is why we use the more obscure "bfd" and not "binutils" for this
|
||||
# choice.
|
||||
else "bfd";
|
||||
# The standard lib directory name that non-nixpkgs binaries distributed
|
||||
# for this platform normally assume.
|
||||
libDir = if final.isLinux then
|
||||
if final.isx86_64 || final.isMips64 || final.isPower64
|
||||
then "lib64"
|
||||
else "lib"
|
||||
else null;
|
||||
extensions = lib.optionalAttrs final.hasSharedLibraries {
|
||||
sharedLibrary =
|
||||
if final.isDarwin then ".dylib"
|
||||
|
|
|
@ -5,11 +5,7 @@
|
|||
, ninja
|
||||
, nixosTests
|
||||
}:
|
||||
let
|
||||
libDir = if builtins.elem stdenv.system [ "x86_64-linux" "mips64-linux" "powerpc64le-linux" ]
|
||||
then "/lib64"
|
||||
else "/lib";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nix-ld";
|
||||
version = "1.2.2";
|
||||
|
@ -36,7 +32,7 @@ stdenv.mkDerivation rec {
|
|||
postInstall = ''
|
||||
mkdir -p $out/nix-support
|
||||
|
||||
ldpath=${libDir}/$(basename $(< ${stdenv.cc}/nix-support/dynamic-linker))
|
||||
ldpath=/${stdenv.hostPlatform.libDir}/$(basename $(< ${stdenv.cc}/nix-support/dynamic-linker))
|
||||
echo "$ldpath" > $out/nix-support/ldpath
|
||||
mkdir -p $out/lib/tmpfiles.d/
|
||||
cat > $out/lib/tmpfiles.d/nix-ld.conf <<EOF
|
||||
|
|
Loading…
Reference in a new issue