From 7afafe0b6dd019851ae0919e11fcee9d035e5698 Mon Sep 17 00:00:00 2001 From: Rickard Nilsson Date: Wed, 7 Nov 2012 16:03:37 +0100 Subject: [PATCH] dmenu: Add option config.dmenu.enableXft for enabling xft font support (turned off by default). --- pkgs/applications/misc/dmenu/default.nix | 13 +++++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix index eae0b0ff233a..048514ad4aa2 100644 --- a/pkgs/applications/misc/dmenu/default.nix +++ b/pkgs/applications/misc/dmenu/default.nix @@ -1,4 +1,6 @@ -{stdenv, fetchurl, libX11, libXinerama}: +{stdenv, fetchurl, libX11, libXinerama, enableXft, libXft, zlib}: + +with stdenv.lib; stdenv.mkDerivation rec { name = "dmenu-4.5"; @@ -8,7 +10,14 @@ stdenv.mkDerivation rec { sha256 = "0l58jpxrr80fmyw5pgw5alm5qry49aw6y049745wl991v2cdcb08"; }; - buildInputs = [ libX11 libXinerama ]; + xftPatch = fetchurl { + url = "http://tools.suckless.org/dmenu/patches/${name}-xft.diff"; + sha256 = "efb4095d65e5e86f9dde97294732174409c24f319bdd4824cc22fa1404972b4f"; + }; + + buildInputs = [ libX11 libXinerama ] ++ optionals enableXft [zlib libXft]; + + patches = optional enableXft xftPatch; preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 974eb3da9b6d..8ac83442fdb9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6700,7 +6700,9 @@ let djview = callPackage ../applications/graphics/djview { }; djview4 = pkgs.djview; - dmenu = callPackage ../applications/misc/dmenu { }; + dmenu = callPackage ../applications/misc/dmenu { + enableXft = config.dmenu.enableXft or false; + }; dmtx = builderDefsPackage (import ../tools/graphics/dmtx) { inherit libpng libtiff libjpeg imagemagick librsvg