aboutsummaryrefslogtreecommitdiff
path: root/audio/tauonmb
diff options
context:
space:
mode:
authorPouria Rezaei <Pouria.rz@outlook.com>2024-07-13 12:41:31 +0330
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-07-15 09:59:04 +0700
commita18d0509de1fc70ed5deae318be55ad40adb751e (patch)
tree4f9461f7c8b4de2300d1e6fec5bbd4cd3196d0aa /audio/tauonmb
parent2738704173d89b449e84720baea6bfcc0f4febd2 (diff)
audio/tauonmb: Update script.
- Too many dependencies already, a little cleanup. - Switched to Unidecode (seems python3-isounidecode is long dead). Signed-off-by: Pouria Rezaei <Pouria.rz@outlook.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/tauonmb')
-rw-r--r--audio/tauonmb/README6
-rw-r--r--audio/tauonmb/config/fix-tauon-options.patch83
-rw-r--r--audio/tauonmb/config/flatpak-rpc.diff (renamed from audio/tauonmb/flatpak-rpc.diff)0
-rw-r--r--audio/tauonmb/config/obsolete-libgme.patch156
-rw-r--r--audio/tauonmb/doinst.sh4
-rw-r--r--audio/tauonmb/tauonmb.SlackBuild15
-rw-r--r--audio/tauonmb/tauonmb.info2
7 files changed, 258 insertions, 8 deletions
diff --git a/audio/tauonmb/README b/audio/tauonmb/README
index 661ec34b37..a020b50527 100644
--- a/audio/tauonmb/README
+++ b/audio/tauonmb/README
@@ -7,5 +7,11 @@ Optional dependencies:
python3-pypresence #Discord RPC
python3-tekore #Spotify API
picard #Internal tagger
+ libgme #Nintendo music emulation
+
+To use GME, install the "libgme" first.
+If desired, do:
+
+ LIBGME="yes" ./tauonmb.SlackBuild
By !red
diff --git a/audio/tauonmb/config/fix-tauon-options.patch b/audio/tauonmb/config/fix-tauon-options.patch
new file mode 100644
index 0000000000..4b02e04eaf
--- /dev/null
+++ b/audio/tauonmb/config/fix-tauon-options.patch
@@ -0,0 +1,83 @@
+diff --git a/t_modules/t_lyrics.py b/t_modules/t_lyrics.py
+index 8e5d197a..19b91bd8 100644
+--- a/t_modules/t_lyrics.py
++++ b/t_modules/t_lyrics.py
+@@ -18,7 +18,7 @@
+ # along with Tauon Music Box. If not, see <http://www.gnu.org/licenses/>.
+
+
+-from isounidecode import unidecode
++from unidecode import unidecode
+ from bs4 import BeautifulSoup
+ import urllib.parse
+ import requests
+@@ -81,7 +81,7 @@ def genius(artist, title, return_url=False):
+ line = line.replace("/", "-")
+ line = line.replace("-&-", "-and-")
+ line = line.replace("&", "-and-")
+- line = unidecode(line).decode()
++ line = unidecode(line)
+ line = urllib.parse.quote(line)
+ line = f"https://genius.com/{line}-lyrics"
+
+diff --git a/t_modules/t_main.py b/t_modules/t_main.py
+index c2f2ebab..4848b7b2 100644
+--- a/t_modules/t_main.py
++++ b/t_modules/t_main.py
+@@ -591,7 +591,7 @@ from pathlib import Path
+ from xml.sax.saxutils import escape, unescape
+ from ctypes import *
+ from send2trash import send2trash
+-from isounidecode import unidecode
++from unidecode import unidecode
+ from collections import OrderedDict
+
+ musicbrainzngs.set_useragent("TauonMusicBox", n_version, "https://github.com/Taiko2k/Tauon")
+@@ -25663,14 +25663,14 @@ def worker2():
+ s_text = s_cn
+
+ if dia_mode:
+- title = unidecode(title).decode()
++ title = unidecode(title)
+
+- artist = unidecode(artist).decode()
+- album_artist = unidecode(album_artist).decode()
+- composer = unidecode(composer).decode()
+- album = unidecode(album).decode()
+- filename = unidecode(filename).decode()
+- sartist = unidecode(sartist).decode()
++ artist = unidecode(artist)
++ album_artist = unidecode(album_artist)
++ composer = unidecode(composer)
++ album = unidecode(album)
++ filename = unidecode(filename)
++ sartist = unidecode(sartist)
+
+ if cache_string is None:
+ search_dia_string_cache[
+@@ -30054,9 +30054,9 @@ class Over:
+ click=self.click, replace="github")
+
+ y += spacing
+- ddt.text((x, y), "isounidecode", colours.box_sub_text, font)
+- ddt.text((xx, y), "New BSD License", colours.box_text_label, font)
+- draw_linked_text2(xxx, y, "https://github.com/redvasily/isounidecode", colours.box_sub_text, font,
++ ddt.text((x, y), "unidecode", colours.box_sub_text, font)
++ ddt.text((xx, y), "GPL-2.0+", colours.box_text_label, font)
++ draw_linked_text2(xxx, y, "https://github.com/avian2/unidecode", colours.box_sub_text, font,
+ click=self.click, replace="github")
+
+ y += spacing
+diff --git a/t_modules/t_main.py b/t_modules/t_main.py
+index 4848b7b2..cc662a74 100644
+--- a/t_modules/t_main.py
++++ b/t_modules/t_main.py
+@@ -4550,7 +4550,7 @@ try:
+ gme.gme_open_file.restype = ctypes.c_char_p
+
+ except:
+- print("Cannont find libgme")
++ pass
+
+ def use_id3(tags, nt):
+ def natural_get(tag, track, frame, attr):
diff --git a/audio/tauonmb/flatpak-rpc.diff b/audio/tauonmb/config/flatpak-rpc.diff
index fbe8501364..fbe8501364 100644
--- a/audio/tauonmb/flatpak-rpc.diff
+++ b/audio/tauonmb/config/flatpak-rpc.diff
diff --git a/audio/tauonmb/config/obsolete-libgme.patch b/audio/tauonmb/config/obsolete-libgme.patch
new file mode 100644
index 0000000000..e6f6466f88
--- /dev/null
+++ b/audio/tauonmb/config/obsolete-libgme.patch
@@ -0,0 +1,156 @@
+diff --git a/compile-phazor.sh b/compile-phazor.sh
+index 090c318b..2313338d 100755
+--- a/compile-phazor.sh
++++ b/compile-phazor.sh
+@@ -3,7 +3,7 @@
+ set -e
+
+ gcc src/phazor/kissfft/kiss_fftr.c src/phazor/kissfft/kiss_fft.c src/phazor/phazor.c \
+- `pkg-config --cflags --libs samplerate wavpack opusfile vorbisfile libmpg123 flac libopenmpt libgme` \
++ `pkg-config --cflags --libs samplerate wavpack opusfile vorbisfile libmpg123 flac libopenmpt` \
+ -shared -o libphazor.so -fPIC -Wall -O3 -g #-Wextra
+ mkdir -p lib
+ mv libphazor.so lib/libphazor.so
+diff --git a/src/phazor/phazor.c b/src/phazor/phazor.c
+index e89edaf6..ecb84259 100644
+--- a/src/phazor/phazor.c
++++ b/src/phazor/phazor.c
+@@ -55,7 +55,6 @@
+ #include <libopenmpt/libopenmpt_stream_callbacks_file.h>
+ #include "kissfft/kiss_fftr.h"
+ #include "wavpack/wavpack.h"
+-#include "gme/gme.h"
+
+ #define BUFF_SIZE 240000 // Decoded data buffer size
+ #define BUFF_SAFE 100000 // Ensure there is this much space free in the buffer
+@@ -209,7 +208,6 @@ enum decoder_types {
+ MPT,
+ FEED,
+ WAVPACK,
+- GME,
+ };
+
+ enum result_status_enum {
+@@ -318,11 +316,6 @@ char parse_buffer[2048 * 2];
+ FILE* mod_file = 0;
+ openmpt_module* mod = 0;
+
+-
+-// GME related -------------------
+-
+-Music_Emu* emu;
+-
+ // FFMPEG related -----------------------------------------------------
+
+ FILE *ffm;
+@@ -893,9 +886,6 @@ void stop_decoder() {
+ case MPT:
+ openmpt_module_destroy(mod);
+ break;
+- case GME:
+- gme_delete(emu);
+- break;
+ }
+ //src_reset(src);
+ decoder_allocated = 0;
+@@ -1132,9 +1122,6 @@ void decode_seek(int abs_ms, int sample_rate) {
+ case MPT:
+ openmpt_module_set_position_seconds(mod, abs_ms / 1000.0);
+ break;
+- case GME:
+- gme_seek(emu, (long) abs_ms);
+- break;
+ }
+ }
+
+@@ -1281,7 +1268,6 @@ int load_next() {
+ long rate;
+ int e = 0;
+ int old_sample_rate = sample_rate_src;
+- src_channels = 2;
+
+ char *ext;
+ ext = strrchr(loaded_target_file, '.');
+@@ -1424,21 +1410,6 @@ int load_next() {
+ )
+ ) codec = MPT;
+
+- if (codec == UNKNOWN && ext != NULL && (
+- strcmp(ext, ".spc") == 0 || strcmp(ext, ".SPC") == 0 ||
+- strcmp(ext, ".ay") == 0 || strcmp(ext, ".AY") == 0 ||
+- strcmp(ext, ".gbs") == 0 || strcmp(ext, ".GBS") == 0 ||
+- strcmp(ext, ".gym") == 0 || strcmp(ext, ".GYM") == 0 ||
+- strcmp(ext, ".hes") == 0 || strcmp(ext, ".HES") == 0 ||
+- strcmp(ext, ".kss") == 0 || strcmp(ext, ".KSS") == 0 ||
+- strcmp(ext, ".nsf") == 0 || strcmp(ext, ".NSF") == 0 ||
+- strcmp(ext, ".nsfe") == 0 || strcmp(ext, ".NSFE") == 0 ||
+- strcmp(ext, ".sap") == 0 || strcmp(ext, ".SAP") == 0 ||
+- strcmp(ext, ".vgm") == 0 || strcmp(ext, ".VGM") == 0 ||
+- strcmp(ext, ".vgz") == 0 || strcmp(ext, ".VGZ") == 0
+- )
+- ) codec = GME;
+-
+ if (codec == UNKNOWN && ext != NULL) {
+ if (strcmp(ext, ".flac") == 0 || strcmp(ext, ".FLAC") == 0) {
+ codec = FLAC;
+@@ -1476,25 +1447,6 @@ int load_next() {
+ return 0;
+ }
+
+- if (codec == GME){
+-
+- sample_rate_src = 48000;
+- gme_open_file(loaded_target_file, &emu, (long) sample_rate_src);
+- gme_start_track(emu, subtrack);
+-
+- if (load_target_seek > 0) gme_seek(emu, (long) load_target_seek);
+-
+- if (old_sample_rate != sample_rate_src) {
+- src_reset(src);
+- }
+-
+- pthread_mutex_unlock(&buffer_mutex);
+- decoder_allocated = 1;
+-
+- return 0;
+-
+- }
+-
+ if (codec == MPT){
+
+ mod_file = uni_fopen(loaded_target_file);
+@@ -1811,20 +1763,6 @@ void pump_decode() {
+ pthread_mutex_unlock(&buffer_mutex);
+ }
+
+- } else if (codec == GME) {
+-
+- gme_play(emu, 1024, temp16l);
+-
+- pthread_mutex_lock(&buffer_mutex);
+- read_to_buffer_s16int(temp16l, 1024);
+- samples_decoded += 1024;
+- pthread_mutex_unlock(&buffer_mutex);
+-
+- if (gme_track_ended(emu)){
+- decoder_eos();
+- }
+-
+-
+ } else if (codec == FLAC) {
+ // FLAC decoding
+
+@@ -1853,12 +1791,7 @@ void pump_decode() {
+
+ unsigned int done;
+
+- if(src_channels == 1){
+- done = op_read(opus_dec, opus_buffer, 4096, NULL);
+- }
+- else{
+- done = op_read_stereo(opus_dec, opus_buffer, 1024 * 2) * 2;
+- }
++ done = op_read_stereo(opus_dec, opus_buffer, 1024 * 2) * 2;
+
+ pthread_mutex_lock(&buffer_mutex);
+ read_to_buffer_s16int(opus_buffer, done);
diff --git a/audio/tauonmb/doinst.sh b/audio/tauonmb/doinst.sh
index 1ed122d2fb..f76a4cc462 100644
--- a/audio/tauonmb/doinst.sh
+++ b/audio/tauonmb/doinst.sh
@@ -7,10 +7,6 @@ if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
-if [ -x /usr/bin/update-mime-database ]; then
- /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
-fi
-
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
diff --git a/audio/tauonmb/tauonmb.SlackBuild b/audio/tauonmb/tauonmb.SlackBuild
index 3069420c51..69b056e460 100644
--- a/audio/tauonmb/tauonmb.SlackBuild
+++ b/audio/tauonmb/tauonmb.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for Tauon Music Box
-# Copyright 2019-2022 Pouria Rezaei <Pouria.rz@outlook.com>
+# Copyright 2019-2024 Pouria Rezaei <Pouria.rz@outlook.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -29,7 +29,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=tauonmb
VERSION=${VERSION:-7.8.0}
SRCNAM=Tauon
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -66,6 +66,15 @@ tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION
+# - Replace my own isounidecode with Unidecode.
+# - Pass libgme.
+patch -p1 < $CWD/config/fix-tauon-options.patch
+
+# Make libgme optional, isn't this messy already?
+if [ ! "${LIBGME:-no}" = "yes" ]; then
+ patch -p1 < "$CWD/config/obsolete-libgme.patch"
+fi
+
# PHAZOR dependencies (Do not modify this part)
mkdir -p src/phazor/{kissfft,miniaudio}
tar xvf $CWD/kissfft-$KFVER.tar.gz --strip-components=1 -C src/phazor/kissfft
@@ -87,7 +96,7 @@ rm -f locale/*/*/*.po
case "$RPC" in
[yY][eE][sS])
- patch -p1 < "$CWD/flatpak-rpc.diff"
+ patch -p1 < "$CWD/config/flatpak-rpc.diff"
;;
esac
diff --git a/audio/tauonmb/tauonmb.info b/audio/tauonmb/tauonmb.info
index dfbd622a7b..a3311b4fd4 100644
--- a/audio/tauonmb/tauonmb.info
+++ b/audio/tauonmb/tauonmb.info
@@ -9,6 +9,6 @@ MD5SUM="1e056ebbc649db767ff64e9275df60c1 \
01b821de48cdba3838239b6cbd5e13e5"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="libopenmpt libgme musicbrainzngs mutagen pylast python3-isounidecode python3-natsort python3-plexapi python3-pulsectl python3-pylyrics python3-pysdl2 send2trash setproctitle python3-websocket-client"
+REQUIRES="libopenmpt musicbrainzngs mutagen pylast Unidecode python3-natsort python3-plexapi python3-pulsectl python3-pylyrics python3-pysdl2 send2trash setproctitle python3-websocket-client"
MAINTAINER="Pouria Rezaei"
EMAIL="Pouria.rz@outlook.com"