From 204cb87e31874a44193613139471831159a74492 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Sun, 2 Jun 2024 23:54:04 -0700 Subject: [PATCH 1/5] armagetronad: fix installCheckPhase on hydra --- pkgs/games/armagetronad/default.nix | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index d4bfba671d65..2b954cfa6689 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -22,6 +22,7 @@ , libxml2 , protobuf , xvfb-run +, gnugrep , dedicatedServer ? false }: @@ -54,22 +55,21 @@ let # https://gitlab.com/armagetronad/armagetronad/-/commits/trunk/?ref_type=heads ${unstableVersionMajor} = let - rev = "e7f41fd26363e7c6a72f0c673470ed06ab54ae08"; - hash = "sha256-Uxxk6L7WPxKYQ4CNxWwEtvbZjK8BqYNTuwwdleZ44Ro="; + rev = "391a74625c1222dd180f069f1b61c3e069a3ba8c"; + hash = "sha256-fUY0dBj85k0QhnAoDzyBmmKmRh9oCYC6r6X4ukt7/L0="; in dedicatedServer: { version = "${unstableVersionMajor}-${builtins.substring 0 8 rev}"; src = fetchArmagetron rev hash; extraBuildInputs = [ protobuf boost ] ++ lib.optionals (!dedicatedServer) [ glew ftgl freetype SDL2 SDL2_image SDL2_mixer ]; extraNativeBuildInputs = [ bison ]; - extraNativeInstallCheckInputs = lib.optionals (!dedicatedServer) [ xvfb-run ]; }; # https://gitlab.com/armagetronad/armagetronad/-/commits/hack-0.2.8-sty+ct+ap/?ref_type=heads "${latestVersionMajor}-sty+ct+ap" = let - rev = "a5bffe9dda2b43d330433f76f14eb374701f326a"; - hash = "sha256-cNABxfg3MSmbxU/R78QyPOMwXGqJEamaFOPNw5yhDGE="; + rev = "5a17cc9fb6e1e27a358711afbd745ae54d4a8c60"; + hash = "sha256-111C1j/hSaASGcvYy3//TyHs4Z+3fuiOvCmtcWLdFd4="; in dedicatedServer: { version = "${latestVersionMajor}-sty+ct+ap-${builtins.substring 0 8 rev}"; src = fetchArmagetron rev hash; @@ -136,7 +136,9 @@ let nativeBuildInputs = [ autoconf automake gnum4 pkg-config which python3 ] ++ (resolvedParams.extraNativeBuildInputs or []); - nativeInstallCheckInputs = resolvedParams.extraNativeInstallCheckInputs or []; + nativeInstallCheckInputs = [ gnugrep ] + ++ lib.optional (!dedicatedServer) xvfb-run + ++ (resolvedParams.extraNativeInstallCheckInputs or []); postInstall = lib.optionalString (!dedicatedServer) '' mkdir -p $out/share/{applications,icons/hicolor} @@ -154,18 +156,21 @@ let else run="$bin" fi + echo "Checking game info:" >&2 version="$($run --version || true)" + echo " - Version: $version" >&2 prefix="$($run --prefix || true)" - rubber="$($run --doc | grep -m1 CYCLE_RUBBER)" - - echo "Version: $version" >&2 - echo "Prefix: $prefix" >&2 - echo "Docstring: $rubber" >&2 + echo " - Prefix: $prefix" >&2 + rubber="$(($run --doc || true) | grep -m1 CYCLE_RUBBER)" + echo " - Docstring: $rubber" >&2 if [[ "$version" != *"${resolvedParams.version}"* ]] || \ [ "$prefix" != "$out" ] || \ [[ ! "$rubber" =~ ^CYCLE_RUBBER[[:space:]]+Niceness[[:space:]]factor ]]; then + echo "Something didn't match. :-(" >&2 exit 1 + else + echo "Everything is ok." >&2 fi ''; From 105bb49c4ba26b5d806e842415b2f2279f8a31ad Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Mon, 3 Jun 2024 11:05:15 -0700 Subject: [PATCH 2/5] armagetronad: add passthru.tests --- pkgs/games/armagetronad/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 2b954cfa6689..8f0203c1a360 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -23,6 +23,7 @@ , protobuf , xvfb-run , gnugrep +, nixosTests , dedicatedServer ? false }: @@ -191,6 +192,7 @@ let { # Allow both a "dedicated" passthru and a passthru for all the options other than the latest version, which this is. dedicated = mkArmagetron fn true; + tests.armagetronad = nixosTests.armagetronad; }; meta = with lib; { From da4c9eb47b5af5e64bd10836b133cab71e731bcb Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Mon, 3 Jun 2024 22:59:49 -0700 Subject: [PATCH 3/5] tests/armagetronad: increase memory allocation --- nixos/tests/armagetronad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/armagetronad.nix b/nixos/tests/armagetronad.nix index ca93ce8fb6c5..0fe197860a54 100644 --- a/nixos/tests/armagetronad.nix +++ b/nixos/tests/armagetronad.nix @@ -13,7 +13,7 @@ let { imports = [ ./common/user-account.nix ./common/x11.nix ]; hardware.graphics.enable = true; - virtualisation.memorySize = 256; + virtualisation.memorySize = 384; environment = { systemPackages = [ pkgs.armagetronad ]; variables.XAUTHORITY = "/home/${user}/.Xauthority"; From 8abfb83a312c4ded2efce4c4963532cb6a917175 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Tue, 30 Jul 2024 11:32:34 -0700 Subject: [PATCH 4/5] armagetronad: use libxml2 with HTTP support --- pkgs/games/armagetronad/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 8f0203c1a360..1db364ce6fc8 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -131,7 +131,7 @@ let ] ++ lib.optional dedicatedServer "--enable-dedicated" ++ lib.optional (!dedicatedServer) "--enable-music"; - buildInputs = [ libxml2 ] + buildInputs = lib.singleton (libxml2.override { enableHttp = true; }) ++ (resolvedParams.extraBuildInputs or []); nativeBuildInputs = [ autoconf automake gnum4 pkg-config which python3 ] From d968402cd5a533604b6b4c57332f083cce6bcad7 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Tue, 30 Jul 2024 16:49:58 -0700 Subject: [PATCH 5/5] tests/armagetronad: increase timeout for busy Hydra server --- nixos/tests/armagetronad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/armagetronad.nix b/nixos/tests/armagetronad.nix index 0fe197860a54..b657893fc9ee 100644 --- a/nixos/tests/armagetronad.nix +++ b/nixos/tests/armagetronad.nix @@ -208,7 +208,7 @@ makeTest { barrier.wait() # Get to the Server Bookmarks screen on both clients. This takes a while so do it asynchronously. - barrier = threading.Barrier(3, timeout=120) + barrier = threading.Barrier(len(clients) + 1, timeout=240) for client in clients: threading.Thread(target=client_setup, args=(client, servers, barrier)).start() barrier.wait()