about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/apache-ant
diff options
context:
space:
mode:
authorMartin Bravenboer <martin.bravenboer@logicblox.com>2004-07-10 13:59:21 +0000
committerMartin Bravenboer <martin.bravenboer@logicblox.com>2004-07-10 13:59:21 +0000
commitfeeff4dfb11ed456a4cf20091a41dfe9c2b04a08 (patch)
tree5423f8a6bc12f1ed34dc253e95fd00d6fd122e46 /pkgs/development/tools/build-managers/apache-ant
parentd91c216e2cefa4484cedb23685ad73e6bd7dcc35 (diff)
downloadnixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar.gz
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar.bz2
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar.lz
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar.xz
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.tar.zst
nixlib-feeff4dfb11ed456a4cf20091a41dfe9c2b04a08.zip
Working on improved Ant package in Nix: do configuration in wrapper scripts. This is the 'core' Ant.
svn path=/nixpkgs/trunk/; revision=1148
Diffstat (limited to 'pkgs/development/tools/build-managers/apache-ant')
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/builder.sh19
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix10
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/core-builder.sh51
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/default.nix8
4 files changed, 61 insertions, 27 deletions
diff --git a/pkgs/development/tools/build-managers/apache-ant/builder.sh b/pkgs/development/tools/build-managers/apache-ant/builder.sh
deleted file mode 100644
index e3e8e63d73d9..000000000000
--- a/pkgs/development/tools/build-managers/apache-ant/builder.sh
+++ /dev/null
@@ -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
diff --git a/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix b/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix
new file mode 100644
index 000000000000..1a6af33114da
--- /dev/null
+++ b/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix
@@ -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";
+  };
+}
diff --git a/pkgs/development/tools/build-managers/apache-ant/core-builder.sh b/pkgs/development/tools/build-managers/apache-ant/core-builder.sh
new file mode 100644
index 000000000000..afa6a259f7e6
--- /dev/null
+++ b/pkgs/development/tools/build-managers/apache-ant/core-builder.sh
@@ -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
+
diff --git a/pkgs/development/tools/build-managers/apache-ant/default.nix b/pkgs/development/tools/build-managers/apache-ant/default.nix
deleted file mode 100644
index e7c587136a7a..000000000000
--- a/pkgs/development/tools/build-managers/apache-ant/default.nix
+++ /dev/null
@@ -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";
-  };
-}