pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc Enable OpenJDK 7 and 8 on Linux. Add builtin support.
details: https://anonhg.NetBSD.org/pkgsrc/rev/11af730e6c62
branches: trunk
changeset: 355985:11af730e6c62
user: asau <asau%pkgsrc.org@localhost>
date: Fri Dec 16 16:27:23 2016 +0000
description:
Enable OpenJDK 7 and 8 on Linux. Add builtin support.
Tested on openSUSE 11-42.
diffstat:
lang/openjdk7/builtin.mk | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
lang/openjdk8/builtin.mk | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
mk/java-vm.mk | 6 +++-
3 files changed, 151 insertions(+), 1 deletions(-)
diffs (181 lines):
diff -r 9e0665a00353 -r 11af730e6c62 lang/openjdk7/builtin.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk7/builtin.mk Fri Dec 16 16:27:23 2016 +0000
@@ -0,0 +1,73 @@
+BUILTIN_PKG:= openjdk7
+
+BUILTIN_FIND_FILES_VAR:= OJDK7
+BUILTIN_FIND_FILES.OJDK7= \
+ /usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/bin/javac
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.openjdk7)
+. if empty(OJDK7:M__nonexistent__)
+IS_BUILTIN.openjdk7= yes
+. else
+IS_BUILTIN.openjdk7= no
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.openjdk7
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.openjdk7) && \
+ !empty(IS_BUILTIN.openjdk7:M[yY][eE][sS])
+BUILTIN_VERSION.openjdk7!= ${OJDK7} -version 2>&1 | ${SED} -Ee 's:^[^0-9]*([0-9._]+)$:\1:' -e 's/_/./g' -e 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\1.\2.\4/'
+BUILTIN_PKG.openjdk7= openjdk7-$(BUILTIN_VERSION.openjdk7)
+.endif
+MAKEVARS+= BUILTIN_PKG.openjdk7
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.openjdk7)
+. if ${PREFER.openjdk7} == "pkgsrc"
+USE_BUILTIN.openjdk7= no
+. else
+USE_BUILTIN.openjdk7= ${IS_BUILTIN.openjdk7}
+. if defined(BUILTIN_PKG.openjdk7) && \
+ !empty(IS_BUILTIN.openjdk7:M[yY][eE][sS])
+USE_BUILTIN.openjdk7= yes
+. for _dep_ in ${BUILDLINK_API_DEPENDS.openjdk7}
+. if !empty(USE_BUILTIN.openjdk7:M[yY][eE][sS])
+USE_BUILTIN.openjdk7!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.openjdk7:Q}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+. endif
+.endif
+MAKEVARS+= USE_BUILTIN.openjdk7
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+CHECK_BUILTIN.openjdk7?= no
+.if !empty(CHECK_BUILTIN.openjdk7:M[nN][oO])
+#
+# Here we place code that depends on whether USE_BUILTIN.openjdk7 is
+# set to "yes" or "no".
+#
+. if !empty(USE_BUILTIN.openjdk7:M[yY][eE][sS])
+PKG_JAVA_HOME= ${OJDK7:H:H}
+. endif
+.endif # CHECK_BUILTIN.openjdk7
diff -r 9e0665a00353 -r 11af730e6c62 lang/openjdk8/builtin.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk8/builtin.mk Fri Dec 16 16:27:23 2016 +0000
@@ -0,0 +1,73 @@
+BUILTIN_PKG:= openjdk8
+
+BUILTIN_FIND_FILES_VAR:= OJDK8
+BUILTIN_FIND_FILES.OJDK8= \
+ /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/bin/javac
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.openjdk8)
+. if empty(OJDK8:M__nonexistent__)
+IS_BUILTIN.openjdk8= yes
+. else
+IS_BUILTIN.openjdk8= no
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.openjdk8
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.openjdk8) && \
+ !empty(IS_BUILTIN.openjdk8:M[yY][eE][sS])
+BUILTIN_VERSION.openjdk8!= ${OJDK8} -version 2>&1 | ${SED} -Ee 's:^[^0-9]*([0-9._]+)$:\1:' -e 's/_/./g' -e 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\1.\2.\4/'
+BUILTIN_PKG.openjdk8= openjdk8-$(BUILTIN_VERSION.openjdk8)
+.endif
+MAKEVARS+= BUILTIN_PKG.openjdk8
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.openjdk8)
+. if ${PREFER.openjdk8} == "pkgsrc"
+USE_BUILTIN.openjdk8= no
+. else
+USE_BUILTIN.openjdk8= ${IS_BUILTIN.openjdk8}
+. if defined(BUILTIN_PKG.openjdk8) && \
+ !empty(IS_BUILTIN.openjdk8:M[yY][eE][sS])
+USE_BUILTIN.openjdk8= yes
+. for _dep_ in ${BUILDLINK_API_DEPENDS.openjdk8}
+. if !empty(USE_BUILTIN.openjdk8:M[yY][eE][sS])
+USE_BUILTIN.openjdk8!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.openjdk8:Q}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+. endif
+.endif
+MAKEVARS+= USE_BUILTIN.openjdk8
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+CHECK_BUILTIN.openjdk8?= no
+.if !empty(CHECK_BUILTIN.openjdk8:M[nN][oO])
+#
+# Here we place code that depends on whether USE_BUILTIN.openjdk8 is
+# set to "yes" or "no".
+#
+. if !empty(USE_BUILTIN.openjdk8:M[yY][eE][sS])
+PKG_JAVA_HOME= ${OJDK8:H:H}
+. endif
+.endif # CHECK_BUILTIN.openjdk8
diff -r 9e0665a00353 -r 11af730e6c62 mk/java-vm.mk
--- a/mk/java-vm.mk Fri Dec 16 16:21:54 2016 +0000
+++ b/mk/java-vm.mk Fri Dec 16 16:27:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: java-vm.mk,v 1.107 2016/07/13 14:16:17 jperkin Exp $
+# $NetBSD: java-vm.mk,v 1.108 2016/12/16 16:27:23 asau Exp $
#
# This Makefile fragment handles Java dependencies and make variables,
# and is meant to be included by packages that require Java either at
@@ -139,6 +139,8 @@
SunOS-5.11-x86_64
_ONLY_FOR_PLATFORMS.openjdk7= \
DragonFly-*-* \
+ Linux-*-i[3-6]86 \
+ Linux-*-x86_64 \
NetBSD-[5-9]*-i386 \
NetBSD-[5-9]*-x86_64 \
NetBSD-[7-9]*-sparc64 \
@@ -147,6 +149,8 @@
SunOS-*-x86_64
_ONLY_FOR_PLATFORMS.openjdk8= \
DragonFly-*-* \
+ Linux-*-i[3-6]86 \
+ Linux-*-x86_64 \
NetBSD-[5-9]*-i386 \
NetBSD-[5-9]*-x86_64 \
NetBSD-[7-9]*-sparc64 \
Home |
Main Index |
Thread Index |
Old Index