texstudio: 4.8.4 -> 4.8.5 (#365076)
[NixPkgs.git] / pkgs / applications / audio / termusic / default.nix
blobafc767749a3d9a13ddd2dcea7b10b45fbb5cf1bf
2   alsa-lib,
3   AppKit,
4   CoreAudio,
5   CoreGraphics,
6   dbus,
7   Foundation,
8   fetchFromGitHub,
9   fetchpatch,
10   glib,
11   gst_all_1,
12   IOKit,
13   lib,
14   MediaPlayer,
15   mpv-unwrapped,
16   openssl,
17   pkg-config,
18   protobuf,
19   rustPlatform,
20   Security,
21   sqlite,
22   stdenv,
25 rustPlatform.buildRustPackage rec {
26   pname = "termusic";
27   version = "0.9.1";
29   src = fetchFromGitHub {
30     owner = "tramhao";
31     repo = "termusic";
32     rev = "v${version}";
33     hash = "sha256-aEkg1j6R86QGn21HBimtZwmjmW1K9Wo+67G4DlpY960=";
34   };
36   cargoPatches = [
37     # both following patches can be removed with the follow up release to 0.9.1 as they are cherry-picked from `termusic/master` branch
38     # fix build issue with 0.9.1 release and vendoring producing wrong hash for soundtouch-ffi
39     (fetchpatch {
40       url = "https://github.com/tramhao/termusic/commit/211fc3fe008932d052d31d3b836e8a80eade3cfe.patch";
41       hash = "sha256-11kSI28YonoTe5W31+R76lGhNiN1ZLAg94FrfYiZUAY=";
42     })
43     # fix a bug through previous patch
44     (fetchpatch {
45       url = "https://github.com/tramhao/termusic/commit/2a40b2f366dfa5c1f008c79a3ff5c1bbf53fe10f.patch";
46       hash = "sha256-b7CJ5SqxrU1Jr4GDaJe9sFutDHMqIQxGhXbBFGB6y84=";
47     })
48   ];
50   postPatch = ''
51     pushd $cargoDepsCopy/stream-download
52     oldHash=$(sha256sum src/lib.rs | cut -d " " -f 1)
53     substituteInPlace $cargoDepsCopy/stream-download/src/lib.rs \
54       --replace-warn '#![doc = include_str!("../README.md")]' ""
55     substituteInPlace .cargo-checksum.json \
56       --replace-warn $oldHash $(sha256sum src/lib.rs | cut -d " " -f 1)
57     popd
58   '';
60   cargoHash = "sha256-4PprZdTIcYa8y7FwQVrG0ZBg7N/Xe6HDt/z6ZmaHd5Y=";
62   useNextest = true;
64   nativeBuildInputs = [
65     pkg-config
66     protobuf
67     rustPlatform.bindgenHook
68   ];
70   buildInputs =
71     [
72       dbus
73       glib
74       gst_all_1.gstreamer
75       mpv-unwrapped
76       openssl
77       sqlite
78     ]
79     ++ lib.optionals stdenv.hostPlatform.isDarwin [
80       AppKit
81       CoreAudio
82       CoreGraphics
83       Foundation
84       IOKit
85       MediaPlayer
86       Security
87     ]
88     ++ lib.optionals stdenv.hostPlatform.isLinux [
89       alsa-lib
90     ];
92   meta = {
93     description = "Terminal Music Player TUI written in Rust";
94     homepage = "https://github.com/tramhao/termusic";
95     license = with lib.licenses; [ gpl3Only ];
96     maintainers = with lib.maintainers; [ devhell ];
97     mainProgram = "termusic";
98   };