Working on improved Ant package in Nix: do configuration in wrapper scripts. This is the 'core' Ant.

svn path=/nixpkgs/trunk/; revision=1148
This commit is contained in:
Martin Bravenboer 2004-07-10 13:59:21 +00:00
parent d91c216e2c
commit feeff4dfb1
7 changed files with 71 additions and 41 deletions

View file

@ -1,8 +1,2 @@
. $stdenv/setup || exit 1
tar xvfj $src || exit 1
cd jikes-* || exit 1
./configure --prefix=$out || exit 1
make || exit 1
make install || exit 1
. $stdenv/setup
genericBuild

View file

@ -1,8 +1,10 @@
{stdenv, fetchurl}: stdenv.mkDerivation {
name = "jikes-1.18";
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "jikes-1.21";
builder = ./builder.sh;
src = fetchurl {
url = ftp://www-126.ibm.com/pub/jikes/1.18/jikes-1.18.tar.bz2;
md5 = "74bbcfd31aa2d7df4b86c5fe2db315cc";
url = ftp://www-126.ibm.com/pub/jikes/1.21/jikes-1.21.tar.bz2;
md5 = "4e45eeab4c75918174e16ea2b695d812";
};
}

View file

@ -1,19 +0,0 @@
. $stdenv/setup || exit 1
tar xvfj $src || exit 1
mkdir -p $out
mv apache-ant-1.6.0/* $out || exit 1
rm -rf $out/docs
rm $out/*
confpath=$out/etc/nixpaths.conf || exit 1
sed "s^.etc.ant.conf^$confpath^g" $out/bin/ant > $out/bin/ant_temp || exit 1
mv $out/bin/ant_temp $out/bin/ant || exit 1
chmod u+xrw $out/bin/ant || exit 1
chmod u+x $out/bin/* || exit 1
echo "
JAVA_HOME=$j2sdk
ANT_HOME=$out
" > $confpath || exit 1

View file

@ -0,0 +1,10 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "apache-ant-1.6.1";
builder = ./core-builder.sh;
src = fetchurl {
url = http://www.apache.org/dist/ant/binaries/apache-ant-1.6.1-bin.tar.bz2;
md5 = "703d0265d05b98afd95be0bc21b98420";
};
}

View file

@ -0,0 +1,51 @@
. $stdenv/setup || exit 1
# unpack the binary distribution
tar jxf $src || exit 1
mkdir -p $out
mv apache-ant-1.6.1/* $out || exit 1
# remove crap in the root directory
for file in $out/*
do
if test -f $file ; then
rm $file
fi
done
rm -rf $out/docs
# prevent the use of hacky scripts. This will be handled in Nix.
rm $out/bin/* || exit 1
# add core-ant script. This script is to be invoked with all
# appropiate variables and will try to be clever or user-friendlt=y.
cat >> $out/bin/core-ant <<EOF
#! /bin/sh
# Variables:
# JAVA_HOME
# JAVACMD
# ANT_OPTS
# ANT_ARGS
ANT_HOME=$out
if [ -z "\$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar
else
LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar:\$LOCALCLASSPATH
fi
if [ -n "\$JIKESPATH" ]; then
exec "\$JAVACMD" \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" -Djikes.class.path="\$JIKESPATH" org.apache.tools.ant.launch.Launcher \$ANT_ARGS -l
ib "$CLASSPATH" "\$@"
else
exec "\$JAVACMD" \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" org.apache.tools.ant.launch.Launcher \$ANT_ARGS -lib "$CLASSPATH" "\$@"
fi
fi
EOF
chmod a+x $out/bin/core-ant

View file

@ -1,8 +0,0 @@
{stdenv, fetchurl, j2sdk}: stdenv.mkDerivation {
name = "apache-ant-1.6.0";
builder = ./builder.sh;
src = fetchurl {
url = http://dist.apache.easynet.nl/ant/binaries/apache-ant-1.6.0-bin.tar.bz2;
md5 = "01989c306da53862c101d9ea4ebb1f00";
};
}

View file

@ -306,8 +306,8 @@ rec {
inherit fetchurl stdenv;
};
apacheant = (import ../development/tools/build-managers/apache-ant) {
inherit fetchurl stdenv j2sdk;
apacheant = (import ../development/tools/build-managers/apache-ant/core-apache-ant.nix) {
inherit fetchurl stdenv;
};
pcre = (import ../development/libraries/pcre) {