141 lines
5.1 KiB
Bash
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=76
|
|
_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="878659af51338538c595e6f7f6da5c5ef45698fef7d8d87b18a5b58d42cdfcaf
|
|
033d76e8bfb6e16ae4dac909c6b91f95ac855391d04a98e9f85fb222ba28883a
|
|
c815e0d0d02bb6dffca5715ef70a4bf1c57a9f45c84f9164cb756bc99306c7c5
|
|
508dbde102a055fd1e4401b2e8b9d5c63d0a787ed3511f5db0f947edca1d1487
|
|
c4e393c04a9c5b4c9da3bf5089a65c24b8a46b69974786153ba57cbad72258b4
|
|
125c4538297e210febf5ec21b6fc049749b99c02638623c4f6b3bf770e232d5b
|
|
24255174a0a09afc39bd987f0c6332859bedf8c809aa8d4ea650e507cff28f10
|
|
0603fa53c93d6652ba17b2f720008ecaf247de00f416dc0987105b32ffdc2d86"
|
|
|
|
# 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
|
|
}
|
|
}
|