summary refs log tree commit diff
path: root/pkgs/build-support/release
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2010-10-20 12:30:03 +0000
committerRob Vermaas <rob.vermaas@gmail.com>2010-10-20 12:30:03 +0000
commit0df15241ca861e1abb366191759f548c20644898 (patch)
tree433dfd1e4639c47945c21f6e09a5bf1f9b88b814 /pkgs/build-support/release
parent51ac7f1a27df3d9c463c47909c5cb114b7d88f2e (diff)
downloadnixpkgs-0df15241ca861e1abb366191759f548c20644898.tar
nixpkgs-0df15241ca861e1abb366191759f548c20644898.tar.gz
nixpkgs-0df15241ca861e1abb366191759f548c20644898.tar.bz2
nixpkgs-0df15241ca861e1abb366191759f548c20644898.tar.lz
nixpkgs-0df15241ca861e1abb366191759f548c20644898.tar.xz
nixpkgs-0df15241ca861e1abb366191759f548c20644898.tar.zst
nixpkgs-0df15241ca861e1abb366191759f548c20644898.zip
fixes to ant-build
svn path=/nixpkgs/trunk/; revision=24383
Diffstat (limited to 'pkgs/build-support/release')
-rw-r--r--pkgs/build-support/release/ant-build.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix
index f6882de54d0..779841aec6a 100644
--- a/pkgs/build-support/release/ant-build.nix
+++ b/pkgs/build-support/release/ant-build.nix
@@ -15,10 +15,12 @@
 
 let
   antFlags = "-f ${buildfile} " + stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value} " ) antProperties ;
+  lib = stdenv.lib;
 in
 stdenv.mkDerivation (
 
   {
+    inherit jre ant;
     showBuildStats = true;
 
     postPhases =
@@ -48,14 +50,18 @@ stdenv.mkDerivation (
       done
     '';
 
-    generateWrappersPhase = '' 
+    generateWrappersPhase = 
+      let 
+        cp = w: "-cp ${lib.optionalString (w ? classPath) w.classPath}${lib.optionalString (w ? mainClass) ":$out/lib/java/${w.jar}"}";
+      in
+      '' 
       header "Generating jar wrappers"
     '' + (stdenv.lib.concatMapStrings (w: ''
 
       cat >> $out/bin/${w.name} <<EOF
       #! /bin/sh
       export JAVA_HOME=$jre
-      $jre/bin/java ${if w ? mainClass then "-cp $out/lib/java/${w.jar} ${w.mainClass}" else "-jar $out/lib/java/${w.jar}"} \$@
+      $jre/bin/java ${cp w} ${if w ? mainClass then w.mainClass else "-jar ${w.jar}"} \$@
       EOF
 
       chmod a+x $out/bin/${w.name} || exit 1
@@ -83,7 +89,7 @@ stdenv.mkDerivation (
       '';
   }
 
-  // removeAttrs args ["antProperties" "buildInputs" "pkgs"] // 
+  // removeAttrs args ["antProperties" "buildInputs" "pkgs" "jarWrappers"] // 
 
   {
     name = name + (if src ? version then "-" + src.version else "");