tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fetchMavenArtifact: deprecate phases & use pname+version
Felix Buehler
2 years ago
0f57b4bd
972b0fa8
+6
-11
1 changed file
expand all
collapse all
unified
split
pkgs
build-support
fetchmavenartifact
default.nix
+6
-11
pkgs/build-support/fetchmavenartifact/default.nix
···
37
assert (repos != []) || (url != "") || (urls != []);
38
39
let
40
-
name_ =
41
-
lib.concatStrings [
42
-
(lib.replaceStrings ["."] ["_"] groupId) "_"
43
-
(lib.replaceStrings ["."] ["_"] artifactId) "-"
44
-
version
45
-
];
46
-
suffix = if isNull classifier then "" else "-${classifier}";
47
filename = "${artifactId}-${version}${suffix}.jar";
48
mkJarUrl = repoUrl:
49
lib.concatStringsSep "/" [
···
59
else map mkJarUrl repos;
60
jar =
61
fetchurl (
62
-
builtins.removeAttrs args ["groupId" "artifactId" "version" "classifier" "repos" "url" ]
63
-
// { urls = urls_; name = "${name_}.jar"; }
64
);
65
in
66
stdenv.mkDerivation {
67
-
name = name_;
68
-
phases = "installPhase fixupPhase";
69
# By moving the jar to $out/share/java we make it discoverable by java
70
# packages packages that mention this derivation in their buildInputs.
71
installPhase = ''
···
37
assert (repos != []) || (url != "") || (urls != []);
38
39
let
40
+
pname = (lib.replaceStrings [ "." ] [ "_" ] groupId) + "_" + (lib.replaceStrings [ "." ] [ "_" ] artifactId);
41
+
suffix = lib.optionalString (classifier != null) "-${classifier}";
0
0
0
0
0
42
filename = "${artifactId}-${version}${suffix}.jar";
43
mkJarUrl = repoUrl:
44
lib.concatStringsSep "/" [
···
54
else map mkJarUrl repos;
55
jar =
56
fetchurl (
57
+
builtins.removeAttrs args [ "groupId" "artifactId" "version" "classifier" "repos" "url" ]
58
+
// { urls = urls_; name = "${pname}-${version}.jar"; }
59
);
60
in
61
stdenv.mkDerivation {
62
+
inherit pname version;
63
+
dontUnpack = true;
64
# By moving the jar to $out/share/java we make it discoverable by java
65
# packages packages that mention this derivation in their buildInputs.
66
installPhase = ''