about summary refs log tree commit diff
path: root/pkgs/by-name/dr/dreamchess/package.nix
blob: 65df152c7a16fc4249a59269d4bdb12b2b18523c (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, bison
, flex
, gettext
, SDL2
, SDL2_image
, SDL2_mixer
, expat
, glew
, freetype
, libSM
, libXext
, libGL
, libGLU
, xorg
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "dreamchess";
  version = "0.3.0";
  src = fetchFromGitHub {
    owner = "dreamchess";
    repo = "dreamchess";
    rev = "${finalAttrs.version}";
    hash = "sha256-qus/RjwdAl9SuDXfLVKTPImqrvPF3xSDVlbXYLM3JNE=";
  };

  buildInputs = [
    SDL2
    SDL2_image
    SDL2_mixer
    expat
    glew
    freetype
    libSM
    libXext
    libGL
    libGLU
    xorg.libxcb
    xorg.libX11
  ];
  nativeBuildInputs = [
    cmake
    bison
    flex
    gettext
  ];
  cmakeFlags = [
    (lib.cmakeBool "CMAKE_VERBOSE_MAKEFILE" true)
    (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND")
    (lib.cmakeFeature "CMAKE_INSTALL_DATAROOTDIR" "${placeholder "out"}/share")
  ];

  doInstallCheck = true;

  postInstallCheck = ''
    stat "''${!outputBin}/bin/${finalAttrs.meta.mainProgram}"
  '';

  meta = {
    homepage = "https://github.com/dreamchess/dreamchess";
    description = "OpenGL Chess Game";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ spk ];
    platforms = lib.platforms.linux;
    mainProgram = "dreamchess";
  };
})