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