Merge pull request #268658 from jtbx/teeworlds-buildClient

teeworlds, ddnet: add buildClient feature flag

authored by Naïm Favier and committed by GitHub b6eba20e d5da153f

+40 -10
+24 -6
pkgs/games/ddnet/default.nix
··· 30 30 , Cocoa 31 31 , OpenGL 32 32 , Security 33 + , buildClient ? true 33 34 }: 34 35 35 36 stdenv.mkDerivation rec { ··· 64 65 65 66 buildInputs = [ 66 67 curl 68 + libnotify 69 + pcre 70 + python3 71 + sqlite 72 + ] ++ lib.optionals buildClient ([ 67 73 freetype 68 74 libGLU 69 - libnotify 70 75 libogg 71 - libX11 72 76 opusfile 73 - pcre 74 - python3 75 77 SDL2 76 - sqlite 77 78 wavpack 78 79 ffmpeg 79 80 x264 ··· 81 82 vulkan-headers 82 83 glslang 83 84 spirv-tools 84 - ] ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa OpenGL Security ]; 85 + ] ++ lib.optionals stdenv.isLinux [ 86 + libX11 87 + ] ++ lib.optionals stdenv.isDarwin [ 88 + Carbon 89 + Cocoa 90 + OpenGL 91 + Security 92 + ]); 85 93 86 94 postPatch = '' 87 95 substituteInPlace src/engine/shared/storage.cpp \ ··· 90 98 91 99 cmakeFlags = [ 92 100 "-DAUTOUPDATE=OFF" 101 + "-DCLIENT=${if buildClient then "ON" else "OFF"}" 93 102 ]; 94 103 95 104 doCheck = true; 96 105 checkTarget = "run_tests"; 106 + 107 + postInstall = lib.optionalString (!buildClient) '' 108 + # DDNet's CMakeLists.txt automatically installs .desktop 109 + # shortcuts and icons for the client, even if the client 110 + # is not supposed to be built 111 + rm -rf $out/share/applications 112 + rm -rf $out/share/icons 113 + rm -rf $out/share/metainfo 114 + ''; 97 115 98 116 meta = with lib; { 99 117 description = "A Teeworlds modification with a unique cooperative gameplay.";
+14 -4
pkgs/games/teeworlds/default.nix
··· 3 3 , nixosTests 4 4 , Carbon 5 5 , Cocoa 6 + , buildClient ? true 6 7 }: 7 8 8 9 stdenv.mkDerivation rec { ··· 38 39 nativeBuildInputs = [ 39 40 cmake 40 41 pkg-config 41 - ] ++ lib.optionals stdenv.isLinux [ 42 + ] ++ lib.optionals (buildClient && stdenv.isLinux) [ 42 43 icoutils 43 44 ]; 44 45 45 46 buildInputs = [ 46 - python3 libGLU SDL2 lua5_3 zlib freetype wavpack 47 + python3 lua5_3 zlib 48 + ] ++ lib.optionals buildClient ([ 49 + libGLU 50 + SDL2 51 + freetype 52 + wavpack 47 53 ] ++ lib.optionals stdenv.isLinux [ 48 54 alsa-lib 49 55 libX11 50 56 ] ++ lib.optionals stdenv.isDarwin [ 51 57 Carbon 52 58 Cocoa 59 + ]); 60 + 61 + cmakeFlags = [ 62 + "-DCLIENT=${if buildClient then "ON" else "OFF"}" 53 63 ]; 54 64 55 - postInstall = lib.optionalString stdenv.isLinux '' 65 + postInstall = lib.optionalString buildClient (lib.optionalString stdenv.isLinux '' 56 66 # Convert and install desktop icon 57 67 mkdir -p $out/share/pixmaps 58 68 icotool --extract --index 1 --output $out/share/pixmaps/teeworlds.png $src/other/icons/teeworlds.ico ··· 68 78 cp '../other/bundle/client/PkgInfo' "$out/Applications/teeworlds.app/Contents/" 69 79 ln -s "$out/bin/teeworlds" "$out/Applications/teeworlds.app/Contents/MacOS/" 70 80 ln -s "$out/share/teeworlds/data" "$out/Applications/teeworlds.app/Contents/Resources/data" 71 - ''; 81 + ''); 72 82 73 83 passthru.tests.teeworlds = nixosTests.teeworlds; 74 84
+2
pkgs/top-level/all-packages.nix
··· 37672 37672 ddnet = callPackage ../games/ddnet { 37673 37673 inherit (darwin.apple_sdk.frameworks) Carbon Cocoa OpenGL Security; 37674 37674 }; 37675 + ddnet-server = ddnet.override { buildClient = false; }; 37675 37676 37676 37677 ddns-go = callPackage ../tools/networking/ddns-go { }; 37677 37678 ··· 38458 38459 teeworlds = callPackage ../games/teeworlds { 38459 38460 inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; 38460 38461 }; 38462 + teeworlds-server = teeworlds.override { buildClient = false; }; 38461 38463 38462 38464 tengine = callPackage ../servers/http/tengine { 38463 38465 modules = with nginxModules; [ rtmp dav moreheaders modsecurity ];