6 # We do the sed in 3 steps, as the -snapshot may or may not be there,
7 # and I can't see a way to optionally match it with POSIX BREs
8 tarred=`ls -1 libraries/tarballs | sed -e 's/\.tar\.gz$//' -e 's/-snapshot$//' -e 's/-[0-9.]*$//'`
12 libraries="$libraries libraries/$p"
13 if [ -d "libraries/$p/_darcs" ]
15 echo Ignoring libraries/$p as it looks like a darcs checkout
17 tarball=libraries/tarballs/$p-*.tar.gz
18 stamp="libraries/stamp/$p"
19 if [ ! -d "libraries/$p" ] ||
21 [ "libraries/stamp/$p" -ot $tarball ]
27 cat ../../$tarball | gzip -d | tar xf -
35 for f in libraries/*; do
37 if test -f $pkgs; then
38 for p in `cat $pkgs`; do
39 libraries="$libraries $f/$p"
42 libraries="$libraries $f"
46 for f in $libraries; do
48 cabals=`echo $f/*.cabal`
49 if test -f $cabals; then
50 echo "Creating $f/ghc.mk"
52 pkg=`echo "$cabals" | sed -e 's#.*/##' -e 's#\.cabal$##'`
53 if test -f $f/ghc-stage; then
54 stage=`cat $f/ghc-stage`
58 top=`echo $f | sed 's#[^/][^/]*#..#g'`
59 echo "${f}_PACKAGE = ${pkg}" >> $f/ghc.mk
60 echo "${f}_dist-install_GROUP = libraries" >> $f/ghc.mk
61 echo "\$(eval \$(call build-package,${f},dist-install,${stage}))" >> $f/ghc.mk
63 echo "Creating $f/GNUmakefile"
64 echo "dir = ${f}" >> $f/GNUmakefile
65 echo "TOP = ${top}" >> $f/GNUmakefile
66 echo "include \$(TOP)/mk/sub-makefile.mk" >> $f/GNUmakefile