aboutsummaryrefslogtreecommitdiffstats
path: root/java/openjdk6/Makefile
blob: 552940426a159ee7a56cc8e6777222b49db57e04 (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
# New ports collection makefile for:    openjdk6
# Date created:         2009/2/21
# Whom:                 Brian Gardner <brian@experts-exchange.com>
#
# $FreeBSD$
#

PORTNAME=   openjdk6
PORTVERSION=    b14
CATEGORIES= java devel
MASTER_SITES=   http://filedb.experts-exchange.com/incoming/2009/02_w07/104611/ \
        http://filedb.experts-exchange.com/incoming/2009/02_w08/108800/
DISTNAME=   openjdk-6-src-${PORTVERSION}-${OPENJDK_BUILDDATE}
DISTFILES=  ${DISTNAME}.zip ${CUSTOM_PATCH_NAME}.zip

MAINTAINER= brian@experts-exchange.com
COMMENT=    Sun\'s java 6 virtual machine release under the GNUV2 license

RUN_DEPENDS=    javavm:${PORTSDIR}/java/javavmwrapper

PATCHVERSION=   0.2.1
OPENJDK_BUILDDATE=10-feb-2009
CUSTOM_PATCHES_PREFIX=  jdk7_bsd_changes_20090203
CUSTOM_PATCH_NAME=  patch-${PORTNAME}-freebsd-${PATCHVERSION}
CUSTOM_UNZIPPED_PATCH_NAME= patch_${PORTNAME}_freebsd_${PATCHVERSION}
CUSTOM_PATCH_WRKSRC=    $(WRKDIR)/$(CUSTOM_UNZIPPED_PATCH_NAME)

OPTIONS=    DEBUG   "Enable debugging support"  off \
        IPV6    "Enable IPv6 support"   off \
        WEB "Enable the browser plugin and Java Web Start"  on \
        POLICY  "Install the Unlimited Strength Policy Files"   off \

# java extracts directly to the cwd
WRKSRC= $(WRKDIR)

USE_GMAKE=  yes
USE_JAVA=   yes
JAVA_VENDOR=    freebsd bsdjava
JAVA_VERSION=   1.6
USE_MOTIF=  yes
USE_ANT=    yes
USE_XLIB=   yes

LIB_DEPENDS+=   cups.2:${PORTSDIR}/print/cups-base
LIB_DEPENDS+=   freetype.9:${PORTSDIR}/print/freetype2
BUILD_DEPENDS+= $(LOCALBASE)/include/X11/Xlib.h:${PORTSDIR}/x11/xorg-libraries
BUILD_DEPENDS+= $(JAVAJARDIR)/jdk-7-icedtea-plugs/jre/lib/rt-closed.jar:${PORTSDIR}/java/icedtea6-stubs

.include <bsd.port.pre.mk>

.if defined(WITH_IPV6)
CATEGORIES+=    ipv6
.endif

# we set the arch to i586 to simulate linux.
# there is probably a better way to due this
.if ${ARCH} == "i386"
ARCH=   i586
.endif

OPENJDK_OSARCH= bsd-${ARCH}

ONLY_FOR_ARCHS= amd64 i586

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

MAKE_ENV=   LANG=C LC_ALL=C ALT_BOOTDIR=${BOOTSTRAP_JDKS} \
        ALT_HOTSPOT_IMPORT_PATH=${BOOTSTRAP_JDKS} \
        ALT_JDK_IMPORT_PATH=${BOOTSTRAP_JDKS} \
        ALT_FREETYPE_HEADERS_PATH=${LOCALBASE}/include \
        ALT_FREETYPE_LIB_PATH=${LOCALBASE}/lib \
        ALT_BINARY_PLUGS_PATH=$(JAVAJARDIR)/jdk-7-icedtea-plugs \
        ANT_HOME=${LOCALBASE} NO_DOCS=true ALT_CUPS_HEADERS_PATH=${LOCALBASE}/include

.if !defined(WITH_IPV6)
MAKE_ENV+=  DONT_ENABLE_IPV6="YES"
.endif

.if defined(WITH_DEBUG)
MAKE_ENV+=  SKIP_DEBUG_BUILD="false"
.endif

# perhaps we could check to see how many processors are availble and set this equivelent to that
MAKE_ENV+= HOTSPOT_BUILD_JOBS=4

JDK_MAJOR_VERSION=  6
POLICYFILE= jce_policy-${JDK_MAJOR_VERSION}.zip

.if defined(WITH_POLICY)
DISTFILES+= ${POLICYFILE}
.endif

.if defined(WITH_POLICY) && !exists(${DISTDIR}/${POLICYFILE})#{
DISTFILE_INSTRUCTIONS =\n\
Due to licensing restrictions, certain files must be fetched manually.\n\n
DISTFILE_INSTRUCTIONS += Please open http://java.sun.com/javase/downloads/index.jsp\n\
in a web browser and follow the \"Download\" link for\n\
\"Other Downloads\" to obtain the JCE policy file, ${POLICYFILE}.\n\
This file must be placed is ${PORTSDIR}/distfiles\n\n
.endif#}

pre-fetch:
.if defined(DISTFILE_INSTRUCTIONS)
    @${PRINTF} "${DISTFILE_INSTRUCTIONS}"
    @exit 1
.endif

pre-patch:
    (cd $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).newfiles/ && ${CP} -Rp ./ $(WRKSRC))
    (cd $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).linuxfiles/ && ${CP} -Rp ./ $(WRKSRC))
    (cd $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).linuxmakefiles/ && ${CP} -Rp ./ $(WRKSRC))
    # these are expected to fail
    ((cd $(WRKSRC) && ${CAT} $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).makepatches/*.patch | ${PATCH} -p1) || true)
    ((cd $(WRKSRC) && ${CAT} $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).linuxpatches/*.patch | ${PATCH} -p1) || true)
    ((cd $(WRKSRC) && ${CAT} $(CUSTOM_PATCH_WRKSRC)/$(CUSTOM_PATCHES_PREFIX).patches/*.patch | ${PATCH} -p1) || true)
    # these patches should apply cleanly
    ((cd $(WRKSRC) && ${CAT} $(CUSTOM_PATCH_WRKSRC)/custom_patches_$(PATCHVERSION)/*.patch | ${PATCH} -p1) || true)

do-install:
    $(MKDIR) ${PREFIX}/openjdk6/
    ${CP} -Rp $(WRKSRC)/build/$(OPENJDK_OSARCH)/j2sdk-image/ ${PREFIX}/openjdk6/
    ${INSTALL_DATA} ${FILESDIR}/cacerts \
          ${PREFIX}/openjdk6/jre/lib/security/cacerts
.if defined(WITH_POLICY)
    ${INSTALL_DATA} ${WRKDIR}/jce/*.jar ${PREFIX}/openjdk6/jre/lib/security
.endif
    @${FIND} -s ${PREFIX}/openjdk6 -not -type d | \
    ${SED} -e 's#^${PREFIX}/##' >> ${TMPPLIST}

.include <bsd.port.post.mk>