about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/endless-sky/default.nix
blob: ffb71f393ca2e5c78838466b4f4f99719f0c7eea (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
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, libpng
, libjpeg
, glew
, openal
, scons
, libmad
, libuuid
}:

stdenv.mkDerivation rec {
  pname = "endless-sky";
  version = "0.10.6";

  src = fetchFromGitHub {
    owner = "endless-sky";
    repo = "endless-sky";
    rev = "v${version}";
    sha256 = "sha256-3mprmW6K8pYs7J2q71fohsh9fZEP2RZjN1rSWUAwbhg=";
  };

  patches = [
    ./fixes.patch
  ];

  postPatch = ''
    # the trailing slash is important!!
    # endless sky naively joins the paths with string concatenation
    # so it's essential that there be a trailing slash on the resources path
    substituteInPlace source/Files.cpp \
      --replace '%NIXPKGS_RESOURCES_PATH%' "$out/share/games/endless-sky/"
  '';

  preBuild = ''
    export AR="${stdenv.cc.targetPrefix}gcc-ar"
  '';

  enableParallelBuilding = true;

  buildInputs = [
    SDL2
    libpng
    libjpeg
    glew
    openal
    scons
    libmad
    libuuid
  ];

  prefixKey = "PREFIX=";

  meta = with lib; {
    description = "A sandbox-style space exploration game similar to Elite, Escape Velocity, or Star Control";
    homepage = "https://endless-sky.github.io/";
    license = with licenses; [
      gpl3Plus
      cc-by-sa-30
      cc-by-sa-40
      publicDomain
    ];
    maintainers = with maintainers; [ lheckemann _360ied ];
    platforms = platforms.linux; # Maybe other non-darwin Unix
  };
}