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