From feeff4dfb11ed456a4cf20091a41dfe9c2b04a08 Mon Sep 17 00:00:00 2001 From: Martin Bravenboer Date: Sat, 10 Jul 2004 13:59:21 +0000 Subject: [PATCH] Working on improved Ant package in Nix: do configuration in wrapper scripts. This is the 'core' Ant. svn path=/nixpkgs/trunk/; revision=1148 --- pkgs/development/compilers/jikes/builder.sh | 10 +--- pkgs/development/compilers/jikes/default.nix | 10 ++-- .../build-managers/apache-ant/builder.sh | 19 ------- .../apache-ant/core-apache-ant.nix | 10 ++++ .../build-managers/apache-ant/core-builder.sh | 51 +++++++++++++++++++ .../build-managers/apache-ant/default.nix | 8 --- pkgs/system/all-packages-generic.nix | 4 +- 7 files changed, 71 insertions(+), 41 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/apache-ant/builder.sh create mode 100644 pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix create mode 100644 pkgs/development/tools/build-managers/apache-ant/core-builder.sh delete mode 100644 pkgs/development/tools/build-managers/apache-ant/default.nix diff --git a/pkgs/development/compilers/jikes/builder.sh b/pkgs/development/compilers/jikes/builder.sh index 35b2aa8cc97b..9a297c67f6e8 100644 --- a/pkgs/development/compilers/jikes/builder.sh +++ b/pkgs/development/compilers/jikes/builder.sh @@ -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 diff --git a/pkgs/development/compilers/jikes/default.nix b/pkgs/development/compilers/jikes/default.nix index 05fd014afc06..1e89c30788cd 100644 --- a/pkgs/development/compilers/jikes/default.nix +++ b/pkgs/development/compilers/jikes/default.nix @@ -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"; }; } 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 <