summaryrefslogtreecommitdiff
path: root/java/jdk16/Makefile
blob: 3ace31bc864faf5334b5a2d392c8c7e36159a4c2 (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
# New ports collection makefile for:	jdk13
# Date created:				10 October 2000
# Whom:					Maxim Sobolev <sobomax@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	jdk
PORTVERSION=	${JDK_VERSION}p${JDK_PATCHSET_VERSION}
PORTREVISION=	4
CATEGORIES=	java devel
MASTER_SITES=	# http://www.sun.com/software/java2/download.html
#		 http://www.eyesbeyond.com/freebsddom/java/jdk13.html
DISTFILES=	j2sdk-${JDK_VERSION:S/./_/g}-src${EXTRACT_SUFX} \
		bsd-jdk131-patches-${JDK_PATCHSET_VERSION}.tar.gz

MAINTAINER=	glewis@FreeBSD.org

BUILD_DEPENDS=	gm4:${PORTSDIR}/devel/m4 \
		zip:${PORTSDIR}/archivers/zip \
		gtar:${PORTSDIR}/archivers/gtar \
		${JDK13DIR}/bin/javac:${PORTSDIR}/java/linux-sun-jdk13 \
		${X11BASE}/lib/libMrm.a:${PORTSDIR}/x11-toolkits/open-motif
.if !defined(WITHOUT_PLUGIN)
BUILD_DEPENDS+=	msgfmt:${PORTSDIR}/devel/gettext
LIB_DEPENDS=	glib12.3:$(PORTSDIR)/devel/glib12 \
		gtk12.2:$(PORTSDIR)/x11-toolkits/gtk12 \
		nspr4.1:$(PORTSDIR)/devel/nspr
.endif
RUN_DEPENDS=	javavm:${PORTSDIR}/java/javavmwrapper \
		${X11BASE}/lib/libMrm.a:${PORTSDIR}/x11-toolkits/open-motif \
		${X11BASE}/lib/X11/fonts/URW/fonts.dir:${PORTSDIR}/x11-fonts/urwfonts

WRKSRC=		${WRKDIR}/j2sdk1.3.1/make

JDK_VERSION=	1.3.1
JDK_PATCHSET_VERSION=	6

.if defined(NATIVE_BOOTSTRAP)
JDK13DIR?=	${LOCALBASE}/jdk${JDK_VERSION}
.else
JDK13DIR?=	${LOCALBASE}/linux-jdk${JDK_VERSION}
.endif

ONLY_FOR_ARCHS=	i386
USE_GMAKE=	yes
RESTRICTED=	"Redistribution of pre-compiled binaries isn't permitted"
MAKE_ENV=	ALT_BOOTDIR="${JDK13DIR}" \
		ALT_MOTIF_DIR="${X11BASE}" \
		OPENWINHOME="${X11BASE}" \
		SYS_CFLAGS="${CFLAGS}" \
		CLASSPATH="" \
		LD_LIBRARY_PATH="" \
		JAVA_COMPILER=""
.if !defined(WITHOUT_PLUGIN)
MAKE_ENV +=	LIBG_HDRS="${LOCALBASE}/include/glib12" \
		GTK_HDRS="${X11BASE}/include/gtk12" \
		LIBIDL_HDRS=
.endif
.if !defined(WITHOUT_PLUGIN)
ALL_TARGET=	all plugin images
.else
ALL_TARGET=	all images
.endif
TAR=		gtar	# Necessary for proper extraction of sources
PLIST_SUB+=	JDK_VERSION=${JDK_VERSION}

JDKIMAGEDIR=	${WRKSRC}/../build/bsd-i386/jdk-image-i386
JDKIMAGEDIR_G=	${WRKSRC}/../build/bsd-i386/jdk-debug-image-i386

SORT?=		/usr/bin/sort
CPIO?=		/usr/bin/cpio

.if defined(NODEBUG)
PLIST_SUB+=	DEBUG:="@comment "
PKGNAMESUFFIX=	-nodebug
.else
PLIST_SUB+=	DEBUG:=""
.endif

.if defined(WITH_NATIVE_THREADS)
PLIST_SUB+=    NATIVE:=""
MAKE_ARGS+=    HPIS="green native"
.else
PLIST_SUB+=    NATIVE:="@comment "
.endif

.if defined(WITHOUT_PLUGIN)
PLIST_SUB+=    PLUGIN:="@comment "
.else
PLIST_SUB+=    PLUGIN:=""
.endif

.if defined(BATCH) || defined(PACKAGE_BUILDING)
IGNORE=		"You can not legally distribute pre-compiled binaries"
.endif

.include <bsd.port.pre.mk>

.for file in ${DISTFILES}
.if !exists(${DISTDIR}/${file})
IGNORE=You must manually fetch the source distribution and FreeBSD patches (${DISTFILES}) from http://www.sun.com/software/java2/download.html and http://www.eyesbeyond.com/freebsddom/java/jdk13.html, place it in ${DISTDIR} and then run make again
.endif
.endfor

pre-patch:
	@cd ${WRKDIR} &&  \
		${CHMOD} -R u+w * && \
		${MKDIR} j2sdk1.3.1/ext/plugin/oji-plugin/include/bsd/jdk12 && \
		${MKDIR} j2sdk1.3.1/ext/plugin/oji-plugin/include/solaris/navig5/private && \
		${MKDIR} j2sdk1.3.1/src/bsd/doc/man && \
		${MKDIR} hotspot1.3.1/build/bsd && \
		${MKDIR} hotspot1.3.1/build/bsd/makefiles && \
		${MKDIR} hotspot1.3.1/build/bsd/package && \
		${MKDIR} hotspot1.3.1/src/os/bsd/launcher && \
		${MKDIR} hotspot1.3.1/src/os/bsd/vm && \
		${MKDIR} hotspot1.3.1/src/os_cpu/bsd_i486/vm && \
			${PATCH} < ${WRKDIR}/jdk131.patches

post-build:
	# Prune empty dirs
	${FIND} ${JDKIMAGEDIR} -type d | ${SORT} -r | \
		${XARGS} ${RMDIR} 2> /dev/null || ${TRUE}
	${FIND} ${JDKIMAGEDIR_G} -type d | ${SORT} -r | \
		${XARGS} ${RMDIR} 2> /dev/null || ${TRUE}

.if !defined(NODEBUG)
pre-install:
	@${ECHO_MSG}
	@${ECHO_MSG} "Please use \`make -DNODEBUG' if you don't want to install libraries and binaries"
	@${ECHO_MSG} "with debugging support."
	@${ECHO_MSG}
.endif

do-install:
	${MKDIR} ${PREFIX}/jdk${JDK_VERSION}
	cd ${JDKIMAGEDIR} && ${FIND} . \
	  | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} ${PREFIX}/jdk${JDK_VERSION}
.if !defined(NODEBUG)
	cd ${JDKIMAGEDIR_G} && ${FIND} . \
	  | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} ${PREFIX}/jdk${JDK_VERSION}
.endif
	${MKDIR} ${PREFIX}/jdk${JDK_VERSION}/jre/lib/ext

post-install:
	@${LOCALBASE}/bin/registervm "${PREFIX}/jdk${JDK_VERSION}/bin/java # FREEBSD-JDK${JDK_VERSION}"
.if !defined(WITHOUT_PLUGIN)
	@${ECHO_MSG}
	@${ECHO_MSG} The use the Java plugin with Mozilla you must create a
	@${ECHO_MSG} symbolic link from
	@${ECHO_MSG}
	@${ECHO_MSG} ${PREFIX}/jdk${JDK_VERSION}/jre/plugin/i386/ns600/libjavaplugin_oji.so
	@${ECHO_MSG}
	@${ECHO_MSG} to your Mozilla plugins directory, which is usually found at
	@${ECHO_MSG}
	@${ECHO_MSG} ${X11BASE}/lib/mozilla/plugins
	@${ECHO_MSG}
.endif

.include <bsd.port.post.mk>