From edb6a80ac3b4eff392718139baa6f6df8f2aa052 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 5 Mar 2010 10:09:22 +0000 Subject: ant builder svn path=/nixpkgs/trunk/; revision=20395 --- pkgs/build-support/release/ant-build.nix | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 pkgs/build-support/release/ant-build.nix (limited to 'pkgs/build-support/release/ant-build.nix') diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix new file mode 100644 index 000000000000..7aa449af3a6a --- /dev/null +++ b/pkgs/build-support/release/ant-build.nix @@ -0,0 +1,85 @@ +{ src +, stdenv +, name +, antTargets ? [] +, jars ? [] +, jarWrappers ? [] +, antProperties ? [] +, ... } @ args: + +let + antFlags = stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value}" ) antProperties ; +in +stdenv.mkDerivation ( + + { + showBuildStats = true; + + postPhases = + ["generateWrappersPhase" "finalPhase"]; + + installPhase = '' + ensureDir $out/lib/java + ${ if jars == [] then '' + find . -name "*.jar" | xargs -I{} cp -v {} $out/lib/java + '' else stdenv.lib.concatMapStrings (j: '' + cp -v ${j} $out/lib/java + echo file jar $out/lib/java/${j} >> $out/nix-support/hydra-build-products + '') jars } + ''; + + generateWrappersPhase = '' + header "Generating jar wrappers" + '' + (stdenv.lib.concatMapStrings (w: '' + + cat >> $out/bin/jclasslib < $out/nix-support/system + + # If `src' is the result of a call to `makeSourceTarball', then it + # has a subdirectory containing the actual tarball(s). If there are + # multiple tarballs, just pick the first one. + origSrc=$src + if test -d $src/tarballs; then + src=$(ls $src/tarballs/*.tar.bz2 $src/tarballs/*.tar.gz | sort | head -1) + fi + + ''; + } +) -- cgit 1.4.1