diff --git a/doc/language-support.xml b/doc/language-support.xml index cb40be4bf57..69361e3be6c 100644 --- a/doc/language-support.xml +++ b/doc/language-support.xml @@ -112,7 +112,7 @@ file used by Makefile.PL: buildPerlPackage rec { name = "BerkeleyDB-0.36"; - + src = fetchurl { url = "mirror://cpan/authors/id/P/PM/PMQS/${name}.tar.gz"; sha256 = "07xf50riarb60l1h6m2dqmql8q5dij619712fsgw7ach04d8g3z1"; @@ -123,7 +123,7 @@ buildPerlPackage rec { echo "INCLUDE = ${db4}/include" >> config.in ''; } - + @@ -233,10 +233,83 @@ twisted = buildPythonPackage { -
Java +
Java -Java packages should install JAR files in -$out/lib/java. +Ant-based Java packages are typically built from source as follows: + + +stdenv.mkDerivation { + name = "..."; + src = fetchurl { ... }; + + buildInputs = [ jdk ant ]; + + buildPhase = "ant"; +} + + +Note that jdk is an alias for the OpenJDK. + +JAR files that are intended to be used by other packages should +be installed in $out/share/java. The OpenJDK has +a stdenv setup hook that adds any JARs in the +share/java directories of the build inputs to the +CLASSPATH environment variable. For instance, if the +package libfoo installs a JAR named +foo.jar in its share/java +directory, and another package declares the attribute + + +buildInputs = [ jdk libfoo ]; + + +then CLASSPATH will be set to +/nix/store/...-libfoo/share/java/foo.jar. + +Private JARs +should be installed in a location like +$out/share/package-name. + +If your Java package provides a program, you need to generate a +wrapper script to run it using the OpenJRE. You can use +makeWrapper for this: + + +buildInputs = [ makeWrapper ]; + +installPhase = + '' + mkdir -p $out/bin + makeWrapper ${jre}/bin/java $out/bin/foo \ + --add-flags "-cp $out/share/java/foo.jar org.foo.Main" + ''; + + +Note the use of jre, which is the part of the +OpenJDK package that contains the Java Runtime Environment. By using +${jre}/bin/java instead of +${jdk}/bin/java, you prevent your package from +depending on the JDK at runtime. + +It is possible to use a different Java compiler than +javac from the OpenJDK. For instance, to use the +Eclipse Java Compiler: + + +buildInputs = [ jre ant ecj ]; + + +(Note that here you don’t need the full JDK as an input, but just the +JRE.) The ECJ has a stdenv setup hook that sets some environment +variables to cause Ant to use ECJ, but this doesn’t work with all Ant +files. Similarly, you can use the GNU Java Compiler: + + +buildInputs = [ gcj ant ]; + + +Here, Ant will automatically use gij (the GNU Java +Runtime) instead of the OpenJRE.
diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix index 07a76d9ad1f..42fbe841d07 100644 --- a/nixos/modules/config/timezone.nix +++ b/nixos/modules/config/timezone.nix @@ -25,9 +25,11 @@ with pkgs.lib; config = { environment.variables.TZDIR = "/etc/zoneinfo"; - environment.variables.TZ = config.time.timeZone; - environment.etc.localtime.source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}"; + environment.etc.localtime = + { source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}"; + mode = "direct-symlink"; + }; environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo"; diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl index 7cb6d2a6a45..4b79dbaab89 100644 --- a/nixos/modules/system/etc/setup-etc.pl +++ b/nixos/modules/system/etc/setup-etc.pl @@ -57,9 +57,13 @@ sub link { open MODE, "<$_.mode"; my $mode = ; chomp $mode; close MODE; - copy "$static/$fn", "$target.tmp" or warn; - chmod oct($mode), "$target.tmp" or warn; - rename "$target.tmp", $target or warn; + if ($mode eq "direct-symlink") { + atomicSymlink readlink("$static/$fn"), $target or warn; + } else { + copy "$static/$fn", "$target.tmp" or warn; + chmod oct($mode), "$target.tmp" or warn; + rename "$target.tmp", $target or warn; + } } elsif (-l "$_") { atomicSymlink "$static/$fn", $target or warn; } diff --git a/pkgs/applications/editors/emacs-modes/jdee/default.nix b/pkgs/applications/editors/emacs-modes/jdee/default.nix index b25d178d164..89d908826b1 100644 --- a/pkgs/applications/editors/emacs-modes/jdee/default.nix +++ b/pkgs/applications/editors/emacs-modes/jdee/default.nix @@ -26,8 +26,8 @@ in mkdir -p "dist" cat > build.properties < # specify the correct JAVA_HOME - > JAVA_HOME=${jre} + > JAVA_HOME=${jdk.jre}/lib/openjdk/jre > EOF sed -i "s|/usr/share/jEdit/@jar.filename@|$out/share/jEdit/jedit.jar|g" package-files/linux/jedit @@ -44,9 +44,7 @@ stdenv.mkDerivation { chmod +x $out/bin/jedit ''; - buildInputs = [ ant ]; - - meta = { + meta = { description = "Mature programmer's text editor (Java based)"; homepage = http://www.jedit.org; license = "GPL"; diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix index 93d1b28854a..4eefd5749b6 100644 --- a/pkgs/applications/graphics/zgrviewer/default.nix +++ b/pkgs/applications/graphics/zgrviewer/default.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { buildInputs = [jre unzip]; buildPhase = ""; installPhase = '' - mkdir -p "$out"/{bin,lib/java/zvtm/plugins,share/doc/zvtm} + mkdir -p "$out"/{bin,share/java/zvtm/plugins,share/doc/zvtm} cp overview.html *.license.* "$out/share/doc/zvtm" - cp -r target/* "$out/lib/java/zvtm/" + cp -r target/* "$out/share/java/zvtm/" echo '#!/bin/sh' > "$out/bin/zgrviewer" - echo "java -jar '$out/lib/java/zvtm/zgrviewer-${version}.jar'" >> "$out/bin/zgrviewer" + echo "java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar'" >> "$out/bin/zgrviewer" chmod a+x "$out/bin/zgrviewer" ''; meta = { diff --git a/pkgs/applications/networking/p2p/freenet/default.nix b/pkgs/applications/networking/p2p/freenet/default.nix index 67037a07132..4c74c2c32de 100644 --- a/pkgs/applications/networking/p2p/freenet/default.nix +++ b/pkgs/applications/networking/p2p/freenet/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, apacheAntOpenJDK, jre }: +{ stdenv, fetchurl, ant, jdk }: let # The .gitmodules in freenet-official-20130413-eccc9b3198 @@ -14,7 +14,7 @@ let }; in stdenv.mkDerivation { - name = "freenet-official-20130413-eccc9b3198"; + name = "freenet-20130413-eccc9b3198"; src = fetchurl { url = https://github.com/freenet/fred-official/tarball/eccc9b3198; @@ -29,7 +29,7 @@ stdenv.mkDerivation { sed '/antcall.*-ext/d' -i build.xml ''; - buildInputs = [ apacheAntOpenJDK jre ]; + buildInputs = [ ant jdk ]; buildPhase = "ant package-only"; @@ -41,13 +41,13 @@ stdenv.mkDerivation { cat < $out/bin/freenet #!${stdenv.shell} - ${jre}/bin/java -cp $out/share/freenet/bcprov.jar:$out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\ + ${jdk.jre}/bin/java -cp $out/share/freenet/bcprov.jar:$out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\ -Xmx1024M freenet.node.NodeStarter EOF chmod +x $out/bin/freenet ''; - meta = { + meta = { description = "Decentralised and censorship-resistant network"; homepage = https://freenetproject.org/; license = "GPLv2+"; diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix index 0cabdf2f7e7..1ca3c65d3f2 100644 --- a/pkgs/build-support/release/ant-build.nix +++ b/pkgs/build-support/release/ant-build.nix @@ -8,7 +8,7 @@ , antProperties ? [] , antBuildInputs ? [] , buildfile ? "build.xml" -, ant ? pkgs.apacheAntOpenJDK +, ant ? pkgs.ant , jre ? pkgs.openjdk , hydraAntLogger ? pkgs.hydraAntLogger , ... } @ args: @@ -31,7 +31,7 @@ stdenv.mkDerivation ( antSetupPhase = with stdenv.lib; '' if test "$hydraAntLogger" != "" ; then - export ANT_ARGS="-logger org.hydra.ant.HydraLogger -lib `ls $hydraAntLogger/lib/java/*.jar | head -1`" + export ANT_ARGS="-logger org.hydra.ant.HydraLogger -lib `ls $hydraAntLogger/share/java/*.jar | head -1`" fi for abi in ${concatStringsSep " " (map (f: "`find ${f} -name '*.jar'`") antBuildInputs)}; do export ANT_ARGS="$ANT_ARGS -lib $abi" @@ -39,20 +39,20 @@ stdenv.mkDerivation ( ''; installPhase = '' - mkdir -p $out/lib/java + mkdir -p $out/share/java ${ if jars == [] then '' - find . -name "*.jar" | xargs -I{} cp -v {} $out/lib/java + find . -name "*.jar" | xargs -I{} cp -v {} $out/share/java '' else stdenv.lib.concatMapStrings (j: '' - cp -v ${j} $out/lib/java + cp -v ${j} $out/share/java '') jars } - for j in $out/lib/java/*.jar ; do + for j in $out/share/java/*.jar ; do echo file jar $j >> $out/nix-support/hydra-build-products done ''; generateWrappersPhase = let - cp = w: "-cp '${lib.optionalString (w ? classPath) w.classPath}${lib.optionalString (w ? mainClass) ":$out/lib/java/*"}'"; + cp = w: "-cp '${lib.optionalString (w ? classPath) w.classPath}${lib.optionalString (w ? mainClass) ":$out/share/java/*"}'"; in '' header "Generating jar wrappers" diff --git a/pkgs/build-support/setup-hooks/set-java-classpath.sh b/pkgs/build-support/setup-hooks/set-java-classpath.sh new file mode 100644 index 00000000000..76e8e42ca26 --- /dev/null +++ b/pkgs/build-support/setup-hooks/set-java-classpath.sh @@ -0,0 +1,13 @@ +# This setup hook adds every JAR in the share/java subdirectories of +# the build inputs to $CLASSPATH. + +export CLASSPATH + +addPkgToClassPath () { + local jar + for jar in $1/share/java/*.jar; do + export CLASSPATH=''${CLASSPATH}''${CLASSPATH:+:}''${jar} + done +} + +envHooks=(''${envHooks[@]} addPkgToClassPath) diff --git a/pkgs/development/compilers/closure/default.nix b/pkgs/development/compilers/closure/default.nix index 13c9f1c0350..428346b78b6 100644 --- a/pkgs/development/compilers/closure/default.nix +++ b/pkgs/development/compilers/closure/default.nix @@ -14,11 +14,11 @@ stdenv.mkDerivation rec { buildInputs = [ gnutar ]; installPhase = '' - mkdir -p $out/lib/java $out/bin + mkdir -p $out/share/java $out/bin tar -xzf $src - cp -r compiler.jar $out/lib/java/ + cp -r compiler.jar $out/share/java/ echo "#!${bash}/bin/bash" > $out/bin/closure-compiler - echo "${jre}/bin/java -jar $out/lib/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler + echo "${jre}/bin/java -jar $out/share/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler chmod +x $out/bin/closure-compiler ''; diff --git a/pkgs/development/compilers/openjdk/default.nix b/pkgs/development/compilers/openjdk/default.nix index fd229cf5b13..b99139c0e3f 100644 --- a/pkgs/development/compilers/openjdk/default.nix +++ b/pkgs/development/compilers/openjdk/default.nix @@ -1,30 +1,6 @@ -{ stdenv -, fetchurl -, unzip -, zip -, procps -, coreutils -, alsaLib -, ant -, freetype -, cups -, which -, jdk -, nettools -, libX11 -, libXt -, libXext -, libXrender -, libXtst -, libXi -, libXinerama -, libXcursor -, fontconfig -, cpio -, cacert -, jreOnly ? false -, perl -}: +{ stdenv, fetchurl, unzip, zip, procps, coreutils, alsaLib, ant, freetype, cups +, which, jdk, nettools, libX11, libXt, libXext, libXrender, libXtst, libXi, libXinerama +, libXcursor, fontconfig, cpio, cacert, perl, setJavaClassPath }: let @@ -46,35 +22,20 @@ let in stdenv.mkDerivation rec { - name = "openj${if jreOnly then "re" else "dk"}-7u${update}b${build}"; + name = "openjdk-7u${update}b${build}"; src = fetchurl { url = http://www.java.net/download/openjdk/jdk7u40/promoted/b43/openjdk-7u40-fcs-src-b43-26_aug_2013.zip; sha256 = "15h5nmbw6yn5596ccakqdbs0vd8hmslsfg5sfk8wmjvn31bfmy00"; }; - # outputs = [ "out" ] ++ stdenv.lib.optionals (! jreOnly) [ "jre" ]; + outputs = [ "out" "jre" ]; - buildInputs = [ - unzip - procps - ant - which - zip - cpio - nettools - alsaLib - libX11 - libXt - libXext - libXrender - libXtst - libXi - libXinerama - libXcursor - fontconfig - perl - ]; + buildInputs = + [ unzip procps ant which zip cpio nettools alsaLib + libX11 libXt libXext libXrender libXtst libXi libXinerama libXcursor + fontconfig perl + ]; NIX_LDFLAGS = "-lfontconfig -lXcursor -lXinerama"; @@ -85,13 +46,12 @@ stdenv.mkDerivation rec { sed -i "s@/bin/echo -e@${coreutils}/bin/echo -e@" \ openjdk/{jdk,corba}/make/common/shared/Defs-utils.gmk - - sed -i "s@@@" \ - openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c ''; patches = [ ./cppflags-include-fix.patch ]; + NIX_NO_SELF_RPATH = true; + makeFlags = [ "SORT=${coreutils}/bin/sort" "ALSA_INCLUDE=${alsaLib}/include/alsa/version.h" @@ -108,43 +68,68 @@ stdenv.mkDerivation rec { "UNLIMITED_CRYPTO=1" ]; - configurePhase = '' - make $makeFlags sanity - ''; + configurePhase = "true"; installPhase = '' - mkdir -p $out - cp -av build/*/j2${if jreOnly then "re" else "sdk"}-image/* $out + mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk + + cp -av build/*/j2sdk-image/* $out/lib/openjdk + + # Move some stuff to top-level. + mv $out/lib/openjdk/include $out/include + mv $out/lib/openjdk/man $out/share/man # Remove some broken manpages. rm -rf $out/share/man/ja* # Remove crap from the installation. - rm -rf $out/demo $out/sample + rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample + + # Move the JRE to a separate output. + mv $out/lib/openjdk/jre $jre/lib/openjdk/ + ln -s $jre/lib/openjdk/jre $out/lib/openjdk/jre + + # Remove duplicate binaries. + for i in $(cd $out/lib/openjdk/bin && echo *); do + if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then + ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i + fi + done # Generate certificates. - pushd $out/${if ! jreOnly then "jre/" else ""}lib/security + pushd $jre/lib/openjdk/jre/lib/security rm cacerts - perl ${./generate-cacerts.pl} $out/bin/keytool ${cacert}/etc/ca-bundle.crt + perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ca-bundle.crt popd + + ln -s $out/lib/openjdk/bin $out/bin + ln -s $jre/lib/openjdk/jre/bin $jre/bin + ''; # */ + + # FIXME: this is unnecessary once the multiple-outputs branch is merged. + preFixup = '' + prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}" + patchELF $jre + propagatedNativeBuildInputs+=" $jre" + + # Propagate the setJavaClassPath setup hook from the JRE so that + # any package that depends on the JRE has $CLASSPATH set up + # properly. + mkdir -p $jre/nix-support + echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs + + # Set JAVA_HOME automatically. + mkdir -p $out/nix-support + cat < $out/nix-support/setup-hook + if [ -n "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi + EOF ''; -# '' + (if jreOnly then "" else '' -# if [ -z $jre ]; then -# exit 0 -# fi -# mkdir -p $jre -# cp -av build/*/j2re-image/* $jre -# ''); meta = { homepage = http://openjdk.java.net/; - license = "GPLv2"; - description = "The open-source Java Development Kit"; - maintainers = [ stdenv.lib.maintainers.shlevy ]; - platforms = stdenv.lib.platforms.linux; }; diff --git a/pkgs/development/eclipse/ecj/default.nix b/pkgs/development/eclipse/ecj/default.nix index ba3e643a4fe..786fcdba18a 100644 --- a/pkgs/development/eclipse/ecj/default.nix +++ b/pkgs/development/eclipse/ecj/default.nix @@ -1,59 +1,59 @@ -{ stdenv, fetchurl, unzip, ant, gcj }: +{ stdenv, fetchurl, unzip, ant, jdk, makeWrapper }: let version = "3.7.2"; date = "201202080800"; - isGCJ = stdenv.lib.strings.substring 0 3 gcj.name == "gcj"; - javaExec = if isGCJ then "gij" else "java"; - javaFlags = if isGCJ then "--cp" else "-cp"; in - stdenv.mkDerivation rec { - name = "ecj-${version}"; - src = fetchurl { - url = "http://eclipse.ialto.org/eclipse/downloads/drops/R-${version}-${date}/ecjsrc-${version}.jar"; - sha256 = "0swyysbyfmv068x8q1c5jqpwk5zb4xahg17aypx5rwb660f8fpbm"; - }; +stdenv.mkDerivation rec { + name = "ecj-${version}"; - buildInputs = [ unzip ant gcj ]; + src = fetchurl { + url = "http://eclipse.ialto.org/eclipse/downloads/drops/R-${version}-${date}/ecjsrc-${version}.jar"; + sha256 = "0swyysbyfmv068x8q1c5jqpwk5zb4xahg17aypx5rwb660f8fpbm"; + }; - unpackPhase = '' - mkdir "${name}" - cd "${name}" - unzip "$src" + buildInputs = [ unzip ant jdk makeWrapper ]; + + unpackPhase = '' + mkdir "${name}" + cd "${name}" + unzip "$src" + ''; + + # Use whatever compiler Ant knows. + buildPhase = "ant build"; + + installPhase = '' + mkdir -pv $out/share/java + cp -v *.jar $out/share/java + + mkdir -pv $out/bin + makeWrapper ${jdk.jre}/bin/java $out/bin/ecj \ + --add-flags "-cp $out/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main" + + # Add a setup hook that causes Ant to use the ECJ. + mkdir -p $out/nix-support + cat < $out/nix-support/setup-hook + export NIX_ANT_ARGS="-Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter \$NIX_ANT_ARGS" + EOF + ''; + + meta = { + description = "The Eclipse Compiler for Java (ECJ)"; + + longDescription = '' + ECJ is an incremental Java compiler. Implemented as an Eclipse + builder, it is based on technology evolved from VisualAge for Java + compiler. In particular, it allows users to run and debug code which + still contains unresolved errors. ''; - # Use whatever compiler Ant knows. - buildPhase = "ant build"; + homepage = http://www.eclipse.org/jdt/core/index.php; - installPhase = '' - mkdir -pv "$out/lib/java" - cp -v *.jar "$out/lib/java" + # http://www.eclipse.org/legal/epl-v10.html (free software, copyleft) + license = "EPLv1.0"; - mkdir -pv "$out/bin" - cat > "$out/bin/ecj" <> $out/bin/ant <> $out/bin/ant <&2 + exit 1 + fi + fi + + if [ -z \$NIX_JVM ]; then + if [ -e \$JAVA_HOME/bin/java ]; then + NIX_JVM=\$JAVA_HOME/bin/java + elif [ -e \$JAVA_HOME/bin/gij ]; then + NIX_JVM=\$JAVA_HOME/bin/gij + else + NIX_JVM=java + fi + fi + + LOCALCLASSPATH="\$ANT_HOME/lib/ant-launcher.jar\''${LOCALCLASSPATH:+:}\$LOCALCLASSPATH" + + if [ -e \$JAVA_HOME/lib/tools.jar ]; then + LOCALCLASSPATH="\$JAVA_HOME/lib/tools.jar\''${LOCALCLASSPATH:+:}\$LOCALCLASSPATH" + fi + + exec \$NIX_JVM \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" \ + -Dant.home=\$ANT_HOME -Dant.library.dir="\$ANT_LIB" \ + org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS \ + -cp "\$CLASSPATH" "\$@" + EOF + + chmod +x $out/bin/ant + ''; # */ + meta = { - description = "Java-based build tool"; + homepage = http://ant.apache.org/; + description = "A Java-based build tool"; + + longDescription = '' + Apache Ant is a Java-based build tool. In theory, it is kind of like + Make, but without Make's wrinkles. + + Why another build tool when there is already make, gnumake, nmake, jam, + and others? Because all those tools have limitations that Ant's + original author couldn't live with when developing software across + multiple platforms. Make-like tools are inherently shell-based -- they + evaluate a set of dependencies, then execute commands not unlike what + you would issue in a shell. This means that you can easily extend + these tools by using or writing any program for the OS that you are + working on. However, this also means that you limit yourself to the + OS, or at least the OS type such as Unix, that you are working on. + + Ant is different. Instead of a model where it is extended with + shell-based commands, Ant is extended using Java classes. Instead of + writing shell commands, the configuration files are XML-based, calling + out a target tree where various tasks get executed. Each task is run + by an object that implements a particular Task interface. + ''; + + license = stdenv.lib.licenses.asl20; + maintainers = [ stdenv.lib.maintainers.eelco ]; + platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/tools/build-managers/apache-ant/from-source.nix b/pkgs/development/tools/build-managers/apache-ant/from-source.nix deleted file mode 100644 index 14213415ff8..00000000000 --- a/pkgs/development/tools/build-managers/apache-ant/from-source.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ stdenv, fetchurl, gcj, junit }: - -let version = "1.7.1"; in - -/* TODO: Once we have Icedtea, use this Nix expression to build Ant with - Sun's javac. */ - -stdenv.mkDerivation { - name = "ant-gcj-${version}"; - - src = fetchurl { - url = "mirror://apache/ant/source/apache-ant-${version}-src.tar.bz2"; - sha256 = "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"; - }; - - patches = [ ./use-gcj.patch ]; - - buildInputs = [ gcj junit ]; - - configurePhase = '' - mkdir -p "tool-aliases/bin" - cd "tool-aliases/bin" - cat > javac < - -- -- -- -- -- -- -+ - - - diff --git a/pkgs/development/tools/build-managers/leiningen/builder.sh b/pkgs/development/tools/build-managers/leiningen/builder.sh index 8d0924028cc..6a66466506c 100644 --- a/pkgs/development/tools/build-managers/leiningen/builder.sh +++ b/pkgs/development/tools/build-managers/leiningen/builder.sh @@ -1,16 +1,14 @@ #!/bin/bash -set -e - source $stdenv/setup -mkdir -pv $out/bin $out/lib +mkdir -pv $out/bin $out/share/java out_bin=$out/bin/lein cp -v $src $out_bin -cp -v $jarsrc $out/lib -cp -v $clojure/lib/java/* $out/lib +cp -v $jarsrc $out/share/java +cp -v $clojure/share/java/* $out/share/java/ for p in $patches; do diff --git a/pkgs/development/tools/build-managers/leiningen/lein_2.3.0.patch b/pkgs/development/tools/build-managers/leiningen/lein_2.3.0.patch index 23f6b624776..f7d5bc4d9a7 100644 --- a/pkgs/development/tools/build-managers/leiningen/lein_2.3.0.patch +++ b/pkgs/development/tools/build-managers/leiningen/lein_2.3.0.patch @@ -1,4 +1,4 @@ 46c47 < LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar --- -> LEIN_JAR=$(find $(dirname $0)/../lib -name *-standalone.jar | head -n 1) +> LEIN_JAR=$(find $(dirname $0)/../share/java -name *-standalone.jar | head -n 1) diff --git a/pkgs/development/tools/parsing/jikespg/builder.sh b/pkgs/development/tools/parsing/jikespg/builder.sh deleted file mode 100644 index e63ec9808f2..00000000000 --- a/pkgs/development/tools/parsing/jikespg/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup - -set -e - -configurePhase() { - tar zxvf $src - cd jikespg/src -} - -installPhase() { - mkdir -p $out/bin - cp jikespg $out/bin -} - -genericBuild diff --git a/pkgs/development/tools/parsing/jikespg/default.nix b/pkgs/development/tools/parsing/jikespg/default.nix index 290e9a3a003..ea66204d9cd 100644 --- a/pkgs/development/tools/parsing/jikespg/default.nix +++ b/pkgs/development/tools/parsing/jikespg/default.nix @@ -2,9 +2,22 @@ stdenv.mkDerivation { name = "jikespg-1.3"; - builder = ./builder.sh; + src = fetchurl { url = mirror://sourceforge/jikes/jikespg-1.3.tar.gz; md5 = "eba183713d9ae61a887211be80eeb21f"; }; + + sourceRoot = "jikespg/src"; + + installPhase = + '' + mkdir -p $out/bin + cp jikespg $out/bin + ''; + + meta = { + homepage = http://jikes.sourceforge.net/; + description = "The Jikes Parser Generator"; + }; } diff --git a/pkgs/servers/sql/postgresql/jdbc/builder.sh b/pkgs/servers/sql/postgresql/jdbc/builder.sh deleted file mode 100755 index 2fccb686629..00000000000 --- a/pkgs/servers/sql/postgresql/jdbc/builder.sh +++ /dev/null @@ -1,10 +0,0 @@ -source $stdenv/setup - -set -e - -tar zxvf $src -cd postgresql-jdbc-* -ant - -mkdir -p $out/share/java -cp jars/*.jar $out/share/java diff --git a/pkgs/servers/sql/postgresql/jdbc/default.nix b/pkgs/servers/sql/postgresql/jdbc/default.nix index e490a14bea6..61b12164f24 100644 --- a/pkgs/servers/sql/postgresql/jdbc/default.nix +++ b/pkgs/servers/sql/postgresql/jdbc/default.nix @@ -1,15 +1,24 @@ -{ stdenv, fetchurl, ant }: +{ stdenv, fetchurl, ant, jdk }: + +let version = "9.3-1100"; in stdenv.mkDerivation rec { - name = "postgresql-jdbc-9.1-902"; - builder = ./builder.sh; + name = "postgresql-jdbc-${version}"; src = fetchurl { - url = "http://jdbc.postgresql.org/download/${name}.src.tar.gz"; - sha256 = "0sgwbiw5vfxcl0g1yzsndgxdha74cr8ag6y65i0jhgg5g8qc56bz"; + url = "http://jdbc.postgresql.org/download/postgresql-jdbc-${version}.src.tar.gz"; + sha256 = "0mbdzhzg4ws0i7ps98rg0q5n68lsrdm2klj7y7skaix0rpa57gp6"; }; - buildInputs = [ant]; + buildInputs = [ ant jdk ]; + + buildPhase = "ant"; + + installPhase = + '' + mkdir -p $out/share/java + cp jars/*.jar $out/share/java + ''; meta = { homepage = http://jdbc.postgresql.org/; diff --git a/pkgs/tools/misc/jdiskreport/builder.sh b/pkgs/tools/misc/jdiskreport/builder.sh index cdc5f94bde0..f95dafedd32 100644 --- a/pkgs/tools/misc/jdiskreport/builder.sh +++ b/pkgs/tools/misc/jdiskreport/builder.sh @@ -4,12 +4,12 @@ unzip $src jar=$(ls */*.jar) -mkdir -p $out/lib/java -mv $jar $out/lib/java +mkdir -p $out/share/java +mv $jar $out/share/java mkdir -p $out/bin cat > $out/bin/jdiskreport < "$out/bin/smc" << EOF #!${stdenv.shell} - ${jre}/bin/java -jar "$out/lib/java/Smc.jar" "\$@" + ${jre}/bin/java -jar "$out/share/java/Smc.jar" "\$@" EOF chmod a+x "$out/bin/smc" ''; diff --git a/pkgs/tools/typesetting/fop/default.nix b/pkgs/tools/typesetting/fop/default.nix index bc4486ed49c..473b23fe262 100644 --- a/pkgs/tools/typesetting/fop/default.nix +++ b/pkgs/tools/typesetting/fop/default.nix @@ -4,34 +4,28 @@ stdenv.mkDerivation rec { name = "fop-1.1"; src = fetchurl { - url = "http://apache.uib.no/xmlgraphics/fop/source/${name}-src.tar.gz"; + url = "mirror://apache/xmlgraphics/fop/source/${name}-src.tar.gz"; sha256 = "08i56d57w5dl5bqchr34x9165hvi5h4bhiflxhi0a4wd56rlq5jq"; }; buildInputs = [ ant jdk ]; - buildPhase = '' - ant - ''; + buildPhase = "ant"; installPhase = '' - mkdir -p "$out/bin" - mkdir -p "$out/lib" - mkdir -p "$out/share/doc/fop" + mkdir -p $out/bin $out/lib $out/share/doc/fop - cp build/*.jar lib/*.jar "$out/lib/" - cp -r README examples/ "$out/share/doc/fop/" + cp build/*.jar lib/*.jar $out/lib/ + cp -r README examples/ $out/share/doc/fop/ # There is a fop script in the source archive, but it has many impurities. # Instead of patching out 90 % of the script, we write our own. cat > "$out/bin/fop" <