about summary refs log tree commit diff
path: root/pkgs/development/libraries/kmsxx/default.nix
blob: a07bc73a64ce8de8cf06adab8f9b2d03487cd7c2 (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
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, cmake
, pkg-config
, libdrm
, fmt
, libevdev
, withPython ? false
, python3Packages
}:

stdenv.mkDerivation {
  pname = "kmsxx";
  version = "2021-07-26";

  src = fetchFromGitHub {
    owner = "tomba";
    repo = "kmsxx";
    fetchSubmodules = true;
    rev = "54f591ec0de61dd192baf781c9b2ec87d5b461f7";
    sha256 = "sha256-j+20WY4a2iTKZnYjXhxbNnZZ53K3dHpDMTp+ZulS+7c=";
  };

  # Didn't detect pybind11 without cmake
  nativeBuildInputs = [ meson ninja pkg-config ] ++ lib.optionals withPython [ cmake ];
  buildInputs = [ libdrm fmt libevdev ]
    ++ lib.optionals withPython (with python3Packages; [ python pybind11 ]);

  dontUseCmakeConfigure = true;

  mesonFlags = lib.optional (!withPython) "-Dpykms=disabled";

  meta = with lib; {
    description = "C++11 library, utilities and python bindings for Linux kernel mode setting";
    homepage = "https://github.com/tomba/kmsxx";
    license = licenses.mpl20;
    maintainers = with maintainers; [ ];
    platforms = platforms.linux;
  };
}