about summary refs log tree commit diff
path: root/pkgs/tools/graphics/glmark2/default.nix
blob: 9615b57e0c1a708bb9229aa07b18533660990206 (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
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, makeWrapper
, libjpeg
, libpng
, xorg
, libX11
, libGL
, libdrm
, udev
, python3
, wayland
, wayland-protocols
, mesa
, wafHook
}:

stdenv.mkDerivation rec {
  pname = "glmark2";
  version = "2021.12";

  src = fetchFromGitHub {
    owner = "glmark2";
    repo = "glmark2";
    rev = version;
    sha256 = "sha256-S6KkazkG+kdx02MPwrYvCFWSOtM6t5xT0OTE9PLCzas=";
  };

  nativeBuildInputs = [ pkg-config wafHook makeWrapper ];
  buildInputs = [
    libjpeg
    libpng
    xorg.libxcb
    libX11
    libdrm
    python3
    udev
    wayland
    wayland-protocols
    mesa
  ];

  wafConfigureFlags = [ "--with-flavors=x11-gl,x11-glesv2,drm-gl,drm-glesv2,wayland-gl,wayland-glesv2" ];

  postInstall = ''
    for binary in $out/bin/glmark2*; do
      wrapProgram $binary \
        --set LD_LIBRARY_PATH ${libGL}/lib
    done
  '';

  meta = with lib; {
    description = "OpenGL (ES) 2.0 benchmark";
    homepage = "https://github.com/glmark2/glmark2";
    license = licenses.gpl3Plus;
    longDescription = ''
      glmark2 is a benchmark for OpenGL (ES) 2.0. It uses only the subset of
      the OpenGL 2.0 API that is compatible with OpenGL ES 2.0.
    '';
    platforms = platforms.linux;
    maintainers = [ maintainers.wmertens ];
  };
}