1{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook, libdrm, libX11, libGL, mesa, pkg-config }:
2
3stdenv.mkDerivation {
4 pname = "kmscube";
5 version = "unstable-2018-06-17";
6
7 src = fetchgit {
8 url = "git://anongit.freedesktop.org/mesa/kmscube";
9 rev = "9dcce71e603616ee7a54707e932f962cdf8fb20a";
10 sha256 = "1q5b5yvyfj3127385mp1bfmcbnpnbdswdk8gspp7g4541xk4k933";
11 };
12
13 patches = [
14 # Pull upstream patch for -fno-common toolchains.
15 (fetchpatch {
16 name = "fno-common.patch";
17 url = "https://gitlab.freedesktop.org/mesa/kmscube/-/commit/908ef39864442c0807954af5d3f88a3da1a6f8a5.patch";
18 sha256 = "1gxn3b50mvjlc25234839v5z29r8fd9di4176a3yx4gbsz8cc5vi";
19 })
20 ];
21
22 nativeBuildInputs = [ autoreconfHook pkg-config ];
23 buildInputs = [ libdrm libX11 libGL mesa ];
24
25 meta = with lib; {
26 description = "Example OpenGL app using KMS/GBM";
27 homepage = "https://gitlab.freedesktop.org/mesa/kmscube";
28 license = licenses.mit;
29 maintainers = with maintainers; [ dezgeg ];
30 platforms = platforms.linux;
31 };
32}