Skip to content

Commit

Permalink
Merge pull request #3309 from hadfl/jdk17
Browse files Browse the repository at this point in the history
add openjdk 17 (r151038)
  • Loading branch information
oetiker authored Aug 3, 2023
2 parents 0554334 + fd45176 commit ec6aa35
Show file tree
Hide file tree
Showing 52 changed files with 30,651 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/meta/omnios-build-tools.p5m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ depend fmri=pkg://@PKGPUBLISHER@/library/python-3/setuptools-rust-39 \
depend fmri=pkg://@PKGPUBLISHER@/library/security/openssl type=require
depend fmri=pkg://@PKGPUBLISHER@/library/zlib type=require
depend fmri=pkg://@PKGPUBLISHER@/network/rsync type=require
depend fmri=pkg://@PKGPUBLISHER@/runtime/java/openjdk11 type=require
depend fmri=pkg://@PKGPUBLISHER@/runtime/java/openjdk17 type=require
depend fmri=pkg://@PKGPUBLISHER@/runtime/perl type=require
depend fmri=pkg://@PKGPUBLISHER@/runtime/python-27 type=require
depend fmri=pkg://@PKGPUBLISHER@/runtime/python-39 type=require
Expand Down
125 changes: 125 additions & 0 deletions build/openjdk17/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/functions.sh

PROG=openjdk
VER=17
UPDATE=8
BUILD=7
PKG=runtime/java/openjdk17
SUMMARY="openjdk $VER"
DESC="Open-source implementation of the seventeenth edition of the "
DESC+="Java SE Platform"

# check ooce/fonts/liberation for current version
LIBERATIONFONTSVER=2.1.5
SKIP_LICENCES="SILv1.1"

set_arch 64

set_builddir "jdk${VER}u-jdk-$VER.0.$UPDATE-$BUILD"

BMI_EXPECTED=1
SKIP_RTIME_CHECK=1
NO_SONAME_EXPECTED=1

BUILD_DEPENDS_IPS="
system/header/header-audio
runtime/java/openjdk17
ooce/library/fontconfig
ooce/library/freetype2
ooce/print/cups
"

VERHUMAN=jdk${VER}u${UPDATE}-b$BUILD
IVER=${VER}.0

IROOT=usr/jdk/instances
IFULL=$IROOT/$PROG$IVER

OOCEPREFIX=/opt/ooce

XFORM_ARGS="
-DVER=$VER
-DIVER=$IVER
-DIROOT=$IROOT
-DIFULL=$IFULL
-DLFVER=$LIBERATIONFONTSVER
"

# The JDK build framework does not use the -j option to make.
NO_PARALLEL_MAKE=1

CONFIGURE_OPTS="
--with-version-build=$BUILD
--with-version-pre=
--with-version-opt=omnios-$RELVER
--with-toolchain-type=gcc
--with-boot-jdk=/$IFULL
--enable-deprecated-ports=yes
--enable-headless-only
--disable-ccache
--with-native-debug-symbols=none
--disable-warnings-as-errors
--enable-unlimited-crypto
--disable-dtrace
--with-cacerts-file=/etc/ssl/java/cacerts
--x-includes=$OOCEPREFIX/include
--x-libraries=$OOCEPREFIX/lib/$ISAPART64
--with-cups-include=$OOCEPREFIX/include
--with-freetype=bundled
--with-fontconfig-include=$OOCEPREFIX/include
"
CONFIGURE_OPTS_WS="
--with-extra-cflags=\"$CFLAGS $CFLAGS64\"
--with-extra-cxxflags=\"$CXXFLAGS $CXXFLAGS64\"
"

MAKE_ARGS="all"

