Skip to contentSkip to conversation

package/openjdk-bin: use libraries from host pkgs

PATCH New Jared Bents 2 participants 2 messages Jun 15, 2020 – Jun 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/openjdk-bin: use libraries from host pkgs

Update to remove libfreetype.so as it is created by host-freetype and other packages fail with the version of libfreetype.so provided by host-openjdk-bin such as host-xapp_mkfontscale.

Update to add host variant of lksctp-tools, remove libsctp.so, and add host-lksctp-tools dependency.

Two other libraries are included by host-opensdk-bin that could be provided by other packages being built from source however they have issues and have not been included in this update:
* Add host variant of libnet, remove libnet.so,
and add host-libnet dependency. However, this causes openjdk to hang during the build and is not included.
* Remove libzip.so and add host-libzip dependency. However, this currently causes host-zip to fail to build and is not included.

Bug tracker - https://bugs.busybox.net/show_bug.cgi?id=13001

---
 package/lksctp-tools/lksctp-tools.mk |  1 +
 package/openjdk-bin/openjdk-bin.mk   | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
package/lksctp-tools/lksctp-tools.mk +1 -0
index 5ac794e842..ace11ecc97 100644
@@ -20,3 +20,4 @@ endef
 LKSCTP_TOOLS_POST_INSTALL_TARGET_HOOKS += LKSCTP_TOOLS_CLEANUP_TARGET
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/openjdk-bin/openjdk-bin.mk +14 -1
index 31dc4a4666..6660d7ef03 100644
@@ -11,18 +11,31 @@ HOST_OPENJDK_BIN_SOURCE = OpenJDK14U-jdk_x64_linux_hotspot_$(HOST_OPENJDK_BIN_VE
 HOST_OPENJDK_BIN_SITE = https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-$(HOST_OPENJDK_BIN_VERSION_MAJOR)%2B$(HOST_OPENJDK_BIN_VERSION_MINOR)
 HOST_OPENJDK_BIN_LICENSE = GPL-2.0+ with exception
 HOST_OPENJDK_BIN_LICENSE_FILES = legal/java.prefs/LICENSE legal/java.prefs/ASSEMBLY_EXCEPTION
+HOST_OPENJDK_BIN_DEPENDENCIES = \
+	host-freetype \
+	host-lksctp-tools
 
 # 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.
+# Dependency on host-freetype creates an up to date libfreetype.so so
+# libfreetype.so is removed from host-openjdk-bin after extract.
+# Dependency on host-lksctp-tools creates an up to date libsctp.so so
+# libsctp.so is removed from host-openjdk-bin after extract.
+define HOST_OPENJDK_BIN_CLEANUP
+	$(RM) -f $(@D)/bin/unpack200
+	$(RM) -f $(@D)/lib/libfreetype.so
+	$(RM) -f $(@D)/lib/libsctp.so
+endef
+HOST_OPENJDK_BIN_POST_EXTRACT_HOOKS += HOST_OPENJDK_BIN_CLEANUP
+
 define HOST_OPENJDK_BIN_INSTALL_CMDS
 	mkdir -p $(HOST_DIR)/bin
 	cp -dpfr $(@D)/bin/* $(HOST_DIR)/bin/
 	mkdir -p $(HOST_DIR)/lib
 	cp -dpfr $(@D)/lib/* $(HOST_DIR)/lib/
-	$(RM) -f $(HOST_DIR)/bin/unpack200
 endef
 
 $(eval $(host-generic-package))
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/openjdk-bin: use libraries from host pkgs

Jared, All,

On 2020-06-15 18:28 -0500, Jared Bents spake thusly:

Quoted 16 lines

Update to remove libfreetype.so as it is created by host-freetype and other packages fail with the version of libfreetype.so provided by host-openjdk-bin such as host-xapp_mkfontscale.

Update to add host variant of lksctp-tools, remove libsctp.so, and add host-lksctp-tools dependency.

Two other libraries are included by host-opensdk-bin that could be provided by other packages being built from source however they have issues and have not been included in this update:
* Add host variant of libnet, remove libnet.so,
and add host-libnet dependency. However, this causes openjdk to hang during the build and is not included.
* Remove libzip.so and add host-libzip dependency. However, this currently causes host-zip to fail to build and is not included.

Quoted 3 lines

Bug tracker - https://bugs.busybox.net/show_bug.cgi?id=13001

Thanks for your patch.

However, as you noticed, soem of the remaining libraries are causing problens, either in openjdk itself or in other packages, so we can't remove them or replace them.

So, Adam has proposed an alternative solution, to move the openjdk out of the way and into its own installation directory.

This both fixes our issue, while at the same time ressembling the java world a bit more (that's what java users expect, that it is install in /usr/lib/jvm or some sorts...)

As such, I've applied Adam's patch instead.

Thanks for the report and the proposed patch nonetheless. :-)

Regards,
Yann E. MORIN.

Quoted 54 lines
---
 package/lksctp-tools/lksctp-tools.mk |  1 +
 package/openjdk-bin/openjdk-bin.mk   | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
package/lksctp-tools/lksctp-tools.mk +1 -0
index 5ac794e842..ace11ecc97 100644
@@ -20,3 +20,4 @@ endef
 LKSCTP_TOOLS_POST_INSTALL_TARGET_HOOKS += LKSCTP_TOOLS_CLEANUP_TARGET
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/openjdk-bin/openjdk-bin.mk +14 -1
index 31dc4a4666..6660d7ef03 100644
@@ -11,18 +11,31 @@ HOST_OPENJDK_BIN_SOURCE = OpenJDK14U-jdk_x64_linux_hotspot_$(HOST_OPENJDK_BIN_VE
 HOST_OPENJDK_BIN_SITE = https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-$(HOST_OPENJDK_BIN_VERSION_MAJOR)%2B$(HOST_OPENJDK_BIN_VERSION_MINOR)
 HOST_OPENJDK_BIN_LICENSE = GPL-2.0+ with exception
 HOST_OPENJDK_BIN_LICENSE_FILES = legal/java.prefs/LICENSE legal/java.prefs/ASSEMBLY_EXCEPTION
+HOST_OPENJDK_BIN_DEPENDENCIES = \
+	host-freetype \
+	host-lksctp-tools
 
 # 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.
+# Dependency on host-freetype creates an up to date libfreetype.so so
+# libfreetype.so is removed from host-openjdk-bin after extract.
+# Dependency on host-lksctp-tools creates an up to date libsctp.so so
+# libsctp.so is removed from host-openjdk-bin after extract.
+define HOST_OPENJDK_BIN_CLEANUP
+	$(RM) -f $(@D)/bin/unpack200
+	$(RM) -f $(@D)/lib/libfreetype.so
+	$(RM) -f $(@D)/lib/libsctp.so
+endef
+HOST_OPENJDK_BIN_POST_EXTRACT_HOOKS += HOST_OPENJDK_BIN_CLEANUP
+
 define HOST_OPENJDK_BIN_INSTALL_CMDS
 	mkdir -p $(HOST_DIR)/bin
 	cp -dpfr $(@D)/bin/* $(HOST_DIR)/bin/
 	mkdir -p $(HOST_DIR)/lib
 	cp -dpfr $(@D)/lib/* $(HOST_DIR)/lib/
-	$(RM) -f $(HOST_DIR)/bin/unpack200
 endef
 
 $(eval $(host-generic-package))
Signature · 1 line
2.17.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'