1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, meson
6, libtsm
7, systemd
8, libxkbcommon
9, libdrm
10, libGLU
11, libGL
12, pango
13, pixman
14, pkg-config
15, docbook_xsl
16, libxslt
17, mesa
18, ninja
19}:
20
21stdenv.mkDerivation rec {
22 pname = "kmscon";
23 version = "9.0.0";
24
25 src = fetchFromGitHub {
26 owner = "Aetf";
27 repo = "kmscon";
28 rev = "v${version}";
29 sha256 = "sha256-8owyyzCrZVbWXcCR+RA+m0MOrdzW+efI+rIMWEVEZ1o=";
30 };
31
32 buildInputs = [
33 libGLU
34 libGL
35 libdrm
36 libtsm
37 libxkbcommon
38 libxslt
39 pango
40 pixman
41 systemd
42 mesa
43 ];
44
45 nativeBuildInputs = [
46 meson
47 ninja
48 docbook_xsl
49 pkg-config
50 ];
51
52 patches = [
53 (fetchpatch {
54 name = "0001-tests-fix-warnings.patch";
55 url = "https://github.com/Aetf/kmscon/commit/b65f4269b03de580923ab390bde795e7956b633f.patch";
56 sha256 = "sha256-ngflPwmNMM/2JzhV+hHiH3efQyoSULfqEywzWox9iAQ=";
57 })
58 ];
59
60 # _FORTIFY_SOURCE requires compiling with optimization (-O)
61 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O"
62 + " -Wno-error=maybe-uninitialized"; # https://github.com/Aetf/kmscon/issues/49
63
64 configureFlags = [
65 "--enable-multi-seat"
66 "--disable-debug"
67 "--enable-optimizations"
68 "--with-renderers=bbulk,gltex,pixman"
69 ];
70
71 enableParallelBuilding = true;
72
73 meta = with lib; {
74 description = "KMS/DRM based System Console";
75 homepage = "https://www.freedesktop.org/wiki/Software/kmscon/";
76 license = licenses.mit;
77 maintainers = with maintainers; [ omasanori ];
78 platforms = platforms.linux;
79 };
80}