source: trunk/dports/java/openjdk6/Portfile @ 51471

Last change on this file since 51471 was 51471, checked in by landonf@…, 11 years ago

Fix build on systems where /usr/local/bin does not exist.

File size: 5.3 KB
Line 
1# $Id: $
2
3PortSystem 1.0
4
5name                openjdk6
6version             b16
7revision            1
8set builddate 24_apr_2009
9
10categories          java
11maintainers         landonf openmaintainer
12platforms           darwin
13
14homepage            http://openjdk.java.net/
15description         Sun's java 6 virtual machine release under the GNUV2 license
16long_description \
17                    OpenJDK is an open-source implementation of the Java Platform, Standard Edition. \
18                    The version has all of Sun's bug fixes up to JDK 6 Release 11 and should be \
19                    the runtime equivelent to JDK6 Release 11. \
20                    \
21                    Much of the OpenJDK code is licensed under the GPL version 2 with the \
22                    Classpath exception. The Java Hotspot virtual machine source code is \
23                    licensed under the GPL version 2 only.
24
25distname            openjdk-6-src-${version}-${builddate}
26master_sites        http://download.java.net/openjdk/jdk6/promoted/${version}/
27checksums           md5     850a29b70206bc7fa083cd26acc781f3 \
28                    sha256  96159489d8b70db275c125b627c6e6912e6c078279d76b968d2e0969359c9420
29
30patchfiles          patch-set \
31                    patch-null_word_intptr_t \
32                    patch-jdk_src_solaris_javavm_include_typedefs__md.h \
33                    patch-jvm_base_addr \
34                    patch-jdk_src_share_java.c \
35                    patch-jdk_src_solaris_native_common_gdefs__md.h \
36                    patch-10.4-ucontext \
37                    patch-disable_test_gamma
38
39use_configure        no
40
41depends_lib         port:freetype \
42                    port:openmotif \
43                    port:xorg-libX11 \
44                    port:xorg-libXtst
45depends_build       port:icedtea6-plugs \
46                    port:apache-ant
47
48# Check if the boostrap is required
49if {[file exists ${prefix}/share/java/openjdk6/bin/java]} {
50    # A previous OpenJDK6 release is already installed
51    set bootstrapvm "${prefix}/share/java/openjdk6"
52} else {
53    # A bootstrap binary is required to build
54    depends_build-append port:openjdk6_bootstrap
55    set bootstrapvm "${prefix}/share/java/openjdk6_bootstrap"
56}
57
58worksrcdir          "./"
59
60post-extract {
61    set copydirs { \
62        hotspot/src/os/linux/launcher \
63        hotspot/src/os/linux/vm \
64        hotspot/src/os_cpu/linux_x86/vm \
65        hotspot/build/linux \
66        hotspot/build/linux/makefiles \
67        jdk/src/linux/doc/man
68    }
69
70    set copyfiles { \
71        corba/make/common/Defs-linux.gmk \
72        corba/make/common/shared/Defs-linux.gmk \
73        jdk/make/common/Defs-linux.gmk \
74        jdk/make/common/shared/Defs-linux.gmk \
75        jdk/make/java/nio/mapfile-linux \
76        jdk/make/netbeans/common/architectures/name-Linux.properties \
77        jdk/make/sun/awt/mapfile-vers-linux \
78        jdk/make/tools/sharing/classlist.linux \
79        jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux \
80        jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.properties \
81        jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \
82        jdk/src/solaris/hpi/include/largefile_linux.h \
83        jdk/src/solaris/native/java/net/linux_close.c \
84        jdk/src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
85    }
86
87    # Copy over original Linux sources
88    foreach src ${copydirs} {
89        set dest "${worksrcpath}/[strsed ${src} g/linux/bsd/]"
90
91        # Create the parent directories
92        file mkdir "${dest}"
93
94        # Copy the contents, adjust file contents
95        foreach srcfile [glob -types f "${worksrcpath}/${src}/*"] {
96            set destfile "${dest}/[strsed [file tail ${srcfile}] g/linux/bsd/]"
97            copy "${srcfile}" "${destfile}"
98            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
99            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
100        }
101    }
102
103    foreach src ${copyfiles} {
104        set dest "${worksrcpath}/[exec echo ${src} | sed {s/linux/bsd/g; s/Linux/Bsd/g}]"
105        copy "${worksrcpath}/${src}" "${dest}"
106        reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${dest}"
107    }
108
109    # Copy the solaris sources
110    copy "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c" \
111         "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
112    reinplace "s/solaris/bsd/g; s/Solaris/Bsd/g" \
113        "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
114
115
116    copy "${worksrcpath}/jdk/src/share/lib/security/java.security" \
117         "${worksrcpath}/jdk/src/share/lib/security/java.security-openbsd"
118}
119
120build.args \
121    ALT_BOOTDIR="${bootstrapvm}" \
122    ALT_BINARY_PLUGS_PATH="${prefix}/share/java/icedtea6-plugs/jre/lib/rt-closed.jar" \
123    ANT_HOME="${prefix}/share/java/apache-ant" \
124    ALT_FREETYPE_HEADERS_PATH="${prefix}/include" \
125    ALT_FREETYPE_LIB_PATH="${prefix}/lib" \
126    ALT_CUPS_HEADERS_PATH="/usr/include" \
127    ALT_MOTIF_DIR="${prefix}" \
128    ALT_X11_PATH="${prefix}" \
129    ALT_DEVTOOLS_PATH=/usr \
130    ALT_CACERTS_FILE=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts \
131    NO_DOCS=true \
132    HOTSPOT_BUILD_JOBS=[expr [exec sysctl -n hw.ncpu] - 1]
133
134destroot {
135    set path "${destroot}${prefix}/share/java/${name}/"
136    xinstall -m 755 -d ${path}
137    system "(cd ${worksrcpath}/build/bsd-i586/j2sdk-image && tar cf - *) | (tar -C ${path} -xf -)"
138}
Note: See TracBrowser for help on using the repository browser.