2021-01-25 09:26:54 +01:00
|
|
|
{ lib
|
2020-11-04 01:14:28 +01:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-01-19 07:50:56 +01:00
|
|
|
, pkg-config
|
2020-11-04 01:14:28 +01:00
|
|
|
, makeWrapper
|
|
|
|
, dbus
|
|
|
|
, libpulseaudio
|
|
|
|
, notmuch
|
2021-02-28 17:24:14 +01:00
|
|
|
, openssl
|
2020-11-04 01:14:28 +01:00
|
|
|
, ethtool
|
|
|
|
}:
|
2017-11-13 21:37:02 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-05-06 21:32:03 +02:00
|
|
|
pname = "i3status-rust";
|
2021-07-31 05:42:57 +02:00
|
|
|
version = "0.20.3";
|
2017-11-13 21:37:02 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "greshake";
|
2019-05-06 21:32:03 +02:00
|
|
|
repo = pname;
|
2019-07-15 21:53:46 +02:00
|
|
|
rev = "v${version}";
|
2021-07-31 05:42:57 +02:00
|
|
|
sha256 = "sha256-JNTTSVWGPqJT9xShF1bgwTGtlp37Ocsdovow8F4EH3g=";
|
2017-11-13 21:37:02 +01:00
|
|
|
};
|
|
|
|
|
2021-07-31 05:42:57 +02:00
|
|
|
cargoSha256 = "sha256-sm7Iorux2GKja0qzw2wM4sdsRwijtezIlef5vh1Nt54=";
|
2017-11-13 21:37:02 +01:00
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2017-11-13 21:37:02 +01:00
|
|
|
|
2021-02-28 17:24:14 +01:00
|
|
|
buildInputs = [ dbus libpulseaudio notmuch openssl ];
|
2020-11-04 01:14:28 +01:00
|
|
|
|
|
|
|
cargoBuildFlags = [
|
|
|
|
"--features=notmuch"
|
2021-05-09 18:14:50 +02:00
|
|
|
"--features=maildir"
|
2021-05-10 23:23:51 +02:00
|
|
|
"--features=pulseaudio"
|
2020-11-04 01:14:28 +01:00
|
|
|
];
|
|
|
|
|
2021-05-10 23:23:51 +02: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-04 01:14:28 +01:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/i3status-rs --prefix PATH : "${ethtool}/bin"
|
|
|
|
'';
|
2019-02-17 18:19:26 +01:00
|
|
|
|
|
|
|
# Currently no tests are implemented, so we avoid building the package twice
|
|
|
|
doCheck = false;
|
2017-11-13 21:37:02 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-11-13 21:37:02 +01:00
|
|
|
description = "Very resource-friendly and feature-rich replacement for i3status";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/greshake/i3status-rust";
|
2017-11-13 21:37:02 +01:00
|
|
|
license = licenses.gpl3;
|
2020-02-03 07:04:38 +01:00
|
|
|
maintainers = with maintainers; [ backuitist globin ma27 ];
|
2017-11-13 21:37:02 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|