* Purify all corepkgs builders.

This commit is contained in:
Eelco Dolstra 2005-03-15 12:03:15 +00:00
parent e52ae1c0ff
commit bacd3a6cfa
5 changed files with 17 additions and 15 deletions

View file

@ -81,6 +81,13 @@ AC_PATH_PROG(xsltproc, xsltproc, false)
AC_PATH_PROG(flex, flex, false) AC_PATH_PROG(flex, flex, false)
AC_PATH_PROG(bison, bison, false) AC_PATH_PROG(bison, bison, false)
NEED_PROG(perl, perl) NEED_PROG(perl, perl)
NEED_PROG(tar, tar)
AC_PATH_PROG(mkdir, mkdir, false)
AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
[path of mkdir, etc.]),
coreutils=$withval, coreutils=$(dirname $mkdir))
AC_SUBST(coreutils)
AC_ARG_WITH(docbook-catalog, AC_HELP_STRING([--with-docbook-catalog=PATH], AC_ARG_WITH(docbook-catalog, AC_HELP_STRING([--with-docbook-catalog=PATH],
[path of the DocBook XML DTD]), [path of the DocBook XML DTD]),

View file

@ -1,9 +1,7 @@
#! @shell@ -e #! @shell@ -e
export PATH=/bin:/usr/bin # !!! impure @coreutils@/mkdir $out
@coreutils@/mkdir $out/tmp
mkdir $out
mkdir $out/tmp
cd $out/tmp cd $out/tmp
expr=$out/default.nix expr=$out/default.nix
@ -12,8 +10,8 @@ echo '[' > $expr
nr=0 nr=0
for i in $inputs; do for i in $inputs; do
echo "unpacking $i" echo "unpacking $i"
@bunzip2@ < $i | tar xvf - @bunzip2@ < $i | @tar@ xvf -
mv * ../$nr # !!! hacky @coreutils@/mv * ../$nr # !!! hacky
echo "(import ./$nr)" >> $expr echo "(import ./$nr)" >> $expr
nr=$(($nr + 1)) nr=$(($nr + 1))
done done
@ -21,4 +19,4 @@ done
echo ']' >> $expr echo ']' >> $expr
cd .. cd ..
rmdir tmp @coreutils@/rmdir tmp

View file

@ -1,13 +1,11 @@
#! @shell@ -e #! @shell@ -e
export PATH=/bin:/usr/bin
echo "downloading $url into $out" echo "downloading $url into $out"
prefetch=@storedir@/nix-prefetch-url-$outputHash prefetch=@storedir@/nix-prefetch-url-$outputHash
if test -f "$prefetch"; then if test -f "$prefetch"; then
echo "using prefetched $prefetch"; echo "using prefetched $prefetch";
mv $prefetch $out @coreutils@/mv $prefetch $out
else else
@curl@ --fail --location --max-redirs 20 "$url" > "$out" @curl@ --fail --location --max-redirs 20 "$url" > "$out"
fi fi

View file

@ -1,10 +1,7 @@
#! @shell@ -e #! @shell@ -e
# !!! impure; fix this
export PATH=/bin:/usr/bin
echo "packing $path into $out..." echo "packing $path into $out..."
mkdir $out @coreutils@/mkdir $out
dst=$out/tmp.nar.bz2 dst=$out/tmp.nar.bz2
@bindir@/nix-store --dump "$path" > tmp @bindir@/nix-store --dump "$path" > tmp
@ -14,4 +11,4 @@ dst=$out/tmp.nar.bz2
@bindir@/nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash @bindir@/nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash
mv $out/tmp.nar.bz2 $out/$(cat $out/narbz2-hash).nar.bz2 @coreutils@/mv $out/tmp.nar.bz2 $out/$(@coreutils@/cat $out/narbz2-hash).nar.bz2

View file

@ -14,6 +14,8 @@
-e "s^@bzip2\@^$(bzip2)^g" \ -e "s^@bzip2\@^$(bzip2)^g" \
-e "s^@bunzip2\@^$(bunzip2)^g" \ -e "s^@bunzip2\@^$(bunzip2)^g" \
-e "s^@perl\@^$(perl)^g" \ -e "s^@perl\@^$(perl)^g" \
-e "s^@coreutils\@^$(coreutils)^g" \
-e "s^@tar\@^$(tar)^g" \
-e "s^@version\@^$(VERSION)^g" \ -e "s^@version\@^$(VERSION)^g" \
< $< > $@ || rm $@ < $< > $@ || rm $@
if test -x $<; then chmod +x $@; fi if test -x $<; then chmod +x $@; fi