wok view icedtea6-jdk/receipt @ rev 6893

Added parallel compile for icedtea6-jdk. openjdk has a special way of doing it.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Oct 21 03:18:33 2010 +0000 (2010-10-21)
parents 685f070bd605
children 501d89e34aae
line source
1 # SliTaz package receipt.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.9.1"
6 CATEGORY="development"
7 SHORT_DESC="A Free Software harness for OpenJDK."
8 MAINTAINER="rcx@zoominternet.net"
9 DEPENDS="icedtea6-jre glibc-base zlib xorg-libX11 xorg-libXau xorg-libXdmcp"
10 BUILD_DEPENDS="gcc+gcj slitaz-toolchain autoconf automake m4 diffutils gawk \
11 coreutils-file-special coreutils-file-summarize alsa-lib-dev cups-dev \
12 gawk file patch findutils perl zip unzip bzip2 tar cpio glib-dev zlib-dev \
13 fastjar rhino ecj apache-ant xalan-xerces-j \
14 freetype-dev gtk+-dev giflib-dev jpeg-dev libpng-dev \
15 xorg-inputproto xorg-kbproto xorg-libXi-dev xorg-libXinerama-dev \
16 xorg-libXp-dev xorg-libXt-dev xorg-libXtst-dev xorg-printproto \
17 xorg-recordproto xorg-renderproto xorg-xextproto xorg-xineramaproto xorg-xproto"
18 TARBALL="$SOURCE-$VERSION.tar.gz"
19 WEB_SITE="http://www.iced-tea.org/"
20 WGET_URL="http://icedtea.classpath.org/download/source/$TARBALL"
22 openjdk_version="b20"
23 openjdk_date="21_jun_2010"
24 JAXWS="jdk6-jaxws-${openjdk_version}.zip"
25 JAXP="jdk6-jaxp-${openjdk_version}.zip"
26 JAF="jdk6-jaf-${openjdk_version}.zip"
27 OPENJDK="openjdk-6-src-${openjdk_version}-${openjdk_date}.tar.gz"
28 WGETJAXWS="https://jax-ws.dev.java.net/files/documents/4202/150724"
29 WGETJAXP="https://jaxp.dev.java.net/files/documents/913/150648"
30 WGETJAF="https://jax-ws.dev.java.net/files/documents/4202/150725"
31 WGETOPENJDK="http://download.java.net/openjdk/jdk6/promoted/${openjdk_version}"
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 # Limit memory usage
37 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
39 local JVM_PREFIX
40 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
42 # NOTE: This build does not seem to work with ECJ 3.5
43 local ECJ_VERSION
44 ECJ_VERSION="3.6"
46 export ALT_PARALLEL_COMPILE_JOBS="4"
47 export HOTSPOT_BUILD_JOBS="${ALT_PARALLEL_COMPILE_JOBS}"
49 cd $src
50 mkdir drops
51 sed -i -e 's/mkdir -p drops/true/' -e 's/ jar xf/ fastjar xf/' Makefile*
52 [ -L /usr/bin/wget ] && tazpkg get-install wget --forced
53 for i in $JAXWS $JAXP $JAF $OPENJDK ; do
54 if [ -f $SOURCES_REPOSITORY/$i ]; then
55 cp $SOURCES_REPOSITORY/$i drops
56 elif [ "$i" == "$JAXWS" ]; then
57 wget -O $SOURCES_REPOSITORY/$JAXWS --no-check-certificate "$WGETJAXWS/$JAXWS"
58 cp $SOURCES_REPOSITORY/$JAXWS drops
59 elif [ "$i" == "$JAXP" ]; then
60 wget -O $SOURCES_REPOSITORY/$JAXP --no-check-certificate "$WGETJAXP/$JAXP"
61 cp $SOURCES_REPOSITORY/$JAXP drops
62 elif [ "$i" == "$JAF" ]; then
63 wget -O $SOURCES_REPOSITORY/$JAF --no-check-certificate "$WGETJAF/$JAF"
64 cp $SOURCES_REPOSITORY/$JAF drops
65 elif [ "$i" == "$OPENJDK" ]; then
66 wget -O $SOURCES_REPOSITORY/$OPENJDK "$WGETOPENJDK/$OPENJDK"
67 cp $SOURCES_REPOSITORY/$OPENJDK .
68 fi
70 done
71 [ -L /usr/bin/find ] && tazpkg get-install findutils --forced
72 [ -L /usr/bin/diff ] && tazpkg get-install diffutils --forced
73 [ "$(readlink /usr/bin/awk)" == "gawk" ] ||
74 tazpkg get-install gawk --forced
75 [ -L /usr/bin/sed ] && tazpkg get-install sed --forced
76 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
77 cat > slitaz.sh <<EOT
78 # Busybox compatibility
79 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
80 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
81 EOT
82 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
83 -e 's/--check/-c/' \
84 -e 's/ln -sfv/ln -sf/' Makefile*
85 autoreconf &&
86 ./configure \
87 --prefix=/usr \
88 --with-parallel-jobs=${HOTSPOT_BUILD_JOBS} \
89 --disable-plugin \
90 --disable-docs \
91 --with-ecj \
92 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
93 --with-gcj \
94 --with-gcj-home=/usr/lib/jvm/java-gcj \
95 --with-xalan2-jar=/usr/share/java/xalan.jar \
96 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
97 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
98 --with-rhino=/usr/share/java/js.jar \
99 --with-abs-install-dir=$JVM_PREFIX \
100 $CONFIGURE_ARGS &&
101 make ARCH_PREFIX= || exit 1
103 # NOTE: IcedTea6 does not define an "install" target
105 rm -r -f $src/_pkg
107 local JVM_BUILDDIR
108 JVM_BUILDDIR=$src/openjdk/build/linux-i586/j2sdk-image
109 local JVM_DESTDIR
110 JVM_DESTDIR=$src/_pkg$JVM_PREFIX
112 mkdir -p $JVM_DESTDIR
113 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
114 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
116 mkdir -p $JVM_DESTDIR/jre
117 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
118 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
120 # Delete duplicated executables from the JDK bin
121 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
122 rm -f $JVM_DESTDIR/bin/$jbin
123 done
125 # Create symlinks for JDK binaries
126 mkdir -p $src/_pkg/usr/jdk-bin
127 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
128 ln -s $JVM_PREFIX/bin/$jbin $src/_pkg/usr/jdk-bin/$jbin
129 done
131 # Create symlinks for JRE binaries
132 mkdir -p $src/_pkg/usr/jre-bin
133 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
134 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
135 ln -s $JVM_PREFIX/jre/bin/$jbin $src/_pkg/usr/jre-bin
136 done
137 }
139 # Rules to gen a SliTaz package suitable for Tazpkg.
140 genpkg_rules()
141 {
142 mkdir -p $fs/usr/lib/jvm/java-icedtea
143 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
144 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
145 }