diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-10-23 14:52:21 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-10-23 14:52:21 +0000 |
commit | 6dc839d3445e66b259361f08838a8c05b1912e68 (patch) | |
tree | 5ef88f8fe4cb6f75cf0a1c1e821945c7186491c7 /pkgs/build-support | |
parent | 4309788df022c89765cd7f6b178f4ce7a08db600 (diff) | |
parent | 327a2eae30b48277bd453842d03a144f618822b2 (diff) | |
download | nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar.gz nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar.bz2 nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar.lz nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar.xz nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.tar.zst nixlib-6dc839d3445e66b259361f08838a8c05b1912e68.zip |
Merging from trunk. I resolved some conflicts; I hope that well.
svn path=/nixpkgs/branches/stdenv-updates/; revision=24429
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/release/ant-build.nix | 22 | ||||
-rw-r--r-- | pkgs/build-support/release/default.nix | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix index e761205f663f..779841aec6ac 100644 --- a/pkgs/build-support/release/ant-build.nix +++ b/pkgs/build-support/release/ant-build.nix @@ -1,5 +1,6 @@ { src -, stdenv +, pkgs +, stdenv ? pkgs.stdenv , name , antTargets ? [] , jars ? [] @@ -7,14 +8,19 @@ , antProperties ? [] , antBuildInputs ? [] , buildfile ? "build.xml" +, ant ? pkgs.ant +, jre ? pkgs.jre +, hydraAntLogger ? pkgs.hydraAntLogger , ... } @ args: let - antFlags = "-f ${buildfile} " + stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value}" ) antProperties ; + antFlags = "-f ${buildfile} " + stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value} " ) antProperties ; + lib = stdenv.lib; in stdenv.mkDerivation ( { + inherit jre ant; showBuildStats = true; postPhases = @@ -44,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 @@ -79,11 +89,13 @@ stdenv.mkDerivation ( ''; } - // removeAttrs args ["antProperties"] // + // removeAttrs args ["antProperties" "buildInputs" "pkgs" "jarWrappers"] // { name = name + (if src ? version then "-" + src.version else ""); + buildInputs = [ant jre] ++ stdenv.lib.optional (args ? buildInputs) args.buildInputs ; + postHook = '' ensureDir $out/nix-support echo "$system" > $out/nix-support/system diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index b7a362aa9f92..2cf2b1f8d6d9 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -15,7 +15,7 @@ rec { } // args); antBuild = args: import ./ant-build.nix ( - { inherit stdenv; + { inherit pkgs; } // args); mvnBuild = args: import ./maven-build.nix ( |