From nobody@FreeBSD.org  Fri Aug 24 22:02:10 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id CC3F7106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Aug 2012 22:02:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id ADDBF8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Aug 2012 22:02:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OM2AND033677
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Aug 2012 22:02:10 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q7OM2AcG033676;
	Fri, 24 Aug 2012 22:02:10 GMT
	(envelope-from nobody)
Message-Id: <201208242202.q7OM2AcG033676@red.freebsd.org>
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: [patch] Correct java/openjdk6 Dependency Declaration
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171014
>Category:       ports
>Synopsis:       [patch] Correct java/openjdk6 Dependency Declaration
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-java
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 24 22:10:00 UTC 2012
>Closed-Date:    Wed May 21 21:30:30 UTC 2014
>Last-Modified:  Wed May 21 21:30:30 UTC 2014
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-java 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Aug 24 22:10:13 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171014 
State-Changed-From-To: open->closed 
State-Changed-By: jkim 
State-Changed-When: Wed May 21 21:27:45 UTC 2014 
State-Changed-Why:  
java/jdk16 and java/diablo-jdk16 were removed in r308619.  Closing. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171014 
>Unformatted:
