Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / openjdk7 / Makefile
blob54ab7f32f6d50a7d87004eef757211b2a71a036f
1 # $NetBSD: Makefile,v 1.44 2013/04/06 11:39:26 rodent Exp $
3 DISTNAME= openjdk-7-fcs-src-b147-27_jun_2011
4 PKGNAME= openjdk7-1.7.0.147.20110811
5 PKGREVISION= 9
6 CATEGORIES= lang
7 MASTER_SITES= ${MASTER_SITE_LOCAL:=openjdk7/}
8 EXTRACT_SUFX= .tar.bz2
10 MAINTAINER= pkgsrc-users@NetBSD.org
11 HOMEPAGE= http://openjdk.java.net/
12 COMMENT= Open-source implementation of the Java Platform, Standard Edition
13 LICENSE= gnu-gpl-v2
15 DISTFILES= ${DEFAULT_DISTFILES}
16 EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
18 # diff between distfile and bsd-port branch. To check out, use:
19 # "hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port/"
20 PATCHFILES+= jdk-7-bsd-port-147.20110811.diff.bz2
21 PATCH_SITES+= ${MASTER_SITE_LOCAL:=openjdk7/}
23 CACERTS= cacerts-20091013.tar.bz2
24 DISTFILES+= ${CACERTS}
25 EXTRACT_ONLY+= ${CACERTS}
27 JAVA_NAME= openjdk7
28 JAVA_HOME= ${PREFIX}/java/${JAVA_NAME}
29 JAVA_WRAPPERS= jar java javac javadoc javah javap keytool orbd \
30 policytool rmid rmiregistry servertool tnameserv
32 MAKE_ENV+= PKGSRC_ZIPEXE=${TOOLS_PATH.zip}
33 MAKE_ENV+= PKGSRC_UNZIP=${TOOLS_PATH.unzip}
34 MAKE_ENV+= PKGSRC_UNZIPSFX=${TOOLS_PATH.unzip}sfx
36 DEPENDS+= dejavu-ttf-[0-9]*:../../fonts/dejavu-ttf
37 #DEPENDS+= ja-sazanami-ttf-[0-9]*:../../fonts/ja-sazanami-ttf
38 #DEPENDS+= baekmuk-ttf-[0-9]*:../../fonts/baekmuk-ttf
40 NO_CONFIGURE= yes
41 USE_LANGUAGES= c c++
42 USE_TOOLS+= gmake pax unzip:run zip:run patch
43 UNLIMIT_RESOURCES= datasize stacksize
44 WRKSRC= ${WRKDIR}/openjdk
46 BUILDLINK_PASSTHRU_DIRS+= ${ALT_BOOTDIR}
47 PREPEND_PATH+= ${ALT_BOOTDIR}/bin
49 MAKE_ENV+= ALT_BOOTDIR=${ALT_BOOTDIR}
50 MAKE_ENV+= ALT_DROPS_DIR=${DISTDIR}/${DIST_SUBDIR}
51 MAKE_ENV+= ALT_FREETYPE_LIB_PATH=${BUILDLINK_PREFIX.freetype2}/lib
52 MAKE_ENV+= ALT_FREETYPE_HEADERS_PATH=${BUILDLINK_PREFIX.freetype2}/include
53 MAKE_ENV+= ALT_CUPS_HEADERS_PATH=${BUILDLINK_PREFIX.cups}/include
54 MAKE_ENV+= ALT_COMPILER_PATH=${WRAPPER_DIR}/bin
55 MAKE_ENV+= ALT_PACKAGE_PATH=${PREFIX}
56 MAKE_ENV+= ALT_X11_PATH=${X11BASE}
57 MAKE_ENV+= RHINO_JAR=${WRKDIR}/${RHINO}/js.jar
59 MAKE_ENV+= ALT_PARALLEL_COMPILE_JOBS=${MAKE_JOBS:U1}
60 MAKE_ENV+= HOTSPOT_BUILD_JOBS=${MAKE_JOBS}
62 MAKE_ENV+= HOTSPOT_BUILD_USER=pkgsrc
63 MAKE_ENV+= NO_DOCS=true
64 MAKE_ENV+= SKIP_COMPARE_IMAGES=true
65 MAKE_ENV+= SKIP_FASTDEBUG_BUILD=yes
66 MAKE_ENV+= SKIP_DEBUG_BUILD=yes
68 # Avoid build errors when JAVA_HOME and CLASSPATH are defined by user.
69 MAKE_ENV+= JAVA_HOME=
70 MAKE_ENV+= CLASSPATH=
72 MAKE_ENV+= EXTRA_CFLAGS="-DDEFAULT_LIBPATH=\\\"${PREFIX}/lib/jni:${PREFIX}/lib:/lib:/usr/lib\\\""
73 BUILDDIR= ${WRKSRC}/build/${OPSYS:C/.*BSD/bsd/:S/DragonFly/bsd/}-${MACHINE_ARCH:S/i386/i586/:S/x86_64/amd64/}
74 MAKE_ENV+= LD_LIBRARY_PATH=${BUILDDIR}/lib/${MACHINE_ARCH:S/i386/i586/:S/x86_64/amd64/}
75 BUILDLINK_PASSTHRU_RPATHDIRS+= ${PREFIX}/java/openjdk7/jre/lib/${MACHINE_ARCH:S/x86_64/amd64/}
77 PLIST_SUBST+= ARCH=${MACHINE_ARCH:S/x86_64/amd64/}
78 PLIST_SUBST+= LOWER_OPSYS=${LOWER_OPSYS}
80 .include "../../mk/compiler.mk"
82 .if !empty(PKGSRC_COMPILER:Mclang)
83 _WRAP_EXTRA_ARGS.CXX+= -Wno-parentheses -Wno-sign-conversion \
84 -Wno-shorten-64-to-32 -Wno-conversion \
85 -Wno-unused-value -Wno-switch-enum -Wno-switch \
86 -Wno-tautological-compare \
87 -Wno-delete-non-virtual-dtor \
88 -Wno-return-type -Wno-unused-parameter \
89 -Wno-parentheses-equality -Wno-empty-body
90 .endif
91 .include "bootstrap.mk"
92 .include "icedtea-extras.mk"
94 .include "options.mk"
96 SUBST_CLASSES+= add-rpaths
97 SUBST_STAGE.add-rpaths= pre-build
98 SUBST_MESSAGE.add-rpaths= adding X11 run path flags to Makefiles
99 SUBST_FILES.add-rpaths= jdk/make/sun/awt/Makefile \
100 jdk/make/sun/awt/mawt.gmk \
101 jdk/make/sun/jawt/Makefile \
102 jdk/make/sun/jdga/Makefile \
103 jdk/make/sun/splashscreen/Makefile \
104 jdk/make/sun/xawt/Makefile
105 SUBST_SED.add-rpaths= -e 's|-L$$(OPENWIN_LIB)|-L$$(OPENWIN_LIB) -Wl,-R$$(OPENWIN_LIB)|g'
107 SUBST_CLASSES+= fontpaths
108 SUBST_STAGE.fontpaths= pre-build
109 SUBST_MESSAGE.fontpaths= fixing font paths
110 SUBST_FILES.fontpaths= jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
111 SUBST_FILES.fontpaths+= jdk/src/solaris/native/sun/awt/fontpath.c
112 SUBST_SED.fontpaths= -e 's|@PREFIX@|${PREFIX}|g'
113 SUBST_SED.fontpaths+= -e 's|@BUILDLINK_PREFIX.fontconfig@|${BUILDLINK_PREFIX.fontconfig}|g'
115 PLIST_VARS+= i386 jce
116 .if ${MACHINE_ARCH} == "i386"
117 PLIST.i386= yes
118 .endif
120 post-extract:
121 chmod +x ${ANT_BIN}/ant
122 cd ${WRKDIR}/${ICEDTEA_WEB}/plugin/icedteanp/java && pax -rw . \
123 ${WRKSRC}/jdk/src/share/classes
124 cd ${WRKDIR}/${ICEDTEA_WEB}/netx && pax -rw . \
125 ${WRKSRC}/jdk/src/share/classes
126 cd ${WRKSRC} && patch -s -p1 < ${WRKDIR}/${ICEDTEA}/patches/rhino.patch
127 mv ${WRKDIR}/bootstrap/bin/java ${WRKDIR}/bootstrap/bin/java-real
128 printf '#!/bin/sh\nexec %s/bootstrap/bin/java-real -mx256m "$$@"\n' \
129 ${WRKDIR} > ${WRKDIR}/bootstrap/bin/java
130 chmod a+x ${WRKDIR}/bootstrap/bin/java
131 .for t in idlj jar javac javah javap native2ascii rmic
132 mv ${WRKDIR}/bootstrap/bin/${t} ${WRKDIR}/bootstrap/bin/${t}-real
133 printf '#!/bin/sh\n\nexec %s/bootstrap/bin/${t}-real -J-mx256m "$$@"\n' \
134 ${WRKDIR} > ${WRKDIR}/bootstrap/bin/${t}
135 chmod a+x ${WRKDIR}/bootstrap/bin/${t}
136 .endfor
138 do-build: ${WRKDIR}/stage3-done
140 # stage 1 builds a native JDK using the bootstrap binaries
141 ${WRKDIR}/stage1-done:
142 ${_ULIMIT_CMD} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM}
143 rm -rf ${WRKDIR}/bootstrap
144 cd ${BUILDDIR} && mv j2sdk-image ${WRKDIR}/bootstrap
145 rm -rf ${BUILDDIR}
146 touch ${WRKDIR}/stage1-done
148 # stage 2 rebuilds the JDK using native tools
149 ${WRKDIR}/stage2-done: ${WRKDIR}/stage1-done
150 ${_ULIMIT_CMD} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM}
151 touch ${BUILDDIR}/j2sdk-image/jre/lib/applet/.keep
152 touch ${WRKDIR}/stage2-done
154 # stage 3 builds third party add-ons
155 ${WRKDIR}/stage3-done: ${WRKDIR}/stage2-done ${WRKDIR}/cacerts.out
156 touch ${WRKDIR}/stage3-done
158 ${WRKDIR}/cacerts.out:
159 for cert in ${WRKDIR}/cacerts/*.crt; do \
160 ${ECHO} yes | LC_ALL=C ${BUILDDIR}/bin/keytool \
161 -importcert \
162 -keystore ${.TARGET} \
163 -alias `${ECHO} $$cert | sed 's,.*/\\([^/]*\\)\\.crt,\\1,'` \
164 -file $$cert \
165 -storepass pkgsrc; \
166 done
168 do-install:
169 ${INSTALL_DATA_DIR} ${DESTDIR}${JAVA_HOME}
170 cd ${BUILDDIR}/j2sdk-image && pax -rwpp . \
171 ${DESTDIR}${JAVA_HOME}/.
172 ${INSTALL_DATA} ${WRKDIR}/cacerts.out \
173 ${DESTDIR}${JAVA_HOME}/jre/lib/security/cacerts
174 rm -f ${DESTDIR}${JAVA_HOME}/include/jni_md.h
175 ln -s ${LOWER_OPSYS}/jni_md.h \
176 ${DESTDIR}${JAVA_HOME}/include/jni_md.h
178 .if !empty(MACHINE_PLATFORM:MNetBSD-4.*-*)
179 MAKE_ENV+= PTHREAD_STACKSIZE=1024
180 .endif
182 .if ${OPSYS} == "NetBSD"
183 TOOLS_PLATFORM.unzip=
184 .endif
186 .include "../../fonts/fontconfig/buildlink3.mk"
187 .include "../../graphics/freetype2/buildlink3.mk"
188 BUILDLINK_DEPMETHOD.cups?= build
189 .include "../../print/cups/buildlink3.mk"
190 .include "../../x11/libXext/buildlink3.mk"
191 .include "../../x11/libXi/buildlink3.mk"
192 BUILDLINK_DEPMETHOD.libXp?= build
193 .include "../../x11/libXp/buildlink3.mk"
194 BUILDLINK_DEPMETHOD.libXt?= build
195 .include "../../x11/libXt/buildlink3.mk"
196 .include "../../x11/libXtst/buildlink3.mk"
197 .include "../../x11/libXrender/buildlink3.mk"
198 .include "../../mk/java-env.mk"
199 .include "../../mk/bsd.pkg.mk"