Fix AnyLinux JRE dependency closure

This commit is contained in:
komaruworld committed 2026-08-28 17:26:09 +03:00
1 parent 9812fbceab
commit 409d8a6319
2 files changed
+18

No files matched your search

+16
View File
@@ -555,6 +555,22 @@ BuildJlinkRuntime() {
--strip-debug --no-man-pages \
--no-header-files --compress="${compression}" \
--output "${SUPPORT_RUNTIME}/jre"
# apkanalyzer needs java.desktop data structures, but neither it nor
# apksigner uses Java Sound. Some OpenJDK builds link this optional native
# library against ALSA, which is intentionally absent from the AnyLinux
# build image and must not become a standalone runtime dependency.
local java_sound_library
for java_sound_library in \
"${SUPPORT_RUNTIME}/jre/lib/libjsound.so" \
"${SUPPORT_RUNTIME}/jre/lib/libjsoundalsa.so"; do
if [[ -e "${java_sound_library}" || -L "${java_sound_library}" ]]; then
[[ ! -d "${java_sound_library}" ]] ||
Die "Java Sound library path is unexpectedly a directory"
rm -f -- "${java_sound_library}"
fi
done
[[ -x "${SUPPORT_RUNTIME}/jre/bin/java" ]] ||
Die "jlink did not produce a Java launcher"
ln -s -- "../jre/bin/java" "${SUPPORT_RUNTIME}/bin/java"