212 lines
8.6 KiB
Bash
212 lines
8.6 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=102
|
|
_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"
|
|
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"
|
|
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="1f5774a545c45c8c632629653c921595a14977bb2b37d6a6a13961f022a94944
|
|
cca9416a3384cb357940c329db05086ac7e8ee8a15a26ffbd24ff92c8d87fa47
|
|
f11c4e553ec48eef5aa05905c4935e7d58836bb0b879f24cfdbb290a96304c12
|
|
74db706165ab3d082dee2e719a7d674954996e4320cc66d2d78482a3c0c47663
|
|
cc4cdc20137820a9375b56dcdaa6e33db6b4f798f89fdee3123ae27d0057a9f0
|
|
2e82909331c2c7070f7c2140bcd9a2c7719c2023fe14fa0752f45e3554a3c9cd
|
|
2f08ff03d4f730bc256a4eaaa9ddee31ce200b6a91a954918fdc3603f045e5a7
|
|
7edb054fd2180067852126274ca335e39f11615efc5e28f9817496d0f19b80b4"
|
|
|
|
# Build is still parallel, but don't use -jN.
|
|
disable_parallel_build=yes
|
|
|
|
build_options="oracle_bootstrap"
|
|
build_options_default="oracle_bootstrap"
|
|
desc_option_oracle_bootstrap="Bootstrap using Oracle JDK"
|
|
|
|
alternatives="
|
|
java:/usr/bin/java:/usr/lib/jvm/openjdk/bin/java
|
|
java:/usr/bin/jjs:/usr/lib/jvm/openjdk/bin/jjs
|
|
java:/usr/bin/keytool:/usr/lib/jvm/openjdk/bin/keytool
|
|
java:/usr/bin/mkcacerts:/usr/lib/jvm/openjdk/bin/mkcacerts
|
|
java:/usr/bin/orbd:/usr/lib/jvm/openjdk/bin/orbd
|
|
java:/usr/bin/pack200:/usr/lib/jvm/openjdk/bin/pack200
|
|
java:/usr/bin/policytool:/usr/lib/jvm/openjdk/bin/policytool
|
|
java:/usr/bin/rmid:/usr/lib/jvm/openjdk/bin/rmid
|
|
java:/usr/bin/rmiregistry:/usr/lib/jvm/openjdk/bin/rmiregistry
|
|
java:/usr/bin/servertool:/usr/lib/jvm/openjdk/bin/servertool
|
|
java:/usr/bin/tnameserv:/usr/lib/jvm/openjdk/bin/tnameserv
|
|
java:/usr/bin/unpack200:/usr/lib/jvm/openjdk/bin/unpack200
|
|
|
|
jdk:/usr/bin/appletviewer:/usr/lib/jvm/openjdk/bin/appletviewer
|
|
jdk:/usr/bin/extcheck:/usr/lib/jvm/openjdk/bin/extcheck
|
|
jdk:/usr/bin/idlj:/usr/lib/jvm/openjdk/bin/idlj
|
|
jdk:/usr/bin/jar:/usr/lib/jvm/openjdk/bin/jar
|
|
jdk:/usr/bin/jarsigner:/usr/lib/jvm/openjdk/bin/jarsigner
|
|
jdk:/usr/bin/java:/usr/lib/jvm/openjdk/bin/java
|
|
jdk:/usr/bin/java-rmi.cgi:/usr/lib/jvm/openjdk/bin/java-rmi.cgi
|
|
jdk:/usr/bin/javac:/usr/lib/jvm/openjdk/bin/javac
|
|
jdk:/usr/bin/javadoc:/usr/lib/jvm/openjdk/bin/javadoc
|
|
jdk:/usr/bin/javah:/usr/lib/jvm/openjdk/bin/javah
|
|
jdk:/usr/bin/javap:/usr/lib/jvm/openjdk/bin/javap
|
|
jdk:/usr/bin/jcmd:/usr/lib/jvm/openjdk/bin/jcmd
|
|
jdk:/usr/bin/jconsole:/usr/lib/jvm/openjdk/bin/jconsole
|
|
jdk:/usr/bin/jdb:/usr/lib/jvm/openjdk/bin/jdb
|
|
jdk:/usr/bin/jdeps:/usr/lib/jvm/openjdk/bin/jdeps
|
|
jdk:/usr/bin/jhat:/usr/lib/jvm/openjdk/bin/jhat
|
|
jdk:/usr/bin/jinfo:/usr/lib/jvm/openjdk/bin/jinfo
|
|
jdk:/usr/bin/jjs:/usr/lib/jvm/openjdk/bin/jjs
|
|
jdk:/usr/bin/jmap:/usr/lib/jvm/openjdk/bin/jmap
|
|
jdk:/usr/bin/jps:/usr/lib/jvm/openjdk/bin/jps
|
|
jdk:/usr/bin/jrunscript:/usr/lib/jvm/openjdk/bin/jrunscript
|
|
jdk:/usr/bin/jsadebugd:/usr/lib/jvm/openjdk/bin/jsadebugd
|
|
jdk:/usr/bin/jstack:/usr/lib/jvm/openjdk/bin/jstack
|
|
jdk:/usr/bin/jstat:/usr/lib/jvm/openjdk/bin/jstat
|
|
jdk:/usr/bin/jstatd:/usr/lib/jvm/openjdk/bin/jstatd
|
|
jdk:/usr/bin/keytool:/usr/lib/jvm/openjdk/bin/keytool
|
|
jdk:/usr/bin/native2ascii:/usr/lib/jvm/openjdk/bin/native2ascii
|
|
jdk:/usr/bin/orbd:/usr/lib/jvm/openjdk/bin/orbd
|
|
jdk:/usr/bin/pack200:/usr/lib/jvm/openjdk/bin/pack200
|
|
jdk:/usr/bin/policytool:/usr/lib/jvm/openjdk/bin/policytool
|
|
jdk:/usr/bin/rmic:/usr/lib/jvm/openjdk/bin/rmic
|
|
jdk:/usr/bin/rmid:/usr/lib/jvm/openjdk/bin/rmid
|
|
jdk:/usr/bin/rmiregistry:/usr/lib/jvm/openjdk/bin/rmiregistry
|
|
jdk:/usr/bin/schemagen:/usr/lib/jvm/openjdk/bin/schemagen
|
|
jdk:/usr/bin/serialver:/usr/lib/jvm/openjdk/bin/serialver
|
|
jdk:/usr/bin/servertool:/usr/lib/jvm/openjdk/bin/servertool
|
|
jdk:/usr/bin/tnameserv:/usr/lib/jvm/openjdk/bin/tnameserv
|
|
jdk:/usr/bin/unpack200:/usr/lib/jvm/openjdk/bin/unpack200
|
|
jdk:/usr/bin/wsgen:/usr/lib/jvm/openjdk/bin/wsgen
|
|
jdk:/usr/bin/wsimport:/usr/lib/jvm/openjdk/bin/wsimport
|
|
jdk:/usr/bin/xjc:/usr/lib/jvm/openjdk/bin/xjc
|
|
"
|
|
|
|
do_build() {
|
|
# -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/}
|
|
make ${makejobs} ${make_build_args}
|
|
}
|
|
|
|
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"
|
|
alternatives="
|
|
java:/usr/bin/java:/usr/lib/jvm/openjdk/jre/bin/java
|
|
java:/usr/bin/jjs:/usr/lib/jvm/openjdk/jre/bin/jjs
|
|
java:/usr/bin/keytool:/usr/lib/jvm/openjdk/jre/bin/keytool
|
|
java:/usr/bin/mkcacerts:/usr/lib/jvm/openjdk/jre/bin/mkcacerts
|
|
java:/usr/bin/orbd:/usr/lib/jvm/openjdk/jre/bin/orbd
|
|
java:/usr/bin/pack200:/usr/lib/jvm/openjdk/jre/bin/pack200
|
|
java:/usr/bin/policytool:/usr/lib/jvm/openjdk/jre/bin/policytool
|
|
java:/usr/bin/rmid:/usr/lib/jvm/openjdk/jre/bin/rmid
|
|
java:/usr/bin/rmiregistry:/usr/lib/jvm/openjdk/jre/bin/rmiregistry
|
|
java:/usr/bin/servertool:/usr/lib/jvm/openjdk/jre/bin/servertool
|
|
java:/usr/bin/tnameserv:/usr/lib/jvm/openjdk/jre/bin/tnameserv
|
|
java:/usr/bin/unpack200:/usr/lib/jvm/openjdk/jre/bin/unpack200
|
|
"
|
|
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}
|
|
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
|
|
}
|
|
}
|