tauon: 7.9.0 -> 8.0.1

This commit is contained in:
Jan Solanti 2025-05-10 04:07:12 +03:00
parent c223facf3a
commit 59041b8f6a
2 changed files with 49 additions and 13 deletions

View file

@ -0,0 +1,15 @@
diff --git a/src/tauon/__main__.py b/src/tauon/__main__.py
index 04691586..e48afa02 100755
--- a/src/tauon/__main__.py
+++ b/src/tauon/__main__.py
@@ -115,8 +115,8 @@ def transfer_args_and_exit() -> None:
if "--no-start" in sys.argv:
transfer_args_and_exit()
-# If we're installed, use home data locations
-install_mode = bool(str(install_directory).startswith(("/opt/", "/usr/", "/app/", "/snap/")) or sys.platform in ("darwin", "win32"))
+# Nixpkgs install, use home data dirs.
+install_mode = True
# Assume that it's a classic Linux install, use standard paths
if str(install_directory).startswith("/usr/") and Path("/usr/share/TauonMusicBox").is_dir():

View file

@ -2,6 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
fetchPypi,
kissfft, kissfft,
miniaudio, miniaudio,
pkg-config, pkg-config,
@ -16,6 +17,7 @@
librsvg, librsvg,
libsamplerate, libsamplerate,
libvorbis, libvorbis,
xorg,
mpg123, mpg123,
opusfile, opusfile,
pango, pango,
@ -26,16 +28,32 @@
withDiscordRPC ? true, withDiscordRPC ? true,
}: }:
let
# fork of pypresence, to be reverted if/when there's an upstream release
lynxpresence = python3Packages.buildPythonPackage rec {
pname = "lynxpresence";
version = "4.4.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-y/KboyhEGs9RvyKayEIQu2+WaiQNOdsHDl1/pEoqEkQ=";
};
doCheck = false; # tests require internet connection
pythonImportsCheck = [ "lynxpresence" ];
};
in
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "tauon"; pname = "tauon";
version = "7.9.0"; version = "8.0.1";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Taiko2k"; owner = "Taiko2k";
repo = "Tauon"; repo = "Tauon";
tag = "v${version}"; tag = "v${version}";
hash = "sha256-6aEUniLoE5Qtfht3OAe+zvC9yZwjH+KpskmjGowDuuU="; hash = "sha256-m94/zdlJu/u/dchIXhqB47bkl6Uej2hVr8R6RNg8Vaw=";
}; };
postUnpack = '' postUnpack = ''
@ -46,16 +64,16 @@ python3Packages.buildPythonApplication rec {
ln -s ${miniaudio.src} source/src/phazor/miniaudio ln -s ${miniaudio.src} source/src/phazor/miniaudio
''; '';
postPatch = '' patches = [
substituteInPlace src/tauon/__main__.py \ ./install_mode_true.patch
--replace-fail 'install_mode = False' 'install_mode = True' ];
postPatch = ''
substituteInPlace src/tauon/t_modules/t_phazor.py \ substituteInPlace src/tauon/t_modules/t_phazor.py \
--replace-fail 'base_path = Path(pctl.install_directory).parent.parent / "build"' 'base_path = Path("${placeholder "out"}/${python3Packages.python.sitePackages}")' --replace-fail 'base_path = Path(pctl.install_directory).parent.parent / "build"' 'base_path = Path("${placeholder "out"}/${python3Packages.python.sitePackages}")'
''; '';
pythonRemoveDeps = [ pythonRemoveDeps = [
"pysdl2-dll"
"opencc" "opencc"
"tekore" "tekore"
]; ];
@ -105,23 +123,26 @@ python3Packages.buildPythonApplication rec {
pychromecast pychromecast
pylast pylast
pygobject3 pygobject3
pysdl2 pysdl3
requests requests
send2trash send2trash
setproctitle setproctitle
tidalapi tidalapi
] ]
++ lib.optional withDiscordRPC pypresence ++ lib.optional withDiscordRPC lynxpresence
++ lib.optional stdenv.hostPlatform.isLinux pulsectl; ++ lib.optional stdenv.hostPlatform.isLinux pulsectl;
makeWrapperArgs = [ makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}"
"--prefix LD_LIBRARY_PATH : ${ "--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [ lib.makeLibraryPath (
[
game-music-emu game-music-emu
libopenmpt libopenmpt
pulseaudio pulseaudio
] ]
++ lib.optional stdenv.hostPlatform.isLinux xorg.libXcursor
)
}" }"
"--prefix PYTHONPATH : $out/share/tauon" "--prefix PYTHONPATH : $out/share/tauon"
"--set GI_TYPELIB_PATH $GI_TYPELIB_PATH" "--set GI_TYPELIB_PATH $GI_TYPELIB_PATH"