* Use rpaths to ensure that executable and dynamic libraries are automatically linked

against the right dynamic libraries.  set-env.sh add the right linker flags to the 
  NIX_LDFLAGS environment variable, which is passed by gcc-wrapper to the linker.  
  (In many cases these flags could just be passed through LDFLAGS to configure 
  scripts; however, in many other cases this doesn't work properly.)
 --This line, and those below, will be ignored--

M    pkgs/atk/atk-build.sh
M    pkgs/glibc/glibc-build.sh
M    pkgs/expat/expat-build.sh
M    pkgs/freetype/freetype-build.sh
M    pkgs/system/populate-linkdirs.pl
M    pkgs/sdf2/sdf2-build.sh
M    pkgs/pspell/pspell-build.sh
M    pkgs/subversion/subversion-build.sh
M    pkgs/helpers/set-env.sh
M    pkgs/pango/pango-build.sh
M    pkgs/strategoxt/strategoxt-build.sh
M    pkgs/aterm/aterm-build.sh
M    pkgs/libxml2/libxml2-build.sh
M    pkgs/glib-1/glib-build.sh
M    pkgs/glib/glib-build.sh
M    pkgs/pan/pan.fix
M    pkgs/pan/pan-build.sh
M    pkgs/libxslt/libxslt-build.sh
M    pkgs/httpd/httpd-build.sh
M    pkgs/openssl/openssl-build.sh
M    pkgs/gtkspell/gtkspell-build.sh
M    pkgs/fontconfig/fontconfig.fix
M    pkgs/fontconfig/fontconfig-build.sh
M    pkgs/gnet/gnet-build.sh
M    pkgs/gtk+-1/gtk+-build.sh
M    pkgs/gtk+/gtk+-build.sh
M    pkgs/stdenv/gcc-wrapper.sh
M    pkgs/stdenv/stdenv-build.sh
M    pkgs/db4/db4-build.sh
M    pkgs/db4/db4.fix
M    pkgs/MPlayer/MPlayer-build.sh
M    pkgs/swig/swig-build.sh

svn path=/nixpkgs/trunk/; revision=213
This commit is contained in:
Eelco Dolstra 2003-07-28 21:15:03 +00:00
parent 3372b3f8fd
commit 01e38f9371
32 changed files with 131 additions and 56 deletions

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs="$freetype"
. $setenv
. $setenv || exit 1
tar xvfj $src || exit 1
tar xvfj $fonts || exit 1
@ -18,5 +20,3 @@ cd MPlayer-* || exit 1
make || exit 1
make install || exit 1
cp -p ../font-arial-iso-8859-1/font-arial-18-iso-8859-1/* $out/share/mplayer/font || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -1,10 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd aterm-* || exit 1
./configure --prefix=$out || exit 1
./configure --prefix=$out --with-gcc || exit 1
make || exit 1
make install || exit 1
(cd $out/lib && ln -s libATerm.a libATerm-gcc.a) || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,14 +1,17 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:$PATH
envpkgs=$glib
. $setenv
. $setenv || exit 1
tar xvfj $src || exit 1
cd atk-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -1,10 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd db-*/build_unix || exit 1
LDFLAGS=-Wl,-S ../dist/configure --prefix=$out --enable-cxx --enable-compat185 || exit 1
../dist/configure --prefix=$out --enable-cxx --enable-compat185 || exit 1
make || exit 1
make install || exit 1
rm -rf $out/doc || exit 1

View file

@ -1,5 +1,5 @@
Package(
[ ("name", "db-4.0.14")
[ ("name", "db4-4.0.14")
, ("build", Relative("db4/db4-build.sh"))
, ("src", App(IncludeFix("fetchurl/fetchurl.fix"),

View file

@ -1,9 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd expat-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,13 +1,18 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs=$freetype
. $setenv
envpkgs="$freetype $expat"
. $setenv || exit 1
tar xvfz $src || exit 1
cd fcpackage*/fontconfig || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --with-confdir=$out/etc/fonts --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
./configure --prefix=$out --with-confdir=$out/etc/fonts \
--x-includes=/usr/X11/include --x-libraries=/usr/X11/lib \
--with-expat-includes=$expat/include --with-expat-lib=$expat/lib || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -11,5 +11,6 @@ Package(
, ("stdenv", IncludeFix("stdenv/stdenv.fix"))
, ("freetype", IncludeFix("freetype/freetype.fix"))
, ("expat", IncludeFix("expat/expat.fix"))
]
)

View file

@ -1,10 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfj $src || exit 1
cd freetype-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd glib-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1

View file

@ -1,11 +1,13 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:$PATH
tar xvfj $src || exit 1
cd glib-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1

View file

@ -15,7 +15,6 @@ make localedata/install-locales || exit 1
strip -S $out/lib/*.a $out/lib/*.so $out/lib/gconv/*.so
strip -s $out/bin/* $out/sbin/* $out/libexec/*
ln -s /etc/ld.so.conf $out/etc/ld.so.conf || exit 1
$out/sbin/ldconfig /lib /usr/lib || exit 1
ln -sf /etc/ld.so.cache $out/etc/ld.so.cache || exit 1
exit 0

View file

@ -1,5 +1,7 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:/bin:/usr/bin
@ -8,7 +10,8 @@ envpkgs=$glib
tar xvfz $src || exit 1
cd gnet-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -1,5 +1,7 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs="$glib"
@ -7,7 +9,8 @@ envpkgs="$glib"
tar xvfz $src || exit 1
cd gtk+-* || exit 1
LDFLAGS=-s ./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -1,14 +1,16 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:/bin:/usr/bin
export PATH=$pkgconfig/bin:$PATH
envpkgs="$glib $atk $pango"
. $setenv
. $setenv || exit 1
tar xvfj $src || exit 1
cd gtk+-* || exit 1
LDFLAGS=-Wl,-s ./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
make || exit 1
make install || exit 1

View file

@ -1,5 +1,7 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:$PATH
@ -10,7 +12,8 @@ export C_INCLUDE_PATH=$pspell/include:$C_INCLUDE_PATH
tar xvfz $src || exit 1
cd gtkspell-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --disable-gtk-doc || exit 1
./configure --prefix=$out --disable-gtk-doc || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -7,8 +7,7 @@ addtoenv()
fi
if test -d $1/lib; then
export LIBRARY_PATH=$1/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH
export NIX_LDFLAGS="-L $1/lib -Wl,-rpath,$1/lib $NIX_LDFLAGS"
fi
if test -d $1/lib/pkgconfig; then
@ -28,3 +27,5 @@ envpkgs=
for i in $oldenvpkgs; do
addtoenv $i
done
export NIX_LDFLAGS="-Wl,-rpath,$out/lib $NIX_LDFLAGS"

View file

@ -1,13 +1,15 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs="$ssl $db4 $expat"
. $setenv
. $setenv || exit 1
tar xvfz $src || exit 1
cd httpd-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --enable-ssl --with-ssl=$ssl --with-berkeley-db=$db4 \
./configure --prefix=$out --enable-ssl --with-ssl=$ssl --with-berkeley-db=$db4 \
--with-expat=$expat --enable-mods-shared=all --without-gdbm || exit 1
make || exit 1
make install || exit 1

View file

@ -1,10 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd libxml2-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,13 +1,15 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs="$libxml"
. $setenv
. $setenv || exit 1
tar xvfz $src || exit 1
cd libxslt-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,10 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd openssl-* || exit 1
LDFLAGS=-Wl,-S ./config --prefix=$out shared || exit 1
./config --prefix=$out shared || exit 1
make || exit 1
mkdir $out || exit 1
make install || exit 1

View file

@ -1,5 +1,7 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:$PATH
@ -8,7 +10,6 @@ envpkgs="$gtk $gtkspell $gnet $libxml"
tar xvfj $src || exit 1
cd pan-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -12,7 +12,7 @@ Package(
, ("stdenv", IncludeFix("stdenv/stdenv.fix"))
, ("pkgconfig", IncludeFix("pkgconfig/pkgconfig.fix"))
, ("gtk", IncludeFix("gtk+/gtk+.fix"))
, ("gtkspell", IncludeFix("gtkspell/gtkspell.fix"))
, ("gnet", IncludeFix("gnet/gnet.fix"))
, ("libxml", IncludeFix("libxml2/libxml2.fix"))
]

View file

@ -1,14 +1,17 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
export PATH=$pkgconfig/bin:/bin:/usr/bin
export PATH=$pkgconfig/bin:$PATH
envpkgs="$glib $Xft"
. $setenv
. $setenv || exit 1
tar xvfj $src || exit 1
cd pango-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
./configure --prefix=$out --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib || exit 1
make || exit 1
make install || exit 1
echo $envpkgs > $out/envpkgs || exit 1

View file

@ -1,9 +1,12 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd pspell-* || exit 1
CXX=g++ LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
strip -S $out/lib/*.a || exit 1

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd sdf2-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --with-aterm=$aterm || exit 1
./configure --prefix=$out --with-aterm=$aterm || exit 1
make || exit 1
make install || exit 1

View file

@ -10,11 +10,26 @@ for i in $@; do
if test "$i" == "-c"; then
justcompile=1
fi
if test "$i" == "-S"; then
justcompile=1
fi
if test "$i" == "-E"; then
justcompile=1
fi
done
extra=("-isystem" "$libc/include")
IFS=" "
extra=$NIX_CFLAGS
if test "$justcompile" != "1"; then
extra=(${extra[@]} "-L" "$libc/lib" "-Wl,-dynamic-linker,$libc/lib/ld-linux.so.2,-rpath,$libc/lib")
extra=(${extra[@]} $NIX_LDFLAGS)
fi
if test "$NIX_DEBUG" == "1"; then
echo "extra gcc flags:"
for i in ${extra[@]}; do
echo " $i"
done
fi
IFS=
exec $realgcc $@ ${extra[@]}

View file

@ -6,19 +6,23 @@ mkdir $out || exit 1
mkdir $out/bin || exit 1
echo "export PATH=$out/bin:/bin:/usr/bin" >> $out/setup || exit 1
echo "export NIX_CFLAGS=\"-isystem $glibc/include \$NIX_CFLAGS\"" >> $out/setup || exit 1
echo "export NIX_LDFLAGS=\"-L $glibc/lib -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2,-rpath,$glibc/lib \$NIX_LDFLAGS\"" >> $out/setup || exit 1
gcc=/usr/bin/gcc
sed \
-e s^@GCC\@^$gcc^g \
-e s^@LIBC\@^$glibc^g \
< $gccwrapper > $out/bin/gcc || exit 1
chmod +x $out/bin/gcc || exit 1
ln -s gcc $out/bin/cc
gplusplus=/usr/bin/g++
sed \
-e s^@GCC\@^$gplusplus^g \
-e s^@LIBC\@^$glibc^g \
< $gccwrapper > $out/bin/g++ || exit 1
chmod +x $out/bin/g++ || exit 1
ln -s g++ $out/bin/c++

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd strategoxt-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out --with-aterm=$aterm --with-sdf=$sdf2 || exit 1
./configure --prefix=$out --with-aterm=$aterm --with-sdf=$sdf2 || exit 1
make || exit 1
make install || exit 1

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
envpkgs="$ssl $db4 $httpd $swig $libxml"
. $setenv
. $setenv || exit 1
if test $localServer; then
extraflags="--with-berkeley-db=$db4 $extraflags"
@ -26,7 +28,7 @@ echo "extra flags: $extraflags"
tar xvfz $src || exit 1
cd subversion-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out $extraflags \
./configure --prefix=$out $extraflags \
--without-gdbm --disable-static || exit 1
make $extramakeflags || exit 1
make install $extramakeflags || exit 1

View file

@ -1,9 +1,11 @@
#! /bin/sh
export NIX_LDFLAGS=-Wl,-s
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd SWIG-* || exit 1
LDFLAGS=-Wl,-S ./configure --prefix=$out || exit 1
./configure --prefix=$out || exit 1
gmake || exit 1
gmake install || exit 1

View file

@ -50,14 +50,14 @@ sub addPkg {
createLinks("$pkgdir", "$selfdir");
if (-f "$pkgdir/envpkgs") {
my $envpkgs = `cat $pkgdir/envpkgs`;
chomp $envpkgs;
my @envpkgs = split / +/, $envpkgs;
foreach my $envpkg (@envpkgs) {
addPkg($envpkg);
}
}
# if (-f "$pkgdir/envpkgs") {
# my $envpkgs = `cat $pkgdir/envpkgs`;
# chomp $envpkgs;
# my @envpkgs = split / +/, $envpkgs;
# foreach my $envpkg (@envpkgs) {
# addPkg($envpkg);
# }
# }
}