Loading pkgs/by-name/ta/tauon/install_mode_true.patch 0 → 100644 +15 −0 Original line number Diff line number Diff line 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(): pkgs/by-name/ta/tauon/package.nix +34 −13 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, fetchPypi, kissfft, miniaudio, pkg-config, Loading @@ -16,6 +17,7 @@ librsvg, libsamplerate, libvorbis, xorg, mpg123, opusfile, pango, Loading @@ -26,16 +28,32 @@ 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 { pname = "tauon"; version = "7.9.0"; version = "8.0.1"; pyproject = true; src = fetchFromGitHub { owner = "Taiko2k"; repo = "Tauon"; tag = "v${version}"; hash = "sha256-6aEUniLoE5Qtfht3OAe+zvC9yZwjH+KpskmjGowDuuU="; hash = "sha256-m94/zdlJu/u/dchIXhqB47bkl6Uej2hVr8R6RNg8Vaw="; }; postUnpack = '' Loading @@ -46,16 +64,16 @@ python3Packages.buildPythonApplication rec { ln -s ${miniaudio.src} source/src/phazor/miniaudio ''; postPatch = '' substituteInPlace src/tauon/__main__.py \ --replace-fail 'install_mode = False' 'install_mode = True' patches = [ ./install_mode_true.patch ]; postPatch = '' 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}")' ''; pythonRemoveDeps = [ "pysdl2-dll" "opencc" "tekore" ]; Loading Loading @@ -105,23 +123,26 @@ python3Packages.buildPythonApplication rec { pychromecast pylast pygobject3 pysdl2 pysdl3 requests send2trash setproctitle tidalapi ] ++ lib.optional withDiscordRPC pypresence ++ lib.optional withDiscordRPC lynxpresence ++ lib.optional stdenv.hostPlatform.isLinux pulsectl; makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" "--prefix LD_LIBRARY_PATH : ${ lib.makeLibraryPath [ lib.makeLibraryPath ( [ game-music-emu libopenmpt pulseaudio ] ++ lib.optional stdenv.hostPlatform.isLinux xorg.libXcursor ) }" "--prefix PYTHONPATH : $out/share/tauon" "--set GI_TYPELIB_PATH $GI_TYPELIB_PATH" Loading Loading
pkgs/by-name/ta/tauon/install_mode_true.patch 0 → 100644 +15 −0 Original line number Diff line number Diff line 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():
pkgs/by-name/ta/tauon/package.nix +34 −13 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, fetchPypi, kissfft, miniaudio, pkg-config, Loading @@ -16,6 +17,7 @@ librsvg, libsamplerate, libvorbis, xorg, mpg123, opusfile, pango, Loading @@ -26,16 +28,32 @@ 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 { pname = "tauon"; version = "7.9.0"; version = "8.0.1"; pyproject = true; src = fetchFromGitHub { owner = "Taiko2k"; repo = "Tauon"; tag = "v${version}"; hash = "sha256-6aEUniLoE5Qtfht3OAe+zvC9yZwjH+KpskmjGowDuuU="; hash = "sha256-m94/zdlJu/u/dchIXhqB47bkl6Uej2hVr8R6RNg8Vaw="; }; postUnpack = '' Loading @@ -46,16 +64,16 @@ python3Packages.buildPythonApplication rec { ln -s ${miniaudio.src} source/src/phazor/miniaudio ''; postPatch = '' substituteInPlace src/tauon/__main__.py \ --replace-fail 'install_mode = False' 'install_mode = True' patches = [ ./install_mode_true.patch ]; postPatch = '' 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}")' ''; pythonRemoveDeps = [ "pysdl2-dll" "opencc" "tekore" ]; Loading Loading @@ -105,23 +123,26 @@ python3Packages.buildPythonApplication rec { pychromecast pylast pygobject3 pysdl2 pysdl3 requests send2trash setproctitle tidalapi ] ++ lib.optional withDiscordRPC pypresence ++ lib.optional withDiscordRPC lynxpresence ++ lib.optional stdenv.hostPlatform.isLinux pulsectl; makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" "--prefix LD_LIBRARY_PATH : ${ lib.makeLibraryPath [ lib.makeLibraryPath ( [ game-music-emu libopenmpt pulseaudio ] ++ lib.optional stdenv.hostPlatform.isLinux xorg.libXcursor ) }" "--prefix PYTHONPATH : $out/share/tauon" "--set GI_TYPELIB_PATH $GI_TYPELIB_PATH" Loading