pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Fixes for built-in Java on Darwin
Hello.
Please find the attached patches against -current to make built-in
Oracle Java 7 (i.e. PKG_JVM_DEFAULT=sun-jdk7) work on Mac OS X Mavericks
(Darwin 13). Would a developer be willing to commit these?
mk_java-vm.mk.diff:
Make the _ONLY_FOR_PLATFORMS.sun-jdk7 Darwin pattern match Darwin
10-99 so that the current and all future Mac OS X releases (well, at
least through Darwin 99) will be considered supported. This avoids
the perpetual problem of having support break whenever a new Mac OS
X version comes out and having to add another pattern match for that
specific version of Darwin.
lang_sun-jre7.diff:
Look for the JRE in the standard location on Mac OS X. Support a JRE
path containing a space (which is the case for standard location on
Mac OS X).
lang_sun-jdk7.diff:
Use the system java_home program to find the default 1.7 JDK location
on Mac OS X since there are no 1.7 symlinks on the file system that
would give us a stable path to the current 1.7 JDK.
Thanks!
Lewis
Index: mk/java-vm.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/java-vm.mk,v
retrieving revision 1.94
diff -b -u -r1.94 java-vm.mk
--- mk/java-vm.mk 27 Dec 2013 00:11:38 -0000 1.94
+++ mk/java-vm.mk 28 Aug 2014 21:28:28 -0000
@@ -149,8 +149,7 @@
NetBSD-[5-9]*-x86_64
_ONLY_FOR_PLATFORMS.sun-jdk7= \
Darwin-9.*-i386 Darwin-9.*-x86_64 \
- Darwin-10.*-i386 Darwin-10.*-x86_64 \
- Darwin-11.*-i386 Darwin-11.*-x86_64 \
+ Darwin-[1-9][0-9].*-i386 Darwin-[1-9][0-9].*-x86_64 \
DragonFly-*-i386 \
FreeBSD-6.*-i386 \
Linux-*-i[3-6]86 \
Index: builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/sun-jre7/builtin.mk,v
retrieving revision 1.2
diff -b -u -r1.2 builtin.mk
--- builtin.mk 16 Oct 2013 16:47:29 -0000 1.2
+++ builtin.mk 28 Aug 2014 21:36:53 -0000
@@ -10,6 +10,24 @@
.include "../../mk/buildlink3/bsd.builtin.mk"
###
+### On Darwin, if a suitable JRE has not already been found, try to find
+### it in the standard JRE location. Normally, we would just add the
+### standard JRE location path to BUILTIN_FIND_FILES.JAVAVM7 above, but
+### unfortunately, the path contains a space, and the BUILTIN_FIND_FILES
+### "subroutine" can't handle paths containing whitespace (because it
+### iterates over the paths in a for-loop). So, we perform the check by
+### hand.
+###
+.if ${OPSYS} == "Darwin" && \
+ !empty(JAVAVM7:M__nonexistent__)
+_JRE_HOME= \
+ /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
+. if exists(${_JRE_HOME})
+JAVAVM7= ${_JRE_HOME}
+. endif
+.endif
+
+###
### Determine if there is a built-in implementation of the package and
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
###
@@ -30,7 +48,7 @@
!empty(IS_BUILTIN.sun-jre7:M[yY][eE][sS]) && \
empty(JAVAVM7:M__nonexistent__)
-BUILTIN_VERSION.sun-jre7!= ${JAVAVM7}/bin/java -version 2>&1 | \
+BUILTIN_VERSION.sun-jre7!= ${JAVAVM7:Q}/bin/java -version 2>&1 | \
${AWK} -F \" '{print $$2; exit}' | \
${AWK} '{sub(/^1\./,"");sub(/_/,".");print $$1}'
Index: builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/sun-jdk7/builtin.mk,v
retrieving revision 1.2
diff -b -u -r1.2 builtin.mk
--- builtin.mk 16 Oct 2013 16:48:55 -0000 1.2
+++ builtin.mk 28 Aug 2014 21:37:07 -0000
@@ -7,6 +7,24 @@
/System/Library/Frameworks/JavaVM.framework/Versions/1.7/Commands/javac\
/usr/jdk/instances/jdk1.7.0/bin/javac
+###
+### On Darwin, there are no 1.7 symlinks that would enable us to find a
+### 1.7 JDK. Instead, the best method is to use the java_home system
+### program to find the default 1.7 JDK if it exists.
+###
+.if ${OPSYS} == "Darwin"
+_JAVA_HOME_ANSWER!= \
+ if [ -x /usr/libexec/java_home ]; then \
+ result=`/usr/libexec/java_home -v 1.7 2> /dev/null`; \
+ if [ $$? -eq 0 ]; then \
+ echo "$$result"; \
+ else \
+ echo; \
+ fi; \
+ fi
+BUILTIN_FIND_FILES.JDK7+= ${_JAVA_HOME_ANSWER}/bin/javac
+.endif
+
.include "../../mk/buildlink3/bsd.builtin.mk"
###
Home |
Main Index |
Thread Index |
Old Index