1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchurl,
6 scons,
7 pkg-config,
8 SDL2,
9 SDL2_image,
10 SDL2_mixer,
11 libGLU,
12 libGL,
13 libpng,
14 physfs,
15 unstableGitUpdater,
16}:
17
18let
19 music = fetchurl {
20 url = "https://www.dxx-rebirth.com/download/dxx/res/d2xr-sc55-music.dxa";
21 sha256 = "05mz77vml396mff43dbs50524rlm4fyds6widypagfbh5hc55qdc";
22 };
23
24in
25stdenv.mkDerivation {
26 pname = "dxx-rebirth";
27 version = "0.60.0-beta2-unstable-2025-05-24";
28
29 src = fetchFromGitHub {
30 owner = "dxx-rebirth";
31 repo = "dxx-rebirth";
32 rev = "7a84b3f307ac6f72fd440e55b149d7c2c942dfaf";
33 hash = "sha256-b3rMitf2kw8y0EXwxeKKB8bqzCUaIaMQmpV1gtdcLis=";
34 };
35
36 nativeBuildInputs = [
37 pkg-config
38 scons
39 ];
40
41 buildInputs = [
42 libGLU
43 libGL
44 libpng
45 physfs
46 SDL2
47 SDL2_image
48 SDL2_mixer
49 ];
50
51 enableParallelBuilding = true;
52
53 sconsFlags = [ "sdl2=1" ];
54
55 env.NIX_CFLAGS_COMPILE = toString [
56 "-Wno-format-nonliteral"
57 "-Wno-format-truncation"
58 ];
59
60 postInstall = ''
61 install -Dm644 ${music} $out/share/games/dxx-rebirth/${music.name}
62 install -Dm644 -t $out/share/doc/dxx-rebirth *.txt
63 '';
64
65 passthru.updateScript = unstableGitUpdater { };
66
67 meta = with lib; {
68 description = "Source Port of the Descent 1 and 2 engines";
69 homepage = "https://www.dxx-rebirth.com/";
70 license = licenses.gpl3;
71 maintainers = with maintainers; [ peterhoeg ];
72 platforms = with platforms; linux;
73 };
74}