java-scratchspace/openjdk8-boot/Pkgfile

149 lines
4.7 KiB
Plaintext
Raw Normal View History

2021-02-07 01:31:08 +01:00
# Description: OpenJDK 8 built using IcedTea build harness (minimal pkg for bootstrapping)
# URL: https://icedtea.classpath.org
# Maintainer:
2021-02-07 16:05:47 +01:00
# Depends on: alsa-lib cups fontconfig freetype giflib gtk krb5 lcms2 libjpeg-turbo libpng libxslt nss p11-kit unzip xorg-libxt xorg-libxtst xorg-libxinerama zip
2021-02-07 01:31:08 +01:00
name=openjdk8-boot
2021-02-07 16:05:47 +01:00
version=8u282-b08
_icedtea_version=3.18.0
_bootname=openjdk7-boot
2021-02-07 16:05:47 +01:00
_boot_version=20210207
2021-02-07 01:31:08 +01:00
release=1
2021-02-07 16:05:47 +01:00
source=(http://icedtea.wildebeest.org/download/source/icedtea-$_icedtea_version.tar.xz
https://crux.ster.zone/downloads/java/corba-$version.tar.xz
https://crux.ster.zone/downloads/java/hotspot-$version.tar.xz
https://crux.ster.zone/downloads/java/jaxp-$version.tar.xz
https://crux.ster.zone/downloads/java/jaxws-$version.tar.xz
https://crux.ster.zone/downloads/java/jdk-$version.tar.xz
https://crux.ster.zone/downloads/java/langtools-$version.tar.xz
https://crux.ster.zone/downloads/java/nashorn-$version.tar.xz
https://crux.ster.zone/downloads/java/openjdk-$version.tar.xz
https://crux.ster.zone/downloads/java/$_bootname-$_boot_version.tar.xz)
2021-02-07 01:31:08 +01:00
unpack_source() {
for file in ${source[@]}; do
case ${file##*/} in
2021-02-07 16:19:00 +01:00
icedtea-$_icedtea_version.tar.xz|\
$_bootname-$_boot_version.tar.xz)
bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
*)
cp $(get_filename $file) $SRC ;;
esac
done
2021-02-07 01:31:08 +01:00
}
build() {
# Most of these flags were snarfed directly from Alpine Linux APKBUILD for openjdk7, added -fabi-version.
# Fixes build failures due to suspected gcc8 changes for default std and abi.
export EXTRA_CPP_FLAGS="$CXXFLAGS -fabi-version=10 -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"
export EXTRA_CFLAGS="$CFLAGS -fabi-version=10 -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"
2021-02-07 01:31:08 +01:00
2021-02-07 16:23:14 +01:00
unset JAVA_HOME
OLD_PATH=$PATH
export JAVA_HOME=$SRC/openjdk7-boot
export PATH=$JAVA_HOME/bin:$OLD_PATH
2021-02-07 01:31:08 +01:00
if [ -f /etc/pki/tls/java/cacerts ]; then
JAVA_CACERTS=/etc/pki/tls/java/cacerts
else
/usr/sbin/make-ca -g -D $SRC/certs || exit 1
JAVA_CACERTS=$SRC/certs/etc/pki/tls/java/cacerts
fi
2021-02-07 01:31:08 +01:00
2021-03-14 11:35:26 +01:00
local _COMMON_OPTIONS="
--disable-bootstrap
--disable-docs
--disable-downloading
--disable-precompiled-headers
--disable-tests
--disable-hotspot-tests
--disable-langtools-tests
--disable-jdk-tests
--disable-systemtap-tests
--disable-system-pcsc
--disable-system-sctp
--enable-system-cups
--enable-system-fontconfig
--enable-system-gio
--enable-system-gtk
--enable-system-jpeg
--enable-system-kerberos
--enable-system-lcms
--enable-system-png
--enable-system-zlib
--enable-non-nss-curves
--enable-nss
--with-openjdk-src-zip=$SRC/openjdk-$version.tar.xz
--with-hotspot-src-zip=$SRC/hotspot-$version.tar.xz
--with-corba-src-zip=$SRC/corba-$version.tar.xz
--with-jaxp-src-zip=$SRC/jaxp-$version.tar.xz
--with-jaxws-src-zip=$SRC/jaxws-$version.tar.xz
--with-jdk-src-zip=$SRC/jdk-$version.tar.xz
--with-langtools-src-zip=$SRC/langtools-$version.tar.xz
--with-nashorn-src-zip=$SRC/nashorn-$version.tar.xz
--with-pkgversion=CRUX
--with-jdk-home=$JAVA_HOME
--with-cacerts-file=$JAVA_CACERTS
--with-tzdata-dir=/usr/share/zoneinfo"
mkdir $SRC/build-boot
cd $SRC/build-boot
2021-02-07 01:31:08 +01:00
LC_ALL=C \
CONFIG_SHELL=/bin/bash \
2021-02-07 16:19:00 +01:00
../icedtea-$_icedtea_version/configure \
2021-03-14 11:35:26 +01:00
$_COMMON_OPTIONS \
--prefix=$SRC/build-boot/openjdk.build/images/j2sdk-image \
2021-02-07 01:31:08 +01:00
LC_ALL=C \
make
2021-02-07 01:31:08 +01:00
# Rebuild with our new openjdk8
2021-02-07 01:31:08 +01:00
unset JAVA_HOME
export JAVA_HOME=$SRC/build-boot/openjdk.build/images/j2sdk-image
export PATH=$JAVA_HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin
2021-02-07 01:31:08 +01:00
mkdir $SRC/build
cd $SRC/build
2021-02-07 01:31:08 +01:00
LC_ALL=C \
CONFIG_SHELL=/bin/bash \
2021-02-07 16:19:00 +01:00
../icedtea-$_icedtea_version/configure \
2021-03-14 11:35:26 +01:00
$_COMMON_OPTIONS \
--prefix=/$name
2021-02-07 01:31:08 +01:00
LC_ALL=C \
make
2021-02-07 01:31:08 +01:00
# Copy the sdk image first before pruning it, saving original for later inspection/comparison.
mkdir -p $PKG/$name
cp -r openjdk.build/images/j2sdk-image/* $PKG/$name
2021-02-07 01:31:08 +01:00
# Remove unneeded files
rm -f $PKG/$name/src.zip
rm -rf $PKG/$name/{demo,man,sample,jre/lib/images}
rm -f $PKG/$name/{,jre/}THIRD_PARTY_README
2021-03-14 11:35:26 +01:00
find $PKG/$name \( \
-name '*.ja' -o \
-name '*.txt' -o \
-name '*.properties' -o \
-name '*.template' -o \
-name 'fontconfig.*' -o \
-name 'ASSEMBLY_EXCEPTION' -o \
-name 'LICENSE' -o \
-name 'THIRD_PARTY_README' \) \
-delete
2021-02-07 01:31:08 +01:00
# Deduplicate
rm $PKG/$name/jre/lib/amd64/jli/libjli.so
ln -sr $PKG/$name/lib/amd64/jli/libjli.so \
$PKG/$name/jre/lib/amd64/jli/libjli.so
for f in $PKG/$name/jre/bin/* ; do
if [ -f $PKG/$name/bin/${f##*/} ]; then
rm $f
ln -sr $PKG/$name/bin/${f##*/} $f
fi
done
2021-02-07 01:31:08 +01:00
}