Ticket #20956: Portfile.landonf

File Portfile.landonf, 10.3 KB (added by landonf (Landon Fuller), 13 years ago)

Portfile.openjdk6-b20-landonf

Line 
1# $Id: Portfile 53088 2009-06-29 05:16:32Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                openjdk6
6version             b20
7set builddate 21_jun_2010
8
9categories          java
10maintainers         landonf openmaintainer
11platforms           darwin
12
13homepage            http://openjdk.java.net/
14description         Sun's java 6 virtual machine release under the GPLv2 license
15long_description \
16                    OpenJDK is an open-source implementation of the Java Platform, Standard Edition. \
17                    The version has all of Sun's bug fixes up to JDK 6 Release 11 and should be \
18                    the runtime equivelent to JDK6 Release 11. \
19                    \
20                    Much of the OpenJDK code is licensed under the GPL version 2 with the \
21                    Classpath exception. The Java Hotspot virtual machine source code is \
22                    licensed under the GPL version 2 only.
23
24distname            openjdk-6-src-${version}-${builddate}
25
26set jaxp_build b20
27set jaxp_file jdk6-jaxp-${jaxp_build}.zip
28set jaxws_build b20
29set jaxws_file jdk6-jaxws-${jaxws_build}.zip
30set jaf_build  b20
31set jaf_file jdk6-jaf-${jaf_build}.zip
32
33
34distfiles           ${distname}${extract.suffix} \
35                    ${jaxp_file}:jaxp \
36                    ${jaxws_file}:jaxws \
37                    ${jaf_file}:jaxws
38extract.only        ${distname}${extract.suffix}
39
40master_sites        http://download.java.net/openjdk/jdk6/promoted/${version}/ \
41                    https://jaxp.dev.java.net/files/documents/913/150648/:jaxp \
42                    https://jax-ws.dev.java.net/files/documents/4202/150724/:jaxws \
43                    https://jax-ws.dev.java.net/files/documents/4202/150725/:jaf \
44                    http://icedtea.classpath.org/builds/icedtea6/src/ \
45                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaxp \
46                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaxws \
47                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaf
48
49
50checksums           ${distname}${extract.suffix} \
51                    md5     0b36adbf67e4f261e1b827ed4be4f447 \
52                    sha256  fcf8f1d614e5965e90ef1b1a6d5eecc2bcc3078eaffbb62b83dfba52da62e54b \
53                    \
54                    ${jaxp_file} \
55                    md5     22e95fbdb9fb7d8b6b6fc0a1d76d1fbd \
56                    sha256  d097627d4059d488c5a09d4e33cec275a193d4d8bc0fea8ef4f1337170904156 \
57                    \
58                    ${jaxws_file} \
59                    md5     91adfd41e6f001add4f92ae31216b1e3 \
60                    sha256  0c460583898b968a58bf88eb53f90a0e34369e2562d65fb3a143512dfcaeb3eb \
61                    \
62                    ${jaf_file} \
63                    md5     bc95c133620bd68c161cac9891592901 \
64                    sha256  78c7b5c9d6271e88ee46abadd018a61f1e9645f8936cc8df1617e5f4f5074012
65
66patchfiles          patch-freebsd \
67                    patch-Wformat \
68                    patch-macosx
69#                    patch-stdint
70
71#                    patch-null_word_intptr_t \
72#                    patch-jdk_src_solaris_javavm_include_typedefs__md.h \
73#                    patch-jvm_base_addr \
74#                    patch-jdk_src_share_java.c \
75#                    patch-jdk_src_solaris_native_common_gdefs__md.h \
76#                    patch-10.4-ucontext \
77#                    patch-disable_test_gamma
78
79use_configure        no
80
81depends_lib         port:freetype \
82                    port:dejavu-fonts \
83                    port:openmotif \
84                    port:xorg-libX11 \
85                    port:xorg-libXtst
86depends_build       port:apache-ant
87
88# Check if the boostrap is required
89if {[file exists ${prefix}/share/java/openjdk6/bin/java]} {
90    # A previous OpenJDK6 release is already installed
91    set bootstrapvm "${prefix}/share/java/openjdk6"
92} else {
93    # A bootstrap binary is required to build
94    depends_build-append port:openjdk6_bootstrap
95    set bootstrapvm "${prefix}/share/java/openjdk6_bootstrap"
96}
97
98worksrcdir          "./"
99
100post-extract {
101    set copydirs { \
102        hotspot/src/os/linux/launcher \
103        hotspot/src/os/linux/vm \
104        hotspot/src/os_cpu/linux_x86/vm \
105        hotspot/agent/src/os/linux \
106        hotspot/make/linux \
107        hotspot/make/linux/makefiles \
108        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux \
109        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64 \
110        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86 \
111        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux \
112        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64 \
113        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86 \
114        jdk/src/linux/doc/man \
115    }
116
117    set copyfiles { \
118        corba/make/common/Defs-linux.gmk \
119        corba/make/common/shared/Defs-linux.gmk \
120        hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java \
121        jdk/make/com/sun/tools/attach/mapfile-linux \
122        jdk/make/common/Defs-linux.gmk \
123        jdk/make/common/shared/Defs-linux.gmk \
124        jdk/make/java/nio/mapfile-linux \
125        jdk/make/netbeans/common/architectures/name-Linux.properties \
126        jdk/make/sun/awt/mapfile-vers-linux \
127        jdk/make/tools/sharing/classlist.linux \
128        jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux \
129        jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \
130        jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java \
131        jdk/src/solaris/hpi/include/largefile_linux.h \
132        jdk/src/solaris/native/java/net/linux_close.c \
133        jdk/src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c \
134    }
135
136    # Copy over original Linux sources
137    foreach src ${copydirs} {
138        set dest "${worksrcpath}/[strsed ${src} g/linux/bsd/]"
139
140        # Create the parent directories
141        file mkdir "${dest}"
142
143        # Copy the contents, adjust file contents
144        foreach srcfile [glob -types f "${worksrcpath}/${src}/*"] {
145            set destfile [exec echo "${srcfile}" | sed "s/linux/bsd/g; s/Linux/Bsd/g"]
146
147            copy "${srcfile}" "${destfile}"
148            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
149            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
150        }
151    }
152
153    foreach src ${copyfiles} {
154        set dest "${worksrcpath}/[exec echo ${src} | sed {s/linux/bsd/g; s/Linux/Bsd/g}]"
155        copy "${worksrcpath}/${src}" "${dest}"
156        reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${dest}"
157    }
158
159    # Copy the solaris sources
160    copy "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c" \
161         "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
162    reinplace "s/solaris/bsd/g; s/Solaris/Bsd/g" \
163        "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
164
165
166    copy "${worksrcpath}/jdk/src/share/lib/security/java.security" \
167         "${worksrcpath}/jdk/src/share/lib/security/java.security-openbsd"
168
169    # Configure font paths.
170    copy "${filespath}/fontconfig.properties" \
171        "${worksrcpath}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties"
172    reinplace "s|@PREFIX@|${prefix}|g" \
173        "${worksrcpath}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties"
174}
175
176post-patch {
177    reinplace "s|/lib:/usr/lib|/lib:/usr/lib:${prefix}/lib|" \
178        "${worksrcpath}/hotspot/src/os/bsd/vm/os_bsd.cpp"
179
180    # Enable the unlimited strength policy file
181    reinplace "s|build-policy install-limited|build-policy install-unlimited|g" \
182        "${worksrcpath}/jdk/make/javax/crypto/Makefile"
183}
184
185post-patch {
186    # Work-around small bugs in the b20 patchset:
187
188    # The agent is only supported on FreeBSD
189    file delete -force "${worksrcpath}/hotspot/agent"
190
191    # The unsupported -O1 flag is passed to the Darwin linker
192#    reinplace "s/-Xlinker -O1//g" "${worksrcpath}/corba/make/common/Defs-bsd.gmk"
193
194    # <uncontext.h> is included directly
195#    reinplace "s|\<ucontext\.h\>|\<sys/ucontext.h\>|g" \
196#        "${worksrcpath}/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp" \
197#        "${worksrcpath}/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp"
198
199#    reinplace "s|FORMAT64_MODIFIER \"l\"|FORMAT64_MODIFIER \"ll\"|g" \
200#        "${worksrcpath}/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp"
201}
202
203# Override the overzealous setting of build environmental variables and settings. These
204# assume the use of (a well-behaved) autoconf, and cause an assortment of odd build failures when
205# used with openjdk's build system.
206#
207# Unfortunately there's no simple knob to turn the argument insertion off, so this will
208# probably have to be updated in the future
209build.env {}
210build.pre_args {}
211build.post_args {}
212use_parallel_build no
213
214# Determine the OpenJDK architecture
215#
216# XXX:
217# The openjdk build scripts currently rely on uname -m, which may return i386 or x86_64
218# regardless of the actual supported architecture. I'll be fixing this upstream (using ARCH_DATA_MODEL to
219# let the user select between amd64/i586 on any x86 target), but in the meantime, we use UNAME_MACHINE
220# to override what uname -m returns.
221supported_archs i386 x86_64
222if {${build_arch} == "i386"} {
223    build.env-append "UNAME_MACHINE=i386"
224    set openjdk_datamodel "32"
225    set openjdk_build_arch "i586"
226} elseif {${build_arch} == "x86_64"} {
227    build.env-append "UNAME_MACHINE=amd64"
228
229    set openjdk_datamodel "64"
230    set openjdk_build_arch "amd64"
231} elseif {${build_arch} == "ppc"} {
232    # Currently unsupported
233}
234
235
236build.args \
237    ARCH_DATA_MODEL="${openjdk_datamodel}" \
238    ALT_BOOTDIR="${bootstrapvm}" \
239    ALT_JDK_IMPORT_PATH="${bootstrapvm}" \
240    ALT_DROPS_DIR="${distpath}" \
241    ANT_HOME="${prefix}/share/java/apache-ant" \
242    ALT_FREETYPE_HEADERS_PATH="${prefix}/include" \
243    ALT_FREETYPE_LIB_PATH="${prefix}/lib" \
244    ALT_CUPS_HEADERS_PATH="/usr/include" \
245    ALT_MOTIF_DIR="${prefix}" \
246    ALT_X11_PATH="${prefix}" \
247    ALT_DEVTOOLS_PATH=/usr \
248    ALT_CACERTS_FILE=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts \
249    NO_DOCS=true \
250    BUILD_NUMBER="${version}" \
251    MILESTONE=fcs \
252    HOTSPOT_BUILD_JOBS="${build.jobs}"
253
254destroot {
255    set path "${destroot}${prefix}/share/java/${name}/"
256    xinstall -m 755 -d ${path}
257    system "(cd ${worksrcpath}/build/bsd-${openjdk_build_arch}/j2sdk-image && tar cf - *) | (tar -C ${path} -xf -)"
258}