spotify-tui: patch to work with rust 1.64

This commit is contained in:
Theodore Ni 2022-10-07 00:31:47 -07:00
parent 3c6fbacc9e
commit 03e29459fa
No known key found for this signature in database
GPG Key ID: 48B67583BDDD4474

View File

@ -1,4 +1,17 @@
{ lib, stdenv, fetchFromGitHub, fetchCrate, rustPlatform, installShellFiles, pkg-config, openssl, python3, libxcb, AppKit, Security }: { lib
, stdenv
, fetchFromGitHub
, fetchCrate
, fetchpatch
, rustPlatform
, installShellFiles
, pkg-config
, openssl
, python3
, libxcb
, AppKit
, Security
}:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "spotify-tui"; pname = "spotify-tui";
@ -8,14 +21,30 @@ rustPlatform.buildRustPackage rec {
owner = "Rigellute"; owner = "Rigellute";
repo = "spotify-tui"; repo = "spotify-tui";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-L5gg6tjQuYoAC89XfKE38KCFONwSAwfNoFEUPH4jNAI="; hash = "sha256-L5gg6tjQuYoAC89XfKE38KCFONwSAwfNoFEUPH4jNAI=";
}; };
# Use patched rspotify
cargoPatches = [ cargoPatches = [
# Use patched rspotify
./Cargo.lock.patch ./Cargo.lock.patch
# Needed so that the patch below it applies.
(fetchpatch {
name = "update-dirs.patch";
url = "https://github.com/Rigellute/spotify-tui/commit/3881defc1ed0bcf79df1aef4836b857f64be657c.patch";
hash = "sha256-OGqiYLFojMwR3RgKbddXxPDiAdzPySnscVVsVmTT7t4=";
})
# https://github.com/Rigellute/spotify-tui/pull/990
(fetchpatch {
name = "update-socket2-for-rust-1.64.patch";
url = "https://github.com/Rigellute/spotify-tui/commit/14df9419cf72da13f3b55654686a95647ea9dfea.patch";
hash = "sha256-craY6UwmHDdxih3nZBdPkNJtQ6wvVgf09Ovqdxi0JZo=";
})
]; ];
patches = [ patches = [
# Use patched rspotify
./Cargo.toml.patch ./Cargo.toml.patch
]; ];
@ -44,7 +73,7 @@ rustPlatform.buildRustPackage rec {
ln -s ${rspotify} ./rspotify-${rspotify.version} ln -s ${rspotify} ./rspotify-${rspotify.version}
''; '';
cargoSha256 = "sha256-S8zuVYcyYvrwggIvlpxNydhoN9kx6xLBwYJSHcbEK40="; cargoHash = "sha256-aZJ6Q/rvqrv+wvQw2eKFPnSROhI5vXPvr5pu1hwtZKA=";
nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ pkg-config python3 ]; nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ pkg-config python3 ];
buildInputs = [ ] buildInputs = [ ]