pantry/projects/openjdk.org/package.yml
2024-03-07 13:00:53 -05:00

165 lines
4.9 KiB
YAML

distributable:
# TODO: add jdk11 and jdk8
- url: https://github.com/openjdk/jdk21u/archive/{{version.tag}}.tar.gz
strip-components: 1
- url: https://github.com/openjdk/jdk20u/archive/{{version.tag}}.tar.gz
strip-components: 1
- url: https://github.com/openjdk/jdk17u/archive/{{version.tag}}.tar.gz
strip-components: 1
versions:
# each repo contains all the prior repo tags at the time of the fork,
# as well as tags like 21+10, which should be 21.0.0.10, but parses to
# 21.10.0.
- github: openjdk/jdk21u/tags
transform: 'v => v.match(/jdk-21\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined'
- github: openjdk/jdk20u/tags
transform: 'v => v.match(/jdk-20\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined'
- github: openjdk/jdk17u/tags
transform: 'v => v.match(/jdk-17\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined'
interprets:
extensions: java
args: java
dependencies:
giflib.sourceforge.io: '*'
harfbuzz.org: ^8
libjpeg-turbo.org: '*'
libpng.org: '*'
littlecms.com: '*'
openprinting.github.io/cups: '*'
info-zip.org/unzip: '*'
zlib.net: '*'
libzip.org: '*'
linux:
alsa-project.org/alsa-lib: '*'
freedesktop.org/fontconfig: '*'
freetype.org: '*'
x.org/x11: '*'
x.org/exts: '*'
x.org/xrandr: '*'
x.org/xrender: '*'
x.org/xt: '*'
x.org/xtst: '*'
info-zip.org/zip: '*'
darwinsys.com/file: '*'
runtime:
env:
JAVA_HOME: '{{prefix}}'
build:
dependencies:
linux:
llvm.org: <17
gnu.org/make: '*'
gnu.org/autoconf: '*'
freedesktop.org/pkg-config: '*'
gnu.org/wget: '*'
script:
- run: wget -c ${BOOT_JDK{{version.major}}}_${JDK_ARCH}_bin.tar.gz -O - | tar xz -C . --strip-components=$STRIP
working-directory: boot-jdk
# autoconf won't find llvm-cxxfilt for c++filt, and won't take an envvar
- run: sed -i -e's/c..filt/llvm-cxxfilt/' toolchain.m4
working-directory: make/autoconf
if: linux
- bash configure $ARGS
--with-boot-jdk="$BOOT_JDK_DIR"
--with-vendor-version-string="$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')"
--with-extra-cflags="$CFLAGS"
--with-extra-cxxflags="$CXXFLAGS"
--with-extra-ldflags="$LDFLAGS"
- make images
- mkdir -p {{prefix}}
- mv $JDK_DIR {{prefix}}/
env:
MAKEFLAGS: 'JOBS={{ hw.concurrency }}'
darwin:
STRIP: 2
BOOT_JDK_DIR: $SRCROOT/boot-jdk/Contents/Home
JDK_DIR: build/*/images/jdk-bundle/jdk-{{version.marketing}}.{{version.patch}}.jdk/Contents/Home/*
ARGS:
- --enable-dtrace
linux:
STRIP: 1
BOOT_JDK_DIR: $SRCROOT/boot-jdk
JDK_DIR: build/*/images/jdk/*
ARGS:
- --with-cups={{deps.openprinting.github.io/cups.prefix}}
- --with-fontconfig={{deps.freedesktop.org/fontconfig.prefix}}
- --with-freetype=system
- --with-stdc++lib=dynamic
- --with-toolchain-type=clang
darwin/aarch64:
JDK_ARCH: macos-aarch64
darwin/x86-64:
JDK_ARCH: macos-x64
linux/aarch64:
JDK_ARCH: linux-aarch64
linux/x86-64:
JDK_ARCH: linux-x64
# from https://jdk.java.net/archive/
# the boot jdk should point to the last version of the previous major version
# or the last previous version of the current major version
BOOT_JDK17: https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2
BOOT_JDK20: https://download.java.net/java/GA/jdk20.0.2/6e380f22cbe7469fa75fb448bd903d8e/9/GPL/openjdk-20.0.2
BOOT_JDK21: https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1
ARGS:
- --disable-warnings-as-errors
- --with-debug-level=release
- --with-jvm-variants=server
- --with-native-debug-symbols=none
- --with-vendor-bug-url="https://github.com/teaxyz/pantry/issues"
- --with-vendor-name="tea.xyz"
- --with-vendor-url="https://github.com/teaxyz/pantry/issues"
- --with-vendor-vm-bug-url="https://github.com/teaxyz/pantry/issues"
- --with-version-build={{version.minor}}
- --without-version-opt
- --without-version-pre
- --with-giflib=system
- --with-harfbuzz=system
- --with-lcms=system
- --with-libjpeg=system
- --with-libpng=system
- --with-zlib=system
provides:
- bin/jar
- bin/jarsigner
- bin/java
- bin/javac
- bin/javadoc
- bin/javap
- bin/jcmd
- bin/jconsole
- bin/jdb
- bin/jdeprscan
- bin/jdeps
- bin/jfr
- bin/jhsdb
- bin/jimage
- bin/jinfo
- bin/jlink
- bin/jmap
- bin/jmod
- bin/jpackage
- bin/jps
- bin/jrunscript
- bin/jshell
- bin/jstack
- bin/jstat
- bin/jstatd
# TODO: if: {{version.major}} >= 21
# - bin/jwebserver
- bin/keytool
- bin/rmiregistry
- bin/serialver
test:
script:
- java --version | grep {{version.marketing}}
- javac HelloWorld.java
- java HelloWorld | grep 'Hello, world!'