nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, cargo
5, cmake
6, ninja
7, pkg-config
8, rustPlatform
9, rustc
10, curl
11, freetype
12, libGLU
13, libnotify
14, libogg
15, libX11
16, opusfile
17, pcre
18, python3
19, SDL2
20, sqlite
21, wavpack
22, ffmpeg
23, x264
24, vulkan-headers
25, vulkan-loader
26, glslang
27, spirv-tools
28, gtest
29, Carbon
30, Cocoa
31, OpenGL
32, Security
33}:
34
35stdenv.mkDerivation rec {
36 pname = "ddnet";
37 version = "17.0.2";
38
39 src = fetchFromGitHub {
40 owner = "ddnet";
41 repo = pname;
42 rev = version;
43 hash = "sha256-+k+QiRSFvaGhifN/SKf6bKtooRbnArV2M9o64X5GckE=";
44 };
45
46 cargoDeps = rustPlatform.fetchCargoTarball {
47 name = "${pname}-${version}";
48 inherit src;
49 hash = "sha256-kbVHeavCIrLq9ImA2Z7H2O0NXNPjA+3qiba5LoADyG0=";
50 };
51
52 nativeBuildInputs = [
53 cmake
54 ninja
55 pkg-config
56 rustc
57 cargo
58 rustPlatform.cargoSetupHook
59 ];
60
61 nativeCheckInputs = [
62 gtest
63 ];
64
65 buildInputs = [
66 curl
67 freetype
68 libGLU
69 libnotify
70 libogg
71 libX11
72 opusfile
73 pcre
74 python3
75 SDL2
76 sqlite
77 wavpack
78 ffmpeg
79 x264
80 vulkan-loader
81 vulkan-headers
82 glslang
83 spirv-tools
84 ] ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa OpenGL Security ];
85
86 postPatch = ''
87 substituteInPlace src/engine/shared/storage.cpp \
88 --replace /usr/ $out/
89 '';
90
91 cmakeFlags = [
92 "-DAUTOUPDATE=OFF"
93 ];
94
95 doCheck = true;
96 checkTarget = "run_tests";
97
98 meta = with lib; {
99 description = "A Teeworlds modification with a unique cooperative gameplay.";
100 longDescription = ''
101 DDraceNetwork (DDNet) is an actively maintained version of DDRace,
102 a Teeworlds modification with a unique cooperative gameplay.
103 Help each other play through custom maps with up to 64 players,
104 compete against the best in international tournaments,
105 design your own maps, or run your own server.
106 '';
107 homepage = "https://ddnet.org";
108 license = licenses.asl20;
109 maintainers = with maintainers; [ sirseruju lom ncfavier ];
110 mainProgram = "DDNet";
111 };
112}