add get* helper functions and mass-replace manual outputs search with them

This commit is contained in:
Nikolay Amiantov
2016-04-14 19:00:39 +03:00
parent c779e30d53
commit 5ff40ddedf
20 changed files with 67 additions and 64 deletions

View File

@@ -33,8 +33,8 @@ stdenv.mkDerivation {
for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${gcc.lib or gcc}/lib:${ncurses.out}/lib \
patchelf --set-interpreter ${getLib glibc}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${getLib gcc}/lib:${ncurses.out}/lib \
"$f" || true
fi
done

View File

@@ -1,4 +1,4 @@
{stdenv, fetchurl, perl, libedit, ncurses, gmp}:
{stdenv, lib, fetchurl, perl, libedit, ncurses, gmp}:
stdenv.mkDerivation rec {
version = "6.10.2";
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
'' else "");
configurePhase = ''
./configure --prefix=$out --with-gmp-libraries=${gmp.out}/lib --with-gmp-includes=${gmp.dev or gmp}/include
./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
'';
# Stripping combined with patchelf breaks the executables (they die

View File

@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
# Find the loader dynamically
LOADER="$(find ${libc.out or libc}/lib -name ld-linux\* | head -n 1)"
LOADER="$(find ${lib.getLib libc}/lib -name ld-linux\* | head -n 1)"
# Replace references to the loader
find src/cmd -name asm.c -exec sed -i "s,/lib/ld-linux.*\.so\.[0-9],$LOADER," {} \;