diff options
Diffstat (limited to 'pkgs/fetch-ant-deps.nix')
| -rw-r--r-- | pkgs/fetch-ant-deps.nix | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/fetch-ant-deps.nix b/pkgs/fetch-ant-deps.nix new file mode 100644 index 0000000..69e29b4 --- /dev/null +++ b/pkgs/fetch-ant-deps.nix @@ -0,0 +1,68 @@ +{ + lib, + stdenv, + ant, + buildPackages, +}: + +lib.makeOverridable ( + lib.fetchers.withNormalizedHash { } ( + { + pname, + nativeBuildInputs ? [ ], + antJdk ? buildPackages.jdk, + outputHash, + outputHashAlgo, + ... + }@args: + + let + args' = lib.removeAttrs args [ + "pname" + "nativeBuildInputs" + "antJdk" + ]; + in + + stdenv.mkDerivation ( + lib.recursiveUpdate { + pname = pname + "-ant-deps"; + + nativeBuildInputs = [ ant ] ++ nativeBuildInputs; + + buildPhase = '' + runHook preBuild + ant init + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mv bin/libs $out + runHook postInstall + ''; + + fixupPhase = '' + runHook preFixup + + find $out -type f \( \ + -name \*.lastUpdated \ + -o -name resolver-status.properties \ + -o -name _remote.repositories \) \ + -delete + + runHook postFixup + ''; + + dontConfigure = true; + + env = { + JAVA_HOME = toString (antJdk.passthru.home or antJdk); + }; + + inherit outputHash outputHashAlgo; + outputHashMode = "recursive"; + } args' + ) + ) +) |
