summaryrefslogtreecommitdiff
path: root/lang/sun-jre7
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/sun-jre7
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/sun-jre7')
-rw-r--r--lang/sun-jre7/builtin.mk22
1 files changed, 20 insertions, 2 deletions
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}'