kumquat-buildroot/package/openjdk-bin/openjdk-bin.mk

46 lines
1.7 KiB
Makefile
Raw Normal View History

################################################################################
#
# host-openjdk-bin
#
################################################################################
ifeq ($(BR2_PACKAGE_OPENJDK_VERSION_17),y)
HOST_OPENJDK_BIN_VERSION_MAJOR = 17
HOST_OPENJDK_BIN_VERSION_MINOR = 0.7_7
2021-05-06 21:48:25 +02:00
else
HOST_OPENJDK_BIN_VERSION_MAJOR = 11
HOST_OPENJDK_BIN_VERSION_MINOR = 0.19_7
2021-05-06 21:48:25 +02:00
endif
ifeq ($(HOSTARCH),x86_64)
HOST_OPENJDK_BIN_DOWNLOAD_ARCH_NAME = x64
endif
ifeq ($(HOSTARCH),aarch64)
HOST_OPENJDK_BIN_DOWNLOAD_ARCH_NAME = aarch64
endif
package/openjdk{, -bin}: bump latest to version 16.0.1+9 When introducing OpenJDK to buildroot, the OpenJDK project did not put releases on their GitHub page. Since then, the OpenJDK developers have not only added OpenJDK releases to Github, they are starting to phase out adding releases to their public-facing mercurial repository. Compare the following URLs: https://wiki.openjdk.java.net/display/JDKUpdates/JDK+14u https://wiki.openjdk.java.net/display/JDKUpdates/JDK+15u https://wiki.openjdk.java.net/display/JDKUpdates/JDK+16u With JDK14, only the mercurial repository is listed. With OpenJDK15, both the GitHub and mercurial repository are listed. Finally, with OpenJDK16, only the GitHub repository is listed. For consistency's sake, and for the version bump of JDK latest from 14 to 16 do the following: - Change the repository for OpenJDK14 to point to the official GitHub repository, - In order to simplify and reuse the GitHub URL, modify the OPENJDK_VERSION_MAJOR and OPENJDK_VERSION_MINOR definitions to only include a single number for the MAJOR definition. - Change openjdk-bin.mk to also use the same format as the openjdk.mk file Unfortunately, we can't yet do the switch for OpenJDK11: the Github repository is missing a Mercurial-related file, so that the archive for OpenJDK11 11.0.11+9 would change from the one we already have on s.b.o and that people would alreay have locally, and we'd have a hash mismatch, either on master, or on all pur previous relases. OpenJDK11 just got a new release mere hours ago (as of this writing), but it hasn't yet trickled down to AdoptOpenJDK/openjdk11-binaries, so we can't do the bump just yet... Add a note to the OpenJDK11 case, to prepare the migration to Github with the next version bump. Finally, remove upstreamed patch 0001-fix-gcc-10-support.patch as it's no longer needed. Signed-off-by: Adam Duskett <aduskett@gmail.com> [yann.morin.1998@free.fr: - meld the github switch and 14->16 bump together - drop the github switch for 11 9because hash mismatch) - expand commit log accordingly ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-05-04 23:00:25 +02:00
HOST_OPENJDK_BIN_VERSION = $(HOST_OPENJDK_BIN_VERSION_MAJOR).$(HOST_OPENJDK_BIN_VERSION_MINOR)
HOST_OPENJDK_BIN_SOURCE = OpenJDK$(HOST_OPENJDK_BIN_VERSION_MAJOR)U-jdk_$(HOST_OPENJDK_BIN_DOWNLOAD_ARCH_NAME)_linux_hotspot_$(HOST_OPENJDK_BIN_VERSION).tar.gz
HOST_OPENJDK_BIN_SITE = https://github.com/adoptium/temurin$(HOST_OPENJDK_BIN_VERSION_MAJOR)-binaries/releases/download/jdk-$(subst _,%2B,$(HOST_OPENJDK_BIN_VERSION))
2021-05-06 21:48:25 +02:00
HOST_OPENJDK_BIN_LICENSE = GPL-2.0+ with exception
HOST_OPENJDK_BIN_LICENSE_FILES = legal/java.prefs/LICENSE legal/java.prefs/ASSEMBLY_EXCEPTION
pacakge: drop remnants of $(HOST_DIR)/usr It's been ages (5 years at the next release) that we've not installed host packages in $(HOST_DIR)/usr, but we still have a few packages that reference it or install things in there. Drop all of those in one fell swoop. The run-time test still succeeds, and the following defconfig, which should exercise all touched packages [*], does build: BR2_x86_i686=y BR2_TOOLCHAIN_EXTERNAL=y BR2_INIT_NONE=y BR2_SYSTEM_BIN_SH_NONE=y # BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_GAWK=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_ABOOTIMG=y BR2_PACKAGE_DBUS_PYTHON=y BR2_PACKAGE_OLA=y BR2_PACKAGE_JIMTCL=y BR2_PACKAGE_LUA=y # BR2_PACKAGE_LUA_32BITS is not set BR2_PACKAGE_ARGPARSE=y BR2_PACKAGE_PERL=y BR2_PACKAGE_PHP=y BR2_PACKAGE_PHP_APCU=y BR2_PACKAGE_PHP_LUA=y BR2_PACKAGE_PHP_PAM=y BR2_PACKAGE_PHP_PECL_DBUS=y BR2_PACKAGE_PYTHON3=y BR2_PACKAGE_PYTHON_CRYPTOGRAPHY=y BR2_PACKAGE_PYTHON_PLY=y BR2_PACKAGE_PYTHON_PYBIND=y BR2_PACKAGE_LIBVA=y BR2_PACKAGE_BIND=y BR2_PACKAGE_BIND_SERVER=y BR2_PACKAGE_BIND_TOOLS=y BR2_PACKAGE_APPARMOR=y BR2_PACKAGE_APPARMOR_BINUTILS=y BR2_PACKAGE_APPARMOR_UTILS=y BR2_PACKAGE_APPARMOR_UTILS_EXTRA=y BR2_PACKAGE_APPARMOR_PROFILES=y BR2_PACKAGE_REFPOLICY=y BR2_PACKAGE_URANDOM_SCRIPTS=y BR2_PACKAGE_BASH=y # embiggen-disk to exercise go BR2_PACKAGE_EMBIGGEN_DISK=y BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_I386_PC=y BR2_TARGET_GRUB2_I386_EFI=y [*] exceptions: - zfs was not tested: it needs a kernel to be built; - compiler-rt was not tsted: it needs llvm to be built, that takes ages, and other packages already reference the correct location for llvm-config, so it was assumed that is OK. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com> Cc: Anisse Astier <anisse@astier.eu> Cc: Antoine Tenart <atenart@kernel.org> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Asaf Kahlon <asafka7@gmail.com> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> Cc: Christian Stewart <christian@paral.in> Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Cc: Francois Perrad <francois.perrad@gadz.org> Cc: Guillaume William Brs <guillaume.bressaix@gmail.com> Cc: Hervé Codina <herve.codina@bootlin.com> Cc: James Hilliard <james.hilliard1@gmail.com> Cc: José Luis Salvador Rufo <salvador.joseluis@gmail.com> Cc: Julien Boibessot <julien.boibessot@armadeus.com> Cc: Julien Olivain <ju.o@free.fr> Cc: Matt Weber <matthew.weber@collins.com> Cc: Nicolas Carrier <nicolas.carrier@orolia.com> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Vadim Kochan <vadim4j@gmail.com> Cc: Yegor Yefremov <yegorslists@googlemail.com> Reviewed-by: Romain Naour <romain.naour@smile.fr> --- Changes v1 -> v2: - fix new instance that have crept in (Romain)
2022-07-16 23:04:49 +02:00
HOST_OPENJDK_BIN_ROOT_DIR = $(HOST_DIR)/lib/jvm
package/openjdk-bin: install to host/usr/lib/jvm Buildroot currently installs openjdk-bin to $(HOST_DIR)/ instead of the more traditional (for java installations) $(HOST_DIR)/usr/lib/jvm. As described in https://bugs.busybox.net/show_bug.cgi?id=13001 "Openjdk-bin provides it's own libfreetype.so and places it into $(HOST_DIR)/lib/. This library causes build failures with the host-xapp_mkfontscale package due to the overwritten libfreetype.so. mkfontscale.o: In function `doDirectory': mkfontscale.c:(.text+0x1a80): undefined reference to `FT_Get_BDF_Property' collect2: error: ld returned 1 exit status Reproducing the error is done by repeating the following steps. make host-freetype make host-openjdk-bin make host-xapp_mkfontscale" There are two options for fixing this problem: 1) add host-freetype and host-lksctp-tools as dependencies to host-openjdk-bin and then remove the provided libfreetype.so and libsctp.so libraries in a post_extract_hook. 2) change the installation directory from $(HOST_DIR)/ to $(HOST_DIR)/usr/lib/jvm just like the target OpenJDK package and copy the entire source directories contents to the above location. The second option provides the following advantages: - the directory structure is consistent with how we handle the target OpenJDK. - the HOST_OPENJDK_BIN_INSTALL_CMDS step is simplified. - packages such as Maven require directories of which we are currently not copying. These missing directories cause programs such as Maven to crash when running with an error such as "Can't read cryptographic policy directory: unlimited." - does not miss any other libraries that solution 1 would not cope with (e.g. libzip.so from host-libzip, or libnet.so from not-yet existing host-libnet, or libsctp.so from not-yet existing host-lksctp-tools) Because the second option is both simple, easier to implement, is low-impact, and fixes the problems described above wholly, it is the best to implement. To implement the above changes, we must also modify the following files in the same patch to match the host's new directory paths: - openjdk.mk - openjdk-jni-test.mk - openjdk-hello-world.mk To avoid having to change all those packages in the future, expose two new variables, HOST_OPENJDK_BIN_ROOT_DIR which contains the path where the openjdk-bin was installed in, and JAVAC, which contains the path to the javac compiler (modeled after the way the autoconf et al. variables are set and exposed). Tested with: ./support/testing/run-tests -o out -d dl tests.package.test_openjdk.TestOpenJdk Fixes: https://bugs.busybox.net/show_bug.cgi?id=13001 Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - introduce HOST_OPENJDK_BIN_ROOT_DIR and JAVAC - expand and tweak the commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-17 23:55:20 +02:00
# unpack200 has an invalid RPATH and relies on libzlib. When
# host-libzlib is installed on the system, the error "ERROR: package
# host-libzlib installs executables without proper RPATH: will occur.
# Because unpack200 is a deprecated tool, removing it to fix this
# issue is safe.
define HOST_OPENJDK_BIN_INSTALL_CMDS
package/openjdk-bin: install to host/usr/lib/jvm Buildroot currently installs openjdk-bin to $(HOST_DIR)/ instead of the more traditional (for java installations) $(HOST_DIR)/usr/lib/jvm. As described in https://bugs.busybox.net/show_bug.cgi?id=13001 "Openjdk-bin provides it's own libfreetype.so and places it into $(HOST_DIR)/lib/. This library causes build failures with the host-xapp_mkfontscale package due to the overwritten libfreetype.so. mkfontscale.o: In function `doDirectory': mkfontscale.c:(.text+0x1a80): undefined reference to `FT_Get_BDF_Property' collect2: error: ld returned 1 exit status Reproducing the error is done by repeating the following steps. make host-freetype make host-openjdk-bin make host-xapp_mkfontscale" There are two options for fixing this problem: 1) add host-freetype and host-lksctp-tools as dependencies to host-openjdk-bin and then remove the provided libfreetype.so and libsctp.so libraries in a post_extract_hook. 2) change the installation directory from $(HOST_DIR)/ to $(HOST_DIR)/usr/lib/jvm just like the target OpenJDK package and copy the entire source directories contents to the above location. The second option provides the following advantages: - the directory structure is consistent with how we handle the target OpenJDK. - the HOST_OPENJDK_BIN_INSTALL_CMDS step is simplified. - packages such as Maven require directories of which we are currently not copying. These missing directories cause programs such as Maven to crash when running with an error such as "Can't read cryptographic policy directory: unlimited." - does not miss any other libraries that solution 1 would not cope with (e.g. libzip.so from host-libzip, or libnet.so from not-yet existing host-libnet, or libsctp.so from not-yet existing host-lksctp-tools) Because the second option is both simple, easier to implement, is low-impact, and fixes the problems described above wholly, it is the best to implement. To implement the above changes, we must also modify the following files in the same patch to match the host's new directory paths: - openjdk.mk - openjdk-jni-test.mk - openjdk-hello-world.mk To avoid having to change all those packages in the future, expose two new variables, HOST_OPENJDK_BIN_ROOT_DIR which contains the path where the openjdk-bin was installed in, and JAVAC, which contains the path to the javac compiler (modeled after the way the autoconf et al. variables are set and exposed). Tested with: ./support/testing/run-tests -o out -d dl tests.package.test_openjdk.TestOpenJdk Fixes: https://bugs.busybox.net/show_bug.cgi?id=13001 Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - introduce HOST_OPENJDK_BIN_ROOT_DIR and JAVAC - expand and tweak the commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-17 23:55:20 +02:00
mkdir -p $(HOST_OPENJDK_BIN_ROOT_DIR)
cp -dpfr $(@D)/* $(HOST_OPENJDK_BIN_ROOT_DIR)
$(RM) -f $(HOST_OPENJDK_BIN_ROOT_DIR)/bin/unpack200
endef
$(eval $(host-generic-package))
package/openjdk-bin: install to host/usr/lib/jvm Buildroot currently installs openjdk-bin to $(HOST_DIR)/ instead of the more traditional (for java installations) $(HOST_DIR)/usr/lib/jvm. As described in https://bugs.busybox.net/show_bug.cgi?id=13001 "Openjdk-bin provides it's own libfreetype.so and places it into $(HOST_DIR)/lib/. This library causes build failures with the host-xapp_mkfontscale package due to the overwritten libfreetype.so. mkfontscale.o: In function `doDirectory': mkfontscale.c:(.text+0x1a80): undefined reference to `FT_Get_BDF_Property' collect2: error: ld returned 1 exit status Reproducing the error is done by repeating the following steps. make host-freetype make host-openjdk-bin make host-xapp_mkfontscale" There are two options for fixing this problem: 1) add host-freetype and host-lksctp-tools as dependencies to host-openjdk-bin and then remove the provided libfreetype.so and libsctp.so libraries in a post_extract_hook. 2) change the installation directory from $(HOST_DIR)/ to $(HOST_DIR)/usr/lib/jvm just like the target OpenJDK package and copy the entire source directories contents to the above location. The second option provides the following advantages: - the directory structure is consistent with how we handle the target OpenJDK. - the HOST_OPENJDK_BIN_INSTALL_CMDS step is simplified. - packages such as Maven require directories of which we are currently not copying. These missing directories cause programs such as Maven to crash when running with an error such as "Can't read cryptographic policy directory: unlimited." - does not miss any other libraries that solution 1 would not cope with (e.g. libzip.so from host-libzip, or libnet.so from not-yet existing host-libnet, or libsctp.so from not-yet existing host-lksctp-tools) Because the second option is both simple, easier to implement, is low-impact, and fixes the problems described above wholly, it is the best to implement. To implement the above changes, we must also modify the following files in the same patch to match the host's new directory paths: - openjdk.mk - openjdk-jni-test.mk - openjdk-hello-world.mk To avoid having to change all those packages in the future, expose two new variables, HOST_OPENJDK_BIN_ROOT_DIR which contains the path where the openjdk-bin was installed in, and JAVAC, which contains the path to the javac compiler (modeled after the way the autoconf et al. variables are set and exposed). Tested with: ./support/testing/run-tests -o out -d dl tests.package.test_openjdk.TestOpenJdk Fixes: https://bugs.busybox.net/show_bug.cgi?id=13001 Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - introduce HOST_OPENJDK_BIN_ROOT_DIR and JAVAC - expand and tweak the commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-17 23:55:20 +02:00
# variables used by other packages
JAVAC = $(HOST_OPENJDK_BIN_ROOT_DIR)/bin/javac