fix Pacman Package and try to fix audio.

Audio did not work, but better debug handling.
This commit is contained in:
2026-06-29 23:27:29 +02:00
parent 57deda4b94
commit a53e6a420f
3 changed files with 100 additions and 44 deletions
+38 -17
View File
@@ -348,23 +348,42 @@ jobs:
if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then
cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png" cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png"
fi fi
INSTALLED_SIZE=$(du -sk "$PKGROOT" | cut -f1) INSTALLED_SIZE=$(du -sb "$PKGROOT" | cut -f1)
BUILDDATE=$(date +%s)
WORKFLOW_SHA256=$(sha256sum "$GITHUB_WORKSPACE/.github/workflows/nightly-artifacts.yml" | awk '{print $1}')
cat > "$PKGROOT/.PKGINFO" << EOF cat > "$PKGROOT/.PKGINFO" << EOF
pkgname = kst4contest pkgname = kst4contest
pkgbase = kst4contest pkgbase = kst4contest
pkgver = ${PKGVER}-1 xdata = pkgtype=pkg
pkgdesc = KST4Contest amateur radio contest logger pkgver = ${PKGVER}-1
url = https://github.com/${{ github.repository }} pkgdesc = KST4Contest amateur radio contest logger
builddate = $(date +%s) url = https://github.com/${{ github.repository }}
packager = GitHub Actions builddate = ${BUILDDATE}
size = ${INSTALLED_SIZE} packager = GitHub Actions
arch = ${ARCH} size = ${INSTALLED_SIZE}
license = custom arch = ${ARCH}
depend = java-runtime license = custom
depend = gst-plugins-base depend = java-runtime
depend = gst-plugins-good depend = gst-plugins-base
EOF depend = gst-plugins-good
tar --zstd -cf "dist/${ASSET_BASENAME}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" . EOF
cat > "$PKGROOT/.BUILDINFO" << EOF
format = 2
pkgname = kst4contest
pkgbase = kst4contest
pkgver = ${PKGVER}-1
pkgarch = ${ARCH}
pkgbuild_sha256sum = ${WORKFLOW_SHA256}
packager = GitHub Actions
builddate = ${BUILDDATE}
builddir = /build
startdir = /build
buildtool = makepkg
buildtoolver = 7.0.0-1-x86_64
buildenv = !distcc !color !ccache check !sign
options = !strip docs libtool staticlibs emptydirs zipman purge !debug !lto
EOF
tar --zstd --transform 's|^\./||' -cf "dist/${ASSET_BASENAME}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
- name: Upload Arch Linux artifact - name: Upload Arch Linux artifact
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -437,11 +456,13 @@ jobs:
- --share=ipc - --share=ipc
- --device=dri - --device=dri
- --filesystem=~/.praktiKST - --filesystem=~/.praktiKST
- --env=ALSA_CONFIG_PATH=/app/share/alsa/asound.conf
modules: modules:
- name: kst4contest - name: kst4contest
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- install -d /app/lib/KST4Contest /app/bin /app/share/applications - install -d /app/lib/KST4Contest /app/bin /app/share/applications /app/share/alsa
- printf '@include /usr/share/alsa/alsa.conf\npcm.!default { type pulse }\nctl.!default { type pulse }\n' > /app/share/alsa/asound.conf
- cp -a . /app/lib/KST4Contest/ - cp -a . /app/lib/KST4Contest/
- printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest - printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest
- chmod 755 /app/bin/KST4Contest - chmod 755 /app/bin/KST4Contest
+38 -17
View File
@@ -306,23 +306,42 @@ jobs:
if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then
cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png" cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png"
fi fi
INSTALLED_SIZE=$(du -sk "$PKGROOT" | cut -f1) INSTALLED_SIZE=$(du -sb "$PKGROOT" | cut -f1)
BUILDDATE=$(date +%s)
WORKFLOW_SHA256=$(sha256sum "$GITHUB_WORKSPACE/.github/workflows/tagged-release.yml" | awk '{print $1}')
cat > "$PKGROOT/.PKGINFO" << EOF cat > "$PKGROOT/.PKGINFO" << EOF
pkgname = kst4contest pkgname = kst4contest
pkgbase = kst4contest pkgbase = kst4contest
pkgver = ${PKGVER}-1 xdata = pkgtype=pkg
pkgdesc = KST4Contest amateur radio contest logger pkgver = ${PKGVER}-1
url = https://github.com/${{ github.repository }} pkgdesc = KST4Contest amateur radio contest logger
builddate = $(date +%s) url = https://github.com/${{ github.repository }}
packager = GitHub Actions builddate = ${BUILDDATE}
size = ${INSTALLED_SIZE} packager = GitHub Actions
arch = ${ARCH} size = ${INSTALLED_SIZE}
license = custom arch = ${ARCH}
depend = java-runtime license = custom
depend = gst-plugins-base depend = java-runtime
depend = gst-plugins-good depend = gst-plugins-base
EOF depend = gst-plugins-good
tar --zstd -cf "dist/KST4Contest-${{ github.ref_name }}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" . EOF
cat > "$PKGROOT/.BUILDINFO" << EOF
format = 2
pkgname = kst4contest
pkgbase = kst4contest
pkgver = ${PKGVER}-1
pkgarch = ${ARCH}
pkgbuild_sha256sum = ${WORKFLOW_SHA256}
packager = GitHub Actions
builddate = ${BUILDDATE}
builddir = /build
startdir = /build
buildtool = makepkg
buildtoolver = 7.0.0-1-x86_64
buildenv = !distcc !color !ccache check !sign
options = !strip docs libtool staticlibs emptydirs zipman purge !debug !lto
EOF
tar --zstd --transform 's|^\./||' -cf "dist/KST4Contest-${{ github.ref_name }}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
- name: Upload Arch Linux artifact - name: Upload Arch Linux artifact
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -386,11 +405,13 @@ jobs:
- --share=ipc - --share=ipc
- --device=dri - --device=dri
- --filesystem=~/.praktiKST - --filesystem=~/.praktiKST
- --env=ALSA_CONFIG_PATH=/app/share/alsa/asound.conf
modules: modules:
- name: kst4contest - name: kst4contest
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- install -d /app/lib/KST4Contest /app/bin /app/share/applications - install -d /app/lib/KST4Contest /app/bin /app/share/applications /app/share/alsa
- printf '@include /usr/share/alsa/alsa.conf\npcm.!default { type pulse }\nctl.!default { type pulse }\n' > /app/share/alsa/asound.conf
- cp -a . /app/lib/KST4Contest/ - cp -a . /app/lib/KST4Contest/
- printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest - printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest
- chmod 755 /app/bin/KST4Contest - chmod 755 /app/bin/KST4Contest
@@ -115,6 +115,10 @@ public class PlayAudioUtils {
private Queue<Media> musicList = new LinkedList<Media>(); private Queue<Media> musicList = new LinkedList<Media>();
private MediaPlayer mediaPlayer ; private MediaPlayer mediaPlayer ;
/** Set once when JavaFX media cannot create a player (e.g. no reachable audio
* output in a sandbox/headless session). Prevents repeated failures from
* killing the calling thread and spamming the log. */
private boolean audioUnavailable = false;
/** /**
* Plays notification sounds out of the windws 95 box by given action character<br/> * Plays notification sounds out of the windws 95 box by given action character<br/>
@@ -462,23 +466,33 @@ public class PlayAudioUtils {
private void playMusic() { private void playMusic() {
// System.out.println("Kst4ContestApplication.playMusic"); // System.out.println("Kst4ContestApplication.playMusic");
if(musicList.peek() == null) if(audioUnavailable || musicList.peek() == null)
{ {
musicList.clear();
return; return;
} }
mediaPlayer = new MediaPlayer(musicList.poll()); try {
mediaPlayer.setRate(1.0); mediaPlayer = new MediaPlayer(musicList.poll());
mediaPlayer.setRate(1.0);
mediaPlayer.setOnReady(() -> { mediaPlayer.setOnReady(() -> {
mediaPlayer.play(); mediaPlayer.play();
mediaPlayer.setOnEndOfMedia(() -> { mediaPlayer.setOnEndOfMedia(() -> {
// mediaPlayer.dispose(); // mediaPlayer.dispose();
playMusic(); playMusic();
if (musicList.isEmpty()) { if (musicList.isEmpty()) {
// mediaPlayer.dispose(); // mediaPlayer.dispose();
} }
});
}); });
}); } catch (Throwable t) {
// JavaFX could not create the player (typically: no usable audio output,
// e.g. missing audio socket in a Flatpak sandbox or no ALSA->Pulse bridge).
// Never let this kill the caller (the messageBusManagementThread).
audioUnavailable = true;
musicList.clear();
System.out.println("[KST4ContestApp, warning, audio playback disabled (could not create media player): " + t + "]");
}
} }
} }