2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, writeText
|
|
|
|
, conf ? null, patches ? null
|
|
|
|
# update script dependencies
|
|
|
|
, gitUpdater }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "dmenu";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "5.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://dl.suckless.org/tools/dmenu-${version}.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-Go9T5v0tdJg57IcMXiez4U2lw+6sv8uUXRWeHVQzeV8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libX11 libXinerama zlib libXft ];
|
|
|
|
|
|
|
|
inherit patches;
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postPatch = let
|
|
|
|
configFile = if lib.isDerivation conf || builtins.isPath conf then
|
|
|
|
conf
|
|
|
|
else
|
|
|
|
writeText "config.def.h" conf;
|
|
|
|
in ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run
|
|
|
|
sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path
|
2024-07-27 06:49:29 +00:00
|
|
|
${lib.optionalString (conf != null) "cp ${configFile} config.def.h"}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "CC:=$(CC)" ];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru.updateScript = gitUpdater { url = "git://git.suckless.org/dmenu"; };
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-07-27 06:49:29 +00:00
|
|
|
description =
|
|
|
|
"Generic, highly customizable, and efficient menu for the X Window System";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://tools.suckless.org/dmenu";
|
|
|
|
license = licenses.mit;
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ pSub globin qusic _0david0mp ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = platforms.all;
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "dmenu";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|