ant: Update to 1.9.3
Also, Ant no longer has a build-time dependency on a particular JDK. It finds the JDK via $JAVA_HOME or $PATH (by looking up javac). This way, we don't need to have separate packages like apacheAntOpenJDK and apacheAntOracleJDK. It also seems reasonable: after all, installing GNU Make doesn't give you a C compiler either. It does mean that instead of buildInputs = [ ant ]; you now need to write something like buildInputs = [ ant jdk ];
This commit is contained in:
parent
e1f7144aa8
commit
54d1721414
@ -1,17 +0,0 @@
|
|||||||
args: with args;
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "ant-contrib-1.0b3";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
mv ant-contrib*.jar $out/
|
|
||||||
'';
|
|
||||||
|
|
||||||
phases = "unpackPhase installPhase";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = mirror://sourceforge/ant-contrib/ant-contrib-1.0b3-bin.tar.bz2;
|
|
||||||
sha256 = "96effcca2581c1ab42a4828c770b48d54852edf9e71cefc9ed2ffd6590571ad1";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
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 LANG="en_US"
|
|
||||||
|
|
||||||
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 \$NIX_ANT_ARGS \$ANT_ARGS -lib "$CLASSPATH" "\$@"
|
|
||||||
else
|
|
||||||
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" "\$@"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod a+x $out/bin/ant
|
|
||||||
|
|
||||||
ln -s $out/bin/ant $out/bin/antRun
|
|
||||||
|
|
@ -1,30 +1,64 @@
|
|||||||
{ fetchurl, stdenv, jdk }:
|
{ fetchurl, stdenv, makeWrapper }:
|
||||||
|
|
||||||
let
|
let version = "1.9.3"; in
|
||||||
|
|
||||||
antContrib = import ./ant-contrib.nix {
|
|
||||||
inherit fetchurl stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
version = "1.8.4";
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "ant-${(builtins.parseDrvName jdk.name).name}-${version}";
|
name = "ant-${version}";
|
||||||
|
|
||||||
builder = ./builder.sh;
|
buildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
buildInputs = [ antContrib jdk ];
|
|
||||||
|
|
||||||
inherit antContrib jdk;
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://apache/ant/binaries/apache-ant-${version}-bin.tar.bz2";
|
url = "mirror://apache/ant/binaries/apache-ant-${version}-bin.tar.bz2";
|
||||||
sha1 = "d9e3e83dd9664cfe1dcd4841c082db3f559af922";
|
sha1 = "efcf206e24b0dd1583c501182ad163af277951a4";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
contrib = fetchurl {
|
||||||
|
url = mirror://sourceforge/ant-contrib/ant-contrib-1.0b3-bin.tar.bz2;
|
||||||
|
sha256 = "96effcca2581c1ab42a4828c770b48d54852edf9e71cefc9ed2ffd6590571ad1";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase =
|
||||||
|
''
|
||||||
|
mkdir -p $out/bin $out/lib/ant
|
||||||
|
mv * $out/lib/ant/
|
||||||
|
|
||||||
|
# Get rid of the manual (35 MiB). Maybe we should put this in a
|
||||||
|
# separate output. Also get rid of the Ant scripts since we
|
||||||
|
# provide our own.
|
||||||
|
rm -rf $out/lib/ant/{manual,bin,WHATSNEW}
|
||||||
|
|
||||||
|
# Install ant-contrib.
|
||||||
|
unpackFile $contrib
|
||||||
|
cp -p ant-contrib/ant-contrib-*.jar $out/lib/ant/lib/
|
||||||
|
|
||||||
|
cat >> $out/bin/ant <<EOF
|
||||||
|
#! ${stdenv.shell} -e
|
||||||
|
|
||||||
|
ANT_HOME=$out/lib/ant
|
||||||
|
|
||||||
|
if [ -z "\$JAVA_HOME" ]; then
|
||||||
|
if ! JAVACCMD="\$(type -p javac)"; then
|
||||||
|
echo "\$0: cannot find the Java SDK" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export JAVA_HOME="\$(dirname \$(dirname \$(readlink -f \$JAVACCMD)))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOCALCLASSPATH="\$ANT_HOME/lib/ant-launcher.jar:\$JAVA_HOME/lib/tools.jar\''${LOCALCLASSPATH:+:}\$LOCALCLASSPATH"
|
||||||
|
|
||||||
|
exec "\$JAVA_HOME/bin/java" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" \
|
||||||
|
-Dant.home=\$ANT_HOME -Dant.library.dir="\$ANT_LIB" \
|
||||||
|
org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS \
|
||||||
|
-cp "\$CLASSPATH" "\$@"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x $out/bin/ant
|
||||||
|
''; # */
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Java-based build tool";
|
homepage = http://ant.apache.org/;
|
||||||
|
description = "A Java-based build tool";
|
||||||
|
license = stdenv.lib.licenses.asl20;
|
||||||
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2830,7 +2830,6 @@ let
|
|||||||
openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
|
openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
|
||||||
in callPackage ../development/compilers/openjdk {
|
in callPackage ../development/compilers/openjdk {
|
||||||
jdk = openjdkBootstrap;
|
jdk = openjdkBootstrap;
|
||||||
ant = pkgs.ant.override { jdk = openjdkBootstrap; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
openjre = pkgs.openjdk.jre;
|
openjre = pkgs.openjdk.jre;
|
||||||
@ -3457,9 +3456,6 @@ let
|
|||||||
|
|
||||||
apacheAnt = callPackage ../development/tools/build-managers/apache-ant { };
|
apacheAnt = callPackage ../development/tools/build-managers/apache-ant { };
|
||||||
|
|
||||||
apacheAntOpenJDK = apacheAnt.override { jdk = openjdk; };
|
|
||||||
apacheAntOracleJDK = ant.override { jdk = pkgs.oraclejdk; };
|
|
||||||
|
|
||||||
apacheAntGcj = callPackage ../development/tools/build-managers/apache-ant/from-source.nix {
|
apacheAntGcj = callPackage ../development/tools/build-managers/apache-ant/from-source.nix {
|
||||||
# must be either pre-built or built with GCJ *alone*
|
# must be either pre-built or built with GCJ *alone*
|
||||||
gcj = gcj.gcc; # use the raw GCJ, which has ${gcj}/lib/jvm
|
gcj = gcj.gcc; # use the raw GCJ, which has ${gcj}/lib/jvm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user