3
0
Fork 0
forked from mirrors/nixpkgs

added ant-contrib, expression works but is really really ugly - maybe someone else can have a look at it?

svn path=/nixpkgs/trunk/; revision=11588
This commit is contained in:
Tobias Hammerschmidt 2008-04-11 21:32:00 +00:00
parent 2f52d09204
commit 085dc5bc74
2 changed files with 50 additions and 11 deletions

View file

@ -1,21 +1,53 @@
source $stdenv/setup
mkdir -p $out/bin
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.
cat >> $out/bin/ant <<EOF
#! /bin/sh
export JAVA_HOME=$jdk
export JAVACMD=$jdk/bin/java
export ANT_OPTS=""
export ANT_ARGS=""
export LANG="en_US"
$ant/bin/core-ant \$@
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
exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" -Djikes.class.path="\$JIKESPATH" org.apache.tools.ant.launch.Launcher \$ANT_ARGS -lib "$CLASSPATH" "\$@"
else
exec "\$JAVACMD" \$NIX_ANT_OPTS \$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/ant
ln -s $ant/lib $ant/etc $out/
ln -s $out/bin/ant $out/bin/antRun

View file

@ -1,16 +1,23 @@
{stdenv, fetchurl, jdk, name}:
{fetchurl, stdenv, jdk, name}:
let {
body =
stdenv.mkDerivation {
name = name;
builder = ./builder.sh;
buildInputs = [ant jdk];
inherit ant jdk;
buildInputs = [antContrib jdk];
inherit antContrib jdk;
src = fetchurl {
url = http://apache.surfnet.nl/ant/binaries/apache-ant-1.6.5-bin.tar.bz2;
md5 = "26031ee1a2fd248ad0cc2e7f17c44c39";
};
};
ant =
(import ./core-apache-ant.nix) {
antContrib =
(import ./ant-contrib.nix) {
inherit fetchurl stdenv;
};
}