summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kmscon/default.nix
blob: 4762b63eda9bff4563de7db2c4237e13c3ee9463 (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
73
74
75
76
77
78
79
80
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, meson
, libtsm
, systemd
, libxkbcommon
, libdrm
, libGLU
, libGL
, pango
, pixman
, pkg-config
, docbook_xsl
, libxslt
, mesa
, ninja
}:

stdenv.mkDerivation rec {
  pname = "kmscon";
  version = "9.0.0";

  src = fetchFromGitHub {
    owner = "Aetf";
    repo = "kmscon";
    rev = "v${version}";
    sha256 = "sha256-8owyyzCrZVbWXcCR+RA+m0MOrdzW+efI+rIMWEVEZ1o=";
  };

  buildInputs = [
    libGLU
    libGL
    libdrm
    libtsm
    libxkbcommon
    libxslt
    pango
    pixman
    systemd
    mesa
  ];

  nativeBuildInputs = [
    meson
    ninja
    docbook_xsl
    pkg-config
  ];

  patches = [
    (fetchpatch {
      name = "0001-tests-fix-warnings.patch";
      url = "https://github.com/Aetf/kmscon/commit/b65f4269b03de580923ab390bde795e7956b633f.patch";
      sha256 = "sha256-ngflPwmNMM/2JzhV+hHiH3efQyoSULfqEywzWox9iAQ=";
    })
  ];

  # _FORTIFY_SOURCE requires compiling with optimization (-O)
  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O"
    + " -Wno-error=maybe-uninitialized"; # https://github.com/Aetf/kmscon/issues/49

  configureFlags = [
    "--enable-multi-seat"
    "--disable-debug"
    "--enable-optimizations"
    "--with-renderers=bbulk,gltex,pixman"
  ];

  enableParallelBuilding = true;

  meta = with lib; {
    description = "KMS/DRM based System Console";
    homepage = "https://www.freedesktop.org/wiki/Software/kmscon/";
    license = licenses.mit;
    maintainers = with maintainers; [ omasanori ];
    platforms = platforms.linux;
  };
}