Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 11.6 KB
Newer Older
Timo Teräs's avatar
Timo Teräs committed
1 2 3 4
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk8
_java_ver=8
5 6
_jdk_update=77
_jdk_build=03
Timo Teräs's avatar
Timo Teräs committed
7
pkgver=$_java_ver.$_jdk_update.$_jdk_build
8
pkgrel=0
Timo Teräs's avatar
Timo Teräs committed
9 10
pkgdesc="Sun OpenJDK 8"
url="http://openjdk.java.net"
11
arch="x86_64 x86"
Timo Teräs's avatar
Timo Teräs committed
12
license="custom"
13
depends="$pkgname-jre java-cacerts"
Timo Teräs's avatar
Timo Teräs committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
options="sover-namecheck"
makedepends="bash findutils tar zip file paxmark gawk util-linux libxslt
	     autoconf automake linux-headers sed
	     openjdk7 ca-certificates
	     nss-dev cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev
	     lcms2-dev libxp-dev libxtst-dev libxinerama-dev zlib-dev
	     libxrender-dev alsa-lib-dev freetype-dev fontconfig-dev
	     gtk+2.0-dev krb5-dev attr-dev pcsc-lite-dev lksctp-tools-dev"
install=""

case $CARCH in
x86)	_jarch=i386;;
x86_64)	_jarch=amd64;;
arm*)	_jarch=arm;;
esac

INSTALL_BASE=/usr/lib/jvm/java-1.8-openjdk
BOOTSTRAP_JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk
_jrelib="$INSTALL_BASE/jre/lib/$_jarch"

# exclude xawt from ldpath to avoid duplicate provides for libmawt.so
# (also in headless). in future this should be a virtual provides.
ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"
37
sonameprefix="$pkgname:"
Timo Teräs's avatar
Timo Teräs committed
38 39

subpackages="$pkgname-jre-lib:jrelib $pkgname-jre $pkgname-jre-base:jrebase
40
	     $pkgname-doc:doc $pkgname-demos:demos"
Timo Teräs's avatar
Timo Teräs committed
41 42 43 44

_dropsurl=http://hg.openjdk.java.net/jdk8u/jdk8u
_dropsver=jdk${_java_ver}u${_jdk_update}-b${_jdk_build}

45 46 47 48 49 50 51 52
source="jdk8u-$_dropsver.tar.bz2::$_dropsurl/archive/${_dropsver}.tar.bz2
	corba-$_dropsver.tar.bz2::$_dropsurl/corba/archive/${_dropsver}.tar.bz2
	jaxp-$_dropsver.tar.bz2::$_dropsurl/jaxp/archive/${_dropsver}.tar.bz2
	jaxws-$_dropsver.tar.bz2::$_dropsurl/jaxws/archive/${_dropsver}.tar.bz2
	jdk-$_dropsver.tar.bz2::$_dropsurl/jdk/archive/${_dropsver}.tar.bz2
	langtools-$_dropsver.tar.bz2::$_dropsurl/langtools/archive/${_dropsver}.tar.bz2
	nashorn-$_dropsver.tar.bz2::$_dropsurl/nashorn/archive/${_dropsver}.tar.bz2
	hotspot-$_dropsver.tar.bz2::$_dropsurl/hotspot/archive/${_dropsver}.tar.bz2
Timo Teräs's avatar
Timo Teräs committed
53 54 55 56 57 58 59 60 61

	icedtea-hotspot-musl.patch
	icedtea-hotspot-noagent-musl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-ipv6-init.patch
	icedtea-jdk-musl.patch
	icedtea-jdk-includes.patch
	fix-libjvm-load.patch
62
	build-demo-ldflags.patch
Timo Teräs's avatar
Timo Teräs committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
	"

_builddir="$srcdir/jdk8u-$_dropsver"

prepare() {
	cd "$_builddir"
	update_config_sub || return 1

	local module
	for module in corba hotspot jdk jaxws jaxp langtools nashorn; do
		ln -s ../${module}-${_dropsver} ${module}
	done

        for patch in $source; do
                case $patch in
                *.patch)
                        msg "Applying patch $patch"
                        busybox patch -p1 < "$srcdir"/$patch || return 1
                        ;;
                esac
        done
}

