diff --git a/packages/cliaoke/build.sh b/packages/cliaoke/build.sh index ef0378540..75b827933 100644 --- a/packages/cliaoke/build.sh +++ b/packages/cliaoke/build.sh @@ -3,8 +3,10 @@ TERMUX_PKG_DESCRIPTION="Command line karaoke" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=0.2.4 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/jessfraz/cliaoke/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=df601b7d118acb8c0b7251c42b5b2623335bfc51f5dc94135fa6722850955f50 +TERMUX_PKG_RECOMMENDS="fluidsynth" TERMUX_PKG_BUILD_IN_SRC=true termux_step_make() { @@ -18,3 +20,16 @@ termux_step_make() { termux_step_make_install() { install -Dm700 -t $TERMUX_PREFIX/bin cliaoke } + +termux_step_create_debscripts() { + echo "#!$TERMUX_PREFIX/bin/sh" > postinst + echo "if [ ! -e $TERMUX_PREFIX/share/soundfonts/FluidR3_GM.sf2 ]; then" >> postinst + echo " echo" >> postinst + echo " echo You may need to get \\\`FluidR3_GM.sf2\\' from somewhere and put it into:" >> postinst + echo " echo" >> postinst + echo " echo ' '$TERMUX_PREFIX/share/soundfonts/" >> postinst + echo " echo" >> postinst + echo "fi" >> postinst + echo "exit 0" >> postinst + chmod 0755 postinst +} diff --git a/packages/cliaoke/karaoke-play_linux.go.patch b/packages/cliaoke/karaoke-play_linux.go.patch new file mode 100644 index 000000000..59e8cf7ba --- /dev/null +++ b/packages/cliaoke/karaoke-play_linux.go.patch @@ -0,0 +1,17 @@ +--- a/karaoke/play_linux.go ++++ b/karaoke/play_linux.go +@@ -9,12 +9,12 @@ + ) + + const ( +- soundfontPath = "/usr/share/sounds/sf2/FluidR3_GM.sf2" ++ soundfontPath = "@TERMUX_PREFIX@/share/soundfonts/FluidR3_GM.sf2" + ) + + // Play takes a given .midi file and plays it. + func Play(localmid string) error { +- cmd := exec.Command(fluidsynthBinary, "-a", "alsa", "-m", "alsa_seq", "-l", "-i", soundfontPath, localmid) ++ cmd := exec.Command(fluidsynthBinary, "-a", "pulseaudio", "-l", "-i", soundfontPath, localmid) + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("running `%s %s` failed: %s, %v", cmd.Path, strings.Join(cmd.Args, " "), out, err) + }