mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
fetchMavenArtifact: deprecate phases & use pname+version
This commit is contained in:
parent
972b0fa87f
commit
0f57b4bd73
@ -37,13 +37,8 @@ assert (url == "") || (urls == []);
|
|||||||
assert (repos != []) || (url != "") || (urls != []);
|
assert (repos != []) || (url != "") || (urls != []);
|
||||||
|
|
||||||
let
|
let
|
||||||
name_ =
|
pname = (lib.replaceStrings [ "." ] [ "_" ] groupId) + "_" + (lib.replaceStrings [ "." ] [ "_" ] artifactId);
|
||||||
lib.concatStrings [
|
suffix = lib.optionalString (classifier != null) "-${classifier}";
|
||||||
(lib.replaceStrings ["."] ["_"] groupId) "_"
|
|
||||||
(lib.replaceStrings ["."] ["_"] artifactId) "-"
|
|
||||||
version
|
|
||||||
];
|
|
||||||
suffix = if isNull classifier then "" else "-${classifier}";
|
|
||||||
filename = "${artifactId}-${version}${suffix}.jar";
|
filename = "${artifactId}-${version}${suffix}.jar";
|
||||||
mkJarUrl = repoUrl:
|
mkJarUrl = repoUrl:
|
||||||
lib.concatStringsSep "/" [
|
lib.concatStringsSep "/" [
|
||||||
@ -59,13 +54,13 @@ let
|
|||||||
else map mkJarUrl repos;
|
else map mkJarUrl repos;
|
||||||
jar =
|
jar =
|
||||||
fetchurl (
|
fetchurl (
|
||||||
builtins.removeAttrs args ["groupId" "artifactId" "version" "classifier" "repos" "url" ]
|
builtins.removeAttrs args [ "groupId" "artifactId" "version" "classifier" "repos" "url" ]
|
||||||
// { urls = urls_; name = "${name_}.jar"; }
|
// { urls = urls_; name = "${pname}-${version}.jar"; }
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = name_;
|
inherit pname version;
|
||||||
phases = "installPhase fixupPhase";
|
dontUnpack = true;
|
||||||
# By moving the jar to $out/share/java we make it discoverable by java
|
# By moving the jar to $out/share/java we make it discoverable by java
|
||||||
# packages packages that mention this derivation in their buildInputs.
|
# packages packages that mention this derivation in their buildInputs.
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user