wok view icedtea6-jdk/receipt @ rev 15267

fbxkb, icedtea6-jdk: add LDFLAGS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Sep 25 11:22:57 2013 +0000 (2013-09-25)
parents 380ffe05937a
children 2a162b72aec4
line source
1 # SliTaz package receipt.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.9.7"
6 CATEGORY="development"
7 SHORT_DESC="A Free Software harness for OpenJDK."
8 MAINTAINER="rcx@zoominternet.net"
9 LICENSE="GPL2"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.iced-tea.org/"
12 WGET_URL="http://icedtea.classpath.org/download/source/$TARBALL"
14 DEPENDS="icedtea6-jre xorg xorg-libXtst xorg-libXp cups"
15 BUILD_DEPENDS="gcc+gcj autoconf automake m4 diffutils gawk cups-dev wget cpio \
16 coreutils-file-special coreutils-file-summarize alsa-lib-dev file patch perl \
17 zip unzip findutils bzip2 tar glib-dev fastjar rhino ecj apache-ant jpeg-dev \
18 xalan-xerces-j gtk+-dev giflib-dev libpng-dev xorg-dev xorg-libXtst-dev \
19 xorg-libXp-dev xorg-dev-proto nss nss-dev jdk6-jaxws jdk6-jaxp jdk6-jaf \
20 openjdk-6-src"
22 # Note to icedtea6 updaters,
23 # You should check version into receipts:
24 # * jdk6-jaxws (version: $openjdk_version)
25 # * jdk6-jaxp (version: $openjdk_version)
26 # * jdk6-jaf (version: $openjdk_version)
27 # * openjdk-6-src (version: $openjdk_version-$openjdk_date)
28 # Theses receipts allow to have source tarballs in SRC.
29 openjdk_version="b20"
30 openjdk_date="21_jun_2010"
31 EXTRA_SOURCE_FILES="jdk6-jaxws-$openjdk_version.zip \
32 jdk6-jaxp-$openjdk_version.zip jdk6-jaf-$openjdk_version.zip \
33 openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz"
35 # Rules to configure and make the package.
36 compile_rules()
37 {
38 # Limit memory usage
39 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
41 local JVM_PREFIX
42 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
44 # NOTE: This build does not seem to work with ECJ 3.5
45 local ECJ_VERSION
46 ECJ_VERSION="3.6"
48 cd $src
49 mkdir drops
50 sed -i -e 's/mkdir -p drops/true/' -e 's/ jar xf/ fastjar xf/' Makefile*
52 # Check than all sources files are available, or exit.
53 REPO=http://icedtea.classpath.org/download/drops
54 if [ -x /usr/bin/cook ]; then
55 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf; do
56 [ -s $SOURCES_REPOSITORY/$i-$openjdk_version.zip ] ||
57 wget -P $SOURCES_REPOSITORY $REPO/$i-$openjdk_version.zip
58 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops || return 1
59 done
60 # openjdk-6-src is in BUILD_DEPENDS and must be build like jdk6-* pkgs.
61 [ -s $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz ] ||
62 wget -P $SOURCES_REPOSITORY $REPO/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz
63 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
64 else
65 report open-bloc
66 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf openjdk-6-src; do
67 tazwok get-src $i
68 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops
69 done
70 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
71 report step "Running compilation"
72 fi
74 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
75 cat > slitaz.sh <<EOT
76 # Busybox compatibility
77 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
78 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
79 EOT
80 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
81 -e 's/--check/-c/' \
82 -e 's/ln -sfv/ln -sf/' Makefile*
83 autoreconf &&
84 ./configure \
85 --prefix=/usr \
86 --disable-plugin \
87 --disable-docs \
88 --with-ecj \
89 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
90 --with-gcj \
91 --with-gcj-home=/usr/lib/jvm/java-gcj \
92 --with-xalan2-jar=/usr/share/java/xalan.jar \
93 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
94 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
95 --with-rhino=/usr/share/java/js.jar \
96 --with-abs-install-dir=$JVM_PREFIX \
97 $CONFIGURE_ARGS || return 1
98 export LDFLAGS="-Wl,--copy-dt-needed-entries -lgcj"
99 make -j 1 ARCH_PREFIX= 2>&1 | sed '/java_lang_ClassLoaderr.NativeLibrary/d;s/ERROR/error/'
101 echo "Copying needed files to install dir..."
102 rm -rf $DESTDIR
104 local JVM_BUILDDIR
105 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
106 local JVM_DESTDIR
107 JVM_DESTDIR=${DESTDIR}$JVM_PREFIX
108 echo "OpenJDK build : source/openjdk.build/j2sdk-image"
109 echo "OpenJDK install : install/$JVM_PREFIX"
111 echo "Copying JDK files : bin/ lib/"
112 mkdir -p $JVM_DESTDIR
113 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
114 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
116 echo "Copying JRE files : bin/ lib/"
117 mkdir -p $JVM_DESTDIR/jre
118 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
119 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
121 # Delete duplicated executables from the JDK bin
122 echo "Deleting duplicated files..."
123 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
124 rm -f $JVM_DESTDIR/bin/$jbin
125 done
127 # Create symlinks for JDK binaries
128 echo "Creating symlinks for JDK binaries..."
129 mkdir -p $DESTDIR/usr/jdk-bin
130 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
131 ln -s $JVM_PREFIX/bin/$jbin $DESTDIR/usr/jdk-bin/$jbin
132 done
134 # Create symlinks for JRE binaries
135 echo "Creating symlinks for JRE binaries..."
136 mkdir -p $DESTDIR/usr/jre-bin
137 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
138 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
139 ln -s $JVM_PREFIX/jre/bin/$jbin $DESTDIR/usr/jre-bin
140 done
141 if [ ! -x /usr/bin/cook ]; then
142 report close-bloc
143 fi
144 }
146 # Rules to gen a SliTaz package suitable for Tazpkg.
147 genpkg_rules()
148 {
149 mkdir -p $fs/usr/lib/jvm/java-icedtea
150 cp -a $install/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
151 cp -a $install/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
152 }