Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/10/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ stdenv.mkDerivation {
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/10/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -54,7 +56,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/11/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ stdenv.mkDerivation {
stdenv.hostPlatform != stdenv.buildPlatform
) "-DCMAKE_SYSTEM_VERSION=20.1.0";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/11/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -58,7 +60,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/12/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ stdenv.mkDerivation {
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/12/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -56,7 +58,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/13/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ stdenv.mkDerivation rec {
buildFlags = lib.optional headersOnly "generate-cxx-headers";
installTargets = lib.optional headersOnly "install-cxx-headers";

preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

# At this point, cxxabi headers would be installed in the dev output, which
# prevents moveToOutput from doing its job later in the build process.
postInstall = lib.optionalString (!headersOnly) ''
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/13/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ stdenv.mkDerivation rec {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -53,7 +55,7 @@ stdenv.mkDerivation rec {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/14/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ stdenv.mkDerivation rec {
buildFlags = lib.optional headersOnly "generate-cxx-headers";
installTargets = lib.optional headersOnly "install-cxx-headers";

preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/14/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ stdenv.mkDerivation rec {
installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -64,7 +66,7 @@ stdenv.mkDerivation rec {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/5/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ stdenv.mkDerivation {
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/5/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -39,7 +41,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/6/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ stdenv.mkDerivation {
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/6/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -39,7 +41,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/7/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ stdenv.mkDerivation {
++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ;

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/7/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -58,7 +60,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/8/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ stdenv.mkDerivation {
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/8/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"

# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
Expand All @@ -54,7 +56,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/9/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ stdenv.mkDerivation {
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";

preInstall = lib.optionalString (stdenv.isDarwin) ''
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi

baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')

for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done
'';

passthru = {
isLLVM = true;
};
Expand Down
Loading