diff --git a/scripts/package_standalone_support.sh b/scripts/package_standalone_support.sh index 57c3bbc..70f2886 100755 --- a/scripts/package_standalone_support.sh +++ b/scripts/package_standalone_support.sh @@ -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" diff --git a/tests/portable_packaging_test.sh b/tests/portable_packaging_test.sh index 365fc30..2f7c4d3 100755 --- a/tests/portable_packaging_test.sh +++ b/tests/portable_packaging_test.sh @@ -419,6 +419,8 @@ PYTHONNOUSERSITE=1 "${standalone_runtime}/runtime/bin/python3" -s -c \ ! find "${standalone_runtime}/runtime/python" \ \( -type d \( -name tkinter -o -name idlelib -o -name turtledemo \) -o \ -type f -name '_tkinter*.so' \) -print -quit | grep -q . +! find "${standalone_runtime}/runtime/jre" -name 'libjsound*.so' \ + -print -quit | grep -q . [[ -s "${standalone_runtime}/webkit.env" ]] [[ ! -e "${standalone_runtime}/scripts/mocktail_login_webview.py" ]] [[ ! -e "${standalone_runtime}/libexec/webkit2gtk-4.1" ]]