void-packages/srcpkgs/openjdk/template
2015-08-16 15:22:54 +02:00

141 lines
5.1 KiB
Bash

# TODO: better places for bin and man?
# TODO: make -headless versions
# TODO: config files?
# TODO: find giflib patch for --with-giflib=system
_java_ver=8
_jdk_update=72
_jdk_build=00
_repo_ver="jdk${_java_ver}u${_jdk_update}-b${_jdk_build}"
_openjdk_version="openjdk-1.8.0_${_jdk_update}"
# Template file for 'openjdk'
pkgname=openjdk
version=${_java_ver}u${_jdk_update}
revision=1
nocross=yes
wrksrc=jdk8u-jdk8u${_jdk_update}-b${_jdk_build}/
build_style=gnu-configure
configure_args="
--prefix=${XBPS_DESTDIR}/${sourcepkg}-${version}/usr/lib
--with-update-version=${_jdk_update}
--with-build-number=b${_jdk_build}
--with-milestone=fcs
--enable-unlimited-crypto
--with-zlib=system
$(vopt_if oracle_bootstrap --with-boot-jdk=/usr/lib/jvm/oracle-jdk \
--with-boot-jdk=/usr/lib/jvm/openjdk)"
make_build_args="DEBUG_BINARIES=true docs all"
hostmakedepends="pkg-config cpio unzip zip ca-certificates libressl-openssl"
case "$XBPS_MACHINE" in
arm*) hostmakedepends+=" $(vopt_if oracle_bootstrap oracle-jdk-arm openjdk)";;
*) hostmakedepends+=" $(vopt_if oracle_bootstrap oracle-jdk openjdk)";;
esac
makedepends="libXrender-devel libXtst-devel libXt-devel
libjpeg-turbo-devel cups-devel freetype-devel alsa-lib-devel"
case "$XBPS_TARGET_MACHINE" in
arm*)
makedepends+=" libffi-devel"
configure_args+=" --with-jvm-variants=zero"
esac
depends="openjdk-jre-${version}_${revision}"
provides="java-environment-${version}_1"
replaces="java-environment>=0"
short_desc="OpenJDK Java Development Kit"
maintainer="Christian Neukirchen <chneukirchen@gmail.com>"
license="GPL-3"
homepage="http://openjdk.java.net/"
distfiles="
http://hg.openjdk.java.net/jdk8u/jdk8u/archive/${_repo_ver}.tar.gz>jdk8u-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/corba/archive/${_repo_ver}.tar.gz>corba-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/archive/${_repo_ver}.tar.gz>hotspot-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/${_repo_ver}.tar.gz>jdk-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxws/archive/${_repo_ver}.tar.gz>jaxws-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxp/archive/${_repo_ver}.tar.gz>jaxp-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/archive/${_repo_ver}.tar.gz>langtools-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/nashorn/archive/${_repo_ver}.tar.gz>nashorn-${_repo_ver}.tar.gz"
checksum="868eb5eb39dff0a132fdc7d7a7072edfd2853f46a76c3c4c647298c88cf23a3d
acb8a1e098691faf8d4504f31bf913b4c9b0387ecd74f3746f31faabf59b83e8
a40dc8fe45b7ef0d436db79baf9dd026372098c7b8d95e95f16dd602c4528f0e
d8d6346439810c303343ff3e070ca0ccede4239e5f943fb6f0581fccb31fd9da
0f18298311989238b2ab2a64836290a213b62323e88054120ec071e78739c8da
ac14471c1e8782b21a647581935fb27f997bcdd1133e4b5d6d8d7ff925ab3307
39260b7531386a62e72f8c98f4ae20baa138ffea2a31242c06a400f188015610
7e93f5b61f4c94014de08ae125cfab2db5216436b9cf1ceffa69ace91242c4e9"
# Build is still parallel, but don't use -jN.
disable_parallel_build=yes
# -D_FORTIFY_SOURCE=2 doesn't work with CXX_O_FLAG_NONE="-O0"
CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
CXXFLAGS=${CXXFLAGS/-D_FORTIFY_SOURCE=2/}
build_options="oracle_bootstrap"
build_options_default="oracle_bootstrap"
desc_option_oracle_bootstrap="Bootstrap using Oracle JDK"
post_extract() {
chmod +x configure
for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn; do
ln -s ../${subrepo}-${_repo_ver} ${subrepo}
done
cd hotspot
# https://bugs.openjdk.java.net/browse/JDK-8041658
patch -p1 < ${FILESDIR}/002_gcc.make-4.9.patch
# patch supported os versions to include 4 and 4.1
sed -i ${wrksrc}/hotspot/make/linux/Makefile \
-e "/SUPPORTED_OS_VERSION =/s;\(.*\);\1 4% 4.1%;"
}
post_install() {
rm -rf ${DESTDIR}/usr/lib/bin
vinstall ${FILESDIR}/mkcacerts 755 usr/lib/jvm/$_openjdk_version/jre/bin
vmkdir usr/lib/jvm/$_openjdk_version/jre/lib/security
sh ${FILESDIR}/mkcacerts \
-d "/usr/share/ca-certificates/" \
-s "/usr/bin/openssl" \
-k "${DESTDIR}/usr/lib/jvm/$_openjdk_version/jre/bin/keytool" \
-o "${DESTDIR}/usr/lib/jvm/$_openjdk_version/jre/lib/security/cacerts"
vlicense ASSEMBLY_EXCEPTION
vlicense LICENSE
vlicense THIRD_PARTY_README
}
openjdk-jre_package() {
shlib_provides="libawt.so libawt_xawt.so libjava.so libjli.so libjvm.so"
short_desc="OpenJDK Java Runtime Environment"
provides="java-runtime-${version}_1"
replaces="java-runtime>=0"
pkg_install() {
vmove "usr/lib/jvm/$_openjdk_version/jre"
ln -s $_openjdk_version ${PKGDESTDIR}/usr/lib/jvm/openjdk
vmkdir etc/profile.d
cat >>${PKGDESTDIR}/etc/profile.d/10_openjdk.sh <<EOF
export JAVA_HOME=\${JAVA_HOME=/usr/lib/jvm/$_openjdk_version/jre}
export PATH="\$PATH:/usr/lib/jvm/$_openjdk_version/jre/bin:/usr/lib/jvm/$_openjdk_version/bin"
EOF
}
}
openjdk-src_package() {
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
short_desc+=" -- sources"
pkg_install() {
vmove "usr/lib/jvm/$_openjdk_version/src.zip"
}
}
openjdk-doc_package() {
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
short_desc+=" -- documentation"
pkg_install() {
cd ${wrksrc}
vmkdir usr/share/doc
cp -a build/linux-*/docs/* ${PKGDESTDIR}/usr/share/doc
}
}