lol

Merge pull request #250100 from NixOS/ioquake3/update

ioquake3: fix missing `.so` files at startup and clean-up

authored by

Pol Dellaiera and committed by
GitHub
cac8909c 24c5103b

+46 -22
+7 -3
nixos/modules/services/games/quake3-server.nix
··· 1 1 { config, pkgs, lib, ... }: 2 - with lib; 3 2 4 3 let 4 + inherit (lib) literalMD mkEnableOption mkIf mkOption types; 5 5 cfg = config.services.quake3-server; 6 + 6 7 configFile = pkgs.writeText "q3ds-extra.cfg" '' 7 8 set net_port ${builtins.toString cfg.port} 8 9 9 10 ${cfg.extraConfig} 10 11 ''; 12 + 11 13 defaultBaseq3 = pkgs.requireFile rec { 12 14 name = "baseq3"; 13 15 hashMode = "recursive"; ··· 25 27 $services.quake3-server.baseq3/.q3a/ 26 28 ''; 27 29 }; 30 + 28 31 home = pkgs.runCommand "quake3-home" {} '' 29 32 mkdir -p $out/.q3a/baseq3 30 33 ··· 38 41 options = { 39 42 services.quake3-server = { 40 43 enable = mkEnableOption (lib.mdDoc "Quake 3 dedicated server"); 44 + package = lib.mkPackageOptionMD pkgs "ioquake3" { }; 41 45 42 46 port = mkOption { 43 47 type = types.port; ··· 103 107 ReadOnlyPaths = if baseq3InStore then home else cfg.baseq3; 104 108 ExecStartPre = optionalString (!baseq3InStore) "+${pkgs.coreutils}/bin/cp ${configFile} ${cfg.baseq3}/.q3a/baseq3/nix.cfg"; 105 109 106 - ExecStart = "${pkgs.ioquake3}/ioq3ded.x86_64 +exec nix.cfg"; 110 + ExecStart = "${cfg.package}/bin/ioq3ded +exec nix.cfg"; 107 111 }; 108 112 }; 109 113 }; 110 114 111 - meta.maintainers = with maintainers; [ f4814n ]; 115 + meta.maintainers = with lib.maintainers; [ f4814n ]; 112 116 }
+39 -19
pkgs/games/quake3/ioquake/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 - , which 5 4 , pkg-config 5 + , which 6 + , copyDesktopItems 7 + , makeBinaryWrapper 6 8 , SDL2 7 9 , libGL 8 - , openalSoft 10 + , openal 9 11 , curl 10 12 , speex 11 13 , opusfile 12 14 , libogg 13 15 , libvorbis 14 - , libopus 15 16 , libjpeg 16 - , mumble 17 + , makeDesktopItem 17 18 , freetype 18 19 }: 19 20 20 21 stdenv.mkDerivation { 21 22 pname = "ioquake3"; 22 - version = "unstable-2022-11-24"; 23 + version = "unstable-2023-08-13"; 23 24 24 25 src = fetchFromGitHub { 25 26 owner = "ioquake"; 26 27 repo = "ioq3"; 27 - rev = "70d07d91d62dcdd2f2268d1ac401bfb697b4c991"; 28 - sha256 = "sha256-WDjR0ik+xAs6OA1DNbUGIF1MXSuEoy8nNkPiHaegfF0="; 28 + rev = "ee950eb7b0e41437cc23a9943254c958da8a61ab"; 29 + sha256 = "sha256-NfhInwrtw85i2mnv7EtBrrpNaslaQaVhLNlK0I9aYto="; 29 30 }; 30 31 31 - nativeBuildInputs = [ which pkg-config ]; 32 + nativeBuildInputs = [ 33 + copyDesktopItems 34 + makeBinaryWrapper 35 + pkg-config 36 + which 37 + ]; 38 + 32 39 buildInputs = [ 33 40 SDL2 34 41 libGL 35 - openalSoft 42 + openal 36 43 curl 37 44 speex 38 45 opusfile 39 46 libogg 40 47 libvorbis 41 - libopus 42 48 libjpeg 43 49 freetype 44 - mumble 45 50 ]; 46 51 47 52 enableParallelBuilding = true; ··· 50 55 51 56 installTargets = [ "copyfiles" ]; 52 57 53 - installFlags = [ "COPYDIR=$(out)" "COPYBINDIR=$(out)/bin" ]; 58 + installFlags = [ "COPYDIR=$(out)/share/ioquake3" ]; 54 59 55 - preInstall = '' 56 - mkdir -p $out/baseq3 $out/bin 60 + postInstall = '' 61 + install -Dm644 misc/quake3.svg $out/share/icons/hicolor/scalable/apps/ioquake3.svg 62 + 63 + makeWrapper $out/share/ioquake3/ioquake3.* $out/bin/ioquake3 64 + makeWrapper $out/share/ioquake3/ioq3ded.* $out/bin/ioq3ded 57 65 ''; 58 66 59 - meta = with lib; { 67 + desktopItems = [ 68 + (makeDesktopItem { 69 + name = "IOQuake3"; 70 + exec = "ioquake3"; 71 + icon = "ioquake3"; 72 + comment = "A fast-paced 3D first-person shooter, a community effort to continue supporting/developing id's Quake III Arena"; 73 + desktopName = "ioquake3"; 74 + categories = [ "Game" "ActionGame" ]; 75 + }) 76 + ]; 77 + 78 + meta = { 60 79 homepage = "https://ioquake3.org/"; 61 - description = "First person shooter engine based on the Quake 3: Arena and Quake 3: Team Arena"; 62 - license = licenses.gpl2Only; 63 - platforms = platforms.linux; 64 - maintainers = with maintainers; [ rvolosatovs eelco abbradar ]; 80 + description = "A fast-paced 3D first-person shooter, a community effort to continue supporting/developing id's Quake III Arena"; 81 + license = lib.licenses.gpl2Only; 82 + mainProgram = "ioquake3"; 83 + maintainers = with lib.maintainers; [ abbradar drupol eelco rvolosatovs ]; 84 + platforms = lib.platforms.linux; 65 85 }; 66 86 }