make_install() {
logmsg "Installing openjdk to $DESTDIR"

logcmd mkdir -p $DESTDIR/$IFULL || logerr "--- mkdir failed"
logcmd rsync -a $TMPDIR/$BUILDDIR/images/jdk/ $DESTDIR/$IFULL/ \
|| logerr "--- rsync failed"

# Install liberation fonts to cover the 'core fonts' set
# See also patches/fontpath.patch
DDIR=$DESTDIR/$IFULL/lib/fonts
logcmd mkdir -p $DDIR || logerr "mkdir fonts"
logcmd cp $TMPDIR/$LFDIR/Liberation*.ttf $DDIR \
|| logerr "failed to copy fonts"
}

init
download_source $PROG "jdk-$VER.0.$UPDATE+$BUILD"
patch_source

# Also download the liberation fonts archive. Fonts from here will be
# provided to satisfy the core fonts.
LFDIR=liberation-fonts-ttf-$LIBERATIONFONTSVER
BUILDDIR=$LFDIR download_source liberation-fonts $LFDIR

prep_build autoconf -oot
chmod +x $CONFIGURE_CMD
build -noctf
VER=$IVER.$UPDATE DASHREV=$BUILD make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
51 changes: 51 additions & 0 deletions build/openjdk17/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.

<transform file path=.*/src.zip$ -> drop>
<transform path=$(IFULL)/demo -> drop>

<transform file path=$(IFULL)/conf -> set preserve renamenew>
<transform file path=$(IFULL)/conf -> set overlay allow>

<transform file path=.*/cacerts$ -> drop>
link path=$(IFULL)/jre/lib/security/cacerts target=/etc/ssl/java/cacerts
link path=$(IFULL)/lib/security/cacerts target=/etc/ssl/java/cacerts

<transform file path=$(IFULL)/lib/[^/]+$ \
-> set pkg.depend.bypass-generate libjvm\.so>
# stop pulling in X11 stuff from omnios-extra
<transform file path=$(IFULL)/lib/libjawt\.so$ \
-> add pkg.depend.bypass-generate .*/lib[xX].*>

# Mediated binaries
<transform file path=$(IFULL)/bin/(.*) -> emit \
link path=usr/bin/%<1> target=../java/bin/%<1> \
mediator=openjdk mediator-version=$(VER)>

# Mediated man pages
<transform file path=$(IFULL)/man/man1/(.*) -> emit \
link path=usr/share/man/man1/%<1> target=../../../java/man/man1/%<1> \
mediator=openjdk mediator-version=$(VER)>

# Add mediated link for /usr/java
link path=usr/java target=jdk/openjdk$(IVER) \
mediator=openjdk mediator-version=$(VER)

link path=usr/jdk/openjdk$(IVER) target=instances/openjdk$(IVER)

license $(IFULL)/legal/java.base/LICENSE \
license="GPLv2/with Classpath Exception"

license ../liberation-fonts-ttf-$(LFVER)/LICENSE license=SILv1.1

<transform file path=$(IFULL)/conf -> set preserve renamenew>

34 changes: 34 additions & 0 deletions build/openjdk17/patches/README-removal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
15+24 was tagged after the solaris/sparc removal but didn't actually
include it, it was based on a slightly earlier commit.

However, this is a set of notes on how the removal is being addressed
http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.final/open/webrev/
it's therefore relatively trivial to revert the removal at this point

The patch there was:

wc java-solaris-sparc.patch
143793 691143 5454385 java-solaris-sparc.patch

And there are 953 files affected by the patch

grep '^---' java-solaris-sparc.patch | awk '{print $2}' | wc -l
953

297 of those are under test, we probably don't want them (for now, at
any rate)

214 are sparc, which again we don't want

There are some mac/bsd/linux patches left after that

Overall, we want less that half the files in the patch, based on
filename alone.

It turns out that gpatch couldn't cope with the original
patch. Rebuilt it as 64-bit and it was much happier.

For 15+26, I've trimmed about 2/3 of java-solaris-sparc.patch
This is mostly about not restoring SPARC, there's still quite a lot
more cleanup we could do. Also, we shouldn't have to separately patch
the files we created by applying the main patch.
Loading

0 comments on commit ec6aa35

Please sign in to comment.