2023-08-22 20:05:09 +00:00
|
|
|
{
|
|
|
|
alsa-lib
|
|
|
|
, AppKit
|
|
|
|
, CoreAudio
|
|
|
|
, CoreGraphics
|
|
|
|
, dbus
|
|
|
|
, Foundation
|
|
|
|
, fetchFromGitHub
|
2024-09-19 14:19:46 +00:00
|
|
|
, fetchpatch
|
2023-08-22 20:05:09 +00:00
|
|
|
, glib
|
|
|
|
, gst_all_1
|
|
|
|
, IOKit
|
|
|
|
, lib
|
|
|
|
, MediaPlayer
|
2024-09-19 14:19:46 +00:00
|
|
|
, mpv-unwrapped
|
2023-08-22 20:05:09 +00:00
|
|
|
, openssl
|
2022-03-05 16:20:37 +00:00
|
|
|
, pkg-config
|
2023-08-22 20:05:09 +00:00
|
|
|
, protobuf
|
|
|
|
, rustPlatform
|
|
|
|
, Security
|
|
|
|
, sqlite
|
|
|
|
, stdenv
|
2023-03-04 12:14:45 +00:00
|
|
|
}:
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "termusic";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.9.1";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tramhao";
|
|
|
|
repo = "termusic";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-aEkg1j6R86QGn21HBimtZwmjmW1K9Wo+67G4DlpY960=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoPatches = [
|
|
|
|
# both following patches can be removed with the follow up release to 0.9.1 as they are cherry-picked from `termusic/master` branch
|
|
|
|
# fix build issue with 0.9.1 release and vendoring producing wrong hash for soundtouch-ffi
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tramhao/termusic/commit/211fc3fe008932d052d31d3b836e8a80eade3cfe.patch";
|
|
|
|
hash = "sha256-11kSI28YonoTe5W31+R76lGhNiN1ZLAg94FrfYiZUAY=";
|
|
|
|
})
|
|
|
|
# fix a bug through previous patch
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tramhao/termusic/commit/2a40b2f366dfa5c1f008c79a3ff5c1bbf53fe10f.patch";
|
|
|
|
hash = "sha256-b7CJ5SqxrU1Jr4GDaJe9sFutDHMqIQxGhXbBFGB6y84=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
pushd $cargoDepsCopy/stream-download
|
|
|
|
oldHash=$(sha256sum src/lib.rs | cut -d " " -f 1)
|
|
|
|
substituteInPlace $cargoDepsCopy/stream-download/src/lib.rs \
|
|
|
|
--replace-warn '#![doc = include_str!("../README.md")]' ""
|
|
|
|
substituteInPlace .cargo-checksum.json \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-warn $oldHash $(sha256sum src/lib.rs | cut -d " " -f 1)
|
2024-04-21 15:54:59 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-4PprZdTIcYa8y7FwQVrG0ZBg7N/Xe6HDt/z6ZmaHd5Y=";
|
|
|
|
|
|
|
|
useNextest = true;
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2023-08-22 20:05:09 +00:00
|
|
|
protobuf
|
2023-03-04 12:14:45 +00:00
|
|
|
rustPlatform.bindgenHook
|
|
|
|
];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
gst_all_1.gstreamer
|
2024-09-19 14:19:46 +00:00
|
|
|
mpv-unwrapped
|
2023-08-22 20:05:09 +00:00
|
|
|
openssl
|
|
|
|
sqlite
|
2023-03-04 12:14:45 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-08-22 20:05:09 +00:00
|
|
|
AppKit
|
|
|
|
CoreAudio
|
|
|
|
CoreGraphics
|
|
|
|
Foundation
|
|
|
|
IOKit
|
|
|
|
MediaPlayer
|
|
|
|
Security
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
meta = {
|
2022-03-05 16:20:37 +00:00
|
|
|
description = "Terminal Music Player TUI written in Rust";
|
|
|
|
homepage = "https://github.com/tramhao/termusic";
|
2023-08-22 20:05:09 +00:00
|
|
|
license = with lib.licenses; [ gpl3Only ];
|
|
|
|
maintainers = with lib.maintainers; [ devhell ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "termusic";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
}
|