fetchMavenArtifact: deprecate phases & use pname+version

+6 -11
+6 -11
pkgs/build-support/fetchmavenartifact/default.nix
··· 37 37 assert (repos != []) || (url != "") || (urls != []); 38 38 39 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}"; 40 + pname = (lib.replaceStrings [ "." ] [ "_" ] groupId) + "_" + (lib.replaceStrings [ "." ] [ "_" ] artifactId); 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 - builtins.removeAttrs args ["groupId" "artifactId" "version" "classifier" "repos" "url" ] 63 - // { urls = urls_; name = "${name_}.jar"; } 57 + builtins.removeAttrs args [ "groupId" "artifactId" "version" "classifier" "repos" "url" ] 58 + // { urls = urls_; name = "${pname}-${version}.jar"; } 64 59 ); 65 60 in 66 61 stdenv.mkDerivation { 67 - name = name_; 68 - phases = "installPhase fixupPhase"; 62 + inherit pname version; 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 = ''