teeworlds: add buildClient feature flag

Allows for only building the Teeworlds server (for example, in a
headless environment). This gets rid of a great deal of dependencies
which would be unneccessary in a headless server.

Also added the package "teeworlds-server" in all-packages.nix, defined
as an override.

Jeremy 2fdbabab 3f21a22b

+15 -4
+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
+1
pkgs/top-level/all-packages.nix
··· 38467 38467 teeworlds = callPackage ../games/teeworlds { 38468 38468 inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; 38469 38469 }; 38470 + teeworlds-server = teeworlds.override { buildClient = false; }; 38470 38471 38471 38472 tengine = callPackage ../servers/http/tengine { 38472 38473 modules = with nginxModules; [ rtmp dav moreheaders modsecurity ];