diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-01-13 13:16:17 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-01-13 13:16:17 +0100 |
commit | 6fb27abf3330139b7f5a868ae988fcf04284a1ca (patch) | |
tree | 4e5772e2bf7b785413ea69d15deb38e53925cf6e /pkgs/development/tools | |
parent | 78d3180dbe8896500a35a848675462aeafe6f1b9 (diff) | |
parent | cf4acab5670e9c04cbd924ad0835ba5a5219b296 (diff) | |
download | nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar.gz nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar.bz2 nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar.lz nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar.xz nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.tar.zst nixlib-6fb27abf3330139b7f5a868ae988fcf04284a1ca.zip |
Merge branch 'java'
Diffstat (limited to 'pkgs/development/tools')
9 files changed, 115 insertions, 217 deletions
diff --git a/pkgs/development/tools/build-managers/apache-ant/ant-contrib.nix b/pkgs/development/tools/build-managers/apache-ant/ant-contrib.nix deleted file mode 100644 index ca61f43c7385..000000000000 --- a/pkgs/development/tools/build-managers/apache-ant/ant-contrib.nix +++ /dev/null @@ -1,17 +0,0 @@ -args: with args; - -stdenv.mkDerivation { - name = "ant-contrib-1.0b3"; - - installPhase = '' - mkdir -p $out - mv ant-contrib*.jar $out/ - ''; - - phases = "unpackPhase installPhase"; - - src = fetchurl { - url = mirror://sourceforge/ant-contrib/ant-contrib-1.0b3-bin.tar.bz2; - sha256 = "96effcca2581c1ab42a4828c770b48d54852edf9e71cefc9ed2ffd6590571ad1"; - }; -} diff --git a/pkgs/development/tools/build-managers/apache-ant/builder.sh b/pkgs/development/tools/build-managers/apache-ant/builder.sh deleted file mode 100644 index 68aa89d475e8..000000000000 --- a/pkgs/development/tools/build-managers/apache-ant/builder.sh +++ /dev/null @@ -1,53 +0,0 @@ -source $stdenv/setup - -tar jxf $src || exit 1 -mkdir -p $out - -mv apache-ant-*/* $out || exit 1 - -# add ant-contrib -cp $antContrib/*.jar $out/lib - -# remove crap in the root directory - -for file in $out/* -do - if test -f $file ; then - rm $file - fi -done -rm -rf $out/docs - -# prevent the use of hacky scripts. This will be handled in Nix. -rm $out/bin/* || exit 1 - -# add ant script. This script is to be invoked with all -# appropiate variables and will try to be clever or user-friendly. - -cat >> $out/bin/ant <<EOF -#! /bin/sh - -export JAVA_HOME=$jdk -export JAVACMD=$jdk/bin/java -export LANG="en_US" - -export ANT_HOME=$out - -if [ -z "\$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar -else - LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar:\$LOCALCLASSPATH -fi - -if [ -n "\$JIKESPATH" ]; then - exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" -Djikes.class.path="\$JIKESPATH" org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS -lib "$CLASSPATH" "\$@" -else - exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" org.apache.tools.ant.launch.Launcher \$NIX_ANT_ARGS \$ANT_ARGS -lib "$CLASSPATH" "\$@" - fi -fi -EOF - -chmod a+x $out/bin/ant - -ln -s $out/bin/ant $out/bin/antRun - diff --git a/pkgs/development/tools/build-managers/apache-ant/default.nix b/pkgs/development/tools/build-managers/apache-ant/default.nix index c14e09e25b7f..19c664c2ea7e 100644 --- a/pkgs/development/tools/build-managers/apache-ant/default.nix +++ b/pkgs/development/tools/build-managers/apache-ant/default.nix @@ -1,30 +1,110 @@ -{ fetchurl, stdenv, jdk }: +{ fetchurl, stdenv, makeWrapper }: -let +let version = "1.9.3"; in - antContrib = import ./ant-contrib.nix { - inherit fetchurl stdenv; +stdenv.mkDerivation { + name = "ant-${version}"; + + buildInputs = [ makeWrapper ]; + + src = fetchurl { + url = "mirror://apache/ant/binaries/apache-ant-${version}-bin.tar.bz2"; + sha1 = "efcf206e24b0dd1583c501182ad163af277951a4"; }; - version = "1.8.4"; + contrib = fetchurl { + url = mirror://sourceforge/ant-contrib/ant-contrib-1.0b3-bin.tar.bz2; + sha256 = "96effcca2581c1ab42a4828c770b48d54852edf9e71cefc9ed2ffd6590571ad1"; + }; -in + installPhase = + '' + mkdir -p $out/bin $out/lib/ant + mv * $out/lib/ant/ -stdenv.mkDerivation { - name = "ant-${(builtins.parseDrvName jdk.name).name}-${version}"; + # Get rid of the manual (35 MiB). Maybe we should put this in a + # separate output. Also get rid of the Ant scripts since we + # provide our own. + rm -rf $out/lib/ant/{manual,bin,WHATSNEW} - builder = ./builder.sh; - - buildInputs = [ antContrib jdk ]; + # Install ant-contrib. + unpackFile $contrib + cp -p ant-contrib/ant-contrib-*.jar $out/lib/ant/lib/ - inherit antContrib jdk; + cat >> $out/bin/ant <<EOF + #! ${stdenv.shell} -e - src = fetchurl { - url = "mirror://apache/ant/binaries/apache-ant-${version}-bin.tar.bz2"; - sha1 = "d9e3e83dd9664cfe1dcd4841c082db3f559af922"; - }; + ANT_HOME=$out/lib/ant + + # Find the JDK by looking for javac. As a fall-back, find the + # JRE by looking for java. The latter allows just the JRE to be + # used with (say) ECJ as the compiler. Finally, allow the GNU + # JVM. + if [ -z "\$JAVA_HOME" ]; then + for i in javac java gij; do + if p="\$(type -p \$i)"; then + export JAVA_HOME="\$(dirname \$(dirname \$(readlink -f \$p)))" + break + fi + done + if [ -z "\$JAVA_HOME" ]; then + echo "\$0: cannot find the JDK or JRE" >&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 14213415ff84..000000000000 --- 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 <<EOF -#!/bin/sh -opts="-C" -echo 'running \`gcj '"\$opts \$@'..." -exec "$(type -P gcj)" \$opts \$@ -EOF - chmod +x javac - ln -sv $(type -P gij) java - export PATH="$PWD:$PATH" - - cd ../.. - export JAVA_HOME="$PWD/tool-aliases" - - # Make JUnit visible. - export CLASSPATH="$(find ${junit} -name \*.jar -printf "%p:")" - ''; - - # Note: We don't build the javadoc. - buildPhase = '' - mkdir -p "$out" - ./build.sh -Dant.install="$out" install-lite - ''; - - installPhase = '' - # Actually, everything is already installed at this point, so we just - # rearrange a few things. - rm -v "$out/bin/"*.bat - - mkdir -p "$out/lib/java" - mv -v "$out/lib/"*.jar "$out/lib/java" - sed -i "$out/bin/ant" \ - -e "s|^ANT_LIB=.*$|ANT_LIB=$out/lib/java|g ; - s|JAVACMD=java.*$|JAVACMD=${gcj}/lib/jvm/bin/java|g ; - /^ant_exec_command/i export ANT_HOME=$out" - ''; - - meta = { - description = "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. - ''; - - homepage = http://ant.apache.org/; - - license = "APLv2"; - - maintainers = [ ]; - platforms = stdenv.lib.platforms.gnu; # arbitrary choice - }; -} diff --git a/pkgs/development/tools/build-managers/apache-ant/use-gcj.patch b/pkgs/development/tools/build-managers/apache-ant/use-gcj.patch deleted file mode 100644 index db82d3ba689e..000000000000 --- a/pkgs/development/tools/build-managers/apache-ant/use-gcj.patch +++ /dev/null @@ -1,18 +0,0 @@ -Setting `java.compiler' or `build.compiler' in `build.properties' isn't enough. - ---- apache-ant-1.7.1/build.xml 2008-06-27 07:05:23.000000000 +0200 -+++ apache-ant-1.7.1/build.xml 2009-09-24 15:10:53.000000000 +0200 -@@ -578,12 +578,7 @@ - classname="com.jcraft.jsch.Session" - classpathref="classpath"/> - -- <condition property="build.compiler" value="classic"> -- <not> -- <isset property="jdk1.3+"/> -- </not> -- </condition> -- <property name="build.compiler" value="modern"/> -+ <property name="build.compiler" value="gcj"/> - - <!--check for XSD support in the parser--> - <condition property="xmlschema.present"> diff --git a/pkgs/development/tools/build-managers/leiningen/builder.sh b/pkgs/development/tools/build-managers/leiningen/builder.sh index 8d0924028cc8..6a66466506cb 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 23f6b6247764..f7d5bc4d9a7e 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 e63ec9808f23..000000000000 --- 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 290e9a3a0033..ea66204d9cd5 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"; + }; } |