public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "David Roman" <davidroman96@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:master commit in: media-sound/TauonMusicBox/files/, media-sound/TauonMusicBox/
Date: Fri, 23 Feb 2024 01:36:54 +0000 (UTC)	[thread overview]
Message-ID: <1708650802.dd358e90547f1809674369e2d55abb737b4c7c65.davidroman@gentoo> (raw)

commit:     dd358e90547f1809674369e2d55abb737b4c7c65
Author:     David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Fri Feb 23 01:13:04 2024 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Fri Feb 23 01:13:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dd358e90

media-sound/TauonMusicBox: new package, add 7.7.1, 9999

Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
Closes: https://github.com/gentoo/guru/pull/132

 media-sound/TauonMusicBox/Manifest                 |   1 +
 .../TauonMusicBox/TauonMusicBox-7.7.1.ebuild       | 102 ++++++++++++++
 .../TauonMusicBox/TauonMusicBox-9999.ebuild        | 102 ++++++++++++++
 .../files/TauonMusicBox-fix-build-system.patch     | 156 +++++++++++++++++++++
 media-sound/TauonMusicBox/metadata.xml             |  11 ++
 5 files changed, 372 insertions(+)

diff --git a/media-sound/TauonMusicBox/Manifest b/media-sound/TauonMusicBox/Manifest
new file mode 100644
index 0000000000..c93e2ad79d
--- /dev/null
+++ b/media-sound/TauonMusicBox/Manifest
@@ -0,0 +1 @@
+DIST TauonMusicBox-7.7.1.tar.gz 1049204 BLAKE2B 0d1c4fbf7264bedbdb33fba00de141edffbd2290f3b39faf6e9b82a64f6a75ad30233f6e6071fa351bb9fba935e1d5323e550b25cc8fb4a9a35df34e38531774 SHA512 671d626f14358b6db96da24169ef428911a9e50501b2cc61e1bbc43f8fa7f6b76682e438f86fb94d1e4772085150d602a6a87d3e8bd74a5f77aba11efcda397f

