summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2014-09-03 12:47:37 +0000
committertron <tron@pkgsrc.org>2014-09-03 12:47:37 +0000
commitfb5ccd2e172dfa73a4f87d79b7d68e5b01a49abc (patch)
tree52ce0249c26e897bcabe6afe33cdfda86a8fc286 /lang
parentb4111a17dad400836bb3bb2a7a28bb4f56b27700 (diff)
downloadpkgsrc-fb5ccd2e172dfa73a4f87d79b7d68e5b01a49abc.tar.gz
Add support for Oracle Java 7 (manually installed via Mac OS X builtin
mechanism) under Mac OS X Mavericks. Patches contributed by J. Lewis Muir via "pkgsrc-users" mailing list.
Diffstat (limited to 'lang')
-rw-r--r--lang/sun-jdk7/builtin.mk20
-rw-r--r--lang/sun-jre7/builtin.mk22
2 files changed, 39 insertions, 3 deletions
diff --git a/lang/sun-jdk7/builtin.mk b/lang/sun-jdk7/builtin.mk
index 1f62bd13a73..a85eb7a970a 100644
--- a/lang/sun-jdk7/builtin.mk
+++ b/lang/sun-jdk7/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.2 2013/10/16 16:48:55 richard Exp $
+# $NetBSD: builtin.mk,v 1.3 2014/09/03 12:47:37 tron Exp $
BUILTIN_PKG:= sun-jdk7
@@ -7,6 +7,24 @@ BUILTIN_FIND_FILES.JDK7= \
/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"
###
diff --git a/lang/sun-jre7/builtin.mk b/lang/sun-jre7/builtin.mk
index 394914bedad..82fd44d7460 100644
--- a/lang/sun-jre7/builtin.mk
+++ b/lang/sun-jre7/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.2 2013/10/16 16:47:29 richard Exp $
+# $NetBSD: builtin.mk,v 1.3 2014/09/03 12:47:37 tron Exp $
BUILTIN_PKG:= sun-jre7
@@ -10,6 +10,24 @@ BUILTIN_FIND_FILES.JAVAVM7= \
.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 @@ MAKEVARS+= IS_BUILTIN.sun-jre7
!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}'