|
|
|
import 'compile/configure'
|
|
|
|
|
|
|
|
name=icedtea
|
|
|
|
version=3.4.0
|
|
|
|
version_bootstrap=2.6.10
|
|
|
|
version_gcc=6.3.0
|
|
|
|
version_ecj=4.9
|
|
|
|
version_apache_ant=1.9.9
|
|
|
|
update_url='http://icedtea.wildebeest.org/download/source/'
|
|
|
|
update_names="<a href=\"$name-$version.tar.gz\">"
|
|
|
|
|
|
|
|
define_option '!bootstrap: Bootstrap this program'
|
|
|
|
|
|
|
|
dlextract "http://icedtea.wildebeest.org/download/source/$name-$version.tar.xz" \
|
|
|
|
'0af777c25b01092c511262edf40f868b'
|
|
|
|
modules="
|
|
|
|
corba-68b8c18562214486c971071ba59413e6
|
|
|
|
hotspot-b4d1be014037928badc0a28644511663
|
|
|
|
jaxp-7e4a9e896f4777fe96dd7e49ed507a0b
|
|
|
|
jaxws-df3c1b88db55fdd9b793714d40930f9f
|
|
|
|
jdk-1d2130aaeb5b7546f70564e963a68379
|
|
|
|
langtools-9c7688f164d62d13b4f36e0db379d4c4
|
|
|
|
nashorn-65805818ca9ea2af450ac6265e90d509
|
|
|
|
openjdk-89f287e08058534ed5bf9198d025500f
|
|
|
|
"
|
|
|
|
for module in $modules; do
|
|
|
|
modname="$(echo "$module" | cut -d- -f1)"
|
|
|
|
checksum="$(echo "$module" | cut -d- -f2)"
|
|
|
|
download "http://icedtea.wildebeest.org/download/drops/${name}8/$version/$modname.tar.xz" \
|
|
|
|
"$checksum" \
|
|
|
|
"icedtea-$version-$modname.tar.xz"
|
|
|
|
done
|
|
|
|
|
|
|
|
if option bootstrap; then
|
|
|
|
( name=gcc version="$version_gcc"
|
|
|
|
dlextract "https://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
|
|
|
|
'677a7623c7ef6ab99881bc4e048debb6'
|
|
|
|
)
|
|
|
|
download "ftp://sourceware.org/pub/java/ecj-$version_ecj.jar" \
|
|
|
|
'7339f199ba11c941890031fd9981d7be'
|
|
|
|
dlfile 'https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-java/gcj-jdk/files/javac.in?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d' \
|
|
|
|
'5fb8379653ba60746feb7090ac52bd28'
|
|
|
|
|
|
|
|
( name=apache-ant version="$version_apache_ant"
|
|
|
|
dlextract "https://www.apache.org/dist/ant/source/$name-$version-src.tar.bz2" \
|
|
|
|
'c988158e101e7700b45c14b9804fd554'
|
|
|
|
)
|
|
|
|
|
|
|
|
dlextract "http://icedtea.wildebeest.org/download/source/$name-$version_bootstrap.tar.xz" \
|
|
|
|
'25307cb762455eace830e399c918b11f'
|
|
|
|
bootstrap_modules="
|
|
|
|
corba-8f410876861cb5f00795f16eaead0810
|
|
|
|
hotspot-638ba47781e357ad6f9583045e45dc20
|
|
|
|
jaxp-62a4db1e84cdc7a322ec1442a42234ca
|
|
|
|
jaxws-93abafb7ba0c6281c8a8fcaedd573f3d
|
|
|
|
jdk-fab5c059798ae43b2b636c8ddfb0da7a
|
|
|
|
langtools-2867a657ebb2185ca5954c4cf2742328
|
|
|
|
openjdk-4c6bc2dff0da17def41732cd8e68bb21
|
|
|
|
"
|
|
|
|
for module in $bootstrap_modules; do
|
|
|
|
modname="$(echo "$module" | cut -d- -f1)"
|
|
|
|
checksum="$(echo "$module" | cut -d- -f2)"
|
|
|
|
download "http://icedtea.wildebeest.org/download/drops/${name}7/$version_bootstrap/$modname.tar.bz2" \
|
|
|
|
"$checksum" \
|
|
|
|
"icedtea-$version_bootstrap-$modname.tar.bz2"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
header_end
|
|
|
|
|
|
|
|
# From: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/multiprocessing.eclass
|
|
|
|
makeopts_jobs() {
|
|
|
|
# This assumes the first .* will be more greedy than the second .*
|
|
|
|
# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
|
|
|
|
local jobs=$(echo " $MAKEFLAGS " | sed -r -n \
|
|
|
|
-e 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' \
|
|
|
|
-e 's:.*[[:space:]](-j|--jobs)[[:space:]].*:999:p')
|
|
|
|
echo ${jobs:-1}
|
|
|
|
}
|
|
|
|
|
|
|
|
if option bootstrap; then
|
|
|
|
# Build GCJ
|
|
|
|
( cd "gcc-$version_gcc"
|
|
|
|
getfile "ecj-$version_ecj.jar"
|
|
|
|
mv "ecj-$version_ecj.jar" ecj.jar
|
|
|
|
|
|
|
|
sed -i -e 's/\.\/fixinc\.sh/-c true/' gcc/Makefile.in
|
|
|
|
mkdir build; cd build
|
|
|
|
../configure \
|
|
|
|
--prefix="$PWD/../install" \
|
|
|
|
--disable-bootstrap \
|
|
|
|
--enable-languages=java \
|
|
|
|
--enable-java-home \
|
|
|
|
--with-java-home="$PWD/../install/lib/jvm/jre"
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install missing javac
|
|
|
|
sed -e "s#@JAVA@#$PWD/gcc-$version_gcc/install/lib/jvm/bin/java#" \
|
|
|
|
-e "s#@ECJ_JAR@#$PWD/gcc-$version_gcc/install/share/java/ecj.jar#" \
|
|
|
|
-e "s#@RT_JAR@#$PWD/gcc-$version_gcc/install/lib/jvm/jre/lib/rt.jar#" \
|
|
|
|
-e "s#@TOOLS_JAR@#$PWD/gcc-$version_gcc/install/lib/jvm/lib/tools.jar#" \
|
|
|
|
javac.in > javac
|
|
|
|
install -Dm755 -t "gcc-$version_gcc/install/lib/jvm/bin" javac
|
|
|
|
|
|
|
|
# Set JAVA_HOME to GCJ
|
|
|
|
export JAVA_HOME="$PWD/gcc-$version_gcc/install/lib/jvm"
|
|
|
|
|
|
|
|
# Bootstrap Ant
|
|
|
|
( cd "apache-ant-$version_apache_ant"
|
|
|
|
./build.sh
|
|
|
|
)
|
|
|
|
|
|
|
|
# Bootstrap Icedtea7
|
|
|
|
( cd "$name-$version_bootstrap"
|
|
|
|
for module in $bootstrap_modules; do
|
|
|
|
modname="$(echo "$module" | cut -d- -f1)"
|
|
|
|
getfile "icedtea-$version_bootstrap-$modname.tar.bz2"
|
|
|
|
mv "icedtea-$version_bootstrap-$modname.tar.bz2" "$modname.tar.bz2"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Use the gcc with java support we just built to be able to properly compile java C modules. Add java tools and ant to $PATH as well.
|
|
|
|
export PATH="$PWD/../gcc-$version_gcc/install/bin:$JAVA_HOME/bin:$PWD/../apache-ant-$version_apache_ant/dist/bin:$PATH"
|
|
|
|
|
|
|
|
./configure \
|
|
|
|
--with-jdk-home="$JAVA_HOME" \
|
|
|
|
--with-parallel-jobs="$(makeopts_jobs)" \
|
|
|
|
--disable-downloading \
|
|
|
|
--without-rhino \
|
|
|
|
--disable-system-kerberos \
|
|
|
|
--disable-system-pcsc \
|
|
|
|
--disable-system-sctp
|
|
|
|
make
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set JAVA_HOME to Icedtea7
|
|
|
|
export JAVA_HOME="$PWD/$name-$version_bootstrap/openjdk.build/j2sdk-image"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$name-$version"
|
|
|
|
|
|
|
|
for module in $modules; do
|
|
|
|
modname="$(echo "$module" | cut -d- -f1)"
|
|
|
|
getfile "icedtea-$version-$modname.tar.xz"
|
|
|
|
mv "icedtea-$version-$modname.tar.xz" "$modname.tar.xz"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Build
|
|
|
|
export PATH="$JAVA_HOME/bin:$PATH"
|
|
|
|
./configure \
|
|
|
|
--with-jdk-home="$JAVA_HOME" \
|
|
|
|
--with-parallel-jobs="$(makeopts_jobs)" \
|
|
|
|
--disable-downloading \
|
|
|
|
--disable-ccache \
|
|
|
|
--disable-system-kerberos \
|
|
|
|
--disable-system-pcsc \
|
|
|
|
--disable-system-sctp
|
|
|
|
make
|
|
|
|
|
|
|
|
# Install
|
|
|
|
mkdir -p "$dir_install/$dir_prefix/$dir_libdir/jvm/${name}8"
|
|
|
|
cp -Ta openjdk.build/images/j2sdk-image "$dir_install/$dir_prefix/$dir_libdir/jvm/${name}8"
|
|
|
|
|
|
|
|
# Link default jvm
|
|
|
|
ln -s "${name}8" "$dir_install/$dir_prefix/$dir_libdir/jvm/default"
|
|
|
|
|
|
|
|
# Add profile script
|
|
|
|
cat > java.sh << EOF
|
|
|
|
export JAVA_HOME="/$dir_prefix/$dir_libdir/jvm/default"
|
|
|
|
export PATH="\$PATH:\$JAVA_HOME/bin"
|
|
|
|
export MANPATH="\$MANPATH:\$JAVA_HOME/man"
|
|
|
|
EOF
|
|
|
|
install -Dm755 -t "$dir_install/$dir_prefix/$dir_sysconfdir/profile.d" java.sh
|
|
|
|
|
|
|
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:
|