nixpkgs/pkgs/applications/audio/termusic/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
1.5 KiB
Nix
Raw Normal View History

{
alsa-lib
, AppKit
, CoreAudio
, CoreGraphics
, dbus
, Foundation
, fetchFromGitHub
, glib
, gst_all_1
, IOKit
, lib
, MediaPlayer
, openssl
2022-02-18 16:17:18 +00:00
, pkg-config
, protobuf
, rustPlatform
, Security
, sqlite
, stdenv
2023-02-24 14:15:58 +00:00
}:
2022-02-18 16:17:18 +00:00
rustPlatform.buildRustPackage rec {
pname = "termusic";
version = "0.9.0";
2022-02-18 16:17:18 +00:00
src = fetchFromGitHub {
owner = "tramhao";
repo = "termusic";
rev = "v${version}";
hash = "sha256-FOFZg32hrWpKVsjkMDkiqah7jmUZw0HRWGqOvsN0t8Q=";
2022-02-18 16:17:18 +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 \
--replace $oldHash $(sha256sum src/lib.rs | cut -d " " -f 1)
popd
'';
cargoHash = "sha256-r5FOl3Bp3GYhOhvWj/y6FXsuG2wvuFcMcYKBzVBVqiM=";
2023-02-24 14:15:58 +00:00
nativeBuildInputs = [
pkg-config
protobuf
2023-02-24 14:15:58 +00:00
rustPlatform.bindgenHook
];
2022-02-18 16:17:18 +00:00
buildInputs = [
dbus
glib
gst_all_1.gstreamer
openssl
sqlite
2023-02-24 14:15:58 +00:00
] ++ lib.optionals stdenv.isDarwin [
AppKit
CoreAudio
CoreGraphics
Foundation
IOKit
MediaPlayer
Security
] ++ lib.optionals stdenv.isLinux [
alsa-lib
2023-02-24 14:15:58 +00:00
];
2022-02-18 16:17:18 +00:00
meta = {
2022-02-18 16:17:18 +00:00
description = "Terminal Music Player TUI written in Rust";
homepage = "https://github.com/tramhao/termusic";
license = with lib.licenses; [ gpl3Only ];
maintainers = with lib.maintainers; [ devhell ];
mainProgram = "termusic";
2022-02-18 16:17:18 +00:00
};
}