about summary refs log tree commit diff
path: root/pkgs/applications/window-managers/wmii/default.nix
blob: b5a94ed955dcebda9cf78ee15e32f08e35f0e4e9 (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ lib, stdenv
, fetchFromGitHub
, dash
, libX11
, libXext
, libXft
, libXinerama
, libXrandr
, libXrender
, libixp
, pkg-config
, txt2tags
, unzip
, which
}:

stdenv.mkDerivation rec {
  pname = "wmii";
  version = "unstable-2022-04-04";

  src = fetchFromGitHub {
    owner = "0intro";
    repo = "wmii";
    rev = "ff120c7fee6e1b3a30a4a800074394327fb1da9d";
    hash = "sha256-KEmWnobpT/5TdgT2HGPCpG1duz9Q6Z6PFSEBs2Ce+7g=";
  };

  # for dlopen-ing
  postPatch = ''
    substituteInPlace lib/libstuff/x11/xft.c --replace "libXft.so" "$(pkg-config --variable=libdir xft)/libXft.so.2"
    substituteInPlace cmd/wmii.sh.sh --replace "\$(which which)" "${which}/bin/which"
  '';

  postConfigure = ''
    for file in $(grep -lr '#!.*sh'); do
      sed -i 's|#!.*sh|#!${dash}/bin/dash|' $file
    done

    cat <<EOF >> config.mk
    PREFIX = $out
    LIBIXP = ${libixp}/lib/libixp.a
    BINSH = ${dash}/bin/dash
    EOF
  '';

  # Remove optional python2 functionality
  postInstall = ''
    rm -rf $out/lib/python* $out/etc/wmii-hg/python
  '';

  nativeBuildInputs = [ pkg-config unzip ];
  buildInputs = [
    dash
    libX11
    libXext
    libXft
    libXinerama
    libXrandr
    libXrender
    libixp
    txt2tags
    which
  ];

  meta = {
    homepage = "https://github.com/0intro/wmii";
    description = "Small, scriptable window manager, with a 9P filesystem interface and an acme-like layout";
    maintainers = with lib.maintainers; [ kovirobi ];
    license = lib.licenses.mit;
    platforms = with lib.platforms; linux;
  };
}