diff --git a/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild b/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild
new file mode 100644
index 0000000000..4a820a6fb5
--- /dev/null
+++ b/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PLOCALES="cs de es fr_FR hu id it ja_JP nb_NO pl pt pt_BR pt_PT ru sv tr zh_CN"
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit cmake desktop distutils-r1 plocale
+
+DESCRIPTION="The desktop music player of today!"
+HOMEPAGE="https://tauonmusicbox.rocks/"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_SUBMODULES=()
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/Taiko2k/${PN}"
+else
+	SRC_URI="https://github.com/Taiko2k/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+PHAZOR_DEPS="
+	dev-libs/miniaudio
+	media-libs/flac
+	media-libs/libopenmpt
+	media-sound/mpg123
+	media-libs/opus
+	media-libs/opusfile
+	media-sound/wavpack
+	media-libs/libsamplerate
+	sci-libs/kissfft[-cpu_flags_x86_sse]
+"
+
+DEPEND="
+	dev-python/musicbrainzngs[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/PySDL2[${PYTHON_USEDEP}]
+	media-libs/mutagen[${PYTHON_USEDEP}]
+
+	${PHAZOR_DEPS}
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="sys-devel/gettext"
+
+src_prepare() {
+	# Workaround. If PATCHES is used it would be applied to times and fail
+	eapply "${FILESDIR}/${PN}-fix-build-system.patch"
+
+	distutils-r1_src_prepare
+	cmake_src_prepare
+}
+
+src_configure() {
+	distutils-r1_src_configure
+	cmake_src_configure
+}
+
+src_compile() {
+	distutils-r1_src_compile
+	cmake_src_compile
+
+	build_locale() {
+		msgfmt -o "locale/${1}/LC_MESSAGES/tauon.mo" "locale/${1}/LC_MESSAGES/tauon.po" || die
+	}
+
+	plocale_for_each_locale build_locale
+}
+
+src_test() {
+	distutils-r1_src_test
+	cmake_src_test
+}
+
+python_install() {
+	dobin tauon.py
+	dolib.so  "${WORKDIR}/${P}_build/libphazor.so"
+
+	install_locale() {
+		insinto "/usr/share/locale/${1}/LC_MESSAGES"
+		doins "locale/${1}/LC_MESSAGES/tauon.mo"
+	}
+
+	plocale_for_each_locale install_locale
+
+	insinto "/usr/share/${PN}"
+	doins -r assets theme templates
+	doins input.txt
+	dosym "/usr/$(get_libdir)/libphazor.so" "/usr/share/${PN}/lib/libphazor.so"
+
+	sed -i 's/\/opt\/tauon-music-box\/tauonmb.sh/tauon.py/g' extra/tauonmb.desktop || die
+	domenu extra/tauonmb.desktop
+	doicon -s scalable extra/tauonmb.svg
+
+	distutils-r1_python_install
+}

diff --git a/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild b/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild
new file mode 100644
index 0000000000..4a820a6fb5
--- /dev/null
+++ b/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild
@@ -0,0 +1,102 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PLOCALES="cs de es fr_FR hu id it ja_JP nb_NO pl pt pt_BR pt_PT ru sv tr zh_CN"
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit cmake desktop distutils-r1 plocale
+
+DESCRIPTION="The desktop music player of today!"
+HOMEPAGE="https://tauonmusicbox.rocks/"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_SUBMODULES=()
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/Taiko2k/${PN}"
+else
+	SRC_URI="https://github.com/Taiko2k/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+PHAZOR_DEPS="
+	dev-libs/miniaudio
+	media-libs/flac
+	media-libs/libopenmpt
+	media-sound/mpg123
+	media-libs/opus
+	media-libs/opusfile
+	media-sound/wavpack
+	media-libs/libsamplerate
+	sci-libs/kissfft[-cpu_flags_x86_sse]
+"
+
+DEPEND="
+	dev-python/musicbrainzngs[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/PySDL2[${PYTHON_USEDEP}]
+	media-libs/mutagen[${PYTHON_USEDEP}]
+
+	${PHAZOR_DEPS}
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="sys-devel/gettext"
+
+src_prepare() {
+	# Workaround. If PATCHES is used it would be applied to times and fail
+	eapply "${FILESDIR}/${PN}-fix-build-system.patch"
+
+	distutils-r1_src_prepare
+	cmake_src_prepare
+}
+
+src_configure() {
+	distutils-r1_src_configure
+	cmake_src_configure
+}
+
+src_compile() {
+	distutils-r1_src_compile
+	cmake_src_compile
+
+	build_locale() {
+		msgfmt -o "locale/${1}/LC_MESSAGES/tauon.mo" "locale/${1}/LC_MESSAGES/tauon.po" || die
+	}
+
+	plocale_for_each_locale build_locale
+}
+
+src_test() {
+	distutils-r1_src_test
+	cmake_src_test
+}
+
+python_install() {
+	dobin tauon.py
+	dolib.so  "${WORKDIR}/${P}_build/libphazor.so"
+
+	install_locale() {
+		insinto "/usr/share/locale/${1}/LC_MESSAGES"
+		doins "locale/${1}/LC_MESSAGES/tauon.mo"
+	}
+
+	plocale_for_each_locale install_locale
+
+	insinto "/usr/share/${PN}"
+	doins -r assets theme templates
+	doins input.txt
+	dosym "/usr/$(get_libdir)/libphazor.so" "/usr/share/${PN}/lib/libphazor.so"
+
+	sed -i 's/\/opt\/tauon-music-box\/tauonmb.sh/tauon.py/g' extra/tauonmb.desktop || die
+	domenu extra/tauonmb.desktop
+	doicon -s scalable extra/tauonmb.svg
+
+	distutils-r1_python_install
+}

diff --git a/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch b/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch
new file mode 100644
index 0000000000..dad565e16c
--- /dev/null
+++ b/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch
@@ -0,0 +1,156 @@
+From fea857478425a10ee285818e1c987d1efdbb6a5c Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Tue, 30 Jan 2024 23:34:48 +0100
+Subject: [PATCH 1/3] Add CmakeLists.txt file to compile phrazor
+
+Closes: #828
+---
+ CMakeLists.txt | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+ create mode 100644 CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 000000000..cf79faf5b
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,19 @@
++cmake_minimum_required(VERSION 3.10)
++project(phazor)
++
++add_library(phazor SHARED src/phazor/phazor.c)
++
++find_package(PkgConfig REQUIRED)
++
++pkg_check_modules(phazor REQUIRED flac libopenmpt libmpg123 opus opusfile wavpack samplerate)
++
++find_package(kissfft CONFIG COMPONENTS float)
++if(NOT kissfft_FOUND)
++	add_subdirectory(src/phazor/kissfft)
++endif()
++
++target_include_directories(phazor PRIVATE ${phazor_INCLUDE_DIRS})
++target_link_libraries(phazor kissfft::kissfft ${phazor_LIBRARIES})
++
++
++install(TARGETS phazor DESTINATION ${CMAKE_SOURCE_DIR}/lib)
+
+From 44785f42480b7e53fda707b839153c3665ae4df0 Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Thu, 1 Feb 2024 19:35:58 +0100
+Subject: [PATCH 2/3] Add setup.py and fix install_directory for Linux installs
+
+---
+ setup.py            | 16 ++++++++++++++++
+ t_modules/t_main.py |  4 ++++
+ tauon.py            | 15 +++++++++------
+ 3 files changed, 29 insertions(+), 6 deletions(-)
+ create mode 100644 setup.py
+
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 000000000..dbfa6257a
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,16 @@
++from setuptools import setup, find_packages, Extension
++
++with open('requirements.txt') as f:
++    required = f.read().splitlines()
++
++setup(
++    name = 'Tauon Music Box',
++    packages = find_packages(),
++    version = '7.7.2',
++    url = 'https://tauonmusicbox.rocks/',
++    license = 'GPL-3',
++    install_requires=required,
++	classifiers=[
++		'Programming Language :: Python :: 3'
++	],
++)
+diff --git a/t_modules/t_main.py b/t_modules/t_main.py
+index ebbd325b8..7cbb9782c 100644
+--- a/t_modules/t_main.py
++++ b/t_modules/t_main.py
+@@ -141,6 +141,10 @@
+ # if system == "windows" or msys:
+ #     os.environ["PYSDL2_DLL_PATH"] = install_directory + "\\lib"
+ 
++# Assume that it's a classic Linux install, use standard paths
++if install_directory.startswith("/usr/"):
++    install_directory = "/usr/share/TauonMusicBox"
++
+ # Set data folders (portable mode)
+ user_directory = install_directory
+ config_directory = user_directory
+diff --git a/tauon.py b/tauon.py
+index 6dec8f340..8c502a1a3 100755
+--- a/tauon.py
++++ b/tauon.py
+@@ -78,11 +78,6 @@ def transfer_args_and_exit():
+      os.environ["PATH"] += ":" + sys._MEIPASS
+      os.environ['SSL_CERT_FILE'] = os.path.join(install_directory, "certifi", "cacert.pem")
+ 
+-user_directory = os.path.join(install_directory, "user-data")
+-config_directory = user_directory
+-
+-asset_directory = os.path.join(install_directory, "assets")
+-
+ # If we're installed, use home data locations
+ install_mode = False
+ if install_directory.startswith("/opt/")\
+@@ -91,6 +86,14 @@ def transfer_args_and_exit():
+         or install_directory.startswith("/snap/") or sys.platform == "darwin" or sys.platform == 'win32':
+     install_mode = True
+ 
++# Assume that it's a classic Linux install, use standard paths
++if install_directory.startswith("/usr/"):
++    install_directory = "/usr/share/TauonMusicBox"
++
++user_directory = os.path.join(install_directory, "user-data")
++config_directory = user_directory
++asset_directory = os.path.join(install_directory, "assets")
++
+ if install_directory.startswith("/app/"):
+     # Its Flatpak
+     t_id = "com.github.taiko2k.tauonmb"
+@@ -345,7 +348,7 @@ def transfer_args_and_exit():
+ del flags
+ del img_path
+ 
+-if pyinstaller_mode or sys.platform == "darwin":
++if pyinstaller_mode or sys.platform == "darwin" or install_mode:
+     from t_modules import t_main
+ else:
+     # Using the above import method breaks previous pickles. Could be fixed
+
+From e5f16cfa1176421f4a3b7990a8d30158c9141ae6 Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Fri, 2 Feb 2024 15:56:37 +0100
+Subject: [PATCH 3/3] Search phazor.so from standard LD_LIBRARY_PATH
+
+By removing the hardcoded path we allow LoadLibrary to search the
+library from LD_LIBRARY_PATH directories
+---
+ t_modules/t_phazor.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/t_modules/t_phazor.py b/t_modules/t_phazor.py
+index 2ec5724c9..0c629f62c 100644
+--- a/t_modules/t_phazor.py
++++ b/t_modules/t_phazor.py
+@@ -55,7 +55,12 @@ def player4(tauon):
+     loaded_track = None
+     fade_time = 400
+ 
+-    aud = ctypes.cdll.LoadLibrary(pctl.install_directory + "/lib/libphazor.so")
++    if os.path.isfile(pctl.install_directory + "/lib/libphazor.so"):
++        # XXX: May be unnecesary. It's only to ensure compatibility with WWindows
++        aud = ctypes.cdll.LoadLibrary(pctl.install_directory + "/lib/libphazor.so")
++    else:
++        aud = ctypes.cdll.LoadLibrary("libphazor.so")
++
+     aud.init()
+ 
+     aud.get_device.restype = ctypes.c_char_p

diff --git a/media-sound/TauonMusicBox/metadata.xml b/media-sound/TauonMusicBox/metadata.xml
new file mode 100644
index 0000000000..d30548692a
--- /dev/null
+++ b/media-sound/TauonMusicBox/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>davidroman96@gmail.com</email>
+		<name>David Roman</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">Taiko2k/TauronMusicBox</remote-id> 
+	</upstream>
+</pkgmetadata>


WARNING: multiple messages have this Message-ID (diff)
From: "David Roman" <davidroman96@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-sound/TauonMusicBox/files/, media-sound/TauonMusicBox/
Date: Fri, 23 Feb 2024 01:14:09 +0000 (UTC)	[thread overview]
Message-ID: <1708650802.dd358e90547f1809674369e2d55abb737b4c7c65.davidroman@gentoo> (raw)
Message-ID: <20240223011409.HaKn_-PkDLFMDXX_AUygMEK3u9Wqjghy6MZff4Z94TI@z> (raw)

commit:     dd358e90547f1809674369e2d55abb737b4c7c65
Author:     David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Fri Feb 23 01:13:04 2024 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Fri Feb 23 01:13:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dd358e90

media-sound/TauonMusicBox: new package, add 7.7.1, 9999

Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
Closes: https://github.com/gentoo/guru/pull/132

 media-sound/TauonMusicBox/Manifest                 |   1 +
 .../TauonMusicBox/TauonMusicBox-7.7.1.ebuild       | 102 ++++++++++++++
 .../TauonMusicBox/TauonMusicBox-9999.ebuild        | 102 ++++++++++++++
 .../files/TauonMusicBox-fix-build-system.patch     | 156 +++++++++++++++++++++
 media-sound/TauonMusicBox/metadata.xml             |  11 ++
 5 files changed, 372 insertions(+)

diff --git a/media-sound/TauonMusicBox/Manifest b/media-sound/TauonMusicBox/Manifest
new file mode 100644
index 0000000000..c93e2ad79d
--- /dev/null
+++ b/media-sound/TauonMusicBox/Manifest
@@ -0,0 +1 @@
+DIST TauonMusicBox-7.7.1.tar.gz 1049204 BLAKE2B 0d1c4fbf7264bedbdb33fba00de141edffbd2290f3b39faf6e9b82a64f6a75ad30233f6e6071fa351bb9fba935e1d5323e550b25cc8fb4a9a35df34e38531774 SHA512 671d626f14358b6db96da24169ef428911a9e50501b2cc61e1bbc43f8fa7f6b76682e438f86fb94d1e4772085150d602a6a87d3e8bd74a5f77aba11efcda397f

diff --git a/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild b/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild
new file mode 100644
index 0000000000..4a820a6fb5
--- /dev/null
+++ b/media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PLOCALES="cs de es fr_FR hu id it ja_JP nb_NO pl pt pt_BR pt_PT ru sv tr zh_CN"
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit cmake desktop distutils-r1 plocale
+
+DESCRIPTION="The desktop music player of today!"
+HOMEPAGE="https://tauonmusicbox.rocks/"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_SUBMODULES=()
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/Taiko2k/${PN}"
+else
+	SRC_URI="https://github.com/Taiko2k/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+PHAZOR_DEPS="
+	dev-libs/miniaudio
+	media-libs/flac
+	media-libs/libopenmpt
+	media-sound/mpg123
+	media-libs/opus
+	media-libs/opusfile
+	media-sound/wavpack
+	media-libs/libsamplerate
+	sci-libs/kissfft[-cpu_flags_x86_sse]
+"
+
+DEPEND="
+	dev-python/musicbrainzngs[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/PySDL2[${PYTHON_USEDEP}]
+	media-libs/mutagen[${PYTHON_USEDEP}]
+
+	${PHAZOR_DEPS}
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="sys-devel/gettext"
+
+src_prepare() {
+	# Workaround. If PATCHES is used it would be applied to times and fail
+	eapply "${FILESDIR}/${PN}-fix-build-system.patch"
+
+	distutils-r1_src_prepare
+	cmake_src_prepare
+}
+
+src_configure() {
+	distutils-r1_src_configure
+	cmake_src_configure
+}
+
+src_compile() {
+	distutils-r1_src_compile
+	cmake_src_compile
+
+	build_locale() {
+		msgfmt -o "locale/${1}/LC_MESSAGES/tauon.mo" "locale/${1}/LC_MESSAGES/tauon.po" || die
+	}
+
+	plocale_for_each_locale build_locale
+}
+
+src_test() {
+	distutils-r1_src_test
+	cmake_src_test
+}
+
+python_install() {
+	dobin tauon.py
+	dolib.so  "${WORKDIR}/${P}_build/libphazor.so"
+
+	install_locale() {
+		insinto "/usr/share/locale/${1}/LC_MESSAGES"
+		doins "locale/${1}/LC_MESSAGES/tauon.mo"
+	}
+
+	plocale_for_each_locale install_locale
+
+	insinto "/usr/share/${PN}"
+	doins -r assets theme templates
+	doins input.txt
+	dosym "/usr/$(get_libdir)/libphazor.so" "/usr/share/${PN}/lib/libphazor.so"
+
+	sed -i 's/\/opt\/tauon-music-box\/tauonmb.sh/tauon.py/g' extra/tauonmb.desktop || die
+	domenu extra/tauonmb.desktop
+	doicon -s scalable extra/tauonmb.svg
+
+	distutils-r1_python_install
+}

diff --git a/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild b/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild
new file mode 100644
index 0000000000..4a820a6fb5
--- /dev/null
+++ b/media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild
@@ -0,0 +1,102 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PLOCALES="cs de es fr_FR hu id it ja_JP nb_NO pl pt pt_BR pt_PT ru sv tr zh_CN"
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit cmake desktop distutils-r1 plocale
+
+DESCRIPTION="The desktop music player of today!"
+HOMEPAGE="https://tauonmusicbox.rocks/"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_SUBMODULES=()
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/Taiko2k/${PN}"
+else
+	SRC_URI="https://github.com/Taiko2k/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+PHAZOR_DEPS="
+	dev-libs/miniaudio
+	media-libs/flac
+	media-libs/libopenmpt
+	media-sound/mpg123
+	media-libs/opus
+	media-libs/opusfile
+	media-sound/wavpack
+	media-libs/libsamplerate
+	sci-libs/kissfft[-cpu_flags_x86_sse]
+"
+
+DEPEND="
+	dev-python/musicbrainzngs[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/PySDL2[${PYTHON_USEDEP}]
+	media-libs/mutagen[${PYTHON_USEDEP}]
+
+	${PHAZOR_DEPS}
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="sys-devel/gettext"
+
+src_prepare() {
+	# Workaround. If PATCHES is used it would be applied to times and fail
+	eapply "${FILESDIR}/${PN}-fix-build-system.patch"
+
+	distutils-r1_src_prepare
+	cmake_src_prepare
+}
+
+src_configure() {
+	distutils-r1_src_configure
+	cmake_src_configure
+}
+
+src_compile() {
+	distutils-r1_src_compile
+	cmake_src_compile
+
+	build_locale() {
+		msgfmt -o "locale/${1}/LC_MESSAGES/tauon.mo" "locale/${1}/LC_MESSAGES/tauon.po" || die
+	}
+
+	plocale_for_each_locale build_locale
+}
+
+src_test() {
+	distutils-r1_src_test
+	cmake_src_test
+}
+
+python_install() {
+	dobin tauon.py
+	dolib.so  "${WORKDIR}/${P}_build/libphazor.so"
+
+	install_locale() {
+		insinto "/usr/share/locale/${1}/LC_MESSAGES"
+		doins "locale/${1}/LC_MESSAGES/tauon.mo"
+	}
+
+	plocale_for_each_locale install_locale
+
+	insinto "/usr/share/${PN}"
+	doins -r assets theme templates
+	doins input.txt
+	dosym "/usr/$(get_libdir)/libphazor.so" "/usr/share/${PN}/lib/libphazor.so"
+
+	sed -i 's/\/opt\/tauon-music-box\/tauonmb.sh/tauon.py/g' extra/tauonmb.desktop || die
+	domenu extra/tauonmb.desktop
+	doicon -s scalable extra/tauonmb.svg
+
+	distutils-r1_python_install
+}

diff --git a/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch b/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch
new file mode 100644
index 0000000000..dad565e16c
--- /dev/null
+++ b/media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch
@@ -0,0 +1,156 @@
+From fea857478425a10ee285818e1c987d1efdbb6a5c Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Tue, 30 Jan 2024 23:34:48 +0100
+Subject: [PATCH 1/3] Add CmakeLists.txt file to compile phrazor
+
+Closes: #828
+---
+ CMakeLists.txt | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+ create mode 100644 CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 000000000..cf79faf5b
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,19 @@
++cmake_minimum_required(VERSION 3.10)
++project(phazor)
++
++add_library(phazor SHARED src/phazor/phazor.c)
++
++find_package(PkgConfig REQUIRED)
++
++pkg_check_modules(phazor REQUIRED flac libopenmpt libmpg123 opus opusfile wavpack samplerate)
++
++find_package(kissfft CONFIG COMPONENTS float)
++if(NOT kissfft_FOUND)
++	add_subdirectory(src/phazor/kissfft)
++endif()
++
++target_include_directories(phazor PRIVATE ${phazor_INCLUDE_DIRS})
++target_link_libraries(phazor kissfft::kissfft ${phazor_LIBRARIES})
++
++
++install(TARGETS phazor DESTINATION ${CMAKE_SOURCE_DIR}/lib)
+
+From 44785f42480b7e53fda707b839153c3665ae4df0 Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Thu, 1 Feb 2024 19:35:58 +0100
+Subject: [PATCH 2/3] Add setup.py and fix install_directory for Linux installs
+
+---
+ setup.py            | 16 ++++++++++++++++
+ t_modules/t_main.py |  4 ++++
+ tauon.py            | 15 +++++++++------
+ 3 files changed, 29 insertions(+), 6 deletions(-)
+ create mode 100644 setup.py
+
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 000000000..dbfa6257a
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,16 @@
++from setuptools import setup, find_packages, Extension
++
++with open('requirements.txt') as f:
++    required = f.read().splitlines()
++
++setup(
++    name = 'Tauon Music Box',
++    packages = find_packages(),
++    version = '7.7.2',
++    url = 'https://tauonmusicbox.rocks/',
++    license = 'GPL-3',
++    install_requires=required,
++	classifiers=[
++		'Programming Language :: Python :: 3'
++	],
++)
+diff --git a/t_modules/t_main.py b/t_modules/t_main.py
+index ebbd325b8..7cbb9782c 100644
+--- a/t_modules/t_main.py
++++ b/t_modules/t_main.py
+@@ -141,6 +141,10 @@
+ # if system == "windows" or msys:
+ #     os.environ["PYSDL2_DLL_PATH"] = install_directory + "\\lib"
+ 
++# Assume that it's a classic Linux install, use standard paths
++if install_directory.startswith("/usr/"):
++    install_directory = "/usr/share/TauonMusicBox"
++
+ # Set data folders (portable mode)
+ user_directory = install_directory
+ config_directory = user_directory
+diff --git a/tauon.py b/tauon.py
+index 6dec8f340..8c502a1a3 100755
+--- a/tauon.py
++++ b/tauon.py
+@@ -78,11 +78,6 @@ def transfer_args_and_exit():
+      os.environ["PATH"] += ":" + sys._MEIPASS
+      os.environ['SSL_CERT_FILE'] = os.path.join(install_directory, "certifi", "cacert.pem")
+ 
+-user_directory = os.path.join(install_directory, "user-data")
+-config_directory = user_directory
+-
+-asset_directory = os.path.join(install_directory, "assets")
+-
+ # If we're installed, use home data locations
+ install_mode = False
+ if install_directory.startswith("/opt/")\
+@@ -91,6 +86,14 @@ def transfer_args_and_exit():
+         or install_directory.startswith("/snap/") or sys.platform == "darwin" or sys.platform == 'win32':
+     install_mode = True
+ 
++# Assume that it's a classic Linux install, use standard paths
++if install_directory.startswith("/usr/"):
++    install_directory = "/usr/share/TauonMusicBox"
++
++user_directory = os.path.join(install_directory, "user-data")
++config_directory = user_directory
++asset_directory = os.path.join(install_directory, "assets")
++
+ if install_directory.startswith("/app/"):
+     # Its Flatpak
+     t_id = "com.github.taiko2k.tauonmb"
+@@ -345,7 +348,7 @@ def transfer_args_and_exit():
+ del flags
+ del img_path
+ 
+-if pyinstaller_mode or sys.platform == "darwin":
++if pyinstaller_mode or sys.platform == "darwin" or install_mode:
+     from t_modules import t_main
+ else:
+     # Using the above import method breaks previous pickles. Could be fixed
+
+From e5f16cfa1176421f4a3b7990a8d30158c9141ae6 Mon Sep 17 00:00:00 2001
+From: David Roman <davidroman96@gmail.com>
+Date: Fri, 2 Feb 2024 15:56:37 +0100
+Subject: [PATCH 3/3] Search phazor.so from standard LD_LIBRARY_PATH
+
+By removing the hardcoded path we allow LoadLibrary to search the
+library from LD_LIBRARY_PATH directories
+---
+ t_modules/t_phazor.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/t_modules/t_phazor.py b/t_modules/t_phazor.py
+index 2ec5724c9..0c629f62c 100644
+--- a/t_modules/t_phazor.py
++++ b/t_modules/t_phazor.py
+@@ -55,7 +55,12 @@ def player4(tauon):
+     loaded_track = None
+     fade_time = 400
+ 
+-    aud = ctypes.cdll.LoadLibrary(pctl.install_directory + "/lib/libphazor.so")
++    if os.path.isfile(pctl.install_directory + "/lib/libphazor.so"):
++        # XXX: May be unnecesary. It's only to ensure compatibility with WWindows
++        aud = ctypes.cdll.LoadLibrary(pctl.install_directory + "/lib/libphazor.so")
++    else:
++        aud = ctypes.cdll.LoadLibrary("libphazor.so")
++
+     aud.init()
+ 
+     aud.get_device.restype = ctypes.c_char_p

diff --git a/media-sound/TauonMusicBox/metadata.xml b/media-sound/TauonMusicBox/metadata.xml
new file mode 100644
index 0000000000..d30548692a
--- /dev/null
+++ b/media-sound/TauonMusicBox/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>davidroman96@gmail.com</email>
+		<name>David Roman</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">Taiko2k/TauronMusicBox</remote-id> 
+	</upstream>
+</pkgmetadata>


             reply	other threads:[~2024-02-23  1:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  1:36 David Roman [this message]
2024-02-23  1:14 ` [gentoo-commits] repo/proj/guru:dev commit in: media-sound/TauonMusicBox/files/, media-sound/TauonMusicBox/ David Roman
  -- strict thread matches above, loose matches on Subject: below --
2024-04-19 10:08 [gentoo-commits] repo/proj/guru:master " David Roman
2025-02-24  9:49 [gentoo-commits] repo/proj/guru:dev commit in: media-sound/TauonMusicBox/, media-sound/TauonMusicBox/files/ David Roman
2025-02-24 10:34 ` [gentoo-commits] repo/proj/guru:master commit in: media-sound/TauonMusicBox/files/, media-sound/TauonMusicBox/ David Roman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1708650802.dd358e90547f1809674369e2d55abb737b4c7c65.davidroman@gentoo \
    --to=davidroman96@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox