Skip to content

Commit

Permalink
dev-java/jamvm: Sort out patch naming convention. Fixes bug 563988.
Browse files Browse the repository at this point in the history
Package-Manager: portage-2.2.20.1
Signed-off-by: Patrice Clement <[email protected]>
  • Loading branch information
monsieurp committed Oct 24, 2015
1 parent 2692852 commit fa3b219
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
27 changes: 27 additions & 0 deletions dev-java/jamvm/files/jamvm-1.5.4-classes-location.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 @@
install_dir=$prefix
fi
AC_DEFINE_UNQUOTED(INSTALL_DIR, "$install_dir", [Installation directory (prefix)])
+AC_DEFINE_UNQUOTED(PKGDATADIR, "$datadir/$PACKAGE", [Package data directory (pkgdatadir)])

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 @@
separate class files in a directory structure */

#ifdef USE_ZIP
-#define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes.zip"
+#define JAMVM_CLASSES PKGDATADIR"/classes.zip"
#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath/glibj.zip"
#else
-#define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes"
+#define JAMVM_CLASSES PKGDATADIR"/classes"
#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath"
#endif

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions dev-java/jamvm/jamvm-1.5.4-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ DEPEND="dev-java/gnu-classpath:${CLASSPATH_SLOT}
amd64? ( virtual/libffi )"
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}"/"${P}-classes-location.patch"
)

src_prepare() {
# without this patch, classes.zip is not found at runtime
epatch "${FILESDIR}/classes-location.patch"
epatch "${PATCHES[@]}"
eautoreconf

# These come precompiled.
Expand Down Expand Up @@ -76,7 +80,7 @@ src_install() {

dodoc ACKNOWLEDGEMENTS AUTHORS ChangeLog NEWS README

set_java_env "${FILESDIR}/${PN}-1.5.4-r2.env"
set_java_env "${FILESDIR}/${P}-env.file"

dosym /usr/bin/jamvm ${INSTALL_DIR}/bin/java
dosym ${CLASSPATH_DIR}/share/classpath/glibj.zip ${INSTALL_DIR}/jre/lib/rt.jar
Expand Down
16 changes: 10 additions & 6 deletions dev-java/jamvm/jamvm-2.0.0-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ DEPEND="dev-java/gnu-classpath:0.98
sparc? ( virtual/libffi )"
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}"/"${P}-classes-location.patch"
"${FILESDIR}"/"${P}-noexecstack.patch"
)

src_prepare() {
# without this patch, classes.zip is not found at runtime
epatch "${FILESDIR}/classes-location.patch"
epatch "${FILESDIR}/noexecstack.patch"
epatch "${PATCHES[@]}"
eautoreconf

# These come precompiled.
Expand Down Expand Up @@ -65,7 +69,7 @@ create_launcher() {
-Xbootclasspath/p:/usr/share/classpath/tools.zip" \
gnu.classpath.tools.${1}.Main "\$@"
EOF
chmod +x "${script}"
chmod +x "${script}" || die
}

src_install() {
Expand All @@ -77,7 +81,7 @@ src_install() {

dodoc ACKNOWLEDGEMENTS AUTHORS ChangeLog NEWS README

set_java_env "${FILESDIR}/${PN}.env"
set_java_env "${FILESDIR}/${P}-env.file"

dodir ${JDK_DIR}/bin
dosym /usr/bin/jamvm ${JDK_DIR}/bin/java
Expand All @@ -97,11 +101,11 @@ src_install() {

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#" \
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
"${FILESDIR}"/"${P}-javac.in" | newexe - javac

local libarch="${ARCH}"
[ ${ARCH} == x86 ] && libarch="i386"
Expand Down

0 comments on commit fa3b219

Please sign in to comment.