Ticket #20956: Portfile

File Portfile, 6.5 KB (added by johnsonlaucn@…, 14 years ago)

Latest Portfile

Line 
1# $Id: Portfile 71104 2010-09-01 11:50:35Z jmr@macports.org $
2
3PortSystem 1.0
4
5name                openjdk6
6version             b20
7revision            1
8set builddate 21_jun_2010
9
10categories          java
11maintainers         landonf openmaintainer
12platforms           darwin
13
14homepage            http://openjdk.java.net/
15description         Oracle's Java 6 virtual machine release under the GPL v2
16long_description \
17                    OpenJDK is an open-source implementation of the Java Platform, Standard Edition. \
18                    \
19                    Much of the OpenJDK code is licensed under the GPL version 2 with the \
20                    Classpath exception. The Java Hotspot virtual machine source code is \
21                    licensed under the GPL version 2 only.
22
23distname            openjdk-6-src-${version}-${builddate}
24master_sites        http://download.java.net/openjdk/jdk6/promoted/${version}/
25checksums           md5     0b36adbf67e4f261e1b827ed4be4f447 \
26                    sha256  39fc162a740f16aa18afa855fea9d5daf8cf03d4
27
28patchfiles          patch-set \
29                    patch-nio-kqueue \
30                    patch-null_word_intptr_t \
31                    patch-jdk_src_solaris_javavm_include_typedefs__md.h \
32                    patch-jdk_src_share_java.c \
33                    patch-jdk_src_solaris_native_common_gdefs__md.h \
34                    patch-10.4-ucontext \
35                    patch-10.6-ucontext \
36                    patch-disable_test_gamma \
37                    patch-darwin-arch \
38                    patch-hotspot-arch \
39                    patch-dock-args \
40                    patch-solaris-timezone-md-return-typo \
41                    patch-compile-W-format \
42                    patch-skip-sa-build \
43                    patch-swing-beans-failed-by-bootjdk
44
45use_configure       no
46use_parallel_build  no
47
48depends_lib         port:freetype \
49                    port:openmotif \
50                    port:xorg-libX11 \
51                    port:xorg-libXtst \
52                    port:dejavu-fonts
53depends_build       port:icedtea6-plugs \
54                    port:apache-ant
55
56# Check if the bootstrap is required
57if {[file exists ${prefix}/share/java/openjdk6/bin/java]} {
58    # A previous OpenJDK6 release is already installed
59    set bootstrapvm "${prefix}/share/java/openjdk6"
60} else {
61    # A bootstrap binary is required to build
62    depends_build-append port:openjdk6_bootstrap
63    set bootstrapvm "${prefix}/share/java/openjdk6_bootstrap"
64}
65
66# Target dir for 32bit / 64bit variant
67set targetdir bsd-amd64
68
69worksrcdir          "./"
70
71post-extract {
72    set copydirs { \
73        hotspot/agent/src/os/linux \
74        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux \
75        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64 \
76        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86 \
77        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux \
78        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86 \
79        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64 \
80        hotspot/src/os/linux/launcher \
81        hotspot/src/os/linux/vm \
82        hotspot/src/os_cpu/linux_x86/vm \
83        hotspot/make/linux \
84        hotspot/make/linux/makefiles \
85        jdk/src/linux/doc/man
86    }
87
88    set copyfiles { \
89        corba/make/common/Defs-linux.gmk \
90        corba/make/common/shared/Defs-linux.gmk \
91        jdk/make/common/Defs-linux.gmk \
92        jdk/make/common/shared/Defs-linux.gmk \
93        jdk/make/java/nio/mapfile-linux \
94        jdk/make/netbeans/common/architectures/name-Linux.properties \
95        jdk/make/sun/awt/mapfile-vers-linux \
96        jdk/make/tools/sharing/classlist.linux \
97        jdk/make/com/sun/tools/attach/mapfile-linux \
98        jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux \
99        jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.properties \
100        jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \
101        jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java \
102        jdk/src/solaris/hpi/include/largefile_linux.h \
103        jdk/src/solaris/native/java/net/linux_close.c \
104        jdk/src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
105    }
106
107    # Copy over original Linux sources
108    foreach src ${copydirs} {
109        set dest "${worksrcpath}/[strsed ${src} g/linux/bsd/]"
110
111        # Create the parent directories
112        file mkdir "${dest}"
113
114        # Copy the contents, adjust file contents
115        foreach srcfile [glob -types f "${worksrcpath}/${src}/*"] {
116            set destfile "${dest}/[strsed [strsed [file tail ${srcfile}] g/Linux/Bsd/] g/linux/bsd/]"
117            copy "${srcfile}" "${destfile}"
118            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
119            reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
120        }
121    }
122
123    foreach src ${copyfiles} {
124        set dest "${worksrcpath}/[exec echo ${src} | sed {s/linux/bsd/g; s/Linux/Bsd/g}]"
125        copy "${worksrcpath}/${src}" "${dest}"
126        reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${dest}"
127    }
128
129    # Copy the solaris sources
130    copy "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c" \
131         "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
132    reinplace "s/solaris/bsd/g; s/Solaris/Bsd/g" \
133        "${worksrcpath}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c"
134
135
136    copy "${worksrcpath}/jdk/src/share/lib/security/java.security" \
137         "${worksrcpath}/jdk/src/share/lib/security/java.security-openbsd"
138}
139
140build.args \
141    ALT_BOOTDIR="${bootstrapvm}" \
142    ALT_JDK_IMPORT_PATH="${bootstrapvm}" \
143    ALT_BINARY_PLUGS_PATH="${prefix}/share/java/icedtea6-plugs/jre/lib/rt-closed.jar" \
144    ANT_HOME="${prefix}/share/java/apache-ant" \
145    ALT_FREETYPE_HEADERS_PATH="${prefix}/include" \
146    ALT_FREETYPE_LIB_PATH="${prefix}/lib" \
147    ALT_CUPS_HEADERS_PATH="/usr/include" \
148    ALT_MOTIF_DIR="${prefix}" \
149    ALT_X11_PATH="${prefix}" \
150    ALT_DEVTOOLS_PATH=/usr \
151    ALT_CACERTS_FILE=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts \
152    NO_DOCS=true \
153    ALLOW_DOWNLOADS=true \
154    LANG="C" \
155    HOTSPOT_BUILD_JOBS=${build.jobs}
156
157variant 32bit {
158    build.post_args FORCE_32BIT_JDK=true
159    set targetdir bsd-i586
160}
161
162variant fast-debug {
163    build.post_args FASTDEBUG=true
164}
165
166destroot {
167    set path "${destroot}${prefix}/share/java/${name}/"
168    xinstall -m 755 -d ${path}
169    system "(cd ${worksrcpath}/build/${targetdir}/j2sdk-image && tar cf - *) | (tar -C ${path} -xf -)"
170}