From rv@arabica.esil.univ-mrs.fr  Fri May  7 00:24:48 2004
Return-Path: <rv@arabica.esil.univ-mrs.fr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 3AA5216A4CE; Fri,  7 May 2004 00:24:48 -0700 (PDT)
Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 0682743D45; Fri,  7 May 2004 00:24:47 -0700 (PDT)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: from arabica.esil.univ-mrs.fr (localhost.esil.univ-mrs.fr [127.0.0.1])
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10) with ESMTP id i477Ojbw065668;
	Fri, 7 May 2004 09:24:45 +0200 (CEST)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: (from rv@localhost)
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10/Submit) id i477Ojlh065667;
	Fri, 7 May 2004 09:24:45 +0200 (CEST)
	(envelope-from rv)
Message-Id: <200405070724.i477Ojlh065667@arabica.esil.univ-mrs.fr>
Date: Fri, 7 May 2004 09:24:45 +0200 (CEST)
From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc: glewis@freebsd.org, kris@obsecurity.org, znerd@freebsd.org
Subject: [PATCH] net/javadc: fix build on bento
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         66349
>Category:       java
>Synopsis:       [PATCH] net/javadc: fix build on bento [requires bsd.java.mk patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glewis
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 07 00:30:29 PDT 2004
>Closed-Date:    Wed Jun 09 18:20:38 GMT 2004
>Last-Modified:  Wed Jun 09 18:20:38 GMT 2004
>Originator:     Herve Quiroz
>Release:        FreeBSD 5.2.1-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD arabica.esil.univ-mrs.fr 5.2.1-RELEASE-p5 FreeBSD 5.2.1-RELEASE-p5 #2: Tue May  4 21:44:09 CEST
>Description:

- Now bsd.java.mk 2.0 compliant
- Enforce USE_JIKES=no as jikes won't let import statements contain no package
  name
- Enforce JAVA_VERSION=1.3 as JDK 1.4 won't let import statements contain no
  package name
- re-enabled error statements while compiling

NOTE: the patch will not work unless bsd.java.mk itself get patched (the patch
is attached). Indeed, I discovered a new flaw in bsd.java.mk 2.0: JAVAC setting
is done according to JAVA_BUILD but JAVA_BUILD is actually set after JAVAC is
defined. The ChangeLog for bsd.java.mk is the following:

- Switched stage 6 and 7 so JAVAC is no longer empty when not using jikes
- added '-bootclasspath ${JAVA_CLASSES}' to the command-line for JAVAC when
  jikes is used as a substitute for javac.

NOTE2: When jikes is used explicitely (USE_JIKES=yes), the port has to handle
bootclasspath itself.

Generated with FreeBSD Port Tools 0.50
>How-To-Repeat:
>Fix:

--- javadc-0.20.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/javadc.original/Makefile /usr/ports/net/javadc/Makefile
--- /usr/ports/net/javadc.original/Makefile	Fri May  7 08:34:53 2004
+++ /usr/ports/net/javadc/Makefile	Fri May  7 08:48:44 2004
@@ -14,8 +14,9 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Open source Java DirectConnect (TM) command-line client
 
-USE_JAVA=	1.2+
-NEED_JAVAC=	YES
+USE_JAVA=	yes
+JAVA_VERSION=	1.3
+USE_JIKES=	no
 WRKSRC=		${WRKDIR}/DirectConnect${PORTVERSION}
 BUILD_WRKSRC=	${WRKDIR}/classes
 PLIST_SUB=	JAR_DIR=${JAR_DIR} \
@@ -36,7 +37,7 @@
 # as far as build goes... ;)
 do-build:
 	@${MKDIR} ${BUILD_WRKSRC}
-	@${JAVAC} -d ${BUILD_WRKSRC} -classpath ${BUILD_WRKSRC} ${CLASS_SRCDIR}/*.java 2>/dev/null
+	@${JAVAC} -d ${BUILD_WRKSRC} -classpath ${BUILD_WRKSRC} ${CLASS_SRCDIR}/*.java
 	@${CP} ${CLASS_SRCDIR}/*.txt ${BUILD_WRKSRC}
 	@cd ${BUILD_WRKSRC} && ${JAR} -cmf ${JAR_MANIFEST} ${WRKDIR}/${JAR_FILE} *
 
--- javadc-0.20.patch ends here ---


--- bsd.java.mk.patch begins here ---
Index: bsd.java.mk
===================================================================
--- bsd.java.mk	(revision 139)
+++ bsd.java.mk	(working copy)
@@ -115,8 +115,8 @@
 #          suitable
 # Stage 4: <REMOVED> (merged in stage 3)
 # Stage 5: Decide the exact JDK to use (or install)
-# Stage 6: Define all settings for the port to use
-# Stage 7: Add any dependencies if necessary
+# Stage 6: Add any dependencies if necessary
+# Stage 7: Define all settings for the port to use
 #
 
 .	if defined(USE_JAVA)
@@ -371,8 +371,38 @@
 JAVA_PORT_VENDOR_DESCRIPTION:=	${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/}
 JAVA_PORT_OS_DESCRIPTION:=		${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/}
 
+#-------------------------------------------------------------------------------
+# Stage 6: Add any dependencies if necessary
+#
+
+# Add the JDK port to the dependencies
+DEPEND_JAVA=	${JAVA}:${PORTSDIR}/${JAVA_PORT}
+# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre
+# (unless NO_BUILD is set)
+.		if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN)
+.			if !defined(NO_BUILD)
+JAVA_BUILD=	jdk
+.			endif
+JAVA_RUN=	jre
+.		endif
+.		if defined(JAVA_EXTRACT)
+EXTRACT_DEPENDS+=	${DEPEND_JAVA}
+.			endif
+.		if defined(JAVA_BUILD)
+.			if defined(NO_BUILD)
+.BEGIN:
+	@${ECHO_CMD} "${PKGNAME}: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
+	@${FALSE}
+.				endif
+BUILD_DEPENDS+=		${DEPEND_JAVA}
+.			endif
+.		if defined(JAVA_RUN)
+RUN_DEPENDS+=		${DEPEND_JAVA}
+.		endif
+
+
 #-----------------------------------------------------------------------------
-# Stage 6: Define all settings for the port to use
+# Stage 7: Define all settings for the port to use
 #
 # At this stage both JAVA_HOME and JAVA_PORT are definitely given a value.
 #
@@ -401,7 +431,7 @@
 .			if (${JAVA_BUILD} == "jdk" || ${JAVA_BUILD} == "JDK") && !defined(JAVAC)
 # Use jikes if available and not explicitly forbidden
 .				if exists(${_JIKES_PATH}) && !defined(USE_JIKES)
-JAVAC=			${_JIKES_PATH}
+JAVAC=			${_JIKES_PATH} -bootclasspath ${JAVA_CLASSES}
 BUILD_DEPENDS+=	${DEPEND_JIKES}
 # Otherwise use 'javac'
 .				else
@@ -438,36 +468,6 @@
 
 
 #-------------------------------------------------------------------------------
-# Stage 7: Add any dependencies if necessary
-#
-
-# Add the JDK port to the dependencies
-DEPEND_JAVA=	${JAVA}:${PORTSDIR}/${JAVA_PORT}
-# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre
-# (unless NO_BUILD is set)
-.		if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN)
-.			if !defined(NO_BUILD)
-JAVA_BUILD=	jdk
-.			endif
-JAVA_RUN=	jre
-.		endif
-.		if defined(JAVA_EXTRACT)
-EXTRACT_DEPENDS+=	${DEPEND_JAVA}
-.			endif
-.		if defined(JAVA_BUILD)
-.			if defined(NO_BUILD)
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
-	@${FALSE}
-.				endif
-BUILD_DEPENDS+=		${DEPEND_JAVA}
-.			endif
-.		if defined(JAVA_RUN)
-RUN_DEPENDS+=		${DEPEND_JAVA}
-.		endif
-
-
-#-------------------------------------------------------------------------------
 # Additional Java support
 
 # Debug target
--- bsd.java.mk.patch ends here ---
>Release-Note:
>Audit-Trail:

From: Yuri Khotyaintsev <yuri@irfu.se>
To: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
Cc: FreeBSD-gnats-submit@freebsd.org, glewis@freebsd.org,
	znerd@freebsd.org
Subject: Re: java/66349: [PATCH] net/javadc: fix build on bento
Date: Fri, 07 May 2004 09:47:10 +0200

 Herve Quiroz wrote:
 
 > - added '-bootclasspath ${JAVA_CLASSES}' to the command-line for JAVAC when
 >   jikes is used as a substitute for javac.
 
 What is the reason for not putting this into bsd.java.mk?
 
 If jikes is installed it will be used to compile a port. And then for a 
 port not to fail it should ether set USE_JIKES=no or add -bootclasspath.
 
 -- 
 
 Yuri Khotyaintsev, PhD
 
 Swedish Institute of Space Physics,  http://www.cluster.irfu.se/yuri 
 
 Uppsala (IRF-U)                      http://ovt.irfu.se

From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To: Yuri Khotyaintsev <yuri@irfu.se>
Cc: FreeBSD-gnats-submit@freebsd.org, glewis@freebsd.org,
	znerd@freebsd.org
Subject: Re: java/66349: [PATCH] net/javadc: fix build on bento
Date: Fri, 7 May 2004 10:15:08 +0200

 Yuri,
 
 
 I'm not sure I get your point here...
 
 On Fri, May 07, 2004 at 09:47:10AM +0200, Yuri Khotyaintsev wrote:
 > Herve Quiroz wrote:
 > 
 > >- added '-bootclasspath ${JAVA_CLASSES}' to the command-line for JAVAC when
 > >  jikes is used as a substitute for javac.
 > 
 > What is the reason for not putting this into bsd.java.mk?
 
 Well actually I put it in bsd.java.mk. This statement is from the
 ChangeLog for bsd.java.mk
 
 > If jikes is installed it will be used to compile a port. And then for a 
 > port not to fail it should ether set USE_JIKES=no or add -bootclasspath.
 
 When nothing is asked by the port, jikes is used if present. This may
 cause problems as jikes requires -bootclasspath to be set to the
 location of the standard Java API classes. Provided this is not needed
 when using the former javac command, and as porter won't know in advance
 if jikes will be used or not (unless the port explicitely requires or
 forbids its use by setting USE_JIKES), he won't be able to set
 -bootclasspath accordingly.
 
 That's why I had to add these arguments when "jikes is used
 [transparently] as a substitute for javac"...
 
 Is this what you were asking for or did I misunderstood you ?
 
 Herve
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Mon May 17 18:44:17 PDT 2004 
State-Changed-Why:  
Ernst, Greg, have you had a chance to review the change to 
bsd.java.mk suggested herein?  Is this significant enough to 
need a full bento run once the change is committed? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66349 
Responsible-Changed-From-To: freebsd-java->glewis 
Responsible-Changed-By: glewis 
Responsible-Changed-When: Fri May 28 09:34:46 PDT 2004 
Responsible-Changed-Why:  
I'll take this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66349 

From: Greg Lewis <glewis@eyesbeyond.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: java/66349: [PATCH] net/javadc: fix build on bento
Date: Fri, 28 May 2004 10:30:33 -0600

 I've replied to Herve with one concern I have.  Otherwise the patch looks
 good.  I'm just waiting for his response before committing.
 
 -- 
 Greg Lewis                          Email   : glewis@eyesbeyond.com
 Eyes Beyond                         Web     : http://www.eyesbeyond.com
 Information Technology              FreeBSD : glewis@FreeBSD.org

Adding to audit trail from misfiled PRs 67233 and 67412:

From: Greg Lewis <glewis@eyesbeyond.com>

 Herve,
 
 I think the bsd.java.mk patch is good. I do have one question before
 committing though.
 
 On Fri, May 07, 2004 at 09:24:45AM +0200, Herve Quiroz wrote:
 > NOTE2: When jikes is used explicitely (USE_JIKES=yes), the port has to handle
 > bootclasspath itself.
 
 Why?  Or to expand further, why set bootclasspath in the case where jikes
 is used implicitly and not set it when jikes is requested explicitly?  I
 can't see a reason to change the behaviour this way.

From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>

 If I understand correctly, you would like to set bootclasspath in any
 case. Or is it the opposite? Something has to be enforced for jikes to
 be used a transparent way instead of javac anyway...
 
 If you meant the first alternative (set bootclasspath in any case), I
 agree with you. BTW, I don't even remember why I complexified this
 one... In such a case, do you want me to provide a new patch?
 
 Herve
State-Changed-From-To: feedback->closed 
State-Changed-By: glewis 
State-Changed-When: Wed Jun 9 18:20:25 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

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