mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
Merge pull request #321234 from 0david0mp/dmenu-configfile
dmenu: allow config file argument
This commit is contained in:
commit
7583e8b826
@ -71,6 +71,12 @@
|
||||
github = "0b11stan";
|
||||
githubId = 27831931;
|
||||
};
|
||||
_0david0mp = {
|
||||
email = "davidmrpr@proton.me";
|
||||
github = "0david0mp";
|
||||
githubId = 54892055;
|
||||
name = "David mp";
|
||||
};
|
||||
_0nyr = {
|
||||
email = "onyr.maintainer@gmail.com";
|
||||
github = "0nyr";
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? null
|
||||
# update script dependencies
|
||||
, gitUpdater
|
||||
}:
|
||||
{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, writeText
|
||||
, conf ? null, patches ? null
|
||||
# update script dependencies
|
||||
, gitUpdater }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dmenu";
|
||||
@ -16,9 +16,15 @@ stdenv.mkDerivation rec {
|
||||
|
||||
inherit patches;
|
||||
|
||||
postPatch = ''
|
||||
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 = ''
|
||||
@ -27,15 +33,14 @@ stdenv.mkDerivation rec {
|
||||
|
||||
makeFlags = [ "CC:=$(CC)" ];
|
||||
|
||||
passthru.updateScript = gitUpdater {
|
||||
url = "git://git.suckless.org/dmenu";
|
||||
};
|
||||
passthru.updateScript = gitUpdater { url = "git://git.suckless.org/dmenu"; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Generic, highly customizable, and efficient menu for the X Window System";
|
||||
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 ];
|
||||
maintainers = with maintainers; [ pSub globin qusic _0david0mp ];
|
||||
platforms = platforms.all;
|
||||
mainProgram = "dmenu";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user