blob: 3c5d381df6a27ade0b967d25cf08ad7cd09379c9 (
plain)
1 # Description: OpenJDK 17 Java Development Kit
2 # URL: https://openjdk.java.net/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Co-Maintainer: Danny Rawlins, crux at romster dot me
5 # Depends on: alsa-lib cups giflib harfbuzz lcms2 libxslt nss unzip xorg-libxrandr xorg-libxt xorg-libxtst zip
6
7 name=openjdk17-jdk
8 version=17.0.6+2
9 _boot_ver=20211106
10 _cert_ver=20210916
11 release=1
12 source=(https://github.com/openjdk/jdk17u/archive/jdk-$version/$name-$version.tar.gz
13 https://crux.ster.zone/downloads/java/openjdk17-boot-$_boot_ver.tar.xz
14 https://crux.ster.zone/downloads/java/java_cacerts-${_cert_ver})
15
16 build() {
17 if [ -e '/usr/bin/ccache' ]; then
18 PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
19 PKGMK_JDK17+=' --enable-ccache'
20 fi
21
22 OLD_PATH=$PATH
23 export JAVA_HOME=$SRC/openjdk17-boot
24 export PATH=$JAVA_HOME/bin:$OLD_PATH
25
26 unset CFLAGS
27 unset CXXFLAGS
28 unset LDFLAGS
29 unset MAKEFLAGS
30 export _CFLAGS+=' -fcommon'
31 export _CXXFLAGS+=' -fcommon'
32
33 [ -z $JOBS ] && JOBS=$(nproc)
34
35 mkdir $SRC/build
36 cd $SRC/build
37
38 LC_ALL=C
39 /bin/bash ../jdk17u-jdk-${version/+/-}/configure $PKGMK_JDK17 \
40 --prefix=/usr/lib/java/$name \
41 --disable-precompiled-headers \
42 --disable-warnings-as-errors \
43 --enable-dtrace=no \
44 --enable-unlimited-crypto \
45 --with-native-debug-symbols=internal \
46 --with-debug-level=release \
47 --with-stdc++lib=dynamic \
48 --with-jvm-variants=server \
49 --with-cacerts-file=$SRC/java_cacerts-$_cert_ver \
50 --with-jtreg=no \
51 --with-boot-jdk=$JAVA_HOME \
52 --with-version-opt="CRUX-r$release" \
53 --with-version-build="${version#*+}" \
54 --with-vendor-name="CRUX" \
55 --with-jobs=$JOBS \
56 --with-libjpeg=system \
57 --with-giflib=system \
58 --with-libpng=system \
59 --with-zlib=system \
60 --with-lcms=system \
61 --with-freetype=system \
62 --with-harfbuzz=system \
63 --with-extra-cflags="$_CFLAGS" \
64 --with-extra-cxxflags="$_CXXFLAGS"
65
66 # NOTE: for debugging build issues: set LOG to debug, JOBS to 1.
67 LC_ALL=C \
68 make LOG=warn JOBS=$JOBS jdk-image
69
70 rm -r images/jdk/demo
71 rm -r images/jdk/lib/src.zip
72 rm -r images/jdk/lib/*.ja
73 rm -r images/jdk/legal
74 rm images/jdk/conf/security/policy/README.txt
75
76 install -d -m 0755 $PKG/usr/lib/java/$name
77 cp -r images/jdk/* $PKG/usr/lib/java/$name/
78
79 install -d -m 0755 $PKG/etc/revdep.d
80 echo "/usr/lib/java/$name/lib" > $PKG/etc/revdep.d/$name
81 echo "/usr/lib/java/$name/lib/jli" >> $PKG/etc/revdep.d/$name
82 echo "/usr/lib/java/$name/lib/server" >> $PKG/etc/revdep.d/$name
83 }
|