summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2016-07-24 22:33:45 +0300
committerAlexey Shmalko <rasen.dubi@gmail.com>2016-07-26 02:02:42 +0300
commitbb3fc68b300c8d0712238c95c442dd846a362300 (patch)
tree494f2eae46f922c4798634f58e86aef23baed4ad /pkgs/build-support
parent50a981f2e44dea8dfa84313720b0074afacea392 (diff)
downloadnixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar.gz
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar.bz2
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar.lz
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar.xz
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.tar.zst
nixlib-bb3fc68b300c8d0712238c95c442dd846a362300.zip
antBuild: run default hooks
Fixes https://github.com/NixOS/nixpkgs/issues/10931.
antBuild overrides buildPhase and installPhase without calling default
hooks.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/release/ant-build.nix30
1 files changed, 19 insertions, 11 deletions
diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix
index 06875f6b7654..c77db30a81ce 100644
--- a/pkgs/build-support/release/ant-build.nix
+++ b/pkgs/build-support/release/ant-build.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation (
     postPhases =
       ["generateWrappersPhase" "finalPhase"];
 
-    prePhases = 
+    prePhases =
       ["antSetupPhase"];
 
     antSetupPhase = with stdenv.lib; ''
@@ -41,8 +41,10 @@ stdenv.mkDerivation (
     '';
 
     installPhase = ''
+      runHook preInstall
+
       mkdir -p $out/share/java
-      ${ if jars == [] then '' 
+      ${ if jars == [] then ''
            find . -name "*.jar" | xargs -I{} cp -v {} $out/share/java
          '' else stdenv.lib.concatMapStrings (j: ''
            cp -v ${j} $out/share/java
@@ -53,13 +55,15 @@ stdenv.mkDerivation (
         canonicalizeJar $j
         echo file jar $j >> $out/nix-support/hydra-build-products
       done
+
+      runHook postInstall
     '';
 
-    generateWrappersPhase = 
-      let 
+    generateWrappersPhase =
+      let
         cp = w: "-cp '${lib.optionalString (w ? classPath) w.classPath}${lib.optionalString (w ? mainClass) ":$out/share/java/*"}'";
       in
-      '' 
+      ''
       header "Generating jar wrappers"
     '' + (stdenv.lib.concatMapStrings (w: ''
 
@@ -75,15 +79,19 @@ stdenv.mkDerivation (
       closeNest
     '';
 
-    buildPhase = if antTargets == [] then ''
+    buildPhase = ''
+      runHook preBuild
+    '' + (if antTargets == [] then ''
       header "Building default ant target"
       ant ${antFlags}
       closeNest
     '' else stdenv.lib.concatMapStrings (t: ''
       header "Building '${t}' target"
-      ant ${antFlags} ${t} 
+      ant ${antFlags} ${t}
       closeNest
-    '') antTargets;
+    '') antTargets) + ''
+      runHook postBuild
+    '';
 
     finalPhase =
       ''
@@ -95,11 +103,11 @@ stdenv.mkDerivation (
       '';
   }
 
-  // removeAttrs args ["antProperties" "buildInputs" "pkgs" "jarWrappers"] // 
+  // removeAttrs args ["antProperties" "buildInputs" "pkgs" "jarWrappers"] //
 
   {
     name = name + (if src ? version then "-" + src.version else "");
-  
+
     buildInputs = [ant jre zip unzip] ++ stdenv.lib.optional (args ? buildInputs) args.buildInputs ;
 
     postHook = ''
@@ -109,6 +117,6 @@ stdenv.mkDerivation (
 
       origSrc=$src
       src=$(findTarball $src)
-    ''; 
+    '';
   }
 )