summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Clement <monsieurp@gentoo.org>2015-10-23 19:34:08 +0000
committerPatrice Clement <monsieurp@gentoo.org>2015-10-24 09:01:34 +0000
commit3143fb5765cc33ed3e48afcf577971a2e5cbafd4 (patch)
tree55178da9bf70c9bda33160d9e0997d26aa0d69e4
parentdev-python/rospkg: Bump to 1.0.38. (diff)
downloadgentoo-3143fb5765cc33ed3e48afcf577971a2e5cbafd4.tar.gz
gentoo-3143fb5765cc33ed3e48afcf577971a2e5cbafd4.tar.bz2
gentoo-3143fb5765cc33ed3e48afcf577971a2e5cbafd4.zip
dev-java/jamvm: Version bump. Fixes bug 539734.
Package-Manager: portage-2.2.20.1 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
-rw-r--r--dev-java/jamvm/Manifest1
-rw-r--r--dev-java/jamvm/files/classes-location.patch16
-rw-r--r--dev-java/jamvm/files/jamvm.env16
-rw-r--r--dev-java/jamvm/files/javac.in57
-rw-r--r--dev-java/jamvm/files/noexecstack.patch48
-rw-r--r--dev-java/jamvm/jamvm-2.0.0-r1.ebuild124
6 files changed, 254 insertions, 8 deletions
diff --git a/dev-java/jamvm/Manifest b/dev-java/jamvm/Manifest
index 99424ee2ad28..144c16d459a9 100644
--- a/dev-java/jamvm/Manifest
+++ b/dev-java/jamvm/Manifest
@@ -1 +1,2 @@
DIST jamvm-1.5.4.tar.gz 656283 SHA256 7865693698bc4322cabe1014a4b7ebdec1bc1daf45f1a4457b6e908a4446b124 SHA512 a4a7a2917881262fee19b6aedd9dc50a78463c5e4b02bda4b8184aef49797e3476f8ec8671047a01ba246af7d84cbe58f57ee84bb198817738c79d9f62c1ddbc WHIRLPOOL 615d94ab3a8359c8d6d0a2347d836c0a6adceaeda03a72d105b094f4ffb3161a5f3abbd4c12aa75703823da203d1cee91591e829a796813f82fcfbf2703068f2
+DIST jamvm-2.0.0.tar.gz 741459 SHA256 76428e96df0ae9dd964c7a7c74c1e9a837e2f312c39e9a357fa8178f7eff80da SHA512 8ac27787ee94fa8fde962635d3c08d1dc1e5244c9d56bb693e73f3fd9b58e944ad3f7a0127afeed727d7c00d904a775d2c483157f5ac87e7eab6ecade1aad21d WHIRLPOOL 7e80be683fafb444cd417502b96089ce4f6879a049ca49e33691b4d5d6755814654ab4ed7626b666dd48f9d6101567b2a12de43b916055ea1d067c5d4df06443
diff --git a/dev-java/jamvm/files/classes-location.patch b/dev-java/jamvm/files/classes-location.patch
index 57d046a81882..6cf7611f1f35 100644
--- a/dev-java/jamvm/files/classes-location.patch
+++ b/dev-java/jamvm/files/classes-location.patch
@@ -1,7 +1,7 @@
-diff -ur jamvm-1.5.0.old/configure.ac jamvm-1.5.0/configure.ac
---- jamvm-1.5.0.old/configure.ac 2008-03-03 17:31:46.000000000 +0200
-+++ jamvm-1.5.0/configure.ac 2008-03-03 17:36:14.000000000 +0200
-@@ -208,6 +208,7 @@
+diff -Nru jamvm-2.0.0.old/configure.ac jamvm-2.0.0/configure.ac
+--- jamvm-2.0.0.old/configure.ac 2014-06-10 21:33:37.000000000 +0100
++++ jamvm-2.0.0/configure.ac 2014-11-28 19:22:12.183091414 +0000
+@@ -236,6 +236,7 @@
install_dir=$prefix
fi
AC_DEFINE_UNQUOTED(INSTALL_DIR, "$install_dir", [Installation directory (prefix)])
@@ -9,10 +9,10 @@ diff -ur jamvm-1.5.0.old/configure.ac jamvm-1.5.0/configure.ac
AC_ARG_ENABLE(zip,
[AS_HELP_STRING(--disable-zip,turn-off zip support in the bootstrap loader)],,)
-diff -ur jamvm-1.5.0.old/src/class.h jamvm-1.5.0/src/class.h
---- jamvm-1.5.0.old/src/class.h 2008-03-03 17:31:46.000000000 +0200
-+++ jamvm-1.5.0/src/class.h 2008-03-03 17:36:51.000000000 +0200
-@@ -39,10 +39,10 @@
+diff -Nru jamvm-2.0.0.old/src/classlib/gnuclasspath/class.c jamvm-2.0.0/src/classlib/gnuclasspath/class.c
+--- jamvm-2.0.0.old/src/classlib/gnuclasspath/class.c 2012-05-17 22:01:47.000000000 +0100
++++ jamvm-2.0.0/src/classlib/gnuclasspath/class.c 2014-11-28 19:23:27.312108240 +0000
+@@ -110,10 +110,10 @@
separate class files in a directory structure */
#ifdef USE_ZIP
diff --git a/dev-java/jamvm/files/jamvm.env b/dev-java/jamvm/files/jamvm.env
new file mode 100644
index 000000000000..5eee6a9e0f39
--- /dev/null
+++ b/dev-java/jamvm/files/jamvm.env
@@ -0,0 +1,16 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VERSION="JamVM JDK @PV@"
+JAVA_HOME="@GENTOO_PORTAGE_EPREFIX@/usr/@LIBDIR@/@PN@-jdk"
+JDK_HOME="@GENTOO_PORTAGE_EPREFIX@/usr/@LIBDIR@/@PN@-jdk"
+BOOTCLASSPATH="@GENTOO_PORTAGE_EPREFIX@/usr/@LIBDIR@/@PN@/classes.zip:${JAVA_HOME}/lib/rt.jar"
+JAVAC="${JAVA_HOME}/bin/javac"
+PATH="${JAVA_HOME}/bin"
+ROOTPATH="${JAVA_HOME}/bin"
+PROVIDES_TYPE="JRE"
+PROVIDES_VERSION="1.5"
+GENERATION="2"
+ENV_VARS="JAVA_HOME JAVAC PATH"
+LDPATH="${JAVA_HOME}/lib"
diff --git a/dev-java/jamvm/files/javac.in b/dev-java/jamvm/files/javac.in
new file mode 100644
index 000000000000..8eeda68c7a5e
--- /dev/null
+++ b/dev-java/jamvm/files/javac.in
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+use strict;
+use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
+use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+
+my $ECJ_WARNINGS="-nowarn";
+
+my ( @bcoption, @source15, @target15, @cp );
+push @bcoption, '-bootclasspath', '@RT_JAR@:@TOOLS_JAR@'
+ unless grep {$_ eq '-bootclasspath'} @ARGV;
+push @source15, '-source', '1.5'
+ unless grep {$_ eq '-source'} @ARGV;
+push @target15, '-target', '1.5'
+ unless grep {$_ eq '-target'} @ARGV;
+push @cp, '-cp', '.'
+ unless grep {$_ =~ '\-c(p|lasspath)'} @ARGV or $ENV{CLASSPATH};
+my @ecj_parms = ($ECJ_WARNINGS, @bcoption, @source15, @target15, @cp);
+
+# Work around ecj's inability to handle duplicate command-line
+# options and unknown javac options.
+sub gen_ecj_opts
+{
+ my @new_args = @{$_[0]};
+
+ for my $opt (NO_DUP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ if (@indices > 1) {
+ shift @indices; # keep last instance only
+ splice @new_args, $_, 2 for @indices;
+ }
+ }
+
+ for my $opt (STRIP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ splice @new_args, $_, 1 for @indices;
+ }
+
+ return \@new_args;
+}
+
+sub split_vm_args
+{
+ my @new_args = @{$_[0]};
+
+ my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
+ my @javac_args = grep $_ !~ /^-J/, @new_args;
+
+ return (\@vm_args, \@javac_args);
+}
+
+my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV ));
+my @CLASSPATH = ('@ECJ_JAR@');
+push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
+$ENV{"CLASSPATH"} = join ':', @CLASSPATH;
+exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @$javac_args;
diff --git a/dev-java/jamvm/files/noexecstack.patch b/dev-java/jamvm/files/noexecstack.patch
new file mode 100644
index 000000000000..2a0f14c71a1e
--- /dev/null
+++ b/dev-java/jamvm/files/noexecstack.patch
@@ -0,0 +1,48 @@
+diff --git a/src/os/linux/arm/callNative.S b/src/os/linux/arm/callNative.S
+index 245afd1..1583023 100644
+--- a/src/os/linux/arm/callNative.S
++++ b/src/os/linux/arm/callNative.S
+@@ -36,3 +36,7 @@
+ #include "callNativeOABI.S"
+ #endif
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/src/os/linux/mips/callNative.S b/src/os/linux/mips/callNative.S
+index cede343..90d9163 100644
+--- a/src/os/linux/mips/callNative.S
++++ b/src/os/linux/mips/callNative.S
+@@ -184,3 +184,7 @@ return:
+ j $31
+ .end callJNIMethod
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/src/os/linux/powerpc/callNative.S b/src/os/linux/powerpc/callNative.S
+index aa47f6a..763dc0a 100644
+--- a/src/os/linux/powerpc/callNative.S
++++ b/src/os/linux/powerpc/callNative.S
+@@ -281,3 +281,7 @@ return:
+ mr 1,11
+ blr
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/src/os/linux/x86_64/callNative.S b/src/os/linux/x86_64/callNative.S
+index 26404e6..9fb5cdf 100644
+--- a/src/os/linux/x86_64/callNative.S
++++ b/src/os/linux/x86_64/callNative.S
+@@ -267,3 +267,7 @@ float_ret:
+ addq $8, %rcx
+ jmp return
+ #endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/dev-java/jamvm/jamvm-2.0.0-r1.ebuild b/dev-java/jamvm/jamvm-2.0.0-r1.ebuild
new file mode 100644
index 000000000000..65eeb618fa67
--- /dev/null
+++ b/dev-java/jamvm/jamvm-2.0.0-r1.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib java-vm-2 autotools
+
+DESCRIPTION="An extremely small and specification-compliant virtual machine"
+HOMEPAGE="http://jamvm.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc ~x86"
+IUSE="debug libffi"
+
+DEPEND="dev-java/gnu-classpath:0.98
+ || ( dev-java/eclipse-ecj:* dev-java/ecj-gcj:* )
+ libffi? ( virtual/libffi )
+ ppc64? ( virtual/libffi )
+ sparc? ( virtual/libffi )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # without this patch, classes.zip is not found at runtime
+ epatch "${FILESDIR}/classes-location.patch"
+ epatch "${FILESDIR}/noexecstack.patch"
+ eautoreconf
+
+ # These come precompiled.
+ # configure script uses detects the compiler
+ # from PATH. I guess we should compile this from source.
+ # Then just make sure not to hit
+ # https://bugs.gentoo.org/show_bug.cgi?id=163801
+ #
+ #rm -v lib/classes.zip || die
+}
+
+src_configure() {
+ filter-flags "-fomit-frame-pointer"
+
+ if use ppc64 || use sparc || use libffi; then
+ append-cflags "$(pkg-config --cflags-only-I libffi)"
+ fi
+
+ local fficonf="--enable-ffi"
+ if { ! use ppc64 && ! use sparc; }; then
+ fficonf="$(use_enable libffi ffi)"
+ fi
+
+ econf ${fficonf} \
+ --disable-dependency-tracking \
+ $(use_enable debug trace) \
+ --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} \
+ --includedir="${EPREFIX}"/usr/include/${PN} \
+ --with-classpath-install-dir=/usr
+}
+
+create_launcher() {
+ local script="${D}/${INSTALL_DIR}/bin/${1}"
+ cat > "${script}" <<-EOF
+ #!/bin/sh
+ exec /usr/bin/jamvm \
+ -Xbootclasspath/p:/usr/share/classpath/tools.zip" \
+ gnu.classpath.tools.${1}.Main "\$@"
+ EOF
+ chmod +x "${script}"
+}
+
+src_install() {
+ local libdir=$(get_libdir)
+ local CLASSPATH_DIR=/usr/libexec/gnu-classpath-0.98
+ local JDK_DIR=/usr/${libdir}/${PN}-jdk
+
+ emake DESTDIR="${D}" install
+
+ dodoc ACKNOWLEDGEMENTS AUTHORS ChangeLog NEWS README
+
+ set_java_env "${FILESDIR}/${PN}.env"
+
+ dodir ${JDK_DIR}/bin
+ dosym /usr/bin/jamvm ${JDK_DIR}/bin/java
+ for files in ${CLASSPATH_DIR}/g*; do
+ if [ $files = "${CLASSPATH_DIR}/bin/gjdoc" ] ; then
+ dosym $files ${JDK_DIR}/bin/javadoc || die
+ else
+ dosym $files \
+ ${JDK_DIR}/bin/$(echo $files|sed "s#$(dirname $files)/g##") || die
+ fi
+ done
+
+ dodir ${JDK_DIR}/jre/lib
+ dosym /usr/share/classpath/glibj.zip ${JDK_DIR}/jre/lib/rt.jar
+ dodir ${JDK_DIR}/lib
+ dosym /usr/share/classpath/tools.zip ${JDK_DIR}/lib/tools.jar
+
+ local ecj_jar="$(readlink "${EPREFIX}"/usr/share/eclipse-ecj/ecj.jar)"
+ exeinto ${JDK_DIR}/bin
+ cat "${FILESDIR}"/javac.in | sed -e "s#@JAVA@#/usr/bin/jamvm#" \
+ -e "s#@ECJ_JAR@#${ecj_jar}#" \
+ -e "s#@RT_JAR@#/usr/share/classpath/glibj.zip#" \
+ -e "s#@TOOLS_JAR@#/usr/share/classpath/tools.zip#" \
+ | newexe - javac
+
+ local libarch="${ARCH}"
+ [ ${ARCH} == x86 ] && libarch="i386"
+ [ ${ARCH} == x86_64 ] && libarch="amd64"
+ dodir ${JDK_DIR}/jre/lib/${libarch}/client
+ dodir ${JDK_DIR}/jre/lib/${libarch}/server
+ dosym /usr/${libdir}/${PN}/libjvm.so ${JDK_DIR}/jre/lib/${libarch}/client/libjvm.so
+ dosym /usr/${libdir}/${PN}/libjvm.so ${JDK_DIR}/jre/lib/${libarch}/server/libjvm.so
+ dosym /usr/${libdir}/classpath/libjawt.so ${JDK_DIR}/jre/lib/${libarch}/libjawt.so
+
+ # Can't use java-vm_set-pax-markings as doesn't work with symbolic links
+ # Ensure a PaX header is created.
+ local pax_markings="C"
+ # Usally disabeling MPROTECT is sufficent.
+ local pax_markings+="m"
+ # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
+ use x86 && pax_markings+="sp"
+
+ pax-mark ${pax_markings} "${ED}"/usr/bin/jamvm
+}