Add a setup hook that automatically sets up $CLASSPATH

All JARs in $pkg/share/java (for each $pkg in the build inputs) are
added to $CLASSPATH.  Thus, you can say

  buildInputs = [ setJavaClassPath someJavaDependency ];

and the JARs in someJavaDependency will be found automatically by
tools like javac or ant.

Note that the manual used to say that JARs should be installed in
lib/java; this is now share/java, following the Debian policy:

  http://www.debian.org/doc/packaging-manuals/java-policy/x110.html

The directory share/java makes more sense because JARs are
architecture-independent.  (Also, a quick grep shows that we were not
exactly consistent about this in Nixpkgs.)
This commit is contained in:
Eelco Dolstra
2014-01-06 14:36:14 +01:00
parent e36427fd4e
commit 5d6259a973
4 changed files with 22 additions and 11 deletions
+1 -1
View File
@@ -236,7 +236,7 @@ twisted = buildPythonPackage {
<section><title>Java</title>
<para>Java packages should install JAR files in
<filename>$out/lib/java</filename>.</para>
<filename>$out/share/java</filename>.</para>
</section>