pkgsrc/lang/openjdk8/Makefile

286 lines
10 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.77 2019/03/20 11:10:25 wiz Exp $
2019-02-19 18:04:53 +01:00
DISTNAME= openjdk-1.8.202-20190219
PKGNAME= openjdk8-1.8.202
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL:=openjdk7/}
EXTRACT_SUFX= .tar.xz
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://openjdk.java.net/
COMMENT= Open-source implementation of the Java Platform, Standard Edition
LICENSE= gnu-gpl-v2
DISTFILES= ${DEFAULT_DISTFILES}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
# Use same DIST_SUBDIR as openjdk7 to avoid duplication of common distfiles
DIST_SUBDIR= openjdk7
JAVA_NAME= openjdk8
JAVA_HOME= ${PREFIX}/java/${JAVA_NAME}
JAVA_WRAPPERS= jar java javac javadoc javah javap jcmd jhat jps jstack \
keytool orbd policytool rmid rmiregistry servertool tnameserv
BUILD_DEPENDS+= mozilla-rootcerts>=1.0.20140820nb2:../../security/mozilla-rootcerts
GNU_CONFIGURE= yes
Update to 1.8.192 Changelog: New Features security-libs/javax.net.ssl ➜ Support for Customization of Default Enabled Cipher Suites via System Properties The system property jdk.tls.client.cipherSuites can be used to customize the default enabled cipher suites for the client side of SSL/TLS connections. In a similar way, the system property jdk.tls.server.cipherSuites can be used for customization on the server side. The system properties contain a comma-separated list of supported cipher suite names that specify the default enabled cipher suites. All other supported cipher suites are disabled for this default setting. Unrecognized or unsupported cipher suite names specified in properties are ignored. Explicit setting of enabled cipher suites will override the system properties. Please refer to the "Java Cryptography Architecture Standard Algorithm Name Documentation" for the standard JSSE cipher suite names, and the "Java Cryptography Architecture Oracle Providers Documentation" for the cipher suite names supported by the SunJSSE provider. Note that the actual use of enabled cipher suites is restricted by algorithm constraints. Note also that these system properties are currently supported by the JDK Reference Implementation. They are not guaranteed to be supported by other implementations. Warning: These system properties can be used to configure weak cipher suites, or the configured cipher suites may become more weak over time. We do not recommend using the system properties unless you understand the security implications. Use them at your own risk. See JDK-8162362 Bug Fixes This release contains fixes for security vulnerabilities described in the Oracle Critical Patch Update. For a more complete list of the bug fixes included in this release, see the JDK 8u192 Bug Fixes page. Security bugs: CVE-2018-3183 CVE-2018-3209 CVE-2018-3169 CVE-2018-3149 CVE-2018-3211 CVE-2018-3180 CVE-2018-3214 CVE-2018-3157 CVE-2018-3150 CVE-2018-13785 CVE-2018-3136 CVE-2018-3139
2018-12-12 15:22:11 +01:00
CONFIGURE_SCRIPT= configure
CONFIG_SHELL= bash
CONFIG_SUB_OVERRIDE+= common/autoconf/build-aux/config.sub
2015-02-21 10:55:47 +01:00
CONFIG_GUESS_OVERRIDE+= common/autoconf/build-aux/config.guess
CONFIG_SUB_OVERRIDE+= common/autoconf/build-aux/autoconf-config.sub
2015-02-21 10:55:47 +01:00
CONFIG_GUESS_OVERRIDE+= common/autoconf/build-aux/autoconf-config.guess
USE_LANGUAGES= c c++
USE_TOOLS+= bash gmake pax pkg-config unzip:run zip:run
UNLIMIT_RESOURCES= datasize stacksize
WRKSRC= ${WRKDIR}/openjdk
PLIST_SRC+= ${PLIST_SRC_DFLT}
CHECK_SHLIBS_SKIP+= java/openjdk8/jre/lib/${LIBDIR_ARCH}/libinstrument.so
BUILDLINK_PASSTHRU_DIRS+= ${ALT_BOOTDIR}
PREPEND_PATH+= ${ALT_BOOTDIR}/bin
BUILDLINK_TRANSFORM+= rm:-Werror
CONFIGURE_ARGS+= --disable-option-checking # for --with-libiconv-prefix
CONFIGURE_ARGS+= --prefix=${PREFIX:Q}
CONFIGURE_ARGS+= --build=${MACHINE_GNU_PLATFORM:Q}
CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM:Q}
CONFIGURE_ARGS+= --with-boot-jdk=${ALT_BOOTDIR}
CONFIGURE_ARGS+= --with-zlib=system
CONFIGURE_ARGS+= --with-giflib=bundled
CONFIGURE_ARGS+= --with-cups-include=${BUILDLINK_PREFIX.cups-base}/include
CONFIGURE_ARGS+= --with-freetype-lib=${BUILDLINK_PREFIX.freetype2}/lib
CONFIGURE_ARGS+= --with-freetype-include=${BUILDLINK_PREFIX.freetype2}/include
CONFIGURE_ARGS+= --disable-freetype-bundling
CONFIGURE_ARGS+= --with-jobs=${MAKE_JOBS:U1}
CONFIGURE_ARGS+= --with-num-cores=${MAKE_JOBS:U1}
CONFIGURE_ARGS+= --with-memory-size=768
CONFIGURE_ARGS+= --disable-precompiled-headers
CONFIGURE_ARGS+= --disable-ccache
CONFIGURE_ARGS+= --with-user-release-suffix=pkgsrc_${PKGVERSION}
CONFIGURE_ARGS+= --with-update-version=${PKGVERSION_NOREV:S/1.8.//}
CONFIGURE_ARGS+= --with-extra-ldflags=${LDFLAGS:Q}
CHECK_PORTABILITY_SKIP+= hotspot/test/runtime/*/*.sh
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/bin/[a-ik-z]*
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/bin/j[b-z]*
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/bin/jar*
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/bin/java
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/bin/java[a-z]*
NOT_PAX_MPROTECT_SAFE+= java/openjdk8/jre/bin/*
# Avoid build errors when JAVA_HOME and CLASSPATH are defined by user.
MAKE_ENV+= JAVA_HOME=
MAKE_ENV+= CLASSPATH=
2018-11-12 11:42:07 +01:00
BUILD_OPSYS= ${OPSYS:C/.*BSD/bsd/:S/DragonFly/bsd/:S/SunOS/solaris/:S/Linux/linux/}
BUILD_ARCH= ${MACHINE_ARCH:S/i386/x86/:S/sparc64/sparcv9/:C/^e?arm.*$/arm/}
LIBDIR_ARCH= ${MACHINE_ARCH:S/x86_64/amd64/:S/sparc64/sparcv9/:C/^e?arm.*$/arm/}
BUILDDIR= ${WRKSRC}/build/${BUILD_OPSYS}-${BUILD_ARCH}-normal-${BUILD_VARIANT}-${BUILD_DEBUG_LEVEL}
LD_LIBRARY_PATH= ${WRKDIR}/bootstrap/jre/lib/${LIBDIR_ARCH}:${WRKDIR}/bootstrap/jre/lib/${LIBDIR_ARCH}/jli:${WRKDIR}/bootstrap/jre/lib/${LIBDIR_ARCH}/server
CONFIGURE_ENV+= LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
MAKE_ENV+= LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
CONFIGURE_ENV+= LFLAGS=${LDFLAGS:Q}
MAKE_ENV+= LFLAGS=${LDFLAGS:Q}
BUILDLINK_PASSTHRU_RPATHDIRS+= ${PREFIX}/java/openjdk8/jre/lib/${LIBDIR_ARCH}
PLIST_SUBST+= ARCH=${LIBDIR_ARCH}
PLIST_SUBST+= LOWER_OPSYS=${LOWER_OPSYS:S/sunos/solaris/}
.include "../../mk/compiler.mk"
SUBST_CLASSES+= libpath
SUBST_STAGE.libpath= pre-build
SUBST_FILES.libpath+= hotspot/src/os/bsd/vm/os_bsd.cpp
SUBST_VARS.libpath= PREFIX
CFLAGS+= -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
CXXFLAGS+= -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
2017-12-15 15:27:52 +01:00
CONFIGURE_ENV+= CFLAGS_JDK=${CFLAGS:Q}
CONFIGURE_ENV+= CXXFLAGS_JDK=${CXXFLAGS:Q}
# Fix segfault under NetBSD/amd64 8.99 with GCC 6.4.0
.if !empty(CC_VERSION:Mgcc-[67].*)
CFLAGS+= -fno-lifetime-dse
CFLAGS+= -fno-delete-null-pointer-checks
.endif
.if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc)
MAKE_ENV+= USE_GCC=1
MAKE_ENV+= ARCH_DATA_MODEL=${ABI:Q}
.endif
.if !empty(PKGSRC_COMPILER:Mclang)
Update to 1.8.192 Changelog: New Features security-libs/javax.net.ssl ➜ Support for Customization of Default Enabled Cipher Suites via System Properties The system property jdk.tls.client.cipherSuites can be used to customize the default enabled cipher suites for the client side of SSL/TLS connections. In a similar way, the system property jdk.tls.server.cipherSuites can be used for customization on the server side. The system properties contain a comma-separated list of supported cipher suite names that specify the default enabled cipher suites. All other supported cipher suites are disabled for this default setting. Unrecognized or unsupported cipher suite names specified in properties are ignored. Explicit setting of enabled cipher suites will override the system properties. Please refer to the "Java Cryptography Architecture Standard Algorithm Name Documentation" for the standard JSSE cipher suite names, and the "Java Cryptography Architecture Oracle Providers Documentation" for the cipher suite names supported by the SunJSSE provider. Note that the actual use of enabled cipher suites is restricted by algorithm constraints. Note also that these system properties are currently supported by the JDK Reference Implementation. They are not guaranteed to be supported by other implementations. Warning: These system properties can be used to configure weak cipher suites, or the configured cipher suites may become more weak over time. We do not recommend using the system properties unless you understand the security implications. Use them at your own risk. See JDK-8162362 Bug Fixes This release contains fixes for security vulnerabilities described in the Oracle Critical Patch Update. For a more complete list of the bug fixes included in this release, see the JDK 8u192 Bug Fixes page. Security bugs: CVE-2018-3183 CVE-2018-3209 CVE-2018-3169 CVE-2018-3149 CVE-2018-3211 CVE-2018-3180 CVE-2018-3214 CVE-2018-3157 CVE-2018-3150 CVE-2018-13785 CVE-2018-3136 CVE-2018-3139
2018-12-12 15:22:11 +01:00
CONFIGURE_ARGS+= --with-toolchain-type=clang
MAKE_ENV+= USE_CLANG=true
2015-02-08 18:19:59 +01:00
_WRAP_EXTRA_ARGS.CC+= -Wno-return-type
2015-02-08 18:20:54 +01:00
CWRAPPERS_APPEND.cc+= -Wno-return-type
_WRAP_EXTRA_ARGS.CXX+= -Wno-parentheses -Wno-sign-conversion \
-Wno-shorten-64-to-32 -Wno-conversion \
-Wno-unused-value -Wno-switch-enum -Wno-switch \
-Wno-tautological-compare \
-Wno-delete-non-virtual-dtor \
-Wno-return-type -Wno-unused-parameter \
-Wno-parentheses-equality -Wno-empty-body \
-Wno-format -Wno-dynamic-class-memaccess
CWRAPPERS_APPEND.cxx+= -Wno-parentheses -Wno-sign-conversion \
-Wno-shorten-64-to-32 -Wno-conversion \
-Wno-unused-value -Wno-switch-enum -Wno-switch \
-Wno-tautological-compare \
-Wno-delete-non-virtual-dtor \
-Wno-return-type -Wno-unused-parameter \
-Wno-parentheses-equality -Wno-empty-body \
-Wno-format -Wno-dynamic-class-memaccess
. if ${OPSYS} != "FreeBSD"
_WRAP_EXTRA_ARGS.CXX+= -Wno-new-returns-null
CWRAPPERS_APPEND.cxx+= -Wno-new-returns-null
. endif
BUILDLINK_TRANSFORM+= rm:-fcheck-new
BUILDLINK_TRANSFORM+= rm:-fpch-deps
. if ${MACHINE_ARCH} == "x86_64"
_WRAP_EXTRA_ARGS.CXX+= -mstackrealign
CWRAPPERS_APPEND.cxx+= -mstackrealign
. endif
Update to 1.8.192 Changelog: New Features security-libs/javax.net.ssl ➜ Support for Customization of Default Enabled Cipher Suites via System Properties The system property jdk.tls.client.cipherSuites can be used to customize the default enabled cipher suites for the client side of SSL/TLS connections. In a similar way, the system property jdk.tls.server.cipherSuites can be used for customization on the server side. The system properties contain a comma-separated list of supported cipher suite names that specify the default enabled cipher suites. All other supported cipher suites are disabled for this default setting. Unrecognized or unsupported cipher suite names specified in properties are ignored. Explicit setting of enabled cipher suites will override the system properties. Please refer to the "Java Cryptography Architecture Standard Algorithm Name Documentation" for the standard JSSE cipher suite names, and the "Java Cryptography Architecture Oracle Providers Documentation" for the cipher suite names supported by the SunJSSE provider. Note that the actual use of enabled cipher suites is restricted by algorithm constraints. Note also that these system properties are currently supported by the JDK Reference Implementation. They are not guaranteed to be supported by other implementations. Warning: These system properties can be used to configure weak cipher suites, or the configured cipher suites may become more weak over time. We do not recommend using the system properties unless you understand the security implications. Use them at your own risk. See JDK-8162362 Bug Fixes This release contains fixes for security vulnerabilities described in the Oracle Critical Patch Update. For a more complete list of the bug fixes included in this release, see the JDK 8u192 Bug Fixes page. Security bugs: CVE-2018-3183 CVE-2018-3209 CVE-2018-3169 CVE-2018-3149 CVE-2018-3211 CVE-2018-3180 CVE-2018-3214 CVE-2018-3157 CVE-2018-3150 CVE-2018-13785 CVE-2018-3136 CVE-2018-3139
2018-12-12 15:22:11 +01:00
.else
# GCC
CONFIGURE_ARGS+= --with-toolchain-type=gcc
.endif
.include "bootstrap.mk"
.include "options.mk"
SUBST_CLASSES+= fontpaths
SUBST_STAGE.fontpaths= pre-build
SUBST_MESSAGE.fontpaths= fixing font paths
SUBST_FILES.fontpaths= jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
SUBST_FILES.fontpaths+= jdk/src/solaris/native/sun/awt/fontpath.c
SUBST_SED.fontpaths= -e 's|@PREFIX@|${PREFIX}|g'
SUBST_SED.fontpaths+= -e 's|@BUILDLINK_PREFIX.fontconfig@|${BUILDLINK_PREFIX.fontconfig}|g'
SUBST_CLASSES+= zlibpath
SUBST_STAGE.zlibpath= pre-build
SUBST_FILES.zlibpath= jdk/make/CompileLaunchers.gmk jdk/make/lib/CoreLibraries.gmk
SUBST_FILES.zlibpath+= jdk/make/lib/Awt2dLibraries.gmk jdk/make/lib/ServiceabilityLibraries.gmk
SUBST_VARS.zlibpath= COMPILER_RPATH_FLAG BUILDLINK_PREFIX.zlib
SUBST_VARS.zlibpath+= BUILDLINK_PREFIX.iconv
PLIST_VARS+= i386
.if ${MACHINE_ARCH} == "i386"
PLIST.i386= yes
.endif
PLIST_VARS+= sctp
2018-11-12 11:42:07 +01:00
.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "SunOS" || ${OPSYS} == "Linux"
PLIST.sctp= yes
.endif
post-extract:
# These libs are bundled w/ the netbsd-7 bootstrap to facilitate building with
# MKLLVM=yes / MKGCC=no. Nuke them from bootstrap if they are present in base.
.if exists(/lib/libgcc_s.so.1)
${RM} -f ${ALT_BOOTDIR}/jre/lib/${LIBDIR_ARCH}/libgcc_s.so*
.endif
.if exists(/usr/lib/libstdc++.so.7)
${RM} -f ${ALT_BOOTDIR}/jre/lib/${LIBDIR_ARCH}/libstdc++.so*
.endif
.if defined(TOOLS_PLATFORM.paxctl)
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/[a-ik-z]*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/j[b-z]*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/jar*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/java
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/java[a-z]*
.endif
do-build: ${WRKDIR}/stage3-done
# stage 1 builds a native JDK using the bootstrap binaries
${WRKDIR}/stage1-done:
${_ULIMIT_CMD} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} images
rm -rf ${ALT_BOOTDIR}
cd ${BUILDDIR}/images && mv j2sdk-image ${ALT_BOOTDIR}
.for d in corba hotspot jaxp jaxws langtools tmp
mv ${BUILDDIR}/${d} ${BUILDDIR}/${d}-stage1
.endfor
touch ${.TARGET}
# stage 1.5 reconfigures, since the bootstrap JDK major version might have changed now
${WRKDIR}/stage1_5-done: ${WRKDIR}/stage1-done
.if defined(TOOLS_PLATFORM.paxctl)
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/[a-ik-z]*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/j[b-z]*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/jar*
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/java
${PAXCTL} +m ${WRKDIR}/bootstrap/bin/java[a-z]*
.endif
.if defined(BATCH)
@${RECURSIVE_MAKE} ${MAKEFLAGS} apply-va-hack
.endif
@${STEP_MSG} "Reconfiguring with newly built JDK"
@${RECURSIVE_MAKE} ${MAKEFLAGS} do-configure
touch ${.TARGET}
# stage 2 rebuilds the JDK using native tools
${WRKDIR}/stage2-done: ${WRKDIR}/stage1_5-done
${_ULIMIT_CMD} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} images
touch ${.TARGET}
# stage 3 builds third party add-ons
${WRKDIR}/stage3-done: ${WRKDIR}/stage2-done ${WRKDIR}/cacerts.out
touch ${.TARGET}
${WRKDIR}/cacerts.out:
mkdir ${WRKDIR}/cacerts && cd ${WRKDIR}/cacerts && \
${PREFIX}/sbin/mozilla-rootcerts extract
for cert in ${WRKDIR}/cacerts/*.pem; do \
${INFO_MSG} "Importing $$cert" && \
${SETENV} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} LC_ALL=C \
${ALT_BOOTDIR}/bin/keytool \
-noprompt \
-importcert \
-keystore ${.TARGET} \
-alias `${ECHO} $$cert | sed 's,.*/\\([^/]*\\)\\.pem,\\1,'` \
-file $$cert \
-storepass changeit; \
done
do-install:
${INSTALL_DATA_DIR} ${DESTDIR}${JAVA_HOME}
cd ${BUILDDIR}/images/j2sdk-image && pax -rwpp . \
${DESTDIR}${JAVA_HOME}/.
${INSTALL_DATA} ${WRKDIR}/cacerts.out \
${DESTDIR}${JAVA_HOME}/jre/lib/security/cacerts
rm -f ${DESTDIR}${JAVA_HOME}/include/jni_md.h
ln -s ${LOWER_OPSYS:S/sunos/solaris/}/jni_md.h \
${DESTDIR}${JAVA_HOME}/include/jni_md.h
.if ${OPSYS} == "NetBSD"
TOOLS_PLATFORM.unzip=
.endif
# Include binutils for objcopy and GNU strip on SmartOS
.if ${OS_VARIANT} == "SmartOS"
.include "../../devel/binutils/buildlink3.mk"
BUILDLINK_DEPMETHOD.binutils?= build
MAKE_ENV+= STRIP=${PREFIX}/bin/gstrip
.endif
# disabled the ALSA support for now on BSDs via patch
2018-11-12 11:42:07 +01:00
.if ${OPSYS} == "Linux"
.include "../../audio/alsa-lib/buildlink3.mk"
.endif
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
2018-08-20 18:59:34 +02:00
# Headers from CUPS are required to build the native implementation of
# sun.print.* which is used by java.awt.print.
BUILDLINK_DEPMETHOD.cups-base?= build
.include "../../print/cups-base/buildlink3.mk"
.include "../../mk/java-env.mk"
.include "../../mk/bsd.pkg.mk"