change uulib to store all dependencies to package.conf
added ghc-wrapper to use a generated global package.conf added uuagc svn path=/nixpkgs/trunk/; revision=4608
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
source $stdenv/setup
|
||||
|
||||
#manual setup of ghc
|
||||
PATH=$ghc/bin:$PATH
|
||||
|
||||
#add ghc to search path
|
||||
test -n "$ghc" && PATH=$PATH:$ghc/bin
|
||||
|
||||
#unpack
|
||||
tar xzf "$src" &&
|
||||
@@ -17,20 +18,31 @@ ghc --make Setup.hs -o setup -package Cabal &&
|
||||
#install
|
||||
./setup copy &&
|
||||
|
||||
#register package locally (might use wrapper instead of ugly sed)
|
||||
echo '[]' > package.conf &&
|
||||
# Create package database. If we can find the ghc version we might install the
|
||||
# package, like ghc does, in $out/lib/ghc-version/package.conf.
|
||||
|
||||
support=$out/nix-support &&
|
||||
packages_db=$out/nix-support/package.conf &&
|
||||
|
||||
mkdir $support &&
|
||||
cp $ghc/lib/ghc-*/package.conf $packages_db &&
|
||||
chmod +w $packages_db &&
|
||||
#echo '[]' > $packages_db &&
|
||||
|
||||
# We save a modified version of a register script. This gives a dependency on
|
||||
# ghc, but this should not be a problem as long as $out is a static library.
|
||||
|
||||
./setup register --gen-script &&
|
||||
sed "/ghc-pkg/ s|update -|-f package.conf update -|" register.sh > register-local.sh &&
|
||||
sh register-local.sh &&
|
||||
mv package.conf $out/ &&
|
||||
sed '/ghc-pkg/ s|update -|-f "$1" update -|' register.sh > register-pkg.sh &&
|
||||
sed '/ghc-pkg/ s|--auto-ghci-libs||' register-pkg.sh > $support/register.sh &&
|
||||
|
||||
#add dependencies
|
||||
#dependencies contains a FSO per line
|
||||
#for ghc : prefix each FSO with -package-conf
|
||||
#for ghc-pkg : prefix each FSO with -f or --package-conf (note the difference with ghc)
|
||||
#both : append with package.conf
|
||||
#
|
||||
#example: $(sort FSO1/dependencies FSO2/dependencies | uniq | sed 's|^|FSO/|; s|$|/package.conf|')
|
||||
# The package and its direct cabal dependencies are registered. This may result
|
||||
# in duplicate registrations attempts but hopefully that will not result in
|
||||
# errors.
|
||||
|
||||
#no dependencies
|
||||
touch $out/dependencies
|
||||
# uulib has no dependencies on other ghc libraries
|
||||
for dep in ; do
|
||||
sh $dep/nix-support/register.sh $packages_db || exit 1
|
||||
done &&
|
||||
sh register-pkg.sh $packages_db &&
|
||||
rm -f $package_db.old
|
||||
|
||||
@@ -7,5 +7,6 @@ stdenv.mkDerivation {
|
||||
md5 = "0cc9acc6a268e2bc5c8a954e67406e2d";
|
||||
};
|
||||
builder = ./builder.sh;
|
||||
#buildInputs = [ ghc ];
|
||||
inherit ghc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user