diff --git a/pkgs/by-name/yt/ytui-music/fix-implicit-autoref-errors-in-ui-mod-rs-for-rust-1-80-plus.patch b/pkgs/by-name/yt/ytui-music/fix-implicit-autoref-errors-in-ui-mod-rs-for-rust-1-80-plus.patch new file mode 100644 index 000000000000..9959dac09cb1 --- /dev/null +++ b/pkgs/by-name/yt/ytui-music/fix-implicit-autoref-errors-in-ui-mod-rs-for-rust-1-80-plus.patch @@ -0,0 +1,26 @@ +From 474521f42376b8a374382994313484aa4bba9c85 Mon Sep 17 00:00:00 2001 +From: LATex +Date: Sat, 11 Oct 2025 20:34:31 -0300 +Subject: [PATCH] Fix implicit autoref errors in ui/mod.rs for Rust 1.80+ + +--- + front-end/src/ui/mod.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/front-end/src/ui/mod.rs b/front-end/src/ui/mod.rs +index 81a56e001a7b892d24eeb0404d2bc069fe9c07a3..296fd4711db0d9380b74e07ae933df161b437b36 100644 +--- a/front-end/src/ui/mod.rs ++++ b/front-end/src/ui/mod.rs +@@ -215,9 +215,9 @@ pub fn draw_ui(state: &mut Arc>, cvar: &mut Arc) { + let state_ptr = &mut state_unlocked as *mut std::sync::MutexGuard<'_, State<'_>>; + let (mut music_state, mut playlist_state, mut artist_state); + unsafe { +- music_state = &mut (*state_ptr).musicbar.1; +- playlist_state = &mut (*state_ptr).playlistbar.1; +- artist_state = &mut (*state_ptr).artistbar.1; ++ music_state = &mut (&mut (*state_ptr)).musicbar.1; ++ playlist_state = &mut (&mut (*state_ptr)).playlistbar.1; ++ artist_state = &mut (&mut (*state_ptr)).artistbar.1; + } + + let music_table = MiddleLayout::get_music_container(&mut state_unlocked); diff --git a/pkgs/by-name/yt/ytui-music/package.nix b/pkgs/by-name/yt/ytui-music/package.nix index b1588d96e2fe..d2c45c10e931 100644 --- a/pkgs/by-name/yt/ytui-music/package.nix +++ b/pkgs/by-name/yt/ytui-music/package.nix @@ -8,26 +8,34 @@ mpv, yt-dlp, makeBinaryWrapper, + _experimental-update-script-combinators, + unstableGitUpdater, + nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage { pname = "ytui-music"; - version = "2.0.0-rc1"; + version = "2.0.0-rc1-unstable-2025-03-03"; src = fetchFromGitHub { owner = "sudipghimire533"; repo = "ytui-music"; - rev = "v${version}"; - hash = "sha256-f/23PVk4bpUCvcQ25iNI/UVXqiPBzPKWq6OohVF41p8="; + rev = "b90293d226f6fc27835372f145e55d385112768b"; + hash = "sha256-pRD8ySpkJz8o7DURXG8DmBsbZV9MqVlMN63gAjYl4vc="; }; - cargoHash = "sha256-I+ciLSMvV9EqlfA1+/IC1w7pWpj9HHF/DTfAbKw2CVM="; + cargoHash = "sha256-zwlg4BDHCM+KALjP929upaDpgy1mXEz5PYaVw+BhRp0="; checkFlags = [ "--skip=tests::display_config_path" "--skip=tests::inspect_server_list" ]; + patches = [ + # This patch comes from https://github.com/sudipghimire533/ytui-music/pull/57, which was unmerged. + ./fix-implicit-autoref-errors-in-ui-mod-rs-for-rust-1-80-plus.patch + ]; + nativeBuildInputs = [ pkg-config makeBinaryWrapper @@ -54,11 +62,34 @@ rustPlatform.buildRustPackage rec { runHook postInstallCheck ''; - meta = with lib; { + passthru = { + updateScript = _experimental-update-script-combinators.sequence [ + (unstableGitUpdater { + tagFormat = "v[0-9]*"; + tagPrefix = "v"; + + # * "main" branch is newer than "latest" branch + # * "main" branch is newer than "main" tag + # * The "main" tag doesn't seem to be associated with commits on branches like "main" or "latest". + branch = "main"; + }) + (nix-update-script { + # Updating `cargoHash` + extraArgs = [ "--version=skip" ]; + }) + ]; + }; + + meta = { description = "Youtube client in terminal for music"; homepage = "https://github.com/sudipghimire533/ytui-music"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ kashw2 ]; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ kashw2 ]; mainProgram = "ytui_music"; + + # On Darwin, this package requires sandbox-relaxed to build. + # If the sandbox is enabled, `fetch-cargo-vendor-util` causes errors. + # This issue may be related to: https://github.com/NixOS/nixpkgs/issues/394972 + # broken = stdenv.hostPlatform.isDarwin; }; }