3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #162607 from waldheinz/libllvm-drop-static

llvmPackages/libllvm: do not include static archives when shared is r…
This commit is contained in:
Lassulus 2022-04-08 19:39:18 +01:00 committed by GitHub
commit a1780e4b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 0 deletions

View file

@ -244,6 +244,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -255,6 +255,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -242,6 +242,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -205,6 +205,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -200,6 +200,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -222,6 +222,12 @@ stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
'') versionSuffixes}
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -215,6 +215,12 @@ stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
'') versionSuffixes}
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -234,6 +234,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
'') versionSuffixes}
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -226,6 +226,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -241,6 +241,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';

View file

@ -200,6 +200,12 @@ in stdenv.mkDerivation (rec {
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString enableSharedLibraries ''
mkdir -p $dev/lib
mv $lib/lib/*.a $dev/lib
sed -i -E "s|$lib/lib/(.*)\.a|$dev/lib/\1\.a|" \
"$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake"
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
'';