blob: 9f7c4b56874fdf691caac61a6a37d64d2e85e8d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
# $NetBSD: Makefile,v 1.1 2015/02/08 08:41:25 tnn Exp $
DISTNAME= openjdk-1.8.31-20150207
PKGNAME= openjdk8-1.8.31
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 keytool orbd \
policytool rmid rmiregistry servertool tnameserv
BUILD_DEPENDS+= mozilla-rootcerts>=1.0.20140820nb2:../../security/mozilla-rootcerts
GNU_CONFIGURE= yes
CONFIGURE_SCRIPT= common/autoconf/configure
CONFIG_SHELL= bash
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}
BUILDLINK_PASSTHRU_DIRS+= ${ALT_BOOTDIR}
PREPEND_PATH+= ${ALT_BOOTDIR}/bin
CONFIGURE_ARGS+= --with-boot-jdk=${ALT_BOOTDIR}
CONFIGURE_ARGS+= --with-zlib=system
CONFIGURE_ARGS+= --with-giflib=bundled
CONFIGURE_ARGS+= --with-cups=${BUILDLINK_PREFIX.cups}
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-ccache
CONFIGURE_ARGS+= --with-user-release-suffix=pkgsrc_${PKGVERSION}
CONFIGURE_ARGS+= --with-update-version=u${PKGVERSION_NOREV:S/1.8.//}
ALL_ENV+= PKGSRC_BOOT_JDK_JVMARGS="-XX:+UseSerialGC -Xmx768M"
ALL_ENV+= PKGSRC_BOOT_JDK_TOOLARGS="-J-XX:+UseSerialGC -J-Xmx768M"
CHECK_PORTABILITY_SKIP+= hotspot/test/runtime/*/*.sh
# Avoid build errors when JAVA_HOME and CLASSPATH are defined by user.
MAKE_ENV+= JAVA_HOME=
MAKE_ENV+= CLASSPATH=
BUILDDIR= ${WRKSRC}/build/${OPSYS:C/.*BSD/bsd/:S/DragonFly/bsd/:S/SunOS/solaris/}-${MACHINE_ARCH:S/i386/x86/}-normal-${BUILD_VARIANT}-${BUILD_DEBUG_LEVEL}
LD_LIBRARY_PATH= ${WRKDIR}/bootstrap/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}:${WRKDIR}/bootstrap/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}/jli:${WRKDIR}/bootstrap/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}/server
CONFIGURE_ENV+= LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
MAKE_ENV+= LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
BUILDLINK_PASSTHRU_RPATHDIRS+= ${PREFIX}/java/openjdk8/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}
PLIST_SUBST+= ARCH=${MACHINE_ARCH:S/x86_64/amd64/}
PLIST_SUBST+= LOWER_OPSYS=${LOWER_OPSYS}
.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
.if !empty(PKGSRC_COMPILER:Mclang)
_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
.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'
post-extract:
.if ${OPSYS} == "SunOS"
${MKDIR} ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/include ${ALT_BOOTDIR}/include
${LN} -s ${JDK_BOOTDIR}/lib ${ALT_BOOTDIR}/lib
${LN} -s ${JDK_BOOTDIR}/bin/java ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/javac ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/javah ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/javap ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/idlj ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/jar ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/native2ascii ${ALT_BOOTDIR}/bin
${LN} -s ${JDK_BOOTDIR}/bin/rmic ${ALT_BOOTDIR}/bin
.elif ${OPSYS} == "NetBSD" && exists(${.CURDIR}/libs)
cp ${.CURDIR}/libs/lib* ${ALT_BOOTDIR}/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}
.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 ${WRKDIR}/stage1-done
# stage 2 rebuilds the JDK using native tools
${WRKDIR}/stage2-done: ${WRKDIR}/stage1-done
${_ULIMIT_CMD} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} images
touch ${WRKDIR}/stage2-done
# stage 3 builds third party add-ons
${WRKDIR}/stage3-done: ${WRKDIR}/stage2-done ${WRKDIR}/cacerts.out
touch ${WRKDIR}/stage3-done
${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 \
${BUILDDIR}/images/j2sdk-image/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}/jni_md.h \
${DESTDIR}${JAVA_HOME}/include/jni_md.h
.if ${OPSYS} == "NetBSD"
TOOLS_PLATFORM.unzip=
.endif
# disabled the ALSA support for now on BSDs via patch
#.include "../../audio/alsa-lib/buildlink3.mk"
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
BUILDLINK_DEPMETHOD.cups?= build
.include "../../print/cups15/buildlink3.mk"
.include "../../mk/java-env.mk"
.include "../../mk/bsd.pkg.mk"
|