--- openjdk.SlackBuild.orig 2013-02-01 17:51:17.065397216 +0000 +++ openjdk/openjdk.SlackBuild 2013-02-01 14:44:37.494038829 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2011, 2012 Eric Hameleers, Eindhoven, The Netherlands +# Copyright 2011, 2012, 2013 Eric Hameleers, Eindhoven, The Netherlands # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,16 +25,16 @@ PKGNAM2=openjre JAVAVER=7u9 JAVABLD=b30 -ICEDTEA=2.3.3 +ICEDTEA=2.3.4 VERSION="${JAVAVER}_${JAVABLD}" -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-"alien"} NUMJOBS=${NUMJOBS:--j6} CWD=$(pwd) -TMP=${TMP:-/tmp} +TMP=/tmp/build-openjdk PKG1=$TMP/package-$PKGNAM1 PKG2=$TMP/package-$PKGNAM2 @@ -50,67 +50,20 @@ # Sources the script requires. Note that the Makefile contains SHA256SUM values # for all of these tarballs; if the tarball does not verify then it will be # downloaded again: -SRC_CACAO=cacao-a567bcb7f589.tar.gz SRC_CORBA=corba.tar.gz -SRC_HOTSPOT=hotspot.tar.gz +SRC_HOTSPOT=hotspot-zero.tar.gz SRC_JAXP=jaxp.tar.gz SRC_JAXWS=jaxws.tar.gz -SRC_JDK=jdk.tar.gz -SRC_LANGTOOLS=langtools.tar.gz +SRC_JDK=jdk-dfsg.tar.gz +SRC_LANGTOOLS=langtools-dfsg.tar.gz SRC_OPENJDK=openjdk.tar.gz +SRC_JAMVM=jamvm-0972452d441544f7dd29c55d64f1ce3a5db90d82.tar.gz # Automatically determine the architecture we're building on: -MARCH=$( uname -m ) -if [ -z "$ARCH" ]; then - case "$MARCH" in - i?86) export ARCH=i486 ;; - armv7hl) export ARCH=$MARCH ;; - arm*) export ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: - *) export ARCH=$MARCH ;; - esac -fi - -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" - LIB_ARCH=i386 - ARCH_OPTS="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" - LIB_ARCH=i386 - ARCH_OPTS="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" - LIB_ARCH=amd64 - ARCH_OPTS="" -elif [ "$ARCH" = "arm" ]; then - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" - LIB_ARCH=arm - #ARCH_OPTS="--enable-cacao --with-cacao-src-zip=$CWD/sources/${SRC_CACAO}" - ARCH_OPTS="--enable-zero=yes" -elif [ "$ARCH" = "armv7hl" ]; then - SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" - LIBDIRSUFFIX="" - export LIB_ARCH=arm - export NO_DOCS=true - export ZERO_BUILD=true - export ZERO_LIBARCH=arm - export ZERO_ARCHDEF=ARM - export ZERO_ENDIANNESS=little - export LIBFFI_CFLAGS="`pkg-config --cflags libffi` " - export LIBFFI_LIBS="-lffi " - #ARCH_OPTS="--enable-cacao --with-cacao-src-zip=$CWD/sources/${SRC_CACAO}" - ARCH_OPTS="--enable-zero=yes" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" - LIB_ARCH=$ARCH - ARCH_OPTS="" -fi +export ARCH=arm +SLKCFLAGS="-O2" +LIBDIRSUFFIX="" +LIB_ARCH=$ARCH case "$ARCH" in arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; @@ -120,31 +73,48 @@ rm -rf $PKG1 $PKG2 mkdir -p $TMP $PKG1 $PKG2 cd $TMP -rm -rf icedtea-$ICEDTEA -tar xvf $CWD/sources/icedtea-$ICEDTEA.tar.?z* || exit 1 -cd icedtea-$ICEDTEA || exit 1 +rm -rf icedtea* openjdk* -case "$ARCH" in - arm*) # Fix a patch which fails to apply and thus aborts the build: - cat $CWD/patches/icedtea-2.3.3-refresh-6924259-string_offset.patch | patch -p1 --verbose || exit 1 ;; - *) ;; -esac +# Unpack icedtea source: +tar xf $CWD/sources/openjdk-*.tar.xz || exit 1 +mv -fv openjdk-*orig openjdk +cd openjdk || exit 1 + +# Apply patches from Debian: +xzcat $CWD/sources/openjdk*diff* | patch -p1 +export DISTRIBUTION_BOOT_PATCHES=" \ + debian/patches/ld-symbolic-functions.diff \ + debian/patches/shebang.diff \ + debian/patches/jdk-freetypeScaler-crash.diff \ + debian/patches/icedtea-pretend-memory.diff \ + debian/patches/default-jvm-cfg.diff \ + debian/patches/nonreparenting-wm.diff \ + debian/patches/accessible-toolkit.patch \ + debian/patches/fix_extra_flags-zero.diff \ + debian/patches/atk-wrapper-security.patch \ + debian/patches/icedtea-override-redirect-compiz.patch \ + debian/patches/icedtea-4953367.patch \ + debian/patches/fontconfig-wqy-microhei.patch \ + debian/patches/hotspot-no-werror-zero.diff \ + debian/patches/icc_loading_with_symlink.diff \ + debian/patches/hotspot-sparc-arch.diff \ + debian/patches/sparc-trapsfix.patch \ + debian/patches/sparc-stubgenerator.diff \ + debian/patches/zero-fpu-control-is-noop.diff \ + debian/patches/hotspot-no-march-i586.diff \ + debian/patches/zero-missing-headers.diff \ + debian/patches/enumipv6-fix.patch \ + debian/patches/libpcsclite-dlopen.diff \ + debian/patches/jni_md_h_JNIEXPORT_visibility.patch \ + debian/patches/7130140-MouseEvent-systemout.diff \ + debian/patches/FreetypeFontScaler_getFontMetricsNative.diff \ + debian/patches/text-relocations.diff \ + debian/patches/dnd-files.patch \ + debian/patches/fontconfig-korean-nanum.diff \ + debian/patches/fontconfig-japanese.diff \ + debian/patches/hotspot-libpath-zero.diff \ + debian/patches/jdk-docs-vm-memory.diff" -chown -R root:root . -find . \ - \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; - -# First check: are our sources complying with our SlackBuild? -JDKU=$(cat Makefile.in | grep ^JDK_UPDATE_VERSION | tr -d ' ' | cut -f2 -d=) -JDKB=$(cat Makefile.in | grep ^OPENJDK_VERSION | tr -d ' ' | cut -f2 -d=) -echo "** This SlackBuild creates a package for Java $JAVAVER using OpenJDK build $JAVABLD" -echo "** The script uses icedtea-$ICEDTEA as a build framework." -echo "** Icedtea will (download and) build Java update $JDKU using OpenJDK build $JDKB" -echo "** If you see a mismatch here, then you have 5 seconds to abort this script (press Ctrl-C) and fix it." -sleep 5 # We start with creating a proper build environment. @@ -164,10 +134,7 @@ ! echo $PATH | grep -q jvm/bin && export PATH=/usr/lib${LIBDIRSUFFIX}/jvm/bin:$PATH EXTRA_OPTS="--enable-bootstrap --with-gcj=/usr/bin/gcj" # Bootstrap without cacao: - case "$ARCH" in - arm*) ARCH_OPTS="--enable-zero=yes" ;; - *) ARCH_OPTS="" ;; - esac + ARCH_OPTS="--enable-zero=yes" else # Use a pre-installed OpenJDK: export JVMDIR=/usr/lib${LIBDIRSUFFIX}/java @@ -184,7 +151,14 @@ export OS_VARIANT_VERSION=$(cat /etc/slackware-version | cut -f2 -d' ') cp $CWD/patches/*.patch $TMP/icedtea-$ICEDTEA/patches/ -export DISTRIBUTION_BOOT_PATCHES="patches/openjdk.arm_fixes.patch" +#export DISTRIBUTION_BOOT_PATCHES="patches/openjdk.arm_fixes.patch patches/zero-fpu-control-is-noop.patch patches/zero-only-use-floating-point-if-floating-poi.patch" + +# Move the source archives into a separate dir so that the build script +# doesn't fail when it tries to make symlinks to the same file: +mkdir sourcearchives +for i in $SRC_CORBA $SRC_HOTSPOT $SRC_JAXP $SRC_JAXWS $SRC_JDK $SRC_LANGTOOLS $SRC_OPENJDK $SRC_JAMVM; do + mv -fv $i sourcearchives/ +done CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -192,20 +166,22 @@ --with-abs-install-dir=/usr/lib${LIBDIRSUFFIX}/java \ --with-pkgversion=Slackware \ --with-parallel-jobs=${HOTSPOT_BUILD_JOBS} \ - --with-corba-src-zip=$CWD/sources/${SRC_CORBA} \ - --with-hotspot-src-zip=$CWD/sources/${SRC_HOTSPOT} \ - --with-jaxp-src-zip=$CWD/sources/${SRC_JAXP} \ - --with-jaxws-src-zip=$CWD/sources/${SRC_JAXWS} \ - --with-jdk-src-zip=$CWD/sources/${SRC_JDK} \ - --with-langtools-src-zip=$CWD/sources/${SRC_LANGTOOLS} \ - --with-openjdk-src-zip=$CWD/sources/${SRC_OPENJDK} \ + --with-corba-src-zip=$TMP/openjdk/sourcearchives/${SRC_CORBA} \ + --with-hotspot-src-zip=$TMP/openjdk/sourcearchives/${SRC_HOTSPOT} \ + --with-jaxp-src-zip=$TMP/openjdk/sourcearchives/${SRC_JAXP} \ + --with-jaxws-src-zip=$TMP/openjdk/sourcearchives/${SRC_JAXWS} \ + --with-jdk-src-zip=$TMP/openjdk/sourcearchives/${SRC_JDK} \ + --with-langtools-src-zip=$TMP/openjdk/sourcearchives/${SRC_LANGTOOLS} \ + --with-openjdk-src-zip=$TMP/openjdk/sourcearchives/${SRC_OPENJDK} \ + --with-jamvm-src-zip=$TMP/openjdk/sourcearchives/${SRC_JAMVM} \ --with-jdk-home=${JVMDIR} \ --disable-docs \ - --disable-jamvm \ --disable-jdk-tests \ --disable-langtools-tests \ --disable-system-lcms \ + --disable-downloading \ --enable-nss \ + --with-additional-vms=jamvm \ $ARCH_OPTS \ $EXTRA_OPTS \ --build=$TARGET @@ -214,6 +190,10 @@ # In bootstrap build on Slackware 14, avoid a DSO linking error: sed -i -e "s/-o native-ecj/-lgcj -o native-ecj/" Makefile +make VERBOSE=TRUE +# These are junk and cause the build to fail, so wipe it and continue +# the build. Yucky hack. +find . -name linux.fontconfig.Ubuntu.properties -print0 | xargs -0 rm -fv make VERBOSE=TRUE || exit 1 # Move the generated jre and sdk images to the respective packages: