[Pkg-clojure-maintainers] A few thoughts on jh_linkjars
debian at babilen5.org
Fri Apr 26 10:13:37 UTC 2013
On Tue, Apr 23, 2013 at 18:58 +0200, Eugenio Cano-Manuel Mendoza wrote:
> I don't know if this is too much for a helper but would it be feasible to
> create a local maven repository with the libraries found at /usr/share/java so
> that leiningen can fetch from there when doing lein jar/compile? It would be
> like jh_linkjars except that the symlinks are in the ~/.m2 folder since
> leiningen fetches from there. I believe this would be easier to set up in
> leiningen 2 if we modify :mirrors on the project.clj (I asked yesterday on #
> leiningen how to point to local repos and :mirrors seemed to be the answer).
> What are your thoughts about this?
I mentioned this in earlier discussions and within the Clojure community as
well. The main results of these discussions were:
* Use Debian's local maven repository at /usr/share/maven-repo/ and
populate it using maven-repo-helper 
* Configure leiningen to use this local repository via system level
profiles in combination with a suitable profile  during package
builds. We might want to ship a build profile that sets :offline? and
:repositories for example.
A "problem" with the current situation is that the system repository won't
be used as soon as a user defines a user profile (cf. ).
A patch to implement a system profile (as hinted at by Phil) would be
necessary if we always want to activate the repository. We could think
about patching this ourselves if upstream does not want to do that.
Alternatively we could ship a sensible /etc/leiningen and then document
the activation of the repository in README.Debian. I would probably
prefer this approach, but think that it might be underused as nobody
reads documentation. OTOH it gives the user the freedom to customise
this to her own wishes, which is IMHO the most important aspect.
We have to differentiate between leiningen used during package builds and
leiningen used as a user. As hinted at before we /have/ to adapt leiningen to
our situation during package build time (disable downloading of dependencies,
fetch from local repository, ...), but I don't mind it at all if it works just
like the version installed from the shell script when used by our users.
Enabling the local repository should be an /additional/ feature that enables
our users to simply use jars that are already available on the system.
But this discussion leads to another aspect of our packaging endeavour: We
have to make sure that packages that target Clojure and, in particular,
build-dependencies use /usr/share/maven-repo/. I have to confess that I am not
that familiar with maven-repo-helper and Thomas Koch did a lot of work on it
recently (see discussions on the debian-java ML), but we have to use it. (both
in dh_lein2 /and/ other clojure packages).
Wolodja <debian at babilen5.org>
081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Pkg-clojure-maintainers