pkgsStatic.stdenv.cc.cc: put static libs in $lib

libtool requires the library files its .la files describe to be in the
same directory as those files.  We only do this for compilers without
shared libraries, so that the libraries in $lib are always the
libraries the package set is supposed to use.

Fixes: https://github.com/NixOS/nixpkgs/issues/76873
Fixes: https://github.com/NixOS/nixpkgs/issues/108534
This commit is contained in:
Alyssa Ross 2022-03-21 19:44:32 +00:00
parent c6dd11ca39
commit 12c37aec37
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0
9 changed files with 12 additions and 8 deletions

View file

@ -261,7 +261,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableMultilib enableShared;
inherit (stdenv) is64bit;

View file

@ -264,7 +264,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -290,7 +290,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -306,7 +306,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -320,7 +320,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -272,7 +272,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -254,7 +254,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -280,7 +280,7 @@ stdenv.mkDerivation ({
};
enableParallelBuilding = true;
inherit enableMultilib;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;

View file

@ -222,6 +222,10 @@ postInstall() {
moveToOutput "${targetConfig+$targetConfig/}lib/lib*.dll.a" "${!outputLib}"
moveToOutput "share/gcc-*/python" "${!outputLib}"
if [ -z "$enableShared" ]; then
moveToOutput "${targetConfig+$targetConfig/}lib/lib*.a" "${!outputLib}"
fi
for i in "${!outputLib}/${targetConfig}"/lib/*.{la,py}; do
substituteInPlace "$i" --replace "$out" "${!outputLib}"
done