Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/openjdk-8u171-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
132 lines (110 sloc)
4.3 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# COOKIE=$(mcookie); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh | |
set -xe | |
umask 022 | |
PKG=openjdk | |
VERSION=8u171 | |
BUILD=0 | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
# PREFIX=/dev/shm/pkg/$PKG-$VERSION-$BUILD | |
ICEDTEA=icedtea-3.8.0 | |
ICEDTEA_VER=$(echo $ICEDTEA | cut -f2 -d-) | |
# the build has its own opinion of parallel builds, high counts seem to be instable: | |
PARALLELJOBS=${PARALLELJOBS:-4} | |
SOURCES=(http://icedtea.classpath.org/download/source/icedtea-$ICEDTEA_VER.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/openjdk.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/corba.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/jaxp.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/jaxws.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/jdk.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/langtools.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/nashorn.tar.xz \ | |
http://icedtea.classpath.org/download/drops/icedtea8/$ICEDTEA_VER/hotspot.tar.xz) | |
MD5SUMS=(e6a2a693291296a8e4b3cc76499b047e \ | |
d532e0e7d893c6f3f427d571304fa6b8 \ | |
083df5866e8434786bd62c5d26cf4b1a \ | |
4859c3d3f6c8b6f1b3d92f316089b6a6 \ | |
3f811761f995c7056ab2ab516dd2870f \ | |
7e820fa93b44bc3a214313e0354da026 \ | |
22df0b6af90e722e5cc802a5915f8385 \ | |
e7f0b4ca8f2b897c8f4225d4fe3291fb \ | |
c0017c13ea1c5fc8026d9f2b2bed4a11) | |
COUNT_1=$(( ${#SOURCES[@]} - 1 )) | |
function fetch_preprocess() { | |
local url=$1 | |
local md5=$2 | |
local opt_unpack=$3 | |
local tar=$(echo $url | rev | cut -f1 -d/ | rev) | |
local dir=$(echo $tar | rev | cut -f3- -d. | rev) | |
( | |
cd $BUILDDIR | |
echo "$md5 $tar" > $tar.md5 | |
test -e $tar || wget $url | |
md5sum -c $tar.md5 | |
test -n 'XWIPE' && rm -rf ./$dir | |
if test -n "$opt_unpack"; then | |
test -d $dir || tar xf $tar | |
fi | |
) | |
} | |
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | |
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | |
mkdir -p $BUILD_TMPDIR/home | |
export TMPDIR=$BUILD_TMPDIR | |
export HOME=$BUILD_TMPDIR/home | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
PATH=$PREFIX/bin:\$PATH | |
EOF | |
source $PREFIX/profile | |
BOOT_JAVA=/pkg/openjdk-7u181-0 | |
source $BOOT_JAVA/profile | |
BUILDDIR=$PREFIX/build | |
mkdir -p $BUILDDIR | |
cd $BUILDDIR | |
fetch_preprocess ${SOURCES[0]} ${MD5SUMS[0]} 'yes' | |
for X in $(seq 1 $COUNT_1); do | |
fetch_preprocess ${SOURCES[$X]} ${MD5SUMS[$X]} | |
done | |
# recent cacerts taken from CentOS package, so Red Hat is at least of some use ... | |
( | |
CACERTS_URL=http://mirror.centos.org/centos/6/os/x86_64/Packages | |
RPM=ca-certificates-2018.2.22-65.1.el6.noarch.rpm | |
mkdir -p $BUILDDIR/tmp-certificates | |
cd $BUILDDIR/tmp-certificates | |
test -e $RPM || wget $CACERTS_URL/$RPM | |
test -d ./etc || rpm2cpio $RPM | cpio -imVd | |
cp etc/pki/java/cacerts $BUILDDIR | |
) | |
mkdir -p icedtea-build | |
cd icedtea-build | |
JAVA_HOME=${BOOT_JAVA} PATH=${BOOT_JAVA}/bin:$PATH \ | |
../$ICEDTEA/configure \ | |
--with-jdk-home=${BOOT_JAVA} \ | |
--disable-system-kerberos \ | |
--disable-system-pcsc \ | |
--disable-system-sctp \ | |
--with-cacerts-file="$BUILDDIR/cacerts" \ | |
--with-openjdk-src-zip="$BUILDDIR/openjdk.tar.xz" \ | |
--with-corba-src-zip="$BUILDDIR/corba.tar.xz" \ | |
--with-jaxp-src-zip="$BUILDDIR/jaxp.tar.xz" \ | |
--with-jaxws-src-zip="$BUILDDIR/jaxws.tar.xz" \ | |
--with-jdk-src-zip="$BUILDDIR/jdk.tar.xz" \ | |
--with-langtools-src-zip="$BUILDDIR/langtools.tar.xz" \ | |
--with-nashorn-src-zip="$BUILDDIR/nashorn.tar.xz" \ | |
--with-hotspot-src-zip="$BUILDDIR/hotspot.tar.xz" \ | |
--disable-docs \ | |
--with-parallel-jobs=$PARALLELJOBS \ | |
--disable-downloading | |
# ALT_UNIXCOMMAND_PATH is needed, otherwise make fails due to 'missing' /bin/touch & /bin/cpio | |
# ... make/common/shared/Defs-linux.gmk | |
# UNIXCOMMAND_PATH: path to where the most common Unix commands are. | |
# NOTE: Must end with / so that it could be empty, allowing PATH usage. | |
# | |
# From time to time the build fails (1 outof 5), if so, start over. | |
ALT_UNIXCOMMAND_PATH=/usr/bin/ JAVA_HOME=${BOOT_JAVA} PATH=${BOOT_JAVA}/bin:$PATH LOG=trace \ | |
make | |
# install | |
cp -a $BUILDDIR/icedtea-build/openjdk.build/images/j2sdk-image/* $PREFIX | |
# exit 1 # inhibit closing | |
exit |