2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, pkg-config
|
|
|
|
, writeText
|
|
|
|
, libX11
|
|
|
|
, libXau
|
|
|
|
, libXdmcp
|
|
|
|
, conf ? null
|
2023-11-16 04:20:00 +00:00
|
|
|
, patches ? [ ]
|
2024-04-21 15:54:59 +00:00
|
|
|
# update script dependencies
|
|
|
|
, gitUpdater
|
2023-03-04 12:14:45 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "slstatus";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.suckless.org/slstatus";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-cFah6EgApslLSlJaOy/5W9ZV9Z1lzfKye/rRh9Om3T4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
preBuild =
|
|
|
|
let
|
|
|
|
configFile = if lib.isDerivation conf || builtins.isPath conf then conf else writeText "config.def.h" conf;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
${lib.optionalString (conf!=null) "cp ${configFile} config.def.h"}
|
|
|
|
makeFlagsArray+=(LDLIBS="-lX11 -lxcb -lXau -lXdmcp" CC=$CC)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
inherit patches;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [ libX11 libXau libXdmcp ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = gitUpdater {};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://tools.suckless.org/slstatus/";
|
|
|
|
description = "status monitor for window managers that use WM_NAME like dwm";
|
|
|
|
license = licenses.isc;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ oxzi qusic ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "slstatus";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|