Subject: pkg/32013: Java Build/Detection broken on Darwin
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <cyber@netbsd.org>
List: pkgsrc-bugs
Date: 11/08/2005 07:49:00
>Number:         32013
>Category:       pkg
>Synopsis:       Java Build/Detection broken on Darwin
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 08 07:49:00 +0000 2005
>Originator:     Erik Berls
>Release:        OS X.4.3
>Organization:
>Environment:
Darwin jonestown.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct  3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc

>Description:
Java detection and handling is broken under Darwin.

The Makefiles for sun-jre14 and sun-jre15 do not contain code similar to sun-jre13.  In addition, mk/java-vm.mk does not contain allowance for using later Java versions.

When trying to "build" sun-jre13 an attempt to run the patch code is run, despite NO_PATCH, NO_CONFIGURE, and NO_BUILD being set for Darwin.  This fails as DISTFILES has been set to "" preventing anything from being extracted, thus causing directories to be missing.

NO_PATCH is listed as depricated in pkgtools/pkglint/files/deprecated.map, noting to merely remove it from Makefiles when encountered.  NO_PATCH is used in 6 other packages, half of them in Makefile.common's.

>How-To-Repeat:
Build jakarta-tomcat5 or jakarta-tomcat55 under OS X.

>Fix:
An abstract detection mechanism for builtin java should be used.

Code could be employed to detect what versions are installed on a Darwin system.   
e.g.:
if exists(/System/Library/Frameworks/JavaVM.framework/Versions/${_BUILTIN_JAVA_VERSION}/Home)
(This line pulled from danw@netbsd.orgs posting to tech-pkg on 2004/09/06.)

Some code could be used to unify the Makefile.common that exists in sun-jre1[345].



I'll try to come up with some detection code, but someone more familiar with the framework might better chime in with a good mechanism moving forward.