* Finally got stdenv-nix-linux working again. Still not perfect,

though.
* libxml2: upgrade to latest.
* octavefront/rna: keep debug info.

svn path=/nixpkgs/trunk/; revision=830
This commit is contained in:
Eelco Dolstra
2004-03-11 17:26:14 +00:00
parent a1b3ae0c81
commit de13527000
34 changed files with 162 additions and 131 deletions

View File

@@ -6,7 +6,7 @@
# Force gcc to use ld-wrapper.sh when calling ld.
cflagsCompile="-B$out/bin"
if test -n "$glibc"; then
if test -z "$nativeGlibc"; then
# The "-B$glibc/lib" flag is a quick hack to force gcc to link
# against the crt1.o from our own glibc, rather than the one in
# /usr/lib. The real solution is of course to prevent those paths
@@ -15,14 +15,11 @@ if test -n "$glibc"; then
ldflags="$ldflags -L$glibc/lib -rpath $glibc/lib -dynamic-linker $glibc/lib/ld-linux.so.2"
fi
if test -n "$gcc"; then
ldflags="$ldflags -L$gcc/lib -rpath $gcc/lib"
fi
if test -n "$isNative"; then
if test -n "$nativeTools"; then
gccPath="$nativePrefix/bin"
ldPath="$nativePrefix/bin"
else
ldflags="$ldflags -L$gcc/lib -rpath $gcc/lib"
gccPath="$gcc/bin"
ldPath="$binutils/bin"
fi
@@ -76,8 +73,6 @@ NIX_LDFLAGS="$ldflags \$NIX_LDFLAGS"
EOF
sed \
-e "s^@isNative@^$isNative^g" \
-e "s^@enforcePurity@^$enforcePurity^g" \
-e "s^@gcc@^$gcc^g" \
-e "s^@binutils@^$binutils^g" \
-e "s^@glibc@^$glibc^g" \

View File

@@ -5,11 +5,13 @@
# derivation provides a wrapper that sets up the right environment
# variables so that the compiler and the linker just "work".
{ name, stdenv, isNative, nativePrefix ? ""
, gcc ? null, glibc ? null, binutils ? null}:
{ name, stdenv, nativeTools, nativeGlibc, nativePrefix ? ""
, gcc ? null, glibc ? null, binutils ? null
}:
assert isNative -> nativePrefix != "";
assert !isNative -> gcc != null && glibc != null && binutils != null;
assert nativeTools -> nativePrefix != "";
assert !nativeTools -> gcc != null && binutils != null;
assert !nativeGlibc -> glibc != null;
derivation {
system = stdenv.system;
@@ -17,9 +19,8 @@ derivation {
setupHook = ./setup-hook.sh;
gccWrapper = ./gcc-wrapper.sh;
ldWrapper = ./ld-wrapper.sh;
inherit name stdenv isNative nativePrefix gcc glibc binutils;
enforcePurity = if isNative then false else gcc.enforcePurity;
langC = if isNative then true else gcc.langC;
langCC = if isNative then true else gcc.langCC;
langF77 = if isNative then false else gcc.langF77;
inherit name stdenv nativeTools nativeGlibc nativePrefix gcc glibc binutils;
langC = if nativeTools then true else gcc.langC;
langCC = if nativeTools then true else gcc.langCC;
langF77 = if nativeTools then false else gcc.langF77;
}

View File

@@ -40,22 +40,27 @@ skip () {
fi
}
badPath() {
p=$1
test "${p:0:${#NIX_STORE}}" = "$NIX_STORE" -o "${p:0:4}" = "/tmp"
}
params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
if test "$NIX_ENFORCE_PURITY" = "1x" -a -n "$NIX_STORE"; then
rest=()
n=0
while test $n -lt ${#params[*]}; do
p=${params[n]}
p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" -a "${p:2:${#NIX_STORE}}" != "$NIX_STORE"; then
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
skip $p
elif test "$p" = "-L" -a "${p2:0:${#NIX_STORE}}" != "$NIX_STORE"; then
elif test "$p" = "-L" && badPath "$p2"; then
n=$((n + 1)); skip $p2
elif test "${p:0:3}" = "-I/" -a "${p:2:${#NIX_STORE}}" != "$NIX_STORE"; then
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then
skip $p
elif test "$p" = "-I" -a "${p2:0:${#NIX_STORE}}" != "$NIX_STORE"; then
elif test "$p" = "-I" && badPath "$p2"; then
n=$((n + 1)); skip $p2
elif test "$p" = "-isystem" -a "${p2:0:${#NIX_STORE}}" != "$NIX_STORE"; then
elif test "$p" = "-isystem" && badPath "$p2"; then
n=$((n + 1)); skip $p2
else
rest=("${rest[@]}" "$p")

View File

@@ -12,7 +12,7 @@ skip () {
}
params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
if test "$NIX_ENFORCE_PURITY" = "1x" -a -n "$NIX_STORE"; then
rest=()
n=0
while test $n -lt ${#params[*]}; do
@@ -22,10 +22,12 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
skip $p
elif test "$p" = "-L" -a "${p2:0:${#NIX_STORE}}" != "$NIX_STORE"; then
n=$((n + 1)); skip $p2
elif test "${p:0:1}" = "/" -a "${p:0:${#NIX_STORE}}" != "$NIX_STORE"; then
# We cannot skip this; barf.
echo "impure path \`$p' used in link"
exit 1
elif test "$p" = "-dynamic-linker" -a "${p2:0:${#NIX_STORE}}" != "$NIX_STORE"; then
n=$((n + 1)); skip $p2
# elif test "${p:0:1}" = "/" -a "${p:0:${#NIX_STORE}}" != "$NIX_STORE"; then
# # We cannot skip this; barf.
# echo "impure path \`$p' used in link"
# exit 1
else
rest=("${rest[@]}" "$p")
fi

View File

@@ -10,9 +10,6 @@ addCVars () {
envHooks=(${envHooks[@]} addCVars)
export NIX_IS_NATIVE=@isNative@
export NIX_ENFORCE_PURITY=@enforcePurity@
# Note: these come *after* $out in the PATH (see setup.sh).
if test -n "@gcc@"; then