2018-03-29 20:16:44 -04:00
|
|
|
# Description: OpenJDK 8 built using IcedTea build harness
|
|
|
|
# URL: http://icedtea.classpath.org http://openjdk.java.net
|
|
|
|
# Maintainer: John Vogel, jvogel4 at stny dot rr dot com
|
|
|
|
# Depends on: alsa-lib cups fontconfig freetype giflib gtk krb5 lcms2 libjpeg-turbo libpng libxslt nss unzip xorg-libxt xorg-libxtst xorg-libxinerama zip
|
|
|
|
|
|
|
|
name=openjdk8
|
2018-12-22 11:34:06 -05:00
|
|
|
version=8u181-b13
|
|
|
|
icedtea_version=3.9.0
|
|
|
|
boot_version=20181102
|
|
|
|
pkgsrc_quarter=2018Q3
|
|
|
|
certdata_rev=dc2f7806fbc1
|
2018-03-29 20:16:44 -04:00
|
|
|
release=1
|
|
|
|
source=(http://icedtea.wildebeest.org/download/source/icedtea-$icedtea_version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/corba-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/hotspot-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/jaxp-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/jaxws-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/jdk-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/langtools-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/nashorn-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name/openjdk-$version.tar.xz
|
|
|
|
https://stygian.me/crux/distfiles/$name-boot-$boot_version-bin.tar.xz
|
2018-12-22 11:34:06 -05:00
|
|
|
http://ftp.netbsd.org/pub/pkgsrc/pkgsrc-$pkgsrc_quarter/pkgsrc/security/mozilla-rootcerts/files/mozilla-rootcerts.sh
|
2018-06-17 03:48:52 -04:00
|
|
|
http://hg.mozilla.org/releases/mozilla-release/raw-file/$certdata_rev/security/nss/lib/ckfw/builtins/certdata.txt)
|
2018-03-29 20:16:44 -04:00
|
|
|
|
|
|
|
unpack_source() {
|
|
|
|
for file in ${source[@]}; do
|
|
|
|
case ${file##*/} in
|
|
|
|
icedtea-$icedtea_version.tar.xz|\
|
|
|
|
$name-boot-$boot_version-bin.tar.xz)
|
|
|
|
bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
|
|
|
|
*)
|
|
|
|
cp $(get_filename $file) $SRC ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
# Make sure we do not have ccache masquerade directory in PATH.
|
|
|
|
# Use --enable-ccache instead of providing a wrapped compiler.
|
|
|
|
# NOTE: the check for usr/bin/ccache may be too specific, since it rules out
|
|
|
|
# local or opt installs.
|
2018-03-30 03:54:15 -04:00
|
|
|
if [ -e '/usr/bin/ccache' ]; then
|
2018-03-29 20:16:44 -04:00
|
|
|
EXTRA_OPTIONS='--enable-ccache'
|
|
|
|
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
|
|
|
|
fi
|
|
|
|
|
2018-06-17 03:48:52 -04:00
|
|
|
OLD_PATH=$PATH
|
|
|
|
export JAVA_HOME=$SRC/$name-boot
|
|
|
|
export PATH=$JAVA_HOME/bin:$OLD_PATH
|
2018-03-29 20:16:44 -04:00
|
|
|
|
|
|
|
mkdir $SRC/build
|
|
|
|
cd $SRC/build
|
|
|
|
|
|
|
|
LC_ALL=C \
|
|
|
|
CONFIG_SHELL=/bin/bash \
|
|
|
|
../icedtea-$icedtea_version/configure ${EXTRA_OPTIONS} \
|
|
|
|
--prefix=/usr/lib/java/$name \
|
|
|
|
--disable-docs \
|
|
|
|
--disable-downloading \
|
|
|
|
--disable-precompiled-headers \
|
|
|
|
--disable-tests \
|
2018-06-17 03:48:52 -04:00
|
|
|
--disable-hotspot-tests \
|
|
|
|
--disable-langtools-tests \
|
|
|
|
--disable-jdk-tests \
|
|
|
|
--disable-systemtap-tests \
|
2018-03-29 20:16:44 -04:00
|
|
|
--disable-system-pcsc \
|
|
|
|
--disable-system-sctp \
|
|
|
|
--enable-system-jpeg \
|
|
|
|
--enable-system-kerberos \
|
|
|
|
--enable-system-lcms \
|
|
|
|
--enable-system-png \
|
|
|
|
--enable-system-zlib \
|
|
|
|
--enable-nss \
|
|
|
|
--enable-sunec \
|
|
|
|
--enable-non-nss-curves \
|
|
|
|
--enable-improved-font-rendering \
|
|
|
|
--with-openjdk-src-zip=$SRC/openjdk-$version.tar.xz \
|
|
|
|
--with-hotspot-src-zip=$SRC/hotspot-$version.tar.xz \
|
|
|
|
--with-corba-src-zip=$SRC/corba-$version.tar.xz \
|
|
|
|
--with-jaxp-src-zip=$SRC/jaxp-$version.tar.xz \
|
|
|
|
--with-jaxws-src-zip=$SRC/jaxws-$version.tar.xz \
|
|
|
|
--with-jdk-src-zip=$SRC/jdk-$version.tar.xz \
|
|
|
|
--with-langtools-src-zip=$SRC/langtools-$version.tar.xz \
|
|
|
|
--with-nashorn-src-zip=$SRC/nashorn-$version.tar.xz \
|
|
|
|
--with-pkgversion=CRUX \
|
2018-06-17 03:48:52 -04:00
|
|
|
--with-jdk-home=$JAVA_HOME
|
2018-03-29 20:16:44 -04:00
|
|
|
|
|
|
|
LC_ALL=C \
|
|
|
|
make
|
|
|
|
|
2018-03-30 03:54:15 -04:00
|
|
|
install -d -m 0755 $PKG/usr/lib/java/$name
|
|
|
|
cp -a openjdk.build/images/j2sdk-image/* $PKG/usr/lib/java/$name
|
2018-03-29 20:16:44 -04:00
|
|
|
|
2018-03-30 03:54:15 -04:00
|
|
|
install -d -m 0755 $PKG/etc/revdep.d
|
2018-03-29 20:16:44 -04:00
|
|
|
echo "/usr/lib/java/$name/jre/lib/amd64" > $PKG/etc/revdep.d/$name
|
|
|
|
echo "/usr/lib/java/$name/jre/lib/amd64/jli" >> $PKG/etc/revdep.d/$name
|
|
|
|
echo "/usr/lib/java/$name/jre/lib/amd64/server" >> $PKG/etc/revdep.d/$name
|
|
|
|
|
|
|
|
# remove unneeded files
|
|
|
|
rm -f $PKG/usr/lib/java/$name/src.zip
|
|
|
|
rm -rf $PKG/usr/lib/java/$name/{demo,sample}
|
|
|
|
rm -f $PKG/usr/lib/java/$name/man/ja
|
|
|
|
rm -rf $PKG/usr/lib/java/$name/man/ja_JP.UTF-8
|
|
|
|
rm -f $PKG/usr/lib/java/$name/{,jre/}THIRD_PARTY_README
|
|
|
|
find $PKG/usr/lib/java/$name -name '*.ja' -delete
|
|
|
|
|
|
|
|
# deduplicate
|
|
|
|
rm $PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
|
|
|
|
ln -s ../../../lib/amd64/libjawt.so \
|
|
|
|
$PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
|
|
|
|
rm $PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
|
|
|
|
ln -s ../../../../lib/amd64/jli/libjli.so \
|
|
|
|
$PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
|
|
|
|
for f in $PKG/usr/lib/java/$name/jre/bin/* ; do
|
|
|
|
if [ -f $PKG/usr/lib/java/$name/bin/${f##*/} ]; then
|
|
|
|
rm $f
|
|
|
|
ln -s ../../bin/${f##*/} $f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -e "/# cd \/etc\/openssl\/certs/s//# cd \/usr\/share\/$name\/certs/" \
|
|
|
|
-e '/@AWK@/s,,/usr/bin/awk,' \
|
|
|
|
-e "/@DATADIR@/s,,/usr/share/$name," \
|
|
|
|
-e '/@ECHO@/s,,/bin/echo,' \
|
|
|
|
-e '/@EXPR@/s,,/usr/bin/expr,' \
|
|
|
|
-e '/@LN@/s,,/bin/ln,' \
|
|
|
|
-e '/@LS@/s,,/bin/ls,' \
|
|
|
|
-e '/@MKDIR@/s,,/bin/mkdir,' \
|
|
|
|
-e '/@OPENSSL@/s,,/usr/bin/openssl,' \
|
|
|
|
-e '/@PREFIX@/s,,/usr,' \
|
|
|
|
-e "/@SSLDIR@/s,,/usr/share/$name," \
|
|
|
|
-e '/@RM@/s,,/bin/rm,' \
|
|
|
|
-e 's,self extract,self -f $certfile extract,' \
|
|
|
|
-e 's,self rehash,self -f $certfile rehash,' \
|
|
|
|
$SRC/mozilla-rootcerts.sh > $SRC/mozilla-rootcerts
|
|
|
|
|
2018-06-17 03:48:52 -04:00
|
|
|
export JAVA_HOME=$PKG/usr/lib/java/$name
|
|
|
|
export PATH=$JAVA_HOME/bin:$OLD_PATH
|
|
|
|
|
2018-03-29 20:16:44 -04:00
|
|
|
# generate java's cacerts
|
|
|
|
# big thanks to pkgsrc's mozilla-rootcerts and openjdk pkg's for this part
|
|
|
|
rm -f $PKG/usr/lib/java/$name/jre/lib/security/cacerts
|
|
|
|
mkdir $SRC/cacerts
|
|
|
|
cd $SRC/cacerts
|
|
|
|
sh $SRC/mozilla-rootcerts -f $SRC/certdata.txt extract
|
|
|
|
for cert in *.pem; do
|
|
|
|
keytool \
|
|
|
|
-noprompt \
|
|
|
|
-importcert \
|
|
|
|
-keystore $PKG/usr/lib/java/$name/jre/lib/security/cacerts \
|
|
|
|
-alias $(echo $cert | sed 's,.*/\([^/]*\)\.pem,\1,') \
|
|
|
|
-file $cert \
|
|
|
|
-storepass changeit
|
|
|
|
done
|
|
|
|
}
|