Merge pull request #17036 from romildo/upd.cup

java-cup: 10k -> 11b-20160615
This commit is contained in:
Joachim F 2016-07-19 13:29:18 +02:00 committed by GitHub
commit c1e07d9337
3 changed files with 70 additions and 20 deletions

View file

@ -1,13 +0,0 @@
set -e
source $stdenv/setup
tar zxvf $src
$jdk/bin/javac java_cup/*.java
$jdk/bin/javac java_cup/runtime/*.java
mkdir -p $out/java_cup/runtime
cp java_cup/*.class $out/java_cup
cp java_cup/runtime/*.class $out/java_cup/runtime/

View file

@ -1,13 +1,38 @@
{stdenv, fetchurl, jdk} :
{ stdenv, fetchurl, jdk, ant } :
stdenv.mkDerivation {
name = "java-cup-10k";
builder = ./builder.sh;
stdenv.mkDerivation rec {
name = "java-cup-${version}";
version = "11b-20160615";
src = fetchurl {
url = http://www.cs.princeton.edu/~appel/modern/java/CUP/java_cup_v10k.tar.gz;
md5 = "8b11edfec13c590ea443d0f0ae0da479";
url = "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-${version}.tar.gz";
sha256 = "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0";
};
inherit jdk;
sourceRoot = ".";
nativeBuildInputs = [ jdk ant ];
patches = [ ./javacup-0.11b_beta20160615-build-xml-git.patch ];
buildPhase = "ant";
installPhase = ''
mkdir -p $out/{bin,share/{java,java-cup}}
cp dist/java-cup-11b.jar $out/share/java-cup/
cp dist/java-cup-11b-runtime.jar $out/share/java/
cat > $out/bin/javacup <<EOF
#! $shell
exec ${jdk.jre}/bin/java -jar $out/share/java-cup/java-cup-11b.jar "\$@"
EOF
chmod a+x $out/bin/javacup
'';
meta = {
homepage = http://www2.cs.tum.edu/projects/cup/;
description = "LALR parser generator for Java";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.romildo ];
};
}

View file

@ -0,0 +1,38 @@
--- javacup/build.xml.orig 2016-06-15 07:10:15.000000000 -0300
+++ javacup/build.xml 2016-07-17 08:46:46.632722844 -0300
@@ -21,26 +21,6 @@
<mkdir dir="${dist}" />
<loadfile property="cupversion" srcFile="version.txt" failonerror="false" />
<property name="cupversion" value="custombuild" unless:set="cupversion"/>
- <exec executable="git" outputproperty="gitversion">
- <arg value="log"/>
- <arg value="-1"/>
- <arg value="--format=%h"/>
- </exec>
- <exec executable="git" outputproperty="changed">
- <arg value="status"/>
- <arg value="--porcelain"/>
- <redirector>
- <outputfilterchain>
- <linecontainsregexp>
- <regexp pattern='^M.*'/>
- </linecontainsregexp>
- <tokenfilter>
- <replaceregex pattern=".*" replace="modifications based on "/>
- </tokenfilter>
- </outputfilterchain>
- </redirector>
- </exec>
- <property name="svnversion">${changed}${gitversion}</property>
</target>
<property environment="env" />
@@ -79,7 +59,7 @@
<copy todir="${java}"><fileset dir="${src}"></fileset></copy>
<replace file="${java}/java_cup/version.java"
token="+ version_str"
- value='+ "v0.11b ${cupversion} (GIT ${svnversion})"'>
+ value='+ "v0.11b ${cupversion}"'>
</replace>
<javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.8" target="1.8">
<classpath refid="libraries"/>