Skip to content

Commit 62ca13d

Browse files
author
Paul Dagnelie
authored
DLPX-83163 Add ARM support for adoptopenjdk package (#255)
1 parent 6f18989 commit 62ca13d

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

packages/adoptopenjdk/config.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,36 @@
1919
DEFAULT_PACKAGE_GIT_URL=none
2020
PACKAGE_DEPENDENCIES="make-jpkg"
2121

22-
if [[ "$UPSTREAM_PRODUCT_BRANCH" == "master" ]]; then
22+
case $(dpkg-architecture -q DEB_HOST_ARCH 2>/dev/null || echo "none") in
23+
amd64)
2324
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz"
2425
_tarfile_sha256="ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58"
2526
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
26-
else
27-
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz"
28-
_tarfile_sha256="ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58"
29-
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
30-
fi
27+
;;
28+
arm64)
29+
_tarfile="OpenJDK8U-jdk_aarch64_linux_hotspot_8u345b01.tar.gz"
30+
_tarfile_sha256="c1965fb24dded7d7944e2da36cd902adf3b7b1d327aaa21ea507cff00a5a0090"
31+
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-arm64"
32+
;;
33+
*) ;;
34+
35+
esac
3136

3237
function prepare() {
3338
logmust install_pkgs "$DEPDIR"/make-jpkg/*.deb
3439
}
3540

3641
function fetch() {
42+
# We exit here rather than above in the architecture detection logic
43+
# to deal with the fact that this file can, during test runs, be
44+
# sourced on platforms where builds are not happening. list-packages
45+
# sources the file to gather information about the package, and this
46+
# is performed on jenkins and macos during test runs. Having the exit
47+
# occur above causes those runs to fail.
48+
if [[ -z "$_tarfile" ]]; then
49+
echo "Invalid architecture detected" >&2
50+
exit 1
51+
fi
3752
logmust cd "$WORKDIR/"
3853

3954
local url="http://artifactory.delphix.com/artifactory/java-binaries/linux/jdk/8/$_tarfile"
@@ -42,6 +57,10 @@ function fetch() {
4257
}
4358

4459
function build() {
60+
if [[ -z "$_tarfile" ]]; then
61+
echo "Invalid architecture detected" >&2
62+
exit 1
63+
fi
4564
logmust cd "$WORKDIR/"
4665

4766
logmust env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg "$_tarfile" <<<y

0 commit comments

Comments
 (0)