about summary refs log tree commit diff
path: root/pkgs/larbs/dwm/default.nix
blob: fe5c3ae89d682d1304b7fd952236fe90ab355b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, fetchgit, libX11, libXinerama, libXft, xlibs, patches ? [], header_config_file ? null }:

with stdenv.lib;
let
  customConfig = if header_config_file == null then "" else ''cp ${header_config_file} config.h'';
in
  stdenv.mkDerivation rec {
    name = "dwm";
    version = "1.0";

    src = fetchgit {
      url = "https://github.com/LukeSmithXYZ/dwm";
      rev = "ad08183a60d259387955c8e5f5f319cc5b8a19c9";
      sha256 = "12a9mhbk06hpllc2fqipr37vn2qwxd7xlqf1xyd6g72fjwvmp1w4";
    };

    buildInputs = [ libX11 libXinerama libXft xlibs.libXext.dev ];

    prePatch = ''
      sed -i "s@/usr/local@$out@" config.mk
    '';

    postPatch = customConfig;

    inherit patches;

    buildPhase = ''make LDFLAGS="-L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res -lXext"'';

    meta = {
      homepage = "https://github.com/LukeSmithXYZ/dwm";
      description = "Luke's build of dwm";
      license = stdenv.lib.licenses.mit;
      platforms = with stdenv.lib.platforms; all;
    };
  }