prebuilt ghcs: correctly handle rpaths
This commit is contained in:
parent
ed93d2d645
commit
398061dfc5
|
@ -87,9 +87,6 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
for prog in ld ar gcc strip ranlib; do
|
|
||||||
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePlatforms = [ ];
|
configurePlatforms = [ ];
|
||||||
|
@ -109,8 +106,12 @@ stdenv.mkDerivation rec {
|
||||||
# On Linux, use patchelf to modify the executables so that they can
|
# On Linux, use patchelf to modify the executables so that they can
|
||||||
# find editline/gmp.
|
# find editline/gmp.
|
||||||
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
find "$out" -type f -executable \
|
for p in $(find "$out" -type f -executable); do
|
||||||
-exec patchelf --set-rpath "${libPath}" {} \;
|
if isELF "$p"; then
|
||||||
|
echo "Patchelfing $p"
|
||||||
|
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
|
||||||
|
fi
|
||||||
|
done
|
||||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
# not enough room in the object files for the full path to libiconv :(
|
# not enough room in the object files for the full path to libiconv :(
|
||||||
for exe in $(find "$out" -type f -executable); do
|
for exe in $(find "$out" -type f -executable); do
|
||||||
|
@ -126,6 +127,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
installCheckPhase = ''
|
installCheckPhase = ''
|
||||||
|
unset ${libEnvVar}
|
||||||
# Sanity check, can ghc create executables?
|
# Sanity check, can ghc create executables?
|
||||||
cd $TMP
|
cd $TMP
|
||||||
mkdir test-ghc; cd test-ghc
|
mkdir test-ghc; cd test-ghc
|
||||||
|
|
|
@ -83,9 +83,6 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
for prog in ld ar gcc strip ranlib; do
|
|
||||||
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePlatforms = [ ];
|
configurePlatforms = [ ];
|
||||||
|
@ -105,8 +102,12 @@ stdenv.mkDerivation rec {
|
||||||
# On Linux, use patchelf to modify the executables so that they can
|
# On Linux, use patchelf to modify the executables so that they can
|
||||||
# find editline/gmp.
|
# find editline/gmp.
|
||||||
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
find "$out" -type f -executable \
|
for p in $(find "$out" -type f -executable); do
|
||||||
-exec patchelf --set-rpath "${libPath}" {} \;
|
if isELF "$p"; then
|
||||||
|
echo "Patchelfing $p"
|
||||||
|
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
|
||||||
|
fi
|
||||||
|
done
|
||||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
# not enough room in the object files for the full path to libiconv :(
|
# not enough room in the object files for the full path to libiconv :(
|
||||||
for exe in $(find "$out" -type f -executable); do
|
for exe in $(find "$out" -type f -executable); do
|
||||||
|
@ -122,6 +123,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
installCheckPhase = ''
|
installCheckPhase = ''
|
||||||
|
unset ${libEnvVar}
|
||||||
# Sanity check, can ghc create executables?
|
# Sanity check, can ghc create executables?
|
||||||
cd $TMP
|
cd $TMP
|
||||||
mkdir test-ghc; cd test-ghc
|
mkdir test-ghc; cd test-ghc
|
||||||
|
|
|
@ -91,9 +91,6 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
|
||||||
for prog in ld ar gcc strip ranlib; do
|
|
||||||
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePlatforms = [ ];
|
configurePlatforms = [ ];
|
||||||
|
@ -113,8 +110,12 @@ stdenv.mkDerivation rec {
|
||||||
# On Linux, use patchelf to modify the executables so that they can
|
# On Linux, use patchelf to modify the executables so that they can
|
||||||
# find editline/gmp.
|
# find editline/gmp.
|
||||||
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
find "$out" -type f -executable \
|
for p in $(find "$out" -type f -executable); do
|
||||||
-exec patchelf --set-rpath "${libPath}" {} \;
|
if isELF "$p"; then
|
||||||
|
echo "Patchelfing $p"
|
||||||
|
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
|
||||||
|
fi
|
||||||
|
done
|
||||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
# not enough room in the object files for the full path to libiconv :(
|
# not enough room in the object files for the full path to libiconv :(
|
||||||
for exe in $(find "$out" -type f -executable); do
|
for exe in $(find "$out" -type f -executable); do
|
||||||
|
@ -130,6 +131,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
installCheckPhase = ''
|
installCheckPhase = ''
|
||||||
|
unset ${libEnvVar}
|
||||||
# Sanity check, can ghc create executables?
|
# Sanity check, can ghc create executables?
|
||||||
cd $TMP
|
cd $TMP
|
||||||
mkdir test-ghc; cd test-ghc
|
mkdir test-ghc; cd test-ghc
|
||||||
|
|
Loading…
Reference in a new issue