blob: b0d6349c95088435d11309743e890768be886604 (
plain)
1 # Description: OpenJDK 8 built using IcedTea build harness
2 # URL: http://icedtea.classpath.org http://openjdk.java.net
3 # Maintainer: John Vogel, jvogel4 at stny dot rr dot com
4 # Depends on: alsa-lib cups fontconfig freetype giflib gtk krb5 lcms2 libjpeg-turbo libpng libxslt nss p11-kit unzip xorg-libxt xorg-libxtst xorg-libxinerama zip
5
6 name=openjdk8
7 version=8u252-b09
8 icedtea_version=3.16.0
9 boot_version=20200504
10 release=1
11 source=(http://icedtea.wildebeest.org/download/source/icedtea-$icedtea_version.tar.xz
12 https://stygian.me/crux/distfiles/$name/corba-$version.tar.xz
13 https://stygian.me/crux/distfiles/$name/hotspot-$version.tar.xz
14 https://stygian.me/crux/distfiles/$name/jaxp-$version.tar.xz
15 https://stygian.me/crux/distfiles/$name/jaxws-$version.tar.xz
16 https://stygian.me/crux/distfiles/$name/jdk-$version.tar.xz
17 https://stygian.me/crux/distfiles/$name/langtools-$version.tar.xz
18 https://stygian.me/crux/distfiles/$name/nashorn-$version.tar.xz
19 https://stygian.me/crux/distfiles/$name/openjdk-$version.tar.xz
20 https://stygian.me/crux/distfiles/$name-boot-$boot_version-bin.tar.xz)
21 # See README for links to originally named files and rationale of renaming/versioning/mirroring.
22
23 unpack_source() {
24 for file in ${source[@]}; do
25 case ${file##*/} in
26 icedtea-$icedtea_version.tar.xz|\
27 $name-boot-$boot_version-bin.tar.xz)
28 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
29 *)
30 cp $(get_filename $file) $SRC ;;
31 esac
32 done
33 }
34
35 build() {
36 # Most of these flags were snarfed directly from Alpine Linux APKBUILD for openjdk7, added -fabi-version.
37 # Fixes build failures due to suspected gcc8 changes for default std and abi.
38 export EXTRA_CPP_FLAGS="$CXXFLAGS -fabi-version=10 -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"
39 export EXTRA_CFLAGS="$CFLAGS -fabi-version=10 -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"
40
41 # Make sure we do not have ccache masquerade directory in PATH.
42 # Use --enable-ccache instead of providing a wrapped compiler.
43 # NOTE: the check for usr/bin/ccache may be too specific, since it rules out
44 # local or opt installs.
45 if [ -e '/usr/bin/ccache' ]; then
46 EXTRA_OPTIONS='--enable-ccache'
47 PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
48 fi
49
50 OLD_PATH=$PATH
51 export JAVA_HOME=$SRC/$name-boot
52 export PATH=$JAVA_HOME/bin:$OLD_PATH
53
54 if [ -f /etc/pki/tls/java/cacerts ]; then
55 JAVA_CACERTS=/etc/pki/tls/java/cacerts
56 else
57 /usr/sbin/make-ca -g -D $SRC/certs || exit 1
58 JAVA_CACERTS=$SRC/certs/etc/pki/tls/java/cacerts
59 fi
60
61 mkdir $SRC/build
62 cd $SRC/build
63
64 # Will fail if make-ca has not been run after p11-kit install
65 LC_ALL=C \
66 CONFIG_SHELL=/bin/bash \
67 ../icedtea-$icedtea_version/configure ${EXTRA_OPTIONS} \
68 --prefix=/usr/lib/java/$name \
69 --disable-docs \
70 --disable-downloading \
71 --disable-hotspot-tests \
72 --disable-jdk-tests \
73 --disable-langtools-tests \
74 --disable-precompiled-headers \
75 --disable-system-pcsc \
76 --disable-system-sctp \
77 --disable-systemtap-tests \
78 --disable-tests \
79 --enable-improved-font-rendering \
80 --enable-non-nss-curves \
81 --enable-nss \
82 --enable-system-cups \
83 --enable-system-fontconfig \
84 --enable-system-gio \
85 --enable-system-gtk \
86 --enable-system-jpeg \
87 --enable-system-kerberos \
88 --enable-system-lcms \
89 --enable-system-png \
90 --enable-system-zlib \
91 --with-corba-src-zip=$SRC/corba-$version.tar.xz \
92 --with-hotspot-src-zip=$SRC/hotspot-$version.tar.xz \
93 --with-jaxp-src-zip=$SRC/jaxp-$version.tar.xz \
94 --with-jaxws-src-zip=$SRC/jaxws-$version.tar.xz \
95 --with-jdk-src-zip=$SRC/jdk-$version.tar.xz \
96 --with-langtools-src-zip=$SRC/langtools-$version.tar.xz \
97 --with-nashorn-src-zip=$SRC/nashorn-$version.tar.xz \
98 --with-openjdk-src-zip=$SRC/openjdk-$version.tar.xz \
99 --with-pkgversion=CRUX \
100 --with-jdk-home=$JAVA_HOME \
101 --with-cacerts-file=$JAVA_CACERTS \
102 --with-tzdata-dir=/usr/share/zoneinfo
103
104 LC_ALL=C \
105 make
106
107 # Copy the sdk image first before pruning it, saving original for later inspection/comparison.
108 install -d -m 0755 $PKG/usr/lib/java/$name
109 cp -a openjdk.build/images/j2sdk-image/* $PKG/usr/lib/java/$name
110
111 install -d -m 0755 $PKG/etc/revdep.d
112 echo "/usr/lib/java/$name/jre/lib/amd64" > $PKG/etc/revdep.d/$name
113 echo "/usr/lib/java/$name/jre/lib/amd64/jli" >> $PKG/etc/revdep.d/$name
114 echo "/usr/lib/java/$name/jre/lib/amd64/server" >> $PKG/etc/revdep.d/$name
115
116 # Remove unneeded files
117 rm -f $PKG/usr/lib/java/$name/src.zip
118 rm -rf $PKG/usr/lib/java/$name/{demo,man/ja*,sample}
119 rm -f $PKG/usr/lib/java/$name/{,jre/}THIRD_PARTY_README
120 find $PKG/usr/lib/java/$name \( \
121 -name '*.ja' -o \
122 -name 'ASSEMBLY_EXCEPTION' -o \
123 -name 'LICENSE' -o \
124 -name 'THIRD_PARTY_README' \) \
125 -delete
126
127 # Deduplicate
128 rm $PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
129 ln -sr $PKG/usr/lib/java/$name/lib/amd64/libjawt.so \
130 $PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
131 rm $PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
132 ln -sr $PKG/usr/lib/java/$name/lib/amd64/jli/libjli.so \
133 $PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
134 for f in $PKG/usr/lib/java/$name/jre/bin/* ; do
135 if [ -f $PKG/usr/lib/java/$name/bin/${f##*/} ]; then
136 rm $f
137 ln -sr $PKG/usr/lib/java/$name/bin/${f##*/} $f
138 fi
139 done
140
141 chmod u+w $PKG/usr/lib/java/$name/jre/lib/security/cacerts
142 }
|