2014-03-28 22:11:29 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= openjdk
|
2014-04-21 21:30:04 +00:00
|
|
|
PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//}
|
2014-03-28 22:11:29 +00:00
|
|
|
CATEGORIES= java devel
|
2014-03-31 21:01:26 +00:00
|
|
|
MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/:jdk \
|
2014-03-28 22:11:29 +00:00
|
|
|
https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \
|
2014-03-31 21:01:26 +00:00
|
|
|
LOCAL/jkim:jdk,jtreg
|
2014-05-02 18:00:49 +00:00
|
|
|
PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION}
|
2014-04-21 21:30:04 +00:00
|
|
|
DISTNAME= ${PORTNAME}-${JDK_MAJOR_VERSION}-src-b132-03_mar_2014
|
2014-03-28 22:11:29 +00:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:jdk
|
|
|
|
|
|
|
|
MAINTAINER= java@FreeBSD.org
|
2014-05-02 18:00:49 +00:00
|
|
|
COMMENT?= Java Development Kit ${JDK_MAJOR_VERSION}
|
2014-03-28 22:11:29 +00:00
|
|
|
|
|
|
|
LICENSE= GPLv2
|
|
|
|
|
|
|
|
BUILD_DEPENDS= zip:${PORTSDIR}/archivers/zip \
|
|
|
|
${LOCALBASE}/include/cups/cups.h:${PORTSDIR}/print/cups-client \
|
|
|
|
bash:${PORTSDIR}/shells/bash
|
|
|
|
LIB_DEPENDS= libasound.so:${PORTSDIR}/audio/alsa-lib \
|
|
|
|
libfreetype.so:${PORTSDIR}/print/freetype2 \
|
|
|
|
libgif.so:${PORTSDIR}/graphics/giflib
|
|
|
|
RUN_DEPENDS= javavm:${PORTSDIR}/java/javavmwrapper \
|
|
|
|
${LOCALBASE}/lib/X11/fonts/dejavu:${PORTSDIR}/x11-fonts/dejavu
|
|
|
|
|
|
|
|
USES= compiler:features dos2unix gmake iconv pkgconfig shebangfix zip
|
|
|
|
USE_AUTOTOOLS= autoconf
|
|
|
|
USE_XORG= x11 xext xi xrender xt xtst
|
|
|
|
|
2014-04-03 20:54:07 +00:00
|
|
|
.if !exists(/usr/bin/unzip)
|
|
|
|
BUILD_DEPENDS+= ${UNZIP_CMD}:${PORTSDIR}/archivers/unzip
|
|
|
|
.endif
|
|
|
|
|
2014-03-28 22:11:29 +00:00
|
|
|
ONLY_FOR_ARCHS= i386 amd64
|
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}
|
|
|
|
|
2014-04-25 05:02:35 +00:00
|
|
|
DOS2UNIX_FILES= jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties \
|
|
|
|
nashorn/test/script/jfx.js
|
2014-03-28 22:11:29 +00:00
|
|
|
SHEBANG_FILES= configure
|
|
|
|
|
|
|
|
_MAKE_JOBS= #
|
|
|
|
CPPFLAGS+= -I${LOCALBASE}/include
|
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib
|
|
|
|
MAKE_ENV= LANG="C" LC_ALL="C"
|
|
|
|
MAKE_ENV+= CLASSPATH="" JAVA_HOME="" LD_LIBRARY_PATH="" MAKEFLAGS=""
|
|
|
|
MAKE_ENV+= IGNORE_OLD_CONFIG=true
|
|
|
|
|
|
|
|
JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-normal-server-${JDK_BUILD_TYPE}
|
2014-05-02 18:00:49 +00:00
|
|
|
.if !defined(BUILD_JRE)
|
2014-03-28 22:11:29 +00:00
|
|
|
JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/j2sdk-image
|
2014-05-02 18:00:49 +00:00
|
|
|
JRE_IMAGEDIR= ${JDK_BUILDDIR}/images/j2sdk-image/jre
|
|
|
|
.else
|
|
|
|
JRE_IMAGEDIR= ${JDK_BUILDDIR}/images/j2re-image
|
|
|
|
.endif
|
2014-03-28 22:11:29 +00:00
|
|
|
JDK_OSARCH= bsd-${ARCH:S/i386/x86/:S/amd64/x86_64/}
|
2014-05-02 18:00:49 +00:00
|
|
|
INSTALLDIR= ${PREFIX}/${PKGBASE}
|
2014-03-28 22:11:29 +00:00
|
|
|
|
2014-04-25 05:02:35 +00:00
|
|
|
NO_CCACHE= yes
|
2014-03-28 22:11:29 +00:00
|
|
|
NOPRECIOUSMAKEVARS= yes
|
|
|
|
|
|
|
|
JDK_MAJOR_VERSION= 8
|
2014-07-20 17:00:57 +00:00
|
|
|
JDK_UPDATE_VERSION= 11
|
|
|
|
JDK_BUILD_NUMBER= 12
|
2014-03-28 22:11:29 +00:00
|
|
|
JTREG_VERSION= 4.1
|
|
|
|
JTREG_BUILD_NUMBER= b08
|
|
|
|
JTREG_JENKINS_BUILD= 77
|
|
|
|
|
|
|
|
CONFIGURE_ARGS= --with-boot-jdk=${BOOTSTRAPJDKDIR}
|
2014-04-21 21:30:04 +00:00
|
|
|
CONFIGURE_ARGS+= --with-build-number="b${JDK_BUILD_NUMBER}"
|
|
|
|
.if ${JDK_UPDATE_VERSION} > 0
|
|
|
|
CONFIGURE_ARGS+= --with-update-version=${JDK_UPDATE_VERSION}
|
2014-03-28 22:11:29 +00:00
|
|
|
.endif
|
2014-04-25 05:02:35 +00:00
|
|
|
CONFIGURE_ARGS+= --disable-ccache \
|
|
|
|
--disable-freetype-bundling \
|
2014-03-28 22:11:29 +00:00
|
|
|
--disable-zip-debug-info \
|
|
|
|
--with-alsa=${LOCALBASE} \
|
|
|
|
--with-cacerts-file=${FILESDIR}/cacerts \
|
|
|
|
--with-cups=${LOCALBASE} \
|
|
|
|
--with-debug-level=${JDK_BUILD_TYPE} \
|
|
|
|
--with-freetype=${LOCALBASE} \
|
|
|
|
--with-freetype-include=${LOCALBASE}/include/freetype2 \
|
|
|
|
--with-giflib=system \
|
|
|
|
--with-jobs=${MAKE_JOBS_NUMBER} \
|
|
|
|
--with-milestone=fcs \
|
|
|
|
--with-zlib=system
|
|
|
|
CONFIGURE_SCRIPT= ../../configure
|
|
|
|
CONFIGURE_WRKSRC= ${WRKSRC}/common/autoconf
|
|
|
|
|
2014-05-02 18:00:49 +00:00
|
|
|
OPTIONS_DEFINE= POLICY TZUPDATE
|
|
|
|
OPTIONS_DEFAULT= POLICY TZUPDATE
|
|
|
|
POLICY_DESC= Install the Unlimited Strength Policy Files
|
|
|
|
TZUPDATE_DESC= Update the time zone data
|
|
|
|
|
|
|
|
POLICY_CONFIGURE_ENABLE=unlimited-crypto
|
|
|
|
TZUPDATE_RUN_DEPENDS= ${LOCALBASE}/share/java/zi:${PORTSDIR}/java/java-zoneinfo
|
|
|
|
|
2014-05-15 23:53:56 +00:00
|
|
|
JAVAVMS_COMMENT= OpenJDK${JDK_MAJOR_VERSION}
|
|
|
|
|
2014-05-02 18:00:49 +00:00
|
|
|
.if !defined(BUILD_JRE)
|
|
|
|
OPTIONS_DEFINE+= TEST
|
|
|
|
OPTIONS_DEFAULT+= RELEASE
|
2014-03-28 22:11:29 +00:00
|
|
|
OPTIONS_SINGLE= BUILD
|
|
|
|
OPTIONS_SINGLE_BUILD= DEBUG DEBUGFAST RELEASE
|
|
|
|
BUILD_DESC= Select OpenJDK build type
|
|
|
|
DEBUG_DESC= Build for debugging (without optimizations)
|
|
|
|
DEBUGFAST_DESC= Build for debugging (with optimizations)
|
|
|
|
RELEASE_DESC= Build for release (default)
|
|
|
|
TEST_DESC= Run regression tests
|
|
|
|
|
|
|
|
RELEASE_CONFIGURE_ON= --disable-debug-symbols
|
|
|
|
TEST_ALL_TARGET= test
|
|
|
|
TEST_CONFIGURE_ON= --with-jtreg=${WRKDIR}/jtreg
|
|
|
|
TEST_DISTFILES= jtreg${JTREG_VERSION}-${JTREG_BUILD_NUMBER}.tar.gz:jtreg
|
2014-05-02 18:00:49 +00:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --disable-debug-symbols
|
2014-05-15 23:53:56 +00:00
|
|
|
JAVAVMS_COMMENT+= JRE
|
2014-05-02 18:00:49 +00:00
|
|
|
.endif
|
2014-03-28 22:11:29 +00:00
|
|
|
|
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MDEBUG}
|
|
|
|
JDK_BUILD_TYPE= slowdebug
|
|
|
|
.elif ${PORT_OPTIONS:MDEBUGFAST}
|
|
|
|
JDK_BUILD_TYPE= fastdebug
|
2014-05-02 18:00:49 +00:00
|
|
|
.else
|
2014-03-28 22:11:29 +00:00
|
|
|
JDK_BUILD_TYPE= release
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk8 \
|
|
|
|
${LOCALBASE}/openjdk7
|
|
|
|
|
|
|
|
# do we have valid native jdk installed?
|
|
|
|
.for BJDK in ${BOOTSTRAP_JDKS}
|
|
|
|
. if !defined(BOOTSTRAPJDKDIR) && exists(${BJDK}/bin/javac)
|
|
|
|
BOOTSTRAPJDKDIR= ${BJDK}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# if no valid jdk found, set dependency
|
|
|
|
.if !defined(BOOTSTRAPJDKDIR)
|
|
|
|
BOOTSTRAPJDKDIR?= ${LOCALBASE}/openjdk7
|
|
|
|
BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/openjdk7
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${COMPILER_TYPE} == clang
|
|
|
|
MAKE_ENV+= USE_CLANG=true
|
|
|
|
.if ${COMPILER_FEATURES:Mlibc++}
|
|
|
|
CONFIGURE_ENV= LIBCXX="-lc++"
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if empty(ICONV_LIB)
|
|
|
|
ICONV_CPPFLAGS= -DLIBICONV_PLUG
|
|
|
|
.else
|
|
|
|
ICONV_CPPFLAGS= -I${LOCALBASE}/include
|
|
|
|
ICONV_LDFLAGS= -L${LOCALBASE}/lib ${ICONV_LIB}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-extract:
|
2014-05-01 04:43:39 +00:00
|
|
|
@${MV} -f ${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-debug \
|
|
|
|
${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-debug.macosx
|
|
|
|
@${MV} -f ${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-product \
|
|
|
|
${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-product.macosx
|
|
|
|
@${CP} -f ${WRKSRC}/hotspot/make/linux/makefiles/mapfile-vers-debug \
|
|
|
|
${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-debug
|
|
|
|
@${CP} -f ${WRKSRC}/hotspot/make/linux/makefiles/mapfile-vers-product \
|
|
|
|
${WRKSRC}/hotspot/make/bsd/makefiles/mapfile-vers-product
|
2014-03-28 22:11:29 +00:00
|
|
|
@${MKDIR} ${WRKSRC}/jdk/src/bsd/classes/java/net \
|
|
|
|
${WRKSRC}/jdk/src/bsd/classes/sun/nio/ch
|
|
|
|
@${MV} -f ${WRKSRC}/jdk/src/macosx/classes/java/net/DefaultInterface.java \
|
|
|
|
${WRKSRC}/jdk/src/bsd/classes/java/net
|
|
|
|
@${MV} -f ${WRKSRC}/jdk/src/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java \
|
|
|
|
${WRKSRC}/jdk/src/bsd/classes/sun/nio/ch
|
|
|
|
@${MV} -f ${WRKSRC}/jdk/src/macosx/classes/sun/nio/ch/KQueue*.java \
|
|
|
|
${WRKSRC}/jdk/src/solaris/classes/sun/nio/ch
|
|
|
|
@${MV} -f ${WRKSRC}/jdk/src/macosx/native/sun/nio/ch/KQueue*.c \
|
|
|
|
${WRKSRC}/jdk/src/solaris/native/sun/nio/ch
|
|
|
|
@${RMDIR} ${WRKSRC}/jdk/src/macosx/classes/java/net \
|
|
|
|
${WRKSRC}/jdk/src/macosx/native/sun/nio/ch \
|
|
|
|
${WRKSRC}/jdk/src/macosx/native/sun/nio
|
2014-04-29 05:25:45 +00:00
|
|
|
@${CP} -f ${WRKSRC}/jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd \
|
|
|
|
${WRKSRC}/jdk/src/solaris/classes/java/lang/UNIXProcess.java.macosx
|
2014-05-01 04:43:39 +00:00
|
|
|
@${CP} -f ${FILESDIR}/jdk-test-javax-imageio-plugins-jpeg-truncated.jpg \
|
|
|
|
${WRKSRC}/jdk/test/javax/imageio/plugins/jpeg/truncated.jpg
|
2014-03-28 22:11:29 +00:00
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${SED} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
|
|
|
|
${FILESDIR}/bsd.fontconfig.properties.in > \
|
|
|
|
${WRKSRC}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
|
|
|
|
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
|
2014-04-28 19:27:48 +00:00
|
|
|
${WRKSRC}/common/autoconf/toolchain.m4 \
|
2014-03-28 22:11:29 +00:00
|
|
|
${WRKSRC}/configure \
|
|
|
|
${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java \
|
2014-05-21 20:06:16 +00:00
|
|
|
${WRKSRC}/jdk/src/share/classes/sun/print/PSPrinterJob.java \
|
2014-03-28 22:11:29 +00:00
|
|
|
${WRKSRC}/jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java
|
2014-04-28 19:27:48 +00:00
|
|
|
@${REINPLACE_CMD} -e 's|/usr/local/java/classes|${LOCALBASE}/share/java/classes|' \
|
|
|
|
${WRKSRC}/jdk/src/bsd/doc/man/*.1
|
2014-03-28 22:11:29 +00:00
|
|
|
@${REINPLACE_CMD} -e 's|%%ICONV_CPPFLAGS%%|${ICONV_CPPFLAGS}|' \
|
|
|
|
-e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \
|
2014-05-15 23:53:56 +00:00
|
|
|
${WRKSRC}/jdk/make/lib/Awt2dLibraries.gmk \
|
2014-03-28 22:11:29 +00:00
|
|
|
${WRKSRC}/jdk/make/lib/CoreLibraries.gmk \
|
|
|
|
${WRKSRC}/jdk/make/lib/ServiceabilityLibraries.gmk
|
|
|
|
@${CHMOD} 755 ${WRKSRC}/configure
|
|
|
|
|
|
|
|
post-build:
|
2014-05-02 18:00:49 +00:00
|
|
|
.if !defined(BUILD_JRE)
|
2014-03-28 22:11:29 +00:00
|
|
|
@${JDK_IMAGEDIR}/bin/jar cfe \
|
2014-05-02 18:00:49 +00:00
|
|
|
${JRE_IMAGEDIR}/lib/compilefontconfig.jar \
|
2014-03-28 22:11:29 +00:00
|
|
|
build.tools.compilefontconfig.CompileFontConfig \
|
|
|
|
-C ${JDK_BUILDDIR}/jdk/btclasses build/tools/compilefontconfig
|
|
|
|
@${JDK_IMAGEDIR}/bin/jar cfe \
|
2014-05-02 18:00:49 +00:00
|
|
|
${JRE_IMAGEDIR}/lib/javazic.jar \
|
2014-03-28 22:11:29 +00:00
|
|
|
build.tools.tzdb.TzdbZoneRulesCompiler \
|
|
|
|
-C ${JDK_BUILDDIR}/jdk/btclasses build/tools/tzdb
|
2014-05-02 18:00:49 +00:00
|
|
|
.endif
|
2014-03-28 22:11:29 +00:00
|
|
|
.if ${PORT_OPTIONS:MTZUPDATE}
|
|
|
|
@# Update time zones
|
2014-05-02 18:00:49 +00:00
|
|
|
@${RM} -rf ${JRE_IMAGEDIR}/lib/zi
|
|
|
|
@${LN} -sf ${LOCALBASE}/share/java/zi ${JRE_IMAGEDIR}/lib
|
2014-03-28 22:11:29 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
@${MKDIR} ${STAGEDIR}${INSTALLDIR}
|
2014-05-02 18:00:49 +00:00
|
|
|
.if !defined(BUILD_JRE)
|
|
|
|
@cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR}
|
2014-05-01 04:43:39 +00:00
|
|
|
@cd ${STAGEDIR}${INSTALLDIR} && \
|
|
|
|
${FIND} bin jre/bin -type f -exec ${CHMOD} ${BINMODE} {} \; && \
|
|
|
|
${CHMOD} ${BINMODE} jre/lib/${ARCH}/jexec \
|
|
|
|
jre/lib/${ARCH}/jspawnhelper lib/${ARCH}/jexec
|
2014-05-02 18:00:49 +00:00
|
|
|
.else
|
|
|
|
@cd ${JRE_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR}
|
|
|
|
@cd ${STAGEDIR}${INSTALLDIR} && \
|
|
|
|
${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \; && \
|
|
|
|
${CHMOD} ${BINMODE} lib/${ARCH}/jexec lib/${ARCH}/jspawnhelper
|
|
|
|
.endif
|
2014-03-28 22:11:29 +00:00
|
|
|
@${ECHO} "@unexec ${LOCALBASE}/bin/unregistervm ${INSTALLDIR}/bin/java" >> ${TMPPLIST}
|
|
|
|
@${FIND} -s ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \
|
|
|
|
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
|
|
|
|
@${FIND} ${STAGEDIR}${INSTALLDIR} -type d | ${SORT} -r | \
|
|
|
|
${SED} -e 's,^${STAGEDIR}${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
|
2014-05-15 23:53:56 +00:00
|
|
|
@${ECHO} "@exec ${LOCALBASE}/bin/registervm '${INSTALLDIR}/bin/java # ${JAVAVMS_COMMENT}'" >> ${TMPPLIST}
|
2014-03-28 22:11:29 +00:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|