import 'compile/configure' name=icedtea version=3.7.0 version_bootstrap=2.6.13 version_gcc=6.4.0 version_ecj=4.9 version_apache_ant=1.9.11 define_option '!bootstrap: Bootstrap this program' dlextract "http://icedtea.wildebeest.org/download/source/$name-$version.tar.xz" \ '648a52c2f008ee0bbb865a2a1768891b' modules=" 2ee9aa7e85ed2fb9af1ab87fb87e404b-corba.tar.xz 85693d6cd04ca1b9a694afa81e7c4dda-hotspot.tar.xz c3a5eb1567ac3d8cbfa3dd8cd0848b6f-jaxp.tar.xz 286778356533d5fe3d8ab9c2c747fe3b-jaxws.tar.xz 84c39ca647e24fe81c08bc10e016d194-jdk.tar.xz c03e84cceca1d9173b409920fad3aa93-langtools.tar.xz 4895a6a002374c0dea0be055cb75b9a5-nashorn.tar.xz c686c8d283bc9f89a8874c5344d4e83a-openjdk.tar.xz " for module in $modules; do package="$(echo "$module" | cut -d- -f2)" checksum="$(echo "$module" | cut -d- -f1)" download "http://icedtea.wildebeest.org/download/drops/${name}8/$version/$package" \ "$checksum" \ "$name-$version-$package" done if option bootstrap; then ( name=gcc version="$version_gcc" dlextract "https://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.xz" \ '11ba51a0cfb8471927f387c8895fe232' ) 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" \ 'b3fc479d9f3b9fd5af4cdf08ac172c55' ) dlextract "http://icedtea.wildebeest.org/download/source/$name-$version_bootstrap.tar.xz" \ 'a0fad4c5c9b4ec59240afff6484c6764' bootstrap_modules=" 6e30aa6f2393537d2558b51f7793aa4c-corba.tar.bz2 036fdb0a696857f42e70403916267267-hotspot.tar.bz2 74525da9d7f57bf6640fe3aed591d455-jaxp.tar.bz2 89a547e306caba44416c2c86b7704146-jaxws.tar.bz2 a8aa55d0b7a1aaceadf0b6886d326c17-jdk.tar.bz2 b00e63ffee72633aa88d3cdf33686da3-langtools.tar.bz2 f56a3ebf4774ec78b35422c93ccb95c4-openjdk.tar.bz2 " for module in $bootstrap_modules; do package="$(echo "$module" | cut -d- -f2)" checksum="$(echo "$module" | cut -d- -f1)" download "http://icedtea.wildebeest.org/download/drops/${name}7/$version_bootstrap/$package" \ "$checksum" \ "$name-$version_bootstrap-$package" done fi _ # 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-multilib \ --disable-bootstrap \ --disable-nls \ --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 package="$(echo "$module" | cut -d- -f2)" getfile "$name-$version_bootstrap-$package" mv "$name-$version_bootstrap-$package" "$package" 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 package="$(echo "$module" | cut -d- -f2)" getfile "$name-$version-$package" mv "$name-$version-$package" "$package" 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_lib/jvm/${name}8" cp -Ta openjdk.build/images/j2sdk-image "$dir_install/$dir_prefix/$dir_lib/jvm/${name}8" # Link default jvm ln -s "${name}8" "$dir_install/$dir_prefix/$dir_lib/jvm/default" # Add profile script cat > java.sh << EOF export JAVA_HOME="/$dir_prefix/$dir_lib/jvm/default" export PATH="\$PATH:\$JAVA_HOME/bin" export MANPATH="\$MANPATH:\$JAVA_HOME/man" EOF install -Dm755 -t "$dir_install/$dir_prefix/$dir_sysconf/profile.d" java.sh # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: