[Pkg-clojure-maintainers] A few thoughts on jh_linkjars

Wolodja Wentland 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 [0]

    * Configure leiningen to use this local repository via system level
      profiles in combination with a suitable profile [1] 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. [2]).

      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).

[0] http://wiki.debian.org/Java/MavenRepoHelper
[1] https://github.com/technomancy/leiningen/blob/master/sample.project.clj
[2] https://github.com/technomancy/leiningen/issues/981
-- 
Wolodja <debian at babilen5.org>

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-clojure-maintainers/attachments/20130426/9d654b87/attachment.pgp>


More information about the Pkg-clojure-maintainers mailing list