Merge pull request #250100 from NixOS/ioquake3/update

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

Changed files
+46 -22
nixos
modules
services
pkgs
games
quake3
ioquake
+7 -3
nixos/modules/services/games/quake3-server.nix
···
{ config, pkgs, lib, ... }:
-
with lib;
let
cfg = config.services.quake3-server;
configFile = pkgs.writeText "q3ds-extra.cfg" ''
set net_port ${builtins.toString cfg.port}
${cfg.extraConfig}
'';
defaultBaseq3 = pkgs.requireFile rec {
name = "baseq3";
hashMode = "recursive";
···
$services.quake3-server.baseq3/.q3a/
'';
};
home = pkgs.runCommand "quake3-home" {} ''
mkdir -p $out/.q3a/baseq3
···
options = {
services.quake3-server = {
enable = mkEnableOption (lib.mdDoc "Quake 3 dedicated server");
port = mkOption {
type = types.port;
···
ReadOnlyPaths = if baseq3InStore then home else cfg.baseq3;
ExecStartPre = optionalString (!baseq3InStore) "+${pkgs.coreutils}/bin/cp ${configFile} ${cfg.baseq3}/.q3a/baseq3/nix.cfg";
-
ExecStart = "${pkgs.ioquake3}/ioq3ded.x86_64 +exec nix.cfg";
};
};
};
-
meta.maintainers = with maintainers; [ f4814n ];
}
···
{ config, pkgs, lib, ... }:
let
+
inherit (lib) literalMD mkEnableOption mkIf mkOption types;
cfg = config.services.quake3-server;
+
configFile = pkgs.writeText "q3ds-extra.cfg" ''
set net_port ${builtins.toString cfg.port}
${cfg.extraConfig}
'';
+
defaultBaseq3 = pkgs.requireFile rec {
name = "baseq3";
hashMode = "recursive";
···
$services.quake3-server.baseq3/.q3a/
'';
};
+
home = pkgs.runCommand "quake3-home" {} ''
mkdir -p $out/.q3a/baseq3
···
options = {
services.quake3-server = {
enable = mkEnableOption (lib.mdDoc "Quake 3 dedicated server");
+
package = lib.mkPackageOptionMD pkgs "ioquake3" { };
port = mkOption {
type = types.port;
···
ReadOnlyPaths = if baseq3InStore then home else cfg.baseq3;
ExecStartPre = optionalString (!baseq3InStore) "+${pkgs.coreutils}/bin/cp ${configFile} ${cfg.baseq3}/.q3a/baseq3/nix.cfg";
+
ExecStart = "${cfg.package}/bin/ioq3ded +exec nix.cfg";
};
};
};
+
meta.maintainers = with lib.maintainers; [ f4814n ];
}
+39 -19
pkgs/games/quake3/ioquake/default.nix
···
{ lib
, stdenv
, fetchFromGitHub
-
, which
, pkg-config
, SDL2
, libGL
-
, openalSoft
, curl
, speex
, opusfile
, libogg
, libvorbis
-
, libopus
, libjpeg
-
, mumble
, freetype
}:
stdenv.mkDerivation {
pname = "ioquake3";
-
version = "unstable-2022-11-24";
src = fetchFromGitHub {
owner = "ioquake";
repo = "ioq3";
-
rev = "70d07d91d62dcdd2f2268d1ac401bfb697b4c991";
-
sha256 = "sha256-WDjR0ik+xAs6OA1DNbUGIF1MXSuEoy8nNkPiHaegfF0=";
};
-
nativeBuildInputs = [ which pkg-config ];
buildInputs = [
SDL2
libGL
-
openalSoft
curl
speex
opusfile
libogg
libvorbis
-
libopus
libjpeg
freetype
-
mumble
];
enableParallelBuilding = true;
···
installTargets = [ "copyfiles" ];
-
installFlags = [ "COPYDIR=$(out)" "COPYBINDIR=$(out)/bin" ];
-
preInstall = ''
-
mkdir -p $out/baseq3 $out/bin
'';
-
meta = with lib; {
homepage = "https://ioquake3.org/";
-
description = "First person shooter engine based on the Quake 3: Arena and Quake 3: Team Arena";
-
license = licenses.gpl2Only;
-
platforms = platforms.linux;
-
maintainers = with maintainers; [ rvolosatovs eelco abbradar ];
};
}
···
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
+
, which
+
, copyDesktopItems
+
, makeBinaryWrapper
, SDL2
, libGL
+
, openal
, curl
, speex
, opusfile
, libogg
, libvorbis
, libjpeg
+
, makeDesktopItem
, freetype
}:
stdenv.mkDerivation {
pname = "ioquake3";
+
version = "unstable-2023-08-13";
src = fetchFromGitHub {
owner = "ioquake";
repo = "ioq3";
+
rev = "ee950eb7b0e41437cc23a9943254c958da8a61ab";
+
sha256 = "sha256-NfhInwrtw85i2mnv7EtBrrpNaslaQaVhLNlK0I9aYto=";
};
+
nativeBuildInputs = [
+
copyDesktopItems
+
makeBinaryWrapper
+
pkg-config
+
which
+
];
+
buildInputs = [
SDL2
libGL
+
openal
curl
speex
opusfile
libogg
libvorbis
libjpeg
freetype
];
enableParallelBuilding = true;
···
installTargets = [ "copyfiles" ];
+
installFlags = [ "COPYDIR=$(out)/share/ioquake3" ];
+
postInstall = ''
+
install -Dm644 misc/quake3.svg $out/share/icons/hicolor/scalable/apps/ioquake3.svg
+
+
makeWrapper $out/share/ioquake3/ioquake3.* $out/bin/ioquake3
+
makeWrapper $out/share/ioquake3/ioq3ded.* $out/bin/ioq3ded
'';
+
desktopItems = [
+
(makeDesktopItem {
+
name = "IOQuake3";
+
exec = "ioquake3";
+
icon = "ioquake3";
+
comment = "A fast-paced 3D first-person shooter, a community effort to continue supporting/developing id's Quake III Arena";
+
desktopName = "ioquake3";
+
categories = [ "Game" "ActionGame" ];
+
})
+
];
+
+
meta = {
homepage = "https://ioquake3.org/";
+
description = "A fast-paced 3D first-person shooter, a community effort to continue supporting/developing id's Quake III Arena";
+
license = lib.licenses.gpl2Only;
+
mainProgram = "ioquake3";
+
maintainers = with lib.maintainers; [ abbradar drupol eelco rvolosatovs ];
+
platforms = lib.platforms.linux;
};
}