about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/pioneer/default.nix
blob: b7ac0b73b3b90228c729303e4f57accfa2b5dd8a (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, assimp
, curl
, freetype
#, glew
, libGL
, libGLU
, libpng
, libsigcxx
, libvorbis
, lua5_2
, mesa
, SDL2
, SDL2_image
}:

stdenv.mkDerivation rec {
  pname = "pioneer";
  version = "20240314";

  src = fetchFromGitHub{
    owner = "pioneerspacesim";
    repo = "pioneer";
    rev = version;
    hash = "sha256-CUaiQPRufo8Ng70w5KWlLugySMaTaUuZno/ckyU1w2w=";
  };

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace 'string(TIMESTAMP PROJECT_VERSION "%Y%m%d")' 'set(PROJECT_VERSION ${version})'
  '';

  nativeBuildInputs = [ cmake pkg-config ];

  buildInputs = [
    assimp
    curl
    freetype
    libGL
    libGLU
    libpng
    libsigcxx
    libvorbis
    lua5_2
    mesa
    SDL2
    SDL2_image
  ];

  cmakeFlags = [
    "-DPIONEER_DATA_DIR:PATH=${placeholder "out"}/share/pioneer/data"
    "-DUSE_SYSTEM_LIBLUA:BOOL=YES"
  ];

  makeFlags = [ "all" "build-data" ];

  meta = with lib; {
    description = "A space adventure game set in the Milky Way galaxy at the turn of the 31st century";
    homepage = "https://pioneerspacesim.net";
    license = with licenses; [
        gpl3Only cc-by-sa-30
    ];
    platforms = [ "x86_64-linux" "i686-linux" ];
  };
}