aboutsummaryrefslogtreecommitdiffstats
path: root/java/openjdk7/Makefile
blob: c674cc3b3d49c97931141e8a559afde51d7ec134 (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
# New ports collection makefile for:    openjdk7
# Date created:             2 January 2010
# Whom:                 Greg Lewis <glewis@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   openjdk
PORTVERSION=    ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_BUILD_NUMBER}
CATEGORIES= java devel
MASTER_SITES=   http://download.java.net/openjdk/jdk7/promoted/b${JDK_BUILD_NUMBER}/ \
        https://jaxp.dev.java.net/files/documents/913/152561/:jaxp \
        https://jax-ws.dev.java.net/files/documents/4202/152532/:jaxws \
        https://jax-ws.dev.java.net/files/documents/4202/152336/:jaf \
        ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,}
DISTFILES=  ${JDK_SRC_DISTFILE}${EXTRACT_SUFX} \
        ${JAXPFILE}:jaxp \
        ${JAXWSFILE}:jaxws \
        ${JAFFILE}:jaf \
        ${ANT_DISTFILE}${EXTRACT_SUFX}:ant
EXTRACT_ONLY=   ${JDK_SRC_DISTFILE}${EXTRACT_SUFX} \
        ${ANT_DISTFILE}${EXTRACT_SUFX}

MAINTAINER= glewis@FreeBSD.org
COMMENT=    Java Development Kit 7

LICENSE=    GPLv2

WRKSRC=     ${WRKDIR}/${PORTNAME}

USE_ZIP=    YES
MAKE_JOBS_UNSAFE=   YES

JDK_MAJOR_VERSION=  7
JDK_MINOR_VERSION=  0
JDK_BUILD_NUMBER=   117
JDK_BUILD_DATE=     04_nov_2010
JDK_SRC_DISTFILE=   ${PORTNAME}-${JDK_MAJOR_VERSION}-ea-src-b${JDK_BUILD_NUMBER}-${JDK_BUILD_DATE}

# Use our own version of ant to avoid circular dependencies
ANT_VERSION=        1.7.1
ANT_DISTFILE=       apache-ant-${ANT_VERSION}-bin

LATEST_LINK=        openjdk7

USE_GMAKE=  YES
USE_ICONV=  YES
USE_XORG+=  x11 xext xi xrender xt xtst
MAKE_JOBS_UNSAFE=   yes

JAXPFILE=   jaxp-1_4_4.zip
JAXWSFILE=  jdk7-jaxws2_2-2010_08_19.zip
JAFFILE=    jdk7-jaf-2010_08_19.zip

LIB_DEPENDS+=   freetype.9:${PORTSDIR}/print/freetype2
BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip \
        unzip:${PORTSDIR}/archivers/unzip \
        ${LOCALBASE}/include/cups/cups.h:${PORTSDIR}/print/cups-client
RUN_DEPENDS+=   javavm:${PORTSDIR}/java/javavmwrapper

OPENJDK_OSARCH= bsd-${ARCH:S/i386/i586/}
INSTALLDIR= ${PREFIX}/${PORTNAME}${JDK_MAJOR_VERSION}

NOPRECIOUSMAKEVARS= yes

ONLY_FOR_ARCHS= i386 amd64

MAKE_ENV+=  LANG="C" \
        LC_ALL="C" \
        JAVA_HOME="" \
        CLASSPATH="" \
        LD_LIBRARY_PATH="" \
        MAKEFLAGS="" \
        ALT_BOOTDIR="${BOOTSTRAPJDKDIR}" \
        ALT_FREETYPE_HEADERS_PATH="${LOCALBASE}/include" \
        ALT_FREETYPE_LIB_PATH="${LOCALBASE}/lib" \
        ALT_CUPS_HEADERS_PATH="${LOCALBASE}/include" \
        ALT_X11_PATH="${LOCALBASE}" \
        ALT_PKG_PATH="${LOCALBASE}" \
        ALT_PACKAGE_PATH="${LOCALBASE}" \
        ALT_DROPS_DIR="${DISTDIR}" \
        ANT_HOME="${WRKDIR}/apache-ant-${ANT_VERSION}" \
        X11DIR="${LOCALBASE}" \
        LOCALDIR="${LOCALBASE}" \
        NO_DOCS="true" \
        SKIP_COMPARE_IMAGES="true" \
        SKIP_FASTDEBUG_BUILD="true" \
        SKIP_DEBUG_BUILD="true" \
        PTHREAD_LIBS="${PTHREAD_LIBS}" \
        MILESTONE="fcs"

