diff options
author | Felix Buehler <account@buehler.rocks> | 2023-03-05 17:42:40 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2023-03-26 18:44:55 +0200 |
commit | 0f57b4bd736cbb3237e2b221d4fcbb742d24b527 (patch) | |
tree | dcbf7acdaaefa644da035404fbd58b2117a2d776 /pkgs/build-support/fetchmavenartifact/default.nix | |
parent | 972b0fa87ffc622a690461a43c1608bef5b776ee (diff) |
fetchMavenArtifact: deprecate phases & use pname+version
Diffstat (limited to 'pkgs/build-support/fetchmavenartifact/default.nix')
-rw-r--r-- | pkgs/build-support/fetchmavenartifact/default.nix | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/pkgs/build-support/fetchmavenartifact/default.nix b/pkgs/build-support/fetchmavenartifact/default.nix index b1d8593e72d48..0f3cd4e64dd61 100644 --- a/pkgs/build-support/fetchmavenartifact/default.nix +++ b/pkgs/build-support/fetchmavenartifact/default.nix @@ -37,13 +37,8 @@ assert (url == "") || (urls == []); assert (repos != []) || (url != "") || (urls != []); let - name_ = - lib.concatStrings [ - (lib.replaceStrings ["."] ["_"] groupId) "_" - (lib.replaceStrings ["."] ["_"] artifactId) "-" - version - ]; - suffix = if isNull classifier then "" else "-${classifier}"; + pname = (lib.replaceStrings [ "." ] [ "_" ] groupId) + "_" + (lib.replaceStrings [ "." ] [ "_" ] artifactId); + suffix = lib.optionalString (classifier != null) "-${classifier}"; filename = "${artifactId}-${version}${suffix}.jar"; mkJarUrl = repoUrl: lib.concatStringsSep "/" [ @@ -59,13 +54,13 @@ let else map mkJarUrl repos; jar = fetchurl ( - builtins.removeAttrs args ["groupId" "artifactId" "version" "classifier" "repos" "url" ] - // { urls = urls_; name = "${name_}.jar"; } + builtins.removeAttrs args [ "groupId" "artifactId" "version" "classifier" "repos" "url" ] + // { urls = urls_; name = "${pname}-${version}.jar"; } ); in stdenv.mkDerivation { - name = name_; - phases = "installPhase fixupPhase"; + inherit pname version; + dontUnpack = true; # By moving the jar to $out/share/java we make it discoverable by java # packages packages that mention this derivation in their buildInputs. installPhase = '' |