diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-11-30 17:17:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-11-30 17:18:17 +0000 |
commit | a1722f1076746fba62fa70a30127262d4a5a06bc (patch) | |
tree | 02eaa4b90f47c6bdefd47e5ce4001e9347b96580 /community/java-gcj-compat | |
parent | 667a2bccc28ffcad2cddb4b4cd1085382c521f50 (diff) | |
download | aports-a1722f1076746fba62fa70a30127262d4a5a06bc.tar.bz2 aports-a1722f1076746fba62fa70a30127262d4a5a06bc.tar.xz |
community/java-gcj-compat: resurrect. needed by openjdk7
adjust for gcc6
Diffstat (limited to 'community/java-gcj-compat')
-rw-r--r-- | community/java-gcj-compat/APKBUILD | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/community/java-gcj-compat/APKBUILD b/community/java-gcj-compat/APKBUILD new file mode 100644 index 0000000000..0d8771a84a --- /dev/null +++ b/community/java-gcj-compat/APKBUILD @@ -0,0 +1,81 @@ +# Contributor: Timo Teras <timo.teras@iki.fi> +# Maintainer: Timo Teras <timo.teras@iki.fi> + +_gccver=6.4.0 +_gccpkgrel=7 + +pkgname=java-gcj-compat +pkgver=$_gccver +_mypkgrel=3 +pkgrel=$(( $_mypkgrel + $_gccpkgrel )) +pkgdesc="JDK like environment using GCJ" +url="https://git.alpinelinux.org/aports.git" +arch="all" +license="GPL" +depends="fastjar gcc6-java=$_gccver-r$_gccpkgrel java-common" +makedepends="gcc6-java=$_gccver-r$_gccpkgrel zlib-dev paxmark" +source= + +builddir="$srcdir/$pkgname-$pkgver" + +prepare() { + ( + gccver=`(. ../../community/gcc6/APKBUILD ; echo "$pkgver")` + gccpkgrel=`(. ../../community/gcc6/APKBUILD ; echo "$pkgrel")` + if [ "$gccver" != "$_gccver" ] || [ "$gccpkgrel" != "$_gccpkgrel" ]; then + die "gcc6 version ($gccver) needs to match _gccver ($_gccver)" + fi + ) +} + + +build() { + mkdir -p $builddir + cd $builddir + gcj-6 -Wl,-Bsymbolic -findirect-dispatch -o ecj \ + --main=org.eclipse.jdt.internal.compiler.batch.Main \ + /usr/share/java/ecj.jar -lgcj + paxmark -msp ecj +} + +check() { + $builddir/ecj > /dev/null +} + +package() { + JVM_DIR=$pkgdir/usr/lib/jvm + JDK_DIR=$JVM_DIR/java-1.5-gcj + JDK_BIN_DIR=$JDK_DIR/bin + JRE_DIR=$JDK_DIR/jre + JRE_BIN_DIR=$JRE_DIR/bin + JRE_LIB_DIR=$JRE_DIR/lib + + CPU=$(uname -m | sed -e 's/i.86/i386/g' -e 's/x86_64/amd64/g') + + mkdir -p $JDK_BIN_DIR + ln -sf ../../../../bin/gij-6 $JDK_BIN_DIR/java + ln -sf ../../../../bin/fastjar $JDK_BIN_DIR/fastjar + ln -sf ../../../../bin/sinjdoc $JDK_BIN_DIR/javadoc + ln -sf ../../../../bin/grmic-6 $JDK_BIN_DIR/rmic + ln -sf ../../../../bin/gjavah-6 $JDK_BIN_DIR/javah + install -s $builddir/ecj $JDK_BIN_DIR/javac + ln -sf ../../../../bin/gappletviewer-6 $JDK_BIN_DIR/appletviewer + ln -sf ../../../../bin/gjarsigner-6 $JDK_BIN_DIR/jarsigner + ln -sf ../../../../bin/grmiregistry-6 $JDK_BIN_DIR/rmiregistry + ln -sf ../../../../bin/gkeytool-6 $JDK_BIN_DIR/keytool + ln -sf ../../../../bin/gjar-6 $JDK_BIN_DIR/gjar + ln -sf ../../../../bin/gnative2ascii-6 $JDK_BIN_DIR/gnative2ascii + + gcjrel=`ls -d /usr/lib/gcj-$gccver-* | cut -d '-' -f 3` + + mkdir -p $JRE_BIN_DIR $JRE_LIB_DIR/$CPU + ln -sf ../../../../../bin/gij-6 $JRE_BIN_DIR/java + ln -sf ../../../../../bin/grmiregistry-6 $JRE_BIN_DIR/rmiregistry + ln -sf ../../../../../bin/gkeytool-6 $JRE_BIN_DIR/keytool + ln -sf ../../../../../share/java/libgcj-$_gccver.jar $JRE_LIB_DIR/rt.jar + ln -sf ../../../../../share/java/libgcj-tools-$_gccver.jar $JRE_LIB_DIR/tools.jar + ln -sf ../../../../../../lib/gcj-$_gccver-$gcjrel/libjvm.so $JRE_LIB_DIR/$CPU + ln -sf ../../../../../../lib/gcj-$_gccver-$gcjrel/libjavamath.so $JRE_LIB_DIR/$CPU + ln -sf ../../../../../../lib/gcj-$_gccver-$gcjrel/classmap.db $JRE_LIB_DIR/$CPU +} + |