.if !defined(DISABLE_MAKE_JOBS)
.if defined(MAKE_JOBS_NUMBER)
BUILD_JOBS_NUMBER=  ${MAKE_JOBS_NUMBER}
.else
BUILD_JOBS_NUMBER=  `${SYSCTL} -n kern.smp.cpus`
.endif
MAKE_ENV+=  HOTSPOT_BUILD_JOBS=${BUILD_JOBS_NUMBER}
.endif

BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk6 \
        ${LOCALBASE}/jdk1.6.0 \
        ${LOCALBASE}/diablo-jdk1.6.0

.include <bsd.port.pre.mk>

# 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}/diablo-jdk1.6.0
BUILD_DEPENDS+=     ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk16
.endif

post-extract:
    @for dir in `${FIND} ${WRKSRC} -name '*[Ll][Ii][Nn][Uu][Xx]*' -type d`; do \
        ${MKDIR} `echo $$dir | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \
        for subdir in `${FIND} $$dir -type d`; do \
            ${MKDIR} `echo $$subdir | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \
        done; \
        for file in `${FIND} $$dir -type f`; do \
            newfile=`echo $$file | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \
            ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g' $$file > $$newfile; \
        done; \
    done
    @for file in `${FIND} ${WRKSRC} -name '*[Ll][Ii][Nn][Uu][Xx]*' -type f | ${GREP} -v '\/[^/]*[Ll][Ii][Nn][Uu][Xx][^/]*\/'`; do \
        newfile=`echo $$file | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \
        ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g' $$file > $$newfile; \
    done

post-patch:
    @${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \
        ${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp
    @${REINPLACE_CMD} 's|build-policy install-limited|build-policy install-unlimited|' \
        ${WRKSRC}/jdk/make/javax/crypto/Makefile

do-install:
    @${MKDIR} ${INSTALLDIR}
    @cd ${WRKSRC}/build/${OPENJDK_OSARCH}/j2sdk-image && \
        ${COPYTREE_SHARE} . ${INSTALLDIR}
    @for dir in `${FIND} ${INSTALLDIR} -name bin -type d`; do \
        ${CHOWN} -h -R ${BINOWN}:${BINGRP} $$dir; \
        ${FIND} $$dir -type f -exec ${CHMOD} ${BINMODE} "{}" \; ; \
    done
    @${INSTALL_DATA} ${FILESDIR}/cacerts ${INSTALLDIR}/jre/lib/security/cacerts
    @${ECHO} "@unexec ${LOCALBASE}/bin/unregistervm ${INSTALLDIR}/bin/java" >> ${TMPPLIST}
    @${FIND} -s ${INSTALLDIR} -not -type d | ${SORT} | \
        ${SED} -e 's#^${PREFIX}/##' >> ${TMPPLIST}
    @${FIND} ${INSTALLDIR} -type d | ${SORT} -r | \
        ${SED} -e 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
    @${ECHO} "@exec ${LOCALBASE}/bin/registervm '${INSTALLDIR}/bin/java # OpenJDK${JDK_MAJOR_VERSION}'" >> ${TMPPLIST}

post-install:
    # Register the VM
    "${LOCALBASE}/bin/registervm" "${INSTALLDIR}/bin/java # OpenJDK${JDK_MAJOR_VERSION}"

.include <bsd.port.post.mk>