wok-current view icedtea6-jdk/receipt @ rev 6031
icedtea6-jdk: be less memory hungry (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Aug 15 17:29:22 2010 +0200 (2010-08-15) |
parents | 3ee592ac32af |
children | 324a22c1558a |
line source
1 # SliTaz package receipt.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.8.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 # Rules to configure and make the package.
23 compile_rules()
24 {
25 # Limit memory usage
26 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
28 local JVM_PREFIX
29 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
31 # NOTE: This build does not seem to work with ECJ 3.5
32 local ECJ_VERSION
33 ECJ_VERSION="3.6"
35 cd $src
36 [ -L /usr/bin/diff ] && tazpkg get-install diffutils --forced
37 [ "$(readlink /usr/bin/awk)" == "gawk" ] ||
38 tazpkg get-install gawk --forced
39 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
40 cat > slitaz.sh <<EOT
41 # Busybox compatibility
42 find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
43 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY :=.*@MB_OF_MEMORY := $mem@" Makefile
44 EOT
45 sed -i -e 's|touch stamps/extract.stamp|&\n\tsh slitaz.sh|' \
46 -e 's|touch stamps/download.stamp|&\n\tsh slitaz.sh|' \
47 -e 's/--check/-c/' \
48 -e 's/ln -sfv/ln -sf/' Makefile*
49 autoreconf &&
50 ./configure \
51 --prefix=/usr \
52 --disable-plugin \
53 --disable-docs \
54 --with-ecj \
55 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
56 --with-gcj \
57 --with-gcj-home=/usr/lib/jvm/java-gcj \
58 --with-xalan2-jar=/usr/share/java/xalan.jar \
59 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
60 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
61 --with-rhino=/usr/share/java/js.jar \
62 --with-abs-install-dir=$JVM_PREFIX \
63 $CONFIGURE_ARGS &&
64 make -j 1 ARCH_PREFIX= || exit 1
66 # NOTE: IcedTea6 does not define an "install" target
68 rm -r -f $src/_pkg
70 local JVM_BUILDDIR
71 JVM_BUILDDIR=$src/openjdk/build/linux-i586/j2sdk-image
72 local JVM_DESTDIR
73 JVM_DESTDIR=$src/_pkg$JVM_PREFIX
75 mkdir -p $JVM_DESTDIR
76 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
77 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
79 mkdir -p $JVM_DESTDIR/jre
80 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
81 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
83 # Delete duplicated executables from the JDK bin
84 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
85 rm -f $JVM_DESTDIR/bin/$jbin
86 done
88 # Create symlinks for JDK binaries
89 mkdir -p $src/_pkg/usr/jdk-bin
90 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
91 ln -s $JVM_PREFIX/bin/$jbin $src/_pkg/usr/jdk-bin/$jbin
92 done
94 # Create symlinks for JRE binaries
95 mkdir -p $src/_pkg/usr/jre-bin
96 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
97 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
98 ln -s $JVM_PREFIX/jre/bin/$jbin $src/_pkg/usr/jre-bin
99 done
100 }
102 # Rules to gen a SliTaz package suitable for Tazpkg.
103 genpkg_rules()
104 {
105 mkdir -p $fs/usr/lib/jvm/java-icedtea
106 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
107 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
108 }