diff options
author | Christof Douma <wizztick@douma.eu.org> | 2006-01-27 10:16:15 +0000 |
---|---|---|
committer | Christof Douma <wizztick@douma.eu.org> | 2006-01-27 10:16:15 +0000 |
commit | 8d4e61d096e9c02e652b86f76c986504cd3c4ae3 (patch) | |
tree | 645e3b2c4cdde67fec4115d1ab12e207dc64a157 /pkgs | |
parent | 69b41650adb254e52abe044a74c495d5ea04cd08 (diff) |
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
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/compilers/ghc-wrapper/builder.sh | 32 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc-wrapper/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/libraries/haskell/uulib/builder.sh | 48 | ||||
-rw-r--r-- | pkgs/development/libraries/haskell/uulib/default.nix | 1 | ||||
-rw-r--r-- | pkgs/development/tools/haskell/uuagc/default.nix | 19 | ||||
-rw-r--r-- | pkgs/system/all-packages-generic.nix | 10 | ||||
-rw-r--r-- | pkgs/system/populate-cache.nix | 4 |
7 files changed, 102 insertions, 19 deletions
diff --git a/pkgs/development/compilers/ghc-wrapper/builder.sh b/pkgs/development/compilers/ghc-wrapper/builder.sh new file mode 100644 index 0000000000000..0d774e8a7d566 --- /dev/null +++ b/pkgs/development/compilers/ghc-wrapper/builder.sh @@ -0,0 +1,32 @@ +source $stdenv/setup + +makeWrapper() { + wrapperBase="$1" + wrapperName="$2" + wrapper="$out/$wrapperName" + shift; shift #the other arguments are passed to the source app + echo '#!'"$SHELL" > "$wrapper" + echo "exec \"$wrapperBase/$wrapperName\" $@" '"$@"' > "$wrapper" + chmod +x "$wrapper" +} + +mkdir -p $out/nix-support $out/bin +packages_db=$out/nix-support/package.conf + +#create packages database (start with compiler base packages) +cp $ghc/lib/ghc-*/package.conf $packages_db +chmod +w $packages_db +for lib in $libraries; do + sh $lib/nix-support/register.sh $packages_db || exit 1 +done +rm -f $packages_db.old + +#create the wrappers +#NB: The double dash for ghc-pkg is not a typo! +makeWrapper $ghc "bin/ghc" "-package-conf" $packages_db +makeWrapper $ghc "bin/ghci" "-package-conf" $packages_db +makeWrapper $ghc "bin/runghc" "-package-conf" $packages_db +makeWrapper $ghc "bin/runhaskell" "-package-conf" $packages_db +makeWrapper $ghc "bin/ghc-pkg" "--global-conf" $packages_db + +# todo: link all other binaries of ghc diff --git a/pkgs/development/compilers/ghc-wrapper/default.nix b/pkgs/development/compilers/ghc-wrapper/default.nix new file mode 100644 index 0000000000000..2d4c5dd4634b2 --- /dev/null +++ b/pkgs/development/compilers/ghc-wrapper/default.nix @@ -0,0 +1,7 @@ +{stdenv, ghc, libraries}: + +stdenv.mkDerivation { + name = ghc.name; + inherit ghc libraries; + builder = ./builder.sh; +} diff --git a/pkgs/development/libraries/haskell/uulib/builder.sh b/pkgs/development/libraries/haskell/uulib/builder.sh index 1769fe66b8a49..e2d4969cb871f 100644 --- a/pkgs/development/libraries/haskell/uulib/builder.sh +++ b/pkgs/development/libraries/haskell/uulib/builder.sh @@ -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/ && - -#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|') - -#no dependencies -touch $out/dependencies +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 && + +# The package and its direct cabal dependencies are registered. This may result +# in duplicate registrations attempts but hopefully that will not result in +# errors. + +# 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 diff --git a/pkgs/development/libraries/haskell/uulib/default.nix b/pkgs/development/libraries/haskell/uulib/default.nix index 18371d948b1ea..806db3e14ae3b 100644 --- a/pkgs/development/libraries/haskell/uulib/default.nix +++ b/pkgs/development/libraries/haskell/uulib/default.nix @@ -7,5 +7,6 @@ stdenv.mkDerivation { md5 = "0cc9acc6a268e2bc5c8a954e67406e2d"; }; builder = ./builder.sh; + #buildInputs = [ ghc ]; inherit ghc; } diff --git a/pkgs/development/tools/haskell/uuagc/default.nix b/pkgs/development/tools/haskell/uuagc/default.nix new file mode 100644 index 0000000000000..53c5db34d649f --- /dev/null +++ b/pkgs/development/tools/haskell/uuagc/default.nix @@ -0,0 +1,19 @@ +{stdenv, fetchurl, ghc, uulib}: + +#as long as cabal does not allow to specify which package.conf to use we create a wrapper + +let { + uulibGHC = (import ../../../compilers/ghc-wrapper) { + libraries = [ uulib ]; + inherit stdenv ghc; + }; + + body = stdenv.mkDerivation { + name = "uuagc"; + src = fetchurl { + url = http://abaris.zoo.cs.uu.nl:8080/wiki/pub/HUT/Download/uuagc-0.9.1-src.tar.gz; + md5 = "0f29cad75bd759696edc61c24d1a5db9"; + }; + buildInputs = [uulibGHC]; + }; +} diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 7c957ed69fa0a..2e4028c1e55fb 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -682,6 +682,16 @@ rec { m4 = gnum4; }; + ghcWrapper = assert uulib.ghc == ghc; + (import ../development/compilers/ghc-wrapper) { + inherit stdenv ghc; + libraries = [ uulib ]; + }; + + uuagc = (import ../development/tools/haskell/uuagc) { + inherit fetchurl stdenv ghc uulib; + }; + helium = (import ../development/compilers/helium) { inherit fetchurl stdenv ghc; }; diff --git a/pkgs/system/populate-cache.nix b/pkgs/system/populate-cache.nix index b9111e8fed24e..489c1324620d2 100644 --- a/pkgs/system/populate-cache.nix +++ b/pkgs/system/populate-cache.nix @@ -55,8 +55,10 @@ let { strategoxtUtils transformers - ghc +# ghc + ghcWrapper uulib + uuagc # helium perl python |