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
|
2022-02-01 21:08:01 +01:00
|
|
|
, lm_sensors
|
2022-01-26 12:59:04 +01:00
|
|
|
, iw
|
|
|
|
, iproute2
|
2023-11-25 09:42:21 +01:00
|
|
|
, withICUCalendar ? false
|
2020-11-04 01:14:28 +01:00
|
|
|
}:
|
2017-11-13 21:37:02 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-05-06 21:32:03 +02:00
|
|
|
pname = "i3status-rust";
|
2023-11-22 23:58:24 +01:00
|
|
|
version = "0.32.3";
|
2017-11-13 21:37:02 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "greshake";
|
2019-05-06 21:32:03 +02:00
|
|
|
repo = pname;
|
2022-06-23 17:34:39 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-22 23:58:24 +01:00
|
|
|
hash = "sha256-CldVak1BQ4VhRt24hHdog5O3crkQBZBkRWNT7uYUw4Y=";
|
2017-11-13 21:37:02 +01:00
|
|
|
};
|
|
|
|
|
2023-11-22 23:58:24 +01:00
|
|
|
cargoHash = "sha256-gWBmzpgZcsO4u8kXSqtr4FIYvshXpxWbECg/tcyl9Ok=";
|
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
|
|
|
|
2022-02-01 21:08:01 +01:00
|
|
|
buildInputs = [ dbus libpulseaudio notmuch openssl lm_sensors ];
|
2020-11-04 01:14:28 +01:00
|
|
|
|
2021-11-16 01:00:53 +01:00
|
|
|
buildFeatures = [
|
|
|
|
"notmuch"
|
|
|
|
"maildir"
|
|
|
|
"pulseaudio"
|
2023-11-25 09:42:21 +01:00
|
|
|
] ++ (lib.optionals withICUCalendar [ "icu_calendar" ]);
|
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
|
2021-09-01 16:35:33 +02:00
|
|
|
cp -R examples files/* $out/share
|
2021-05-10 23:23:51 +02:00
|
|
|
'';
|
|
|
|
|
2020-11-04 01:14:28 +01:00
|
|
|
postFixup = ''
|
2022-01-26 12:59:04 +01:00
|
|
|
wrapProgram $out/bin/i3status-rs --prefix PATH : ${lib.makeBinPath [ iproute2 ethtool iw ]}
|
2020-11-04 01:14:28 +01:00
|
|
|
'';
|
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";
|
2022-02-22 23:11:35 +01:00
|
|
|
license = licenses.gpl3Only;
|
2023-03-19 22:35:36 +01:00
|
|
|
mainProgram = "i3status-rs";
|
2023-01-15 18:52:27 +01:00
|
|
|
maintainers = with maintainers; [ backuitist globin ];
|
2017-11-13 21:37:02 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|