34 stdenv.mkDerivation rec {
38 src = fetchFromGitHub {
42 hash = "sha256-mOXD7lEggFus+TBZ5042QALu4PhHRBntnChQFnHu6Dw=";
45 cargoDeps = rustPlatform.fetchCargoTarball {
46 name = "${pname}-${version}";
48 hash = "sha256-zug7MzxqGhlmm6ZeRo+3ldwmFEn5cVCb+nvRzomFrnc=";
57 rustPlatform.cargoSetupHook
72 ++ lib.optionals buildClient (
87 ++ lib.optionals stdenv.hostPlatform.isLinux [
90 ++ lib.optionals stdenv.hostPlatform.isDarwin [
96 substituteInPlace src/engine/shared/storage.cpp \
102 "-DCLIENT=${if buildClient then "ON" else "OFF"}"
105 # Tests loop forever on Darwin for some reason
106 doCheck = !stdenv.hostPlatform.isDarwin;
107 checkTarget = "run_tests";
109 postInstall = lib.optionalString (!buildClient) ''
110 # DDNet's CMakeLists.txt automatically installs .desktop
111 # shortcuts and icons for the client, even if the client
112 # is not supposed to be built
113 rm -rf $out/share/applications
114 rm -rf $out/share/icons
115 rm -rf $out/share/metainfo
118 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
119 # Upstream links against <prefix>/lib while it installs this library in <prefix>/lib/ddnet
120 install_name_tool -change "$out/lib/libsteam_api.dylib" "$out/lib/ddnet/libsteam_api.dylib" "$out/bin/DDNet"
124 description = "Teeworlds modification with a unique cooperative gameplay";
126 DDraceNetwork (DDNet) is an actively maintained version of DDRace,
127 a Teeworlds modification with a unique cooperative gameplay.
128 Help each other play through custom maps with up to 64 players,
129 compete against the best in international tournaments,
130 design your own maps, or run your own server.
132 homepage = "https://ddnet.org";
133 license = licenses.asl20;
134 maintainers = with maintainers; [
139 mainProgram = "DDNet";