java-scratchspace/openjdk12-boot/Pkgfile

105 lines
3.1 KiB
Plaintext

# Description: OpenJDK 12 (minimal pkg for bootstrapping)
# URL: https://openjdk.java.net/
# Maintainer:
# Depends on: alsa-lib cups fontconfig giflib krb5 lcms2 libxslt nss unzip xorg-libxrandr xorg-libxt xorg-libxtst zip
name=openjdk12-boot
version=12.0.2+10
_boot_ver=20210207
_cert_ver=20200215
_jdkhash=c45c2cbfb841
release=1
source=(https://crux.ster.zone/downloads/java/openjdk-$version.tar.bz2
https://crux.ster.zone/downloads/java/openjdk11-boot-$_boot_ver.tar.xz
https://crux.ster.zone/downloads/java/java_cacerts-$_cert_ver
make-4.3_breaks_build.patch)
build() {
patch -p1 -d $SRC/jdk12u-$_jdkhash -i $SRC/make-4.3_breaks_build.patch
# Make sure we do not have ccache masquerade directory in PATH.
# Use --enable-ccache instead of providing a wrapped compiler.
# NOTE: the check for usr/bin/ccache may be too specific, since it rules out
# local or opt installs.
if [ -e '/usr/bin/ccache' ]; then
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
PKGMK_JDK12+=' --enable-ccache'
fi
OLD_PATH=$PATH
export JAVA_HOME=$SRC/openjdk11-boot
export PATH=$JAVA_HOME/bin:$OLD_PATH
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
unset MAKEFLAGS
export _CFLAGS+=' -fabi-version=10 -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow -fcommon'
export _CXXFLAGS+=' -fabi-version=10 -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow -fcommon'
[ -z $JOBS ] && JOBS=$(nproc)
mkdir $SRC/build-boot
cd $SRC/build-boot
local _COMMON_OPTIONS="
--disable-hotspot-gtest
--disable-precompiled-headers
--disable-warnings-as-errors
--enable-dtrace=no
--enable-headless-only
--enable-unlimited-crypto
--with-native-debug-symbols=none
--with-debug-level=release
--with-stdc++lib=dynamic
--with-jvm-variants=server
--with-cacerts-file=$SRC/java_cacerts-$_cert_ver
--with-jtreg=no
--with-boot-jdk=$JAVA_HOME
--with-version-opt=CRUX-r$release
--with-version-build=${version#*+}
--with-vendor-name=CRUX
--with-jobs=$JOBS
--with-libjpeg=system
--with-giflib=system
--with-libpng=system
--with-zlib=system
--with-lcms=system"
LC_ALL=C \
/bin/bash $SRC/jdk12u-$_jdkhash/configure $PKGMK_JDK12 \
$_COMMON_OPTIONS \
--prefix=$SRC/build-boot/images/jdk \
--with-extra-cflags="$_CFLAGS" \
--with-extra-cxxflags="$_CXXFLAGS"
# NOTE: for debugging build issues: set LOG to debug, JOBS to 1.
LC_ALL=C \
make LOG=warn JOBS=$JOBS jdk-image
export JAVA_HOME=$SRC/build-boot/images/jdk
export PATH=$JAVA_HOME/bin:$OLD_PATH
mkdir $SRC/build
cd $SRC/build
LC_ALL=C \
/bin/bash $SRC/jdk12u-$_jdkhash/configure $PKGMK_JDK12 \
--prefix=/$name \
$_COMMON_OPTIONS \
--with-extra-cflags="$_CFLAGS" \
--with-extra-cxxflags="$_CXXFLAGS"
# NOTE: for debugging build issues: set LOG to debug, JOBS to 1.
LC_ALL=C \
make LOG=warn JOBS=$JOBS jdk-image
rm -r images/jdk/demo
rm -r images/jdk/jmods
rm -r images/jdk/lib/src.zip
rm -r images/jdk/lib/*.ja
rm -r images/jdk/legal
cp -r images/jdk $PKG/$name
}