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-08-23 08:02:39 +00:00
|
|
|
version = "0.20.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "greshake";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-23 08:02:39 +00:00
|
|
|
sha256 = "sha256-lohMrsMCAnb2p7H+xfa24Wx3LEFxCAlGHfP9A70Hg48=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-23 08:02:39 +00:00
|
|
|
cargoSha256 = "sha256-pe96VNTH49qgQ4yxKcAcQPN31W2k1mD9TdhNKBp4x5Q=";
|
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
|
|
|
|
|
|
|
cargoBuildFlags = [
|
|
|
|
"--features=notmuch"
|
2021-05-20 23:08:51 +00:00
|
|
|
"--features=maildir"
|
|
|
|
"--features=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
|
|
|
|
cp -R files/* $out/share
|
|
|
|
'';
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|