From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BE23A158041 for ; Fri, 23 Feb 2024 01:14:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 464062BC035; Fri, 23 Feb 2024 01:14:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 214972BC035 for ; Fri, 23 Feb 2024 01:14:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F154A3431CB for ; Fri, 23 Feb 2024 01:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5E38B114F for ; Fri, 23 Feb 2024 01:14:09 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1708650802.dd358e90547f1809674369e2d55abb737b4c7c65.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-sound/TauonMusicBox/files/, media-sound/TauonMusicBox/ X-VCS-Repository: repo/proj/guru X-VCS-Files: media-sound/TauonMusicBox/Manifest media-sound/TauonMusicBox/TauonMusicBox-7.7.1.ebuild media-sound/TauonMusicBox/TauonMusicBox-9999.ebuild media-sound/TauonMusicBox/files/TauonMusicBox-fix-build-system.patch media-sound/TauonMusicBox/metadata.xml X-VCS-Directories: media-sound/TauonMusicBox/ media-sound/TauonMusicBox/files/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: dd358e90547f1809674369e2d55abb737b4c7c65 X-VCS-Branch: dev Date: Fri, 23 Feb 2024 01:14:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ac4ff9cc-4360-4b85-b9e3-4ac5d0457034 X-Archives-Hash: 781232526b259b66e62fdcd112ab98cd Message-ID: <20240223011409.HaKn_-PkDLFMDXX_AUygMEK3u9Wqjghy6MZff4Z94TI@z> commit: dd358e90547f1809674369e2d55abb737b4c7c65 Author: David Roman gmail com> AuthorDate: Fri Feb 23 01:13:04 2024 +0000 Commit: David Roman gmail 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 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 +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 +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 +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 @@ + + + + + davidroman96@gmail.com + David Roman + + + Taiko2k/TauronMusicBox + +