wok-next view icedtea6-jdk/receipt @ rev 21103
emacs: depends on emacs-common
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Jan 03 11:21:15 2019 +0200 (2019-01-03) |
parents | d5aab818505e |
children |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.9.9"
6 CATEGORY="development"
7 SHORT_DESC="A Free Software harness for OpenJDK"
8 MAINTAINER="devel@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="http://www.iced-tea.org/"
11 REPOLOGY="icedtea6"
13 TARBALL="$SOURCE-$VERSION.tar.gz"
14 WGET_URL="http://icedtea.wildebeest.org/download/source/$TARBALL"
16 BUILD_DEPENDS="gcc+gcj autoconf automake m4 diffutils gawk cups-dev cpio \
17 coreutils-file-special coreutils-file-summarize alsa-lib-dev file patch perl \
18 zip unzip findutils bzip2 tar glib-dev fastjar rhino ecj apache-ant jpeg-dev \
19 xalan-xerces-j gtk2-dev giflib-dev libpng-dev xorg-dev libxtst-dev \
20 libxp-dev xorg-dev-proto nss nss-dev jdk6-jaxws jdk6-jaxp jdk6-jaf \
21 openjdk-6-src"
22 SPLIT="icedtea6-jre java-jdk java-jre"
24 # Note to icedtea6 updaters,
25 # You should check version into receipts:
26 # * jdk6-jaxws (version: $openjdk_version)
27 # * jdk6-jaxp (version: $openjdk_version)
28 # * jdk6-jaf (version: $openjdk_version)
29 # * openjdk-6-src (version: $openjdk_version-$openjdk_date)
30 # Theses receipts allow to have source tarballs in SRC.
31 openjdk_version="b20"
32 openjdk_date="21_jun_2010"
33 EXTRA_SOURCE_FILES="jdk6-jaxws-$openjdk_version.zip \
34 jdk6-jaxp-$openjdk_version.zip jdk6-jaf-$openjdk_version.zip \
35 openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz"
37 compile_rules() {
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 $SRC/$i-$openjdk_version.zip ] ||
57 wget -P $SRC $REPO/$i-$openjdk_version.zip
58 cp $SRC/$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 $SRC/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz ] ||
62 wget -P $SRC $REPO/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz
63 cp $SRC/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 $SRC/$i-$openjdk_version.zip drops
69 done
70 cp $SRC/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 # disable currency timebomb
77 find -name GenerateCurrencyData.java | xargs sed -i 's|throw new RuntimeException("time is|System.err.println("time is|' 2> /dev/null
78 find -name CurrencyData.properties | xargs sed -i 's/TR=TRL.*/TR=TRY/' 2> /dev/null
79 # Busybox compatibility
80 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
81 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
82 EOT
83 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
84 -e 's/--check/-c/' \
85 -e 's/Bsymbolic/& -lgcj/' \
86 -e 's/ln -sfv/ln -sf/' Makefile*
87 aclocal
88 autoconf &&
89 automake --add-missing &&
90 {
91 ./configure \
92 --prefix=/usr \
93 --disable-plugin \
94 --disable-docs \
95 --with-ecj \
96 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
97 --with-gcj \
98 --with-gcj-home=/usr/lib/jvm/java-gcj \
99 --with-xalan2-jar=/usr/share/java/xalan.jar \
100 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
101 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
102 --with-rhino=/usr/share/java/js.jar \
103 --with-abs-install-dir=$JVM_PREFIX \
104 $CONFIGURE_ARGS || return 1
105 make -j1 ARCH_PREFIX= 2>&1 | sed '/java_lang_ClassLoaderr.NativeLibrary/d'
106 } 2>&1 | sed 's/No such file/no such file/'
108 echo "Copying needed files to install dir..."
109 rm -rf $install
111 local JVM_BUILDDIR
112 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
113 local JVM_DESTDIR
114 JVM_DESTDIR=$install$JVM_PREFIX
115 echo "OpenJDK build : source/openjdk.build/j2sdk-image"
116 echo "OpenJDK install : install/$JVM_PREFIX"
118 echo "Copying JDK files : bin/ lib/"
119 mkdir -p $JVM_DESTDIR
120 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
121 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
123 echo "Copying JRE files : bin/ lib/"
124 mkdir -p $JVM_DESTDIR/jre
125 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
126 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
128 # Delete duplicated executables from the JDK bin
129 echo "Deleting duplicated files..."
130 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin); do
131 rm -f $JVM_DESTDIR/bin/$jbin
132 done
134 # Create symlinks for JDK binaries
135 echo "Creating symlinks for JDK binaries..."
136 mkdir -p $install/usr/jdk-bin
137 for jbin in $(ls -1 $JVM_DESTDIR/bin); do
138 ln -s $JVM_PREFIX/bin/$jbin $install/usr/jdk-bin/$jbin
139 done
141 # Create symlinks for JRE binaries
142 echo "Creating symlinks for JRE binaries..."
143 mkdir -p $install/usr/jre-bin
144 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin); do
145 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
146 ln -s $JVM_PREFIX/jre/bin/$jbin $install/usr/jre-bin
147 done
148 if [ ! -x /usr/bin/cook ]; then
149 report close-bloc
150 fi
151 }
153 genpkg_rules() {
154 case $PACKAGE in
155 icedtea6-jdk)
156 mkdir -p $fs/usr/lib/jvm/java-icedtea
157 cp -a $install/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
158 cp -a $install/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
159 DEPENDS="icedtea6-jre xorg libxtst libxp cups"
160 ;;
161 icedtea6-jre)
162 mkdir -p $fs/usr/lib/jvm/java-icedtea
163 cp -a $install/usr/lib/jvm/java-icedtea/jre $fs/usr/lib/jvm/java-icedtea
164 CAT="development|JRE"
165 DEPENDS="glibc-base gcc-lib-base util-linux-uuid alsa-lib \
166 freetype giflib libjpeg libpng zlib libice \
167 libsm libx11 libxau libxdmcp \
168 libxext libxi libxrender libxtst"
169 ;;
170 java-jdk)
171 mkdir -p $fs/usr
172 cp -a $install/usr/jdk-bin $fs/usr/bin
173 CAT="development|symlinks for the default Java Development Kit (icedtea6)"
174 TAGS="java"
175 DEPENDS="icedtea6-jdk"
176 ;;
177 java-jre)
178 mkdir -p $fs/usr
179 cp -a $install/usr/jre-bin $fs/usr/bin
180 CAT="development|symlinks for the default Java Runtime Environment (icedtea6)"
181 DEPENDS="icedtea6-jre"
182 ;;
183 esac
184 }
186 post_install_icedtea6_jre() {
187 ln -sf /usr/lib/jvm/java-icedtea/bin/java "$1/usr/bin/java"
188 }
190 post_remove_icedtea6_jre() {
191 rm -f "$1/usr/bin/java"
192 }