aboutsummaryrefslogtreecommitdiffstats
path: root/java/openjdk8/Makefile
blob: 6c447e2fe9f65bc19ac34c0882947f613b55f718 (plain) (blame)
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# $FreeBSD$

PORTNAME=   openjdk
PORTVERSION=    ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//}
PORTREVISION=   1
CATEGORIES= java devel
MASTER_SITES=   http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/:jdk \
        https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \
        LOCAL/jkim:jdk,jtreg
PKGNAMESUFFIX=  ${JDK_MAJOR_VERSION}
DISTNAME=   ${PORTNAME}-${JDK_MAJOR_VERSION}-src-b132-03_mar_2014
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX}:jdk

MAINTAINER= java@FreeBSD.org
COMMENT=    Java Development Kit ${JDK_MAJOR_VERSION}

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

.if !exists(/usr/bin/unzip)
BUILD_DEPENDS+= ${UNZIP_CMD}:${PORTSDIR}/archivers/unzip
.endif

ONLY_FOR_ARCHS= i386 amd64
WRKSRC=     ${WRKDIR}/${PORTNAME}

DOS2UNIX_FILES= jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties \
        nashorn/test/script/jfx.js
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}
JDK_IMAGEDIR=   ${JDK_BUILDDIR}/images/j2sdk-image
JDK_OSARCH= bsd-${ARCH:S/i386/x86/:S/amd64/x86_64/}
INSTALLDIR= ${PREFIX}/${PORTNAME}${JDK_MAJOR_VERSION}

NO_CCACHE=      yes
NOPRECIOUSMAKEVARS= yes

JDK_MAJOR_VERSION=  8
JDK_UPDATE_VERSION= 5
JDK_BUILD_NUMBER=   13
JTREG_VERSION=      4.1
JTREG_BUILD_NUMBER= b08
JTREG_JENKINS_BUILD=    77

CONFIGURE_ARGS=     --with-boot-jdk=${BOOTSTRAPJDKDIR}
CONFIGURE_ARGS+=    --with-build-number="b${JDK_BUILD_NUMBER}"
.if ${JDK_UPDATE_VERSION} > 0
CONFIGURE_ARGS+=    --with-update-version=${JDK_UPDATE_VERSION}
.endif
CONFIGURE_ARGS+=    --disable-ccache \
            --disable-freetype-bundling \
            --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

OPTIONS_DEFINE=     POLICY TEST TZUPDATE
OPTIONS_DEFAULT=    POLICY RELEASE TZUPDATE
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)
POLICY_DESC=        Install the Unlimited Strength Policy Files
RELEASE_DESC=       Build for release (default)
TEST_DESC=      Run regression tests
TZUPDATE_DESC=      Update the time zone data

POLICY_CONFIGURE_ENABLE=unlimited-crypto
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
TZUPDATE_RUN_DEPENDS=   ${LOCALBASE}/share/java/zi:${PORTSDIR}/java/java-zoneinfo

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDEBUG}
JDK_BUILD_TYPE= slowdebug
.elif ${PORT_OPTIONS:MDEBUGFAST}
JDK_BUILD_TYPE= fastdebug
.elif ${PORT_OPTIONS:MRELEASE}
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:
    @${CP} ${FILESDIR}/jdk-test-javax-imageio-plugins-jpeg-truncated.jpg \
        ${WRKSRC}/jdk/test/javax/imageio/plugins/jpeg/truncated.jpg
    @${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

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}|' \
        ${WRKSRC}/configure \
        ${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp \
        ${WRKSRC}/jdk/make/lib/SoundLibraries.gmk \
        ${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java \
        ${WRKSRC}/jdk/src/solaris/bin/java_md_solinux.h \
        ${WRKSRC}/jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java
    @${REINPLACE_CMD} -e 's|%%ICONV_CPPFLAGS%%|${ICONV_CPPFLAGS}|' \
        -e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \
        ${WRKSRC}/jdk/make/lib/CoreLibraries.gmk \
        ${WRKSRC}/jdk/make/lib/ServiceabilityLibraries.gmk
    @${CHMOD} 755 ${WRKSRC}/configure

post-build:
    @${JDK_IMAGEDIR}/bin/jar cfe \
        ${JDK_IMAGEDIR}/jre/lib/compilefontconfig.jar \
        build.tools.compilefontconfig.CompileFontConfig \
        -C ${JDK_BUILDDIR}/jdk/btclasses build/tools/compilefontconfig
    @${JDK_IMAGEDIR}/bin/jar cfe \
        ${JDK_IMAGEDIR}/jre/lib/javazic.jar \
        build.tools.tzdb.TzdbZoneRulesCompiler \
        -C ${JDK_BUILDDIR}/jdk/btclasses build/tools/tzdb
.if ${PORT_OPTIONS:MTZUPDATE}
    @# Update time zones
    @${RM} -rf ${JDK_IMAGEDIR}/jre/lib/zi
    @${LN} -sf ${LOCALBASE}/share/java/zi ${JDK_IMAGEDIR}/jre/lib
.endif

do-install:
    @${MKDIR} ${STAGEDIR}${INSTALLDIR}
    @cd ${JDK_IMAGEDIR} && \
        ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} \
        "-not ( -type d -name bin -prune )"
    @cd ${JDK_IMAGEDIR} && \
        ${COPYTREE_BIN} "bin jre/bin" ${STAGEDIR}${INSTALLDIR}
    @cd ${JDK_IMAGEDIR} && \
        ${INSTALL_PROGRAM} jre/lib/jspawnhelper \
        ${STAGEDIR}${INSTALLDIR}/jre/lib
    @cd ${JDK_IMAGEDIR} && \
        ${INSTALL_PROGRAM} jre/lib/${ARCH}/jexec \
        ${STAGEDIR}${INSTALLDIR}/jre/lib/${ARCH}
    @cd ${JDK_IMAGEDIR} && \
        ${INSTALL_PROGRAM} lib/${ARCH}/jexec \
        ${STAGEDIR}${INSTALLDIR}/lib/${ARCH}
    @${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}
    @${ECHO} "@exec ${LOCALBASE}/bin/registervm '${INSTALLDIR}/bin/java # OpenJDK${JDK_MAJOR_VERSION}'" >> ${TMPPLIST}

.include <bsd.port.post.mk>