Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fetchclojar #43930

Closed
wants to merge 1 commit into from
Closed

add fetchclojar #43930

wants to merge 1 commit into from

Conversation

hlolli
Copy link
Member

@hlolli hlolli commented Jul 21, 2018

Motivation for this change

I'm working on a derivation that uses clojure and depends on clojar. I also want to create a tool clj2nix where I take all dependencies of a clojure project, calculate the sha sums and generate fetchclojar calls. Just for any work with clojure on nix, a clojar fetch helper function is needed.

This fetchclojar is based on fetchmaven under java-modules, because clojar is a maven2 repository, and many clojure dependencies use maven central dependencies. So for every depenency it makes sense to attempt both. This is the approach taken in the new dependency resolution tool for clojure called tools.deps https://github.com/clojure/tools.deps.alpha/blob/4f24e4ea6911e9a30a14979386f2b2cc3ad2ecc8/src/main/clojure/clojure/tools/deps/alpha/util/maven.clj#L56-L57

I hope this gets merged and I can continue my work on getting clojure based packages into nixpkgs.

Things done
  • [ x ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • [ x ] NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • [ x ] Fits CONTRIBUTING.md.

@hlolli
Copy link
Member Author

hlolli commented Jul 22, 2018

@volth that's right. fetchMavenArtifact seems to be enough here.
I only noticed:
https://github.com/NixOS/nixpkgs/blob/1f779398c9a4ce43fab0d60141b6ae23892f684e/pkgs/development/java-modules/m2install.nix

But I don't get the logic of putting the maven jars to $out/share/java maybe it's fine. Allow my to test it, and if it's all good. I close the PR.

Thanks for the comment.

@hlolli
Copy link
Member Author

hlolli commented Jul 22, 2018

Ok I can safely close this PR. But would want to add that, fetchMavenArtifact is missing a classifier option.

I hit this example

https://github.com/google/guice/wiki/Guice40

Where I had locally guice-4.0-no_aop.jar but fetchMavenArtifact defaulted to guice-4.0.jar, so the checksums weren't matching. I guess it makes sense to make PR on fetchMavenArtifact for an extra extension parameter?

@hlolli hlolli closed this Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants