There are already two versions in nixpkgs ("fetchMaven" and
"fetchMavenArtifact") which are just wrappers for "fetchurl".


Basicaly "fetchMaven" is merely a function giving argument
"org.scala-lang:scala-compiler:2.11.11" produces a derivation by
downloading two files

  
https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.11/scala-compiler-2.11.11.pom
  
https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.11/scala-compiler-2.11.11.jar

into $out/share/java/.


Besides the obvious hacky ways, how would it be possible to implement
"fetchMaven" in a way that the output path in nixstore depend only on
the argument ?

Only on the string "org.scala-lang:scala-compiler:2.11.11" and not on
curl version or buildScript's evolution (e.g. it could download PGP
signature and validate it)

Then the jar files would be easily discoverable by the external tools
doing the same calculation.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to