2007-09-06 17:30:38 +02:00
|
|
|
source $stdenv/setup
|
2004-07-10 18:17:48 +02:00
|
|
|
|
2008-04-11 23:32:00 +02:00
|
|
|
tar jxf $src || exit 1
|
|
|
|
mkdir -p $out
|
|
|
|
|
|
|
|
mv apache-ant-*/* $out || exit 1
|
|
|
|
|
|
|
|
# add ant-contrib
|
|
|
|
cp $antContrib/*.jar $out/lib
|
|
|
|
|
|
|
|
# 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 ant script. This script is to be invoked with all
|
|
|
|
# appropiate variables and will try to be clever or user-friendly.
|
2004-07-10 18:17:48 +02:00
|
|
|
|
|
|
|
cat >> $out/bin/ant <<EOF
|
|
|
|
#! /bin/sh
|
|
|
|
|
2005-09-18 01:58:51 +02:00
|
|
|
export JAVA_HOME=$jdk
|
|
|
|
export JAVACMD=$jdk/bin/java
|
2004-08-09 23:28:26 +02:00
|
|
|
export LANG="en_US"
|
2004-07-10 18:17:48 +02:00
|
|
|
|
2008-04-11 23:32:00 +02:00
|
|
|
export 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
|
2010-03-02 16:54:54 +01:00
|
|
|
exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" -Djikes.class.path="\$JIKESPATH" org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS -lib "$CLASSPATH" "\$@"
|
2008-04-11 23:32:00 +02:00
|
|
|
else
|
2010-03-02 16:54:54 +01:00
|
|
|
exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS -lib "$CLASSPATH" "\$@"
|
2008-04-11 23:32:00 +02:00
|
|
|
fi
|
|
|
|
fi
|
2004-07-10 18:17:48 +02:00
|
|
|
EOF
|
|
|
|
|
2007-09-06 17:30:38 +02:00
|
|
|
chmod a+x $out/bin/ant
|
|
|
|
|
2008-04-11 23:32:00 +02:00
|
|
|
ln -s $out/bin/ant $out/bin/antRun
|
2007-09-06 17:30:38 +02:00
|
|
|
|