void-packages/srcpkgs/openjdk9-bootstrap/template

147 lines
4.8 KiB
Bash

# Template file for 'openjdk9-bootstrap'
_final_jdk_home="usr/lib/jvm/java-9-openjdk"
pkgname=openjdk9-bootstrap
version=9.0.4p12
revision=2
_repo_ver=${version/p/+}
wrksrc="jdk9u-jdk-${_repo_ver}"
build_style=gnu-configure
configure_args="
--prefix=${XBPS_DESTDIR}/${pkgname}-${version}/usr/lib
--disable-warnings-as-errors
--with-zlib=system
--with-giflib=system
--with-libjpeg=system
--with-libpng=system
--with-lcms=system
--with-jtreg=no
--with-jobs=${XBPS_MAKEJOBS}
--enable-dtrace=no
--with-debug-level=release
--with-version-pre=
--with-version-build=${version#*p}
--with-boot-jdk=/usr/lib/jvm/java-1.8-openjdk"
make_build_args="images"
hostmakedepends="pkg-config automake autoconf cpio tar unzip zip ca-certificates
zlib-devel which openjdk8 make"
makedepends="libXrender-devel libXtst-devel libXt-devel libXrandr-devel
giflib-devel libpng-devel libjpeg-turbo-devel lcms2-devel cups-devel
freetype-devel alsa-lib-devel fontconfig-devel zlib-devel"
short_desc="OpenJDK Java Development Kit (bootstrap version 9)"
maintainer="q66 <daniel@octaforge.org>"
license="GPL-2.0-only WITH Classpath-exception-2.0"
homepage="http://openjdk.java.net/"
distfiles="
http://hg.openjdk.java.net/jdk-updates/jdk9u/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-root.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/corba/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-corba.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/hotspot/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-hotspot.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/jaxp/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-jaxp.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/jaxws/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-jaxws.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/jdk/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-jdk.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/langtools/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-langtools.tar.bz2
http://hg.openjdk.java.net/jdk-updates/jdk9u/nashorn/archive/jdk-${_repo_ver}.tar.bz2>jdk-${_repo_ver}-nashorn.tar.bz2"
checksum="914183a7eac6a1dfdfa70a98ceb4262244c77ab904c4570bb34c609ecb5f0986
3807400280a3b92e9dd23fcdd76482162ce54af6fbbaa0777cb6235ad6a66fea
e1da0455cb546666494d6a07f263f9af5dd2772c37d89db552dcae48339b9e2f
0021cc00f8ebc35e5a2cc9e8ceffcaf1620499a6eb922937bf7bc0d44a49bab6
d71476426c346cfc819f03521f3d3dc60cae9d5dd09e7e3d1d0f4990107d42a7
b7e42590a81f0e3a681f663efe89cad4c1d7041700832d90b421bb2bbe7f2d1a
9cba7f03ebeda4d3cfaffb015f9bf967fcca2c3c113604836073556df6a7b9aa
c939de46f903ecb283c02155e1415cee98ab66803e17eae0403c399c1a475647"
# no hotspot JIT for arm32 and ppc32
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
arm*|ppc*) _use_zero=yes ;;
esac
if [ -n "$_use_zero" ]; then
makedepends+=" libffi-devel"
configure_args+=" --with-jvm-variants=zero"
case "$XBPS_TARGET_MACHINE" in
ppc*) configure_args+=" --with-boot-jdk-jvmargs=-XX:ThreadStackSize=2560";;
esac
fi
lib32disabled=yes
shlib_provides="libawt.so libawt_xawt.so libjava.so libjli.so libjvm.so libjawt.so"
nocross=yes
if [ -n "$XBPS_DEBUG_PKGS" ]; then
configure_args+=" --with-native-debug-symbols=internal"
fi
# enabling ccache segfaults gcc
export CCACHE_DISABLE=1
post_extract() {
chmod +x configure
for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn; do
mv ../${subrepo}-jdk-${_repo_ver} ${subrepo}
done
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
rm -r hotspot/src/jdk.hotspot.agent
fi
}
post_patch() {
[ "$XBPS_TARGET_LIBC" != "musl" ] && return 0
for f in ${FILESDIR}/musl_*.patch; do
echo "Applying $f"
patch -sNp1 -i "$f"
done
}
do_configure() {
CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
CXXFLAGS=${CXXFLAGS/-D_FORTIFY_SOURCE=2/}
# force ELFv2 for ppc64 just in case
case "$XBPS_TARGET_MACHINE" in
ppc64*)
CFLAGS+=" -DABI_ELFv2"
CXXFLAGS+=" -DABI_ELFv2"
;;
esac
CFLAGS+=" -fcommon"
CXXFLAGS+=" -fcommon"
configure_args=${configure_args/--with-libtool-sysroot=\/usr\/[a-z0-9]*-linux-[a-z]*/}
# build system newly checks for ccache and dies if it finds it
# explicitly need full path as otherwise it will still resolve to ccache
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
./configure ${configure_args} --with-extra-cflags="$CFLAGS" \
--with-extra-cxxflags="$CXXFLAGS" --with-extra-ldflags="$LDFLAGS"
}
pre_build() {
# only use modified flags as specified in configure
unset CFLAGS CXXFLAGS LDFLAGS
}
do_build() {
# do not set disable_parallel_build in order to be able to read makejobs
make -j1 ${make_build_args} ${make_build_target}
}
post_install() {
# we manage this ourselves
rm -rf ${DESTDIR}/usr/lib/bin
# unify the install prefix
mv ${DESTDIR}/usr/lib/jvm/openjdk-${version%p*} ${DESTDIR}/${_final_jdk_home}
# big and unnecessary
rm -f ${DESTDIR}/${_final_jdk_home}/lib/src.zip
vlicense ASSEMBLY_EXCEPTION
vlicense LICENSE
vlicense ADDITIONAL_LICENSE_INFO
}