build() {
	cd "$_builddir"
	unset JAVA_HOME
	export MAKEFLAGS=${MAKEFLAGS/-j*}
	sh ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=$INSTALL_BASE \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-update-version="${_jdk_update}" \
		--with-build-number="b${_jdk_build}" \
		--with-user-release-suffix="alpine-r${pkgrel}" \
		--enable-unlimited-crypto \
		--with-zlib=system \
104 105 106 107
		--with-giflib=system \
		--with-extra-cflags="$CFLAGS" \
		--with-extra-cxxflags="$CXXFLAGS" \
		--with-extra-ldflags="$LDFLAGS" \
Timo Teräs's avatar
Timo Teräs committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
		--disable-freetype-bundling \
		--with-boot-jdk="$BOOTSTRAP_JAVA_HOME" \
		|| return 1

	make DEBUG_BINARIES=true || return 1
	make docs || return 1

	# agent was patched off; make empty sa-jdi.jar to make image builder happy
	local build
	for build in build/* ; do
		touch $build/jdk/lib/sa-jdi.jar
	done
	make images || return 1
}

list_paxables() {
        file "$@" 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//'
}

pax_mark_vm() {
	local paxflags="-mp"
        [ "$CARCH" = "x86" ] && paxflags="-msp"

	for paxable in $(list_paxables "${1}"/bin/* "${1}"/jre/bin/*); do
                echo "PaX mark $paxflags ${paxable}"
                paxmark $paxflags "${paxable}"
        done
}

package() {
	mkdir -p "$pkgdir"/$INSTALL_BASE
	cp -a "$_builddir"/build/*/images/j2sdk-image/* "$pkgdir"/$INSTALL_BASE
140
	rm "$pkgdir"/$INSTALL_BASE/src.zip
Timo Teräs's avatar
Timo Teräs committed
141

142 143 144 145
	find "$pkgdir"/$INSTALL_BASE -iname "*.diz" -delete || return 1
	find "$pkgdir"/$INSTALL_BASE -iname "*.debuginfo" -delete || return 1
	find "$pkgdir"/$INSTALL_BASE \( -name "*.jar" -o -name "*.sym" \) \
		\! -perm /006 | xargs chmod go+r || return 1
Timo Teräs's avatar
Timo Teräs committed
146 147

	pax_mark_vm "$pkgdir"/$INSTALL_BASE
148 149 150 151 152

	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts
	ln -sf /etc/ssl/certs/java/cacerts \
		"$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts
Timo Teräs's avatar
Timo Teräs committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
}

jrelib() {
	pkgdesc="OpenJDK 8 Java Runtime (class libraries)"
	arch="noarch"
	depends=""

	for A in jre/lib/images jre/lib/*.jar jre/lib/security \
		 jre/lib/ext/*.jar jre/lib/cmm jre/ASSEMBLY_EXCEPTION \
		 jre/THIRD_PARTY_README jre/LICENSE ; do
		dirname=${A%/*}
		mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
		mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
	done
}

jrebase() {
	pkgdesc="OpenJDK 8 Java Runtime (no GUI support)"
171
	depends="$pkgname-jre-lib java-common java-cacerts"
Timo Teräs's avatar
Timo Teräs committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

	mkdir -p "$subpkgdir"/$INSTALL_BASE/bin

	for A in java orbd rmid servertool unpack200 keytool \
		 pack200 rmiregistry tnameserv ; do
		mv "$pkgdir"/$INSTALL_BASE/bin/$A "$subpkgdir"/$INSTALL_BASE/bin
	done

	# rest of the jre subdir (which were not taken by -jre subpkg)
	mv "$pkgdir"/$INSTALL_BASE/jre "$subpkgdir"/$INSTALL_BASE

	pax_mark_vm "$subpkgdir"/$INSTALL_BASE
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"

	mkdir -p "$subpkgdir"
	for A in jre/bin/policytool \
		 bin/appletviewer \
		 bin/policytool \
		 jre/lib/$_jarch/libawt_xawt.so \
194 195
		 jre/lib/$_jarch/libfontmanager.so \
		 jre/lib/$_jarch/libjawt.so \
Timo Teräs's avatar
Timo Teräs committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
		 jre/lib/$_jarch/libsplashscreen.so ; do
		dirname=${A%/*}
		mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
		mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
	done

	pax_mark_vm "$subpkgdir"/$INSTALL_BASE
}

doc() {
	default_doc

	mkdir -p "$subpkgdir"/$INSTALL_BASE/
	mv "$pkgdir"/$INSTALL_BASE/man "$subpkgdir"/$INSTALL_BASE/
}

212 213 214 215 216 217 218 219 220
demos() {
	pkgdesc="OpenJDK 8 Java Demos and Samples"
	depends="$pkgname"

	mkdir -p "$subpkgdir"/$INSTALL_BASE/
	mv "$pkgdir"/$INSTALL_BASE/demo "$pkgdir"/$INSTALL_BASE/sample \
		"$subpkgdir"/$INSTALL_BASE/
}

221 222 223 224 225 226 227 228
md5sums="1954ffeb123a7f4552472ba9f9e38b0d  jdk8u-jdk8u77-b03.tar.bz2
eb7695323d3340214792114ad8e3bdce  corba-jdk8u77-b03.tar.bz2
fcc49430937eba2c64f8a53475edf99d  jaxp-jdk8u77-b03.tar.bz2
f05a009f2e0fdb710c3405723ed42199  jaxws-jdk8u77-b03.tar.bz2
ffe70c01fc0fe513e329f170f4c922c1  jdk-jdk8u77-b03.tar.bz2
a7e0ff3378d02e075284db7fe4a8dfbf  langtools-jdk8u77-b03.tar.bz2
1dee0e478002e80f87b235ae982edf6e  nashorn-jdk8u77-b03.tar.bz2
434e3dd4272d39b255ba9269838647b9  hotspot-jdk8u77-b03.tar.bz2
Timo Teräs's avatar
Timo Teräs committed
229 230 231 232 233 234 235
f87dd2c4c3c97fc3ac33080a65ca9e14  icedtea-hotspot-musl.patch
a5841507a216890bd8419d496bb118c3  icedtea-hotspot-noagent-musl.patch
43023861c5f6efc3139a834aa3ec0476  icedtea-hotspot-uclibc-fixes.patch
bdea7060a067faf1c2de5f4eb6e8525d  icedtea-jdk-execinfo.patch
250b0807b59762670954b132e8f8dfba  icedtea-jdk-fix-ipv6-init.patch
fc1dc983dc562eda399c9d7eabd3b299  icedtea-jdk-musl.patch
fc7d3cc1f5a5615574fd1e416144a042  icedtea-jdk-includes.patch
236 237
9b95183ae088ac2520ac66ae587619e4  fix-libjvm-load.patch
ea23c28032d50816a243d15afb2d8fb6  build-demo-ldflags.patch"
238 239 240 241 242 243 244 245
sha256sums="bcd2cacec7c965d67667eec8c0383ab38674ca0bd09b087a6fd4e27fe1e54405  jdk8u-jdk8u77-b03.tar.bz2
724bfdb2c843e28ffc019a545a5394cf0b8a902da348cbe60193bdbf875dfbc4  corba-jdk8u77-b03.tar.bz2
dabc4bdee31f003550d9043f77f096d80a4b94c735d1662df1e7d520ce84150b  jaxp-jdk8u77-b03.tar.bz2
ab61d3eb6717af61e0b52e7b8be207d5b1fd31930ae10c0abc3705fbe162f1b8  jaxws-jdk8u77-b03.tar.bz2
ee6e149c51639303ed8c09c5c8697b5943104540f19b578309f88fd7ddb2173f  jdk-jdk8u77-b03.tar.bz2
34bc6e73fc79034b183cb8443557d874d30f943e2ac6ade07771ae882e9b4905  langtools-jdk8u77-b03.tar.bz2
a30e4e54c31e0bbfde6c16ba073dc5f5f0bfc426b0cd01a1bfa9b38a20123eb1  nashorn-jdk8u77-b03.tar.bz2
236c58dedc773b36621418aa2a6156153914c3f9d726f7b480c24e9120da6690  hotspot-jdk8u77-b03.tar.bz2
Timo Teräs's avatar
Timo Teräs committed
246 247 248 249 250 251 252
a7922430cb767c8a4baae232c8b2e5f377aeb7cfde0c9901cd7774f078e7f92e  icedtea-hotspot-musl.patch
9223d4a1ae20b51bcb901ace115a2cd5f15b05655ea076c05f4c7f2c66f341e5  icedtea-hotspot-noagent-musl.patch
0ef7592b8f2c954eda0a6cf4dc4a4010942f35ea426f44e34412be6c9a949745  icedtea-hotspot-uclibc-fixes.patch
a35d40f24098747cdb73d9c3742cfb4aecafa0f72c9dfdfe2cb460f9706ff665  icedtea-jdk-execinfo.patch
632683ec88a6fb250ef043aae9cace605d0c669b7058f8c47b62b09b03ecc6c5  icedtea-jdk-fix-ipv6-init.patch
d3fcf4779a23181178e722a93290921f5c61ed7220d3a431953a53c24f89e562  icedtea-jdk-musl.patch
38590e411b7bf9b99f5168709b975e1c432ef600915800c709a6617504e2c13a  icedtea-jdk-includes.patch
253 254
47028d87c9a65df8d0103b39bf54b2b22de7db7c52a5de1058f88f4c5ea24f0d  fix-libjvm-load.patch
eebfb2613ae342587e8477a1022703ac986ed59e941ec1e96b2a3264c67c587b  build-demo-ldflags.patch"
255 256 257 258 259 260 261 262
sha512sums="11ba854ec70ad57c2801d9d6ce9f7c1e0b2422f199295efe656726cdd1f0bf9a61d9e3324406118da880e6a783e9a9f4d9cab4baa63772e51b85c826c58dc516  jdk8u-jdk8u77-b03.tar.bz2
f1707f65832dfcc0e75b1c1624b3ef38c19a2db0684a2f6ad27fdf1ddfdc8180b59109a7fa5d8fdfd1f54ea3702d53960f423bac438e14a5ee2cf50a6cfcb084  corba-jdk8u77-b03.tar.bz2
1ad820513b9672b9073ec69c9f677a5e737efed76cbb90efd8fcf87732afcba14efc23a451d294519bd80ef18972267717bcab07805a282931519135aa03ff7b  jaxp-jdk8u77-b03.tar.bz2
abdc24f4caf1a8c440575bc85c416bb2ac0fee75bcebdde433643aa5a4f784f04e77a3efee1bce274fdeadba6f66415d9ea030a6068cf727a7916c4f855ec7dc  jaxws-jdk8u77-b03.tar.bz2
4320c44b04a522e5ca500de9c118c77bb7709cabc13a18d672e88d360135a7c711049052c49e1398aba72615885d70423823d06fdb0b0555508427930784d9f8  jdk-jdk8u77-b03.tar.bz2
2669e4f55c8458be7f494faac98d5ed7b67787cd8294e2476015613c04615be4af4f0fc490e72020952f750e05679d50da401d8581e9a11f6bf6e6e28f07d816  langtools-jdk8u77-b03.tar.bz2
ee55b11b93e0509ae2d4167b3b8a73f64137321ee02fbd5bf422cc66ffa1e10f452a93a68794101c93a4e1b03aeb3c2b0f782c08936b434f5b078f00332605a0  nashorn-jdk8u77-b03.tar.bz2
122bcbd568649d96338b19b5f3e31b877aa6655e3d050009a09a2e26fe6df899abca6e921c074cb1134a012792a6b2e610a7c7c6506486e0f84e5d5d0d505891  hotspot-jdk8u77-b03.tar.bz2
Timo Teräs's avatar
Timo Teräs committed
263 264 265 266 267 268 269
994e8a79a0a23f26d633bf2ce9dad62198c699892f6e7729cc6e509481330399bb2ba736514b516fd2b3dd125fd6c74a127ae7f16d643c3f6a69776737cdb933  icedtea-hotspot-musl.patch
d930edbb830957729031228196720fa2d50747655a9289097103d36f852ab11b7198e18805bd89c6a438c3ccf224be48cda5f994b193ab1f81a72aada0df2b16  icedtea-hotspot-noagent-musl.patch
822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a  icedtea-hotspot-uclibc-fixes.patch
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
2fd75bb52e7c9e3b56a383b72ee519d395413b000aef94ad00b106a692a199de34967bac1120164cebce5f71d302413742922a55cc6479b2d33258aaf7d03c1b  icedtea-jdk-musl.patch
7df0db85039da8cbde49093ec3299f6804370f4134554a9c26c130a4e9e0b35409a3be833f3e90764ed16718683daffb6447261db8e5988f2e0519f649aedbc6  icedtea-jdk-includes.patch
270 271
978539ba0b1f1694cda6a3a1542a4373861cbfb4dc414a3b796cd8841ecf6e12248c746b5efe2c031c85a3b0684101b29e8a5f4ff70e77c1a3f3cd7f5cb148ce  fix-libjvm-load.patch
bcf9af85907b4f49f1aa470d21917280fcf9fc8892f089fe8c284ec3f2eccd57f799c7f06ce2ce641421d50396fa192cb71ccbb7a077958aacf57b8dadc80bc1  build-demo-ldflags.patch"