summary refs log tree commit diff
path: root/pkgs/development/libraries/wlroots/default.nix
blob: c32f0a3b9384f56273e32d05bb23dae14df915f8 (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
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
, wayland, mesa_noglu, wayland-protocols, libinput, libxkbcommon, pixman
, xcbutilwm, libX11, libcap, xcbutilimage
}:

let pname = "wlroots";
    version = "unstable-2017-12-22";
in stdenv.mkDerivation rec {
  name = "${pname}-${version}";

  src = fetchFromGitHub {
    owner = "swaywm";
    repo = "wlroots";
    rev = "0a370c529806077a11638e7fa856d5fbb539496b";
    sha256 = "0h3i0psn5595dncv53l5m2mf13k9wcv3qi16vla5ckpskykc0xx6";
  };

  # TODO: Temporary workaround for compilation errors
  patches = [ ./libdrm.patch ]; #./no-werror.patch

  # $out for the library and $bin for rootston
  outputs = [ "out" "bin" ];

  nativeBuildInputs = [ meson ninja pkgconfig ];

  buildInputs = [
    wayland mesa_noglu wayland-protocols libinput libxkbcommon pixman
    xcbutilwm libX11 libcap xcbutilimage
  ];

  # Install rootston (the reference compositor) to $bin
  postInstall = ''
    mkdir -p $bin/bin
    cp rootston/rootston $bin/bin/
    mkdir $bin/lib
    cp libwlroots.so $bin/lib/
    patchelf --set-rpath "$bin/lib:${stdenv.lib.makeLibraryPath buildInputs}" $bin/bin/rootston
    mkdir $bin/etc
    cp ../rootston/rootston.ini.example $bin/etc/rootston.ini
  '';

  meta = with stdenv.lib; {
    description = "A modular Wayland compositor library";
    inherit (src.meta) homepage;
    license     = licenses.mit;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ primeos ];
  };
}