openjdk-9-jre-headless (#895)

* openjdk-9: move to ubuntu package naming and layout convention

update to latest changesets (tag 162)
update cups headers to 2.2.3
split into jre, jdk and source packages
use the client jvm, renove libffi dependency
create wrappers for binaries for LD_LIBRARY_PATH
various fixes to get it working

* openjdk-9: depend on ca-certificates-java
This commit is contained in:
Vishal Biswas 2017-04-03 21:04:39 +05:30 committed by Fredrik Fornwall
parent b347c7c90f
commit b21ba84392
7 changed files with 122 additions and 32 deletions

View File

@ -1,11 +1,13 @@
TERMUX_PKG_HOMEPAGE=http://openjdk.java.net
TERMUX_PKG_DESCRIPTION="OpenJDK 9 Java Runtime Environment (prerelease)"
_jbuild=160
_jbuild=162
_hg_tag="jdk-9+${_jbuild}"
TERMUX_PKG_VERSION="9.2017.3.20"
_jvm_dir="lib/jvm/openjdk-9"
TERMUX_PKG_VERSION="9.2017.4.3"
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_HOMEPAGE=http://openjdk.java.net/projects/jdk9
TERMUX_PKG_DEPENDS="freetype, libpng, libffi"
TERMUX_PKG_DEPENDS="freetype, libpng, ca-certificates-java"
TERMUX_PKG_CONFFILES="$_jvm_dir/lib/jvm.cfg"
# currently upstream has no support building for these arches on android
# this will change in the future
TERMUX_PKG_BLACKLISTED_ARCHES="aarch64 x86_64"
@ -14,32 +16,35 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-option-checking
--disable-warnings-as-errors
--enable-headless-only
--with-libffi=$TERMUX_PREFIX
--with-freetype=$TERMUX_PREFIX
--with-libpng=system
--with-zlib=system
--with-jdk-variant=normal
--with-jvm-variants=client
"
TERMUX_PKG_CLANG=no
_cups_ver=2.2.2
TERMUX_PKG_RM_AFTER_INSTALL="$_jvm_dir/demo $_jvm_dir/sample"
changesets=('b273cb907f72'
'18f02bc43fe9'
'033d015c6d8b'
'ac4c88ea156c'
'7d5352c54fc8'
'51b63f1b8001'
'2340259b3155'
'd6ef419af865')
_cups_ver=2.2.3
sha256sums=('1fe425e4cade15bc552083b067270b1049a9ae2a4f721a48c55709cc593f1657'
'1dff59f743f03a284caa70184873d24e9d3733485f15c9c3519843ea2986e0d7'
'f417fce184e755b279d681819470f4a6f2d8ba6aa2624b520c67bfc184cb3ab2'
'7de8fd296a1b9602851797d88268fae4fac171706bfeb80b20c352ff070ab60f'
'efe917c6c776485069bfa147065e7ebfa9d7b3d937eec6db4f143b847548c0a2'
'801261a2e65688264ba33fe50ef87bbf3ff703cb6b70d0661b365ca17d776b16'
'a3961c7ff0e2f8c80f99e49e321dc0c2e15c752a90f6ff6b95d77f54e10e1650'
'a4e817b9f2e66f46646b4043081aa8be8e6502221d85d1f606f5e808b0b23f2a'
'f589bb7d5d1dc3aa0915d7cf2b808571ef2e1530cd1a6ebe76ae8f9f4994e4f6')
changesets=('d9c3e4f30936'
'493011dee80e'
'dc3346496843'
'0d44d05a4c96'
'3890f96e8995'
'92a38c75cd27'
'24582dd2649a'
'5e5e436543da')
sha256sums=('36ca35e4fe90ae1b1966d9f909c108f39fe411b2e783faa49102d2088909be8e'
'9d24cab2e16c17f51d591b9786005062bee3e60e394d1b78dddbdfb01b9a5ea6'
'312204f76d4f23be09aa7121273ac791588de5c6a3c25d49b3087a6eb547bb7a'
'9ef21b7013ef2a0b0870d4741fc961d1fce0fcb91f44a1f8cdad865455583246'
'8d925111270630a171b0165b740bdd5d8d07c4aa1f9ea3caa86076b9f896d3ed'
'1fec470e1480472ec7e4ff402bc4b6de5e095cfd5f787bdc250814eb9479a3c0'
'db95a143078cdf3cefff5479c5350b678b1a779fcdcf7e066049559a537d81e1'
'115601bbce2f5d9df66ce49d4ca6f6db327f1e17865537911160f0cde919e7bf'
'66701fe15838f2c892052c913bde1ba106bbee2e0a953c955a62ecacce76885f')
reponames=(dev corba hotspot jdk jaxws jaxp langtools nashorn cups)
@ -71,7 +76,7 @@ termux_step_post_extract_package () {
$TERMUX_TAR xf $file -C $TERMUX_PKG_SRCDIR
}
# override this step to since openjdk provides their own customized guess scripts
# override this step to since openjdk provides its own customized guess scripts
termux_step_replace_guess_scripts () {
return
}
@ -79,14 +84,6 @@ termux_step_replace_guess_scripts () {
termux_step_pre_configure () {
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-cups-include=$TERMUX_PKG_SRCDIR/cups-$_cups_ver"
# might be required
# libffi dependency is required if zero interpreter is used
#if [ -o "$TERMUX_ARCH" == 'i686' -o "$TERMUX_ARCH" == 'x86_64' ]; then
# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=' --with-jvm-variants=client'
#else
# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=' --with-jvm-variants=zero'
#fi
cat > "$TERMUX_STANDALONE_TOOLCHAIN/devkit.info" <<HERE
DEVKIT_NAME="Android ${TERMUX_ARCH^^}"
DEVKIT_TOOLCHAIN_PATH="\$DEVKIT_ROOT/$TERMUX_HOST_PLATFORM/bin"
@ -102,7 +99,6 @@ termux_step_configure () {
bash $TERMUX_PKG_SRCDIR/configure \
--prefix=$TERMUX_PREFIX \
--openjdk-target=$TERMUX_HOST_PLATFORM \
--with-jdk-variant=normal \
--libexecdir=$TERMUX_PREFIX/libexec \
--with-devkit=$ANDROID_DEVKIT \
--with-extra-cflags="$CPPFLAGS $CFLAGS" \
@ -115,3 +111,25 @@ termux_step_make () {
make JOBS=$TERMUX_MAKE_PROCESSES images
}
termux_step_post_make_install () {
# move jvm install dir
mkdir -p $TERMUX_PREFIX/lib/jvm
rm -rf "$TERMUX_PREFIX/lib/jvm/openjdk-9"
mv $TERMUX_PREFIX/jvm/openjdk-9-internal $TERMUX_PREFIX/$_jvm_dir
# place src.zip in standard location mimicking ubuntu
mv $TERMUX_PREFIX/$_jvm_dir/lib/src.zip $TERMUX_PREFIX/$_jvm_dir/src.zip
# create shell wrappers for binaries
for binary in $TERMUX_PREFIX/$_jvm_dir/bin/*; do
binary=`basename $binary`
rm -f $TERMUX_PREFIX/bin/$binary
echo "export JAVA_HOME=\$PREFIX/$_jvm_dir" > $TERMUX_PREFIX/bin/$binary
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$JAVA_HOME/lib:\$JAVA_HOME/lib/jli" >> $TERMUX_PREFIX/bin/$binary
echo "\$JAVA_HOME/bin/$binary \"\$@\"" >> $TERMUX_PREFIX/bin/$binary
chmod u+x $TERMUX_PREFIX/bin/$binary
done
# use cacerts provided by ca-certificates-java
ln -sf "$TERMUX_PREFIX/$_jvm_dir/lib/security/jssecacerts" "$TERMUX_PREFIX/$_jvm_dir/lib/security/cacerts"
}

View File

@ -0,0 +1,12 @@
shoutout to @its-pointless (live_the_dream)
--- ./hotspot/src/share/vm/runtime/os.cpp 2017-03-30 20:45:45.000000000 +0530
+++ ../os.cpp 2017-03-31 11:04:17.097618021 +0530
@@ -74,7 +74,7 @@
int os::_processor_count = 0;
int os::_initial_active_processor_count = 0;
size_t os::_page_sizes[os::page_sizes_max];
-const char * os::_java_home = NULL;
+const char * os::_java_home = "@TERMUX_PREFIX@/lib/jvm/openjdk-9";
#ifndef PRODUCT
julong os::num_mallocs = 0; // # of calls to malloc/realloc

View File

@ -0,0 +1,11 @@
--- ./jdk/src/java.base/unix/native/libjli/java_md_solinux.c 2017-03-30 20:45:48.000000000 +0530
+++ ../java_md_solinux.c 2017-03-31 09:15:07.979651293 +0530
@@ -163,7 +163,7 @@
*/
#ifdef __ANDROID__
-static char * __java_home = NULL;
+static char * __java_home = "@TERMUX_PREFIX@/lib/jvm/openjdk-9";
#endif
void SetJavaHome(char *arg) {

View File

@ -0,0 +1,33 @@
TERMUX_SUBPKG_INCLUDE="$_jvm_dir/bin/idlj bin/idlj
$_jvm_dir/bin/jar bin/jar
$_jvm_dir/bin/jarsigner bin/jarsigner
$_jvm_dir/bin/javac bin/javac
$_jvm_dir/bin/javadoc bin/javadoc
$_jvm_dir/bin/javah bin/javah
$_jvm_dir/bin/javap bin/javap
$_jvm_dir/bin/jcmd bin/jcmd
$_jvm_dir/bin/jdb bin/jdb
$_jvm_dir/bin/jdeprscan bin/jdeprscan
$_jvm_dir/bin/jdeps bin/jdeps
$_jvm_dir/bin/jhsdb bin/jhsdb
$_jvm_dir/bin/jimage bin/jimage
$_jvm_dir/bin/jinfo bin/jinfo
$_jvm_dir/bin/jlink bin/jlink
$_jvm_dir/bin/jmap bin/jmap
$_jvm_dir/bin/jmod bin/jmod
$_jvm_dir/bin/jps bin/jps
$_jvm_dir/bin/jrunscript bin/jrunscript
$_jvm_dir/bin/jshell bin/jshell
$_jvm_dir/bin/jstack bin/jstack
$_jvm_dir/bin/jstat bin/jstat
$_jvm_dir/bin/jstatd bin/jstatd
$_jvm_dir/bin/policytool bin/policytool
$_jvm_dir/bin/rmic bin/rmic
$_jvm_dir/bin/schemagen bin/schemagen
$_jvm_dir/bin/serialver bin/serialver
$_jvm_dir/bin/wsgen bin/wsgen
$_jvm_dir/bin/wsimport bin/wsimport
$_jvm_dir/bin/xjc bin/xjc
$_jvm_dir/include"
TERMUX_SUBPKG_DEPENDS="openjdk-9-jre-headless"
TERMUX_SUBPKG_DESCRIPTION="OpenJDK Development Kit (JDK) (headless)"

View File

@ -0,0 +1,4 @@
TERMUX_SUBPKG_INCLUDE="$_jvm_dir/src.zip"
TERMUX_SUBPKG_DEPENDS="openjdk-9-jre-headless"
TERMUX_SUBPKG_DESCRIPTION="OpenJDK Development Kit (JDK) source files"
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=yes

View File

@ -0,0 +1,12 @@
thanks @fornwall for finding this
--- ./jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java 2017-03-30 20:45:48.000000000 +0530
+++ ../ProcessImpl.java 2017-04-01 23:04:39.565293249 +0530
@@ -157,7 +157,7 @@
static Platform get() {
String osName = GetPropertyAction.privilegedGetProperty("os.name");
- if (osName.equals("Linux")) { return LINUX; }
+ if (osName.equals("Linux") || osName.equals("Android")) { return LINUX; }
if (osName.contains("OS X")) { return BSD; }
if (osName.equals("SunOS")) { return SOLARIS; }
if (osName.equals("AIX")) { return AIX; }