Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Aug 2012 22:02:10 GMT
From:      "A.J. Kehoe IV (Nanoman)" <5dmdmp9o@nanoman.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/171014: [patch] Correct java/openjdk6 Dependency Declaration
Message-ID:  <201208242202.q7OM2AcG033676@red.freebsd.org>
Resent-Message-ID: <201208242210.q7OMA1gC078158@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171014
>Category:       ports
>Synopsis:       [patch] Correct java/openjdk6 Dependency Declaration
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 24 22:10:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     A.J. Kehoe IV (Nanoman)
>Release:        9.0
>Organization:
Nanoman's Company
>Environment:
FreeBSD localhost 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The FreeBSD port java/openjdk6 uses automatic detection to declare its bootstrap dependency.  This causes problems for port and package management.
>How-To-Repeat:

>Fix:
I've attached a patch that corrects this by using a method similar to the one suggested in the FreeBSD Porter's Handbook on the "Dependencies" page under "Problems Caused by Automatic Dependencies":

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html

Patch attached with submission follows:

--- ports/java/openjdk6/Makefile.old	2012-06-13 15:17:00.000000000 -0400
+++ ports/java/openjdk6/Makefile	2012-08-24 17:57:53.861765000 -0400
@@ -44,7 +44,10 @@
 .include <bsd.port.options.mk>
 
 OPTIONS_DEFINE=	DEBUG FASTDEBUG ICEDTEA IPV6 POLICY SOUND TEST TZUPDATE
-OPTIONS_DEFAULT=ICEDTEA TZUPDATE
+
+OPTIONS_SINGLE=	BOOTSTRAP
+OPTIONS_SINGLE_BOOTSTRAP=	OPENJDK6 JDK16 DIABLOJDK16
+
 DEBUG_DESC=	Enable legacy debugging support
 FASTDEBUG_DESC=	Include fastdebug build
 ICEDTEA_DESC=	Apply additional patches from IcedTea
@@ -52,6 +55,11 @@
 SOUND_DESC=	Enable sound support
 TEST_DESC=	Add support for running regression test
 TZUPDATE_DESC=	Update the time zone data
+OPENJDK6_DESC=	Bootstrap with installed OpenJDK 6
+JDK16_DESC=	Bootstrap with JDK 1.6
+DIABLOJDK16_DESC=	Bootstrap with diablo-jdk 1.6
+
+OPTIONS_DEFAULT=	ICEDTEA TZUPDATE DIABLOJDK16
 
 # java extracts directly to the cwd
 WRKSRC=		${WRKDIR}
@@ -95,20 +103,13 @@
 
 ONLY_FOR_ARCHS=	amd64 i386
 
-BOOTSTRAP_JDKS=	${LOCALBASE}/openjdk6 \
-		${LOCALBASE}/jdk1.6.0 \
-		${LOCALBASE}/diablo-jdk1.6.0
-
-# do we have valid native jdk installed?
-.for CJDK in ${BOOTSTRAP_JDKS}
-.  if !defined(BOOTSTRAPJDKDIR) && exists(${CJDK}/bin/javac)
-BOOTSTRAPJDKDIR=	${CJDK}
-.  endif
-.endfor
-
-# if no valid jdk found, set dependency
-.if !defined(BOOTSTRAPJDKDIR)
-BOOTSTRAPJDKDIR?=	${LOCALBASE}/diablo-jdk1.6.0
+.if ${PORT_OPTIONS:MOPENJDK6}
+BOOTSTRAPJDKDIR=	${LOCALBASE}/openjdk6
+.elif ${PORT_OPTIONS:MJDK16}
+BOOTSTRAPJDKDIR=	${LOCALBASE}/jdk1.6.0
+BUILD_DEPENDS+=		${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/jdk16
+.elif ${PORT_OPTIONS:MDIABLOJDK16}
+BOOTSTRAPJDKDIR=	${LOCALBASE}/diablo-jdk1.6.0
 BUILD_DEPENDS+=		${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk16
 .endif
 
@@ -246,6 +247,18 @@
 		${WRKSRC}/jdk/make/javax/crypto/Makefile
 .endif
 
+pre-build:
+.if !exists(${BOOTSTRAPJDKDIR}/bin/javac)
+	@${ECHO} ""
+	@${ECHO} "${BOOTSTRAPJDKDIR}/bin/javac not found."
+	@${ECHO} ""
+	@${ECHO} "You will need to bootstrap this port using a JDK that is already installed."
+	@${ECHO} "Please run \"make config\" again and change the BOOTSTRAP option to JDK16 or"
+	@${ECHO} "DIABLOJDK16."
+	@${ECHO} ""
+	exit 1
+.endif
+
 post-build:
 .if ${PORT_OPTIONS:MTZUPDATE}
 	@# Update time zones


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208242202.q7OM2AcG033676>