about summary refs log tree commit diff
path: root/pkgs/applications/window-managers/sway/default.nix
blob: fa81971885a49d840e1701eb6bd75cf25468697a (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
{ lib, stdenv, fetchurl, makeWrapper, cmake, pkgconfig
, wayland, wlc, libxkbcommon, pixman, fontconfig, pcre, json_c, asciidoc, libxslt, dbus_libs
}:

stdenv.mkDerivation rec {
  name = "sway-${version}";
  version = "git-2016-02-08";
  repo = "https://github.com/SirCmpwn/sway";
  rev = "16e904634c65128610537bed7fcb16ac3bb45165";

  src = fetchurl {
    url = "${repo}/archive/${rev}.tar.gz";
    sha256 = "52d6c4b49fea69e2a2c1b44b858908b7736301bdb9ed483c294bc54bb40e872e";
  };

  nativeBuildInputs = [ cmake pkgconfig ];

  buildInputs = [ makeWrapper wayland wlc libxkbcommon pixman fontconfig pcre json_c asciidoc libxslt dbus_libs ];

  patchPhase = ''
    sed -i s@/etc/sway@$out/etc/sway@g CMakeLists.txt;
  '';

  makeFlags = "PREFIX=$(out)";
  installPhase = "PREFIX=$out make install";

  LD_LIBRARY_PATH = lib.makeLibraryPath [ wlc dbus_libs ];
  preFixup = ''
    wrapProgram $out/bin/sway \
      --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}";
  '';

  meta = {
    description = "i3-compatible window manager for Wayland";
    homepage    = "http://swaywm.org";
    license     = lib.licenses.mit;
    platforms   = lib.platforms.linux;
    maintainers = with lib.maintainers; [ ];
  };
}