nixpkgs/pkgs/applications/misc/dmenu/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.3 KiB
Nix
Raw Normal View History

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