2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-11-06 00:33:48 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-11-06 00:33:48 +00:00
|
|
|
, makeWrapper
|
|
|
|
, dbus
|
|
|
|
, libpulseaudio
|
|
|
|
, notmuch
|
2021-03-09 03:18:52 +00:00
|
|
|
, openssl
|
2020-11-06 00:33:48 +00:00
|
|
|
, ethtool
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "i3status-rust";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.20.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "greshake";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-FLMfXloAAIz/9KAtKFfB8uokQz/J8R+WsGarq/5cblo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
cargoSha256 = "sha256-UVAF2rz0y6h3/rcTJ+31mMyJDLG7q40n6vBK8Wxultg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
buildInputs = [ dbus libpulseaudio notmuch openssl ];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildFeatures = [
|
|
|
|
"notmuch"
|
|
|
|
"maildir"
|
|
|
|
"pulseaudio"
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace src/util.rs \
|
|
|
|
--replace "/usr/share/i3status-rust" "$out/share"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share
|
2021-09-18 10:52:07 +00:00
|
|
|
cp -R examples files/* $out/share
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/i3status-rs --prefix PATH : "${ethtool}/bin"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Currently no tests are implemented, so we avoid building the package twice
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Very resource-friendly and feature-rich replacement for i3status";
|
|
|
|
homepage = "https://github.com/greshake/i3status-rust";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ backuitist globin ma27 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|