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
37
assert (repos != []) || (url != "") || (urls != []);
38
38
39
39
let
40
40
-
name_ =
41
41
-
lib.concatStrings [
42
42
-
(lib.replaceStrings ["."] ["_"] groupId) "_"
43
43
-
(lib.replaceStrings ["."] ["_"] artifactId) "-"
44
44
-
version
45
45
-
];
46
46
-
suffix = if isNull classifier then "" else "-${classifier}";
40
40
+
pname = (lib.replaceStrings [ "." ] [ "_" ] groupId) + "_" + (lib.replaceStrings [ "." ] [ "_" ] artifactId);
41
41
+
suffix = lib.optionalString (classifier != null) "-${classifier}";
47
42
filename = "${artifactId}-${version}${suffix}.jar";
48
43
mkJarUrl = repoUrl:
49
44
lib.concatStringsSep "/" [
···
59
54
else map mkJarUrl repos;
60
55
jar =
61
56
fetchurl (
62
62
-
builtins.removeAttrs args ["groupId" "artifactId" "version" "classifier" "repos" "url" ]
63
63
-
// { urls = urls_; name = "${name_}.jar"; }
57
57
+
builtins.removeAttrs args [ "groupId" "artifactId" "version" "classifier" "repos" "url" ]
58
58
+
// { urls = urls_; name = "${pname}-${version}.jar"; }
64
59
);
65
60
in
66
61
stdenv.mkDerivation {
67
67
-
name = name_;
68
68
-
phases = "installPhase fixupPhase";
62
62
+
inherit pname version;
63
63
+
dontUnpack = true;
69
64
# By moving the jar to $out/share/java we make it discoverable by java
70
65
# packages packages that mention this derivation in their buildInputs.
71
66
installPhase = ''