diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-03-25 00:02:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 00:02:29 +0000 |
commit | 8794d573a4fdd15b0002135cebf65a8f5d9adb6c (patch) | |
tree | cbda6a51859b2b25b701a8798e8340b4be842b16 /pkgs/games | |
parent | e3eacb46bcd607a83cedac34f8d278580359ba92 (diff) | |
parent | 3a6b97ce3259a89c2cd3b0caf021c93fe1998ff1 (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/armagetronad/default.nix | 135 | ||||
-rw-r--r-- | pkgs/games/hyperrogue/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/pioneer/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/scummvm/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/wesnoth/default.nix | 11 |
5 files changed, 89 insertions, 69 deletions
diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 20f253dcfc2f..fc22e7162f6d 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -21,6 +21,7 @@ , libpng , libxml2 , protobuf +, xvfb-run , dedicatedServer ? false }: @@ -28,64 +29,69 @@ let latestVersionMajor = "0.2.9"; unstableVersionMajor = "0.4"; - latestCommonBuildInputs = [ SDL SDL_image SDL_mixer libpng ]; - - unstableCommonBuildInputs = [ SDL2 SDL2_image SDL2_mixer glew ftgl freetype ]; - unstableCommonNativeBuildInputs = [ SDL ]; # for sdl-config - - srcs = { - ${latestVersionMajor} = rec { - version = "${latestVersionMajor}.1.1"; - src = fetchFromGitLab { + srcs = + let + fetchArmagetron = rev: hash: + fetchFromGitLab { owner = "armagetronad"; repo = "armagetronad"; + inherit rev hash; + }; + in + { + # https://gitlab.com/armagetronad/armagetronad/-/tags + ${latestVersionMajor} = + let + version = "${latestVersionMajor}.2.3"; rev = "v${version}"; - sha256 = "tvmKGqzH8IYTSeahc8XmN3RV+GdE5GsP8pAlwG8Ph3M="; + hash = "sha256-lfYJ3luGK9hB0aiiBiJIqq5ddANqGaVtKXckbo4fl2g="; + in dedicatedServer: { + inherit version; + src = fetchArmagetron rev hash; + extraBuildInputs = lib.optionals (!dedicatedServer) [ libpng SDL SDL_image SDL_mixer ]; }; - extraBuildInputs = latestCommonBuildInputs; - }; + # https://gitlab.com/armagetronad/armagetronad/-/commits/trunk/?ref_type=heads ${unstableVersionMajor} = let - rev = "4bf6245a668ce181cd464b767ce436a6b7bf8506"; - in - { + rev = "e7f41fd26363e7c6a72f0c673470ed06ab54ae08"; + hash = "sha256-Uxxk6L7WPxKYQ4CNxWwEtvbZjK8BqYNTuwwdleZ44Ro="; + in dedicatedServer: { version = "${unstableVersionMajor}-${builtins.substring 0 8 rev}"; - src = fetchFromGitLab { - owner = "armagetronad"; - repo = "armagetronad"; - inherit rev; - sha256 = "cpJmQHCS6asGasD7anEgNukG9hRXpsIJZrCr3Q7uU4I="; - }; - extraBuildInputs = [ protobuf boost ] ++ unstableCommonBuildInputs; - extraNativeBuildInputs = [ bison ] ++ unstableCommonNativeBuildInputs; + 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 = "fdfd5fb97083aed45467385b96d50d87669e4023"; - in - { + rev = "a5bffe9dda2b43d330433f76f14eb374701f326a"; + hash = "sha256-cNABxfg3MSmbxU/R78QyPOMwXGqJEamaFOPNw5yhDGE="; + in dedicatedServer: { version = "${latestVersionMajor}-sty+ct+ap-${builtins.substring 0 8 rev}"; - src = fetchFromGitLab { - owner = "armagetronad"; - repo = "armagetronad"; - inherit rev; - sha256 = "UDbe7DiMLzNFAs4C6BbnmdEjqSltSbnk/uQfNOLGAfo="; - }; - extraBuildInputs = latestCommonBuildInputs; - extraNativeBuildInputs = [ python3 ]; + src = fetchArmagetron rev hash; + extraBuildInputs = lib.optionals (!dedicatedServer) [ libpng SDL SDL_image SDL_mixer ]; }; }; - mkArmagetron = { version, src, dedicatedServer ? false, extraBuildInputs ? [ ], extraNativeBuildInputs ? [ ] }@params: + # Creates an Armagetron build. Takes a function returning build inputs for a particular value of dedicatedServer. + mkArmagetron = fn: dedicatedServer: let + # Compute the build params. + resolvedParams = fn dedicatedServer; + + # Figure out the binary name depending on whether this is a dedicated server. + mainProgram = if dedicatedServer then "armagetronad-dedicated" else "armagetronad"; + # Split the version into the major and minor parts - versionParts = lib.splitString "-" version; + versionParts = lib.splitString "-" resolvedParams.version; splitVersion = lib.splitVersion (builtins.elemAt versionParts 0); majorVersion = builtins.concatStringsSep "." (lib.lists.take 2 splitVersion); - minorVersionPart = parts: sep: expectedSize: + minorVersionPart = parts: sep: expectedSize: if builtins.length parts > expectedSize then sep + (builtins.concatStringsSep sep (lib.lists.drop expectedSize parts)) else @@ -93,9 +99,9 @@ let minorVersion = (minorVersionPart splitVersion "." 2) + (minorVersionPart versionParts "-" 1) + "-nixpkgs"; in - stdenv.mkDerivation rec { - pname = if dedicatedServer then "armagetronad-dedicated" else "armagetronad"; - inherit version src; + stdenv.mkDerivation { + pname = mainProgram; + inherit (resolvedParams) version src; # Build works fine; install has a race. enableParallelBuilding = true; @@ -124,10 +130,13 @@ let ] ++ lib.optional dedicatedServer "--enable-dedicated" ++ lib.optional (!dedicatedServer) "--enable-music"; - buildInputs = [ libxml2 ] ++ extraBuildInputs; + buildInputs = [ libxml2 ] + ++ (resolvedParams.extraBuildInputs or []); nativeBuildInputs = [ autoconf automake gnum4 pkg-config which python3 ] - ++ extraNativeBuildInputs; + ++ (resolvedParams.extraNativeBuildInputs or []); + + nativeInstallCheckInputs = resolvedParams.extraNativeInstallCheckInputs or []; postInstall = lib.optionalString (!dedicatedServer) '' mkdir -p $out/share/{applications,icons/hicolor} @@ -139,16 +148,21 @@ let installCheckPhase = '' export XDG_RUNTIME_DIR=/tmp - bin="$out/bin/${pname}" - version="$("$bin" --version || true)" - prefix="$("$bin" --prefix || true)" - rubber="$("$bin" --doc | grep -m1 CYCLE_RUBBER)" + bin="$out/bin/${mainProgram}" + if command -v xvfb-run &>/dev/null; then + run="xvfb-run $bin" + else + run="$bin" + fi + version="$($run --version || true)" + prefix="$($run --prefix || true)" + rubber="$($run --doc | grep -m1 CYCLE_RUBBER)" echo "Version: $version" >&2 echo "Prefix: $prefix" >&2 echo "Docstring: $rubber" >&2 - if [[ "$version" != *"${version}"* ]] || \ + if [[ "$version" != *"${resolvedParams.version}"* ]] || \ [ "$prefix" != "$out" ] || \ [[ ! "$rubber" =~ ^CYCLE_RUBBER[[:space:]]+Niceness[[:space:]]factor ]]; then exit 1 @@ -160,27 +174,28 @@ let # No passthru, end of the line. # https://www.youtube.com/watch?v=NOMa56y_Was } - else if (version != srcs.${latestVersionMajor}.version) then { + else if (resolvedParams.version != (srcs.${latestVersionMajor} dedicatedServer).version) then { # Allow a "dedicated" passthru for versions other than the default. - dedicated = mkArmagetron (params // { - dedicatedServer = true; - }); + dedicated = mkArmagetron fn true; } - else (lib.mapAttrs (name: value: mkArmagetron value) (lib.filterAttrs (name: value: value.version != srcs.${latestVersionMajor}.version) srcs)) // { - # Allow both a "dedicated" passthru and a passthru for all the options other than the latest version, which this is. - dedicated = mkArmagetron (params // { - dedicatedServer = true; - }); - }; + else + ( + lib.mapAttrs (name: value: mkArmagetron value dedicatedServer) + (lib.filterAttrs (name: value: (value dedicatedServer).version != (srcs.${latestVersionMajor} dedicatedServer).version) srcs) + ) // + { + # Allow both a "dedicated" passthru and a passthru for all the options other than the latest version, which this is. + dedicated = mkArmagetron fn true; + }; meta = with lib; { - homepage = "http://armagetronad.org"; + inherit mainProgram; + homepage = "https://www.armagetronad.org"; description = "A multiplayer networked arcade racing game in 3D similar to Tron"; - mainProgram = "armagetronad-dedicated"; maintainers = with maintainers; [ numinit ]; license = licenses.gpl2Plus; platforms = platforms.linux; }; }; in -mkArmagetron (srcs.${latestVersionMajor} // { inherit dedicatedServer; }) +mkArmagetron srcs.${latestVersionMajor} dedicatedServer diff --git a/pkgs/games/hyperrogue/default.nix b/pkgs/games/hyperrogue/default.nix index 1177ad59413a..21316d967c5a 100644 --- a/pkgs/games/hyperrogue/default.nix +++ b/pkgs/games/hyperrogue/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { pname = "hyperrogue"; - version = "13.0c"; + version = "13.0d"; src = fetchFromGitHub { owner = "zenorogue"; repo = "hyperrogue"; rev = "v${version}"; - sha256 = "sha256-eELR/1GzR9wWJ433rIpueMu9omlsl1y5rmvG3GgSHZA="; + sha256 = "sha256-K7KKOumotBx9twgCBF4UkpsgMWb8vAclzbYZK83T66I="; }; CXXFLAGS = [ diff --git a/pkgs/games/pioneer/default.nix b/pkgs/games/pioneer/default.nix index 878101a917fc..b7ac0b73b3b9 100644 --- a/pkgs/games/pioneer/default.nix +++ b/pkgs/games/pioneer/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "pioneer"; - version = "20240203"; + version = "20240314"; src = fetchFromGitHub{ owner = "pioneerspacesim"; repo = "pioneer"; rev = version; - hash = "sha256-Jqv013VM0177VqGYR7vSvdq+67ONM91RrjcdVXNLcHs="; + hash = "sha256-CUaiQPRufo8Ng70w5KWlLugySMaTaUuZno/ckyU1w2w="; }; postPatch = '' diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index bc92c3abbda3..6a700c7ed00c 100644 --- a/pkgs/games/scummvm/default.nix +++ b/pkgs/games/scummvm/default.nix @@ -5,13 +5,13 @@ stdenv.mkDerivation rec { pname = "scummvm"; - version = "2.8.0"; + version = "2.8.1"; src = fetchFromGitHub { owner = "scummvm"; repo = "scummvm"; rev = "v${version}"; - hash = "sha256-W8VZuRVpq0WwaCLH0ODcFmqbE7eKLK6nuyB7qrfqkiY="; + hash = "sha256-8/q16MwHhbbmUxiwJOHkjNxrnBB4grMa7qw/n3KLvRc="; }; nativeBuildInputs = [ nasm ]; diff --git a/pkgs/games/wesnoth/default.nix b/pkgs/games/wesnoth/default.nix index 9afbdf1913b0..54a7aaa822c3 100644 --- a/pkgs/games/wesnoth/default.nix +++ b/pkgs/games/wesnoth/default.nix @@ -1,26 +1,31 @@ { lib, stdenv, fetchFromGitHub , cmake, pkg-config, SDL2, SDL2_image, SDL2_mixer, SDL2_net, SDL2_ttf , pango, gettext, boost, libvorbis, fribidi, dbus, libpng, pcre, openssl, icu +, lua, curl , Cocoa, Foundation }: stdenv.mkDerivation rec { pname = "wesnoth"; - version = "1.16.11"; + version = "1.18.0"; src = fetchFromGitHub { rev = version; owner = "wesnoth"; repo = "wesnoth"; - hash = "sha256-nnAMMc1pPYOziaHGUfh8LevECBb/lzCkaPyzFWs4zTY="; + hash = "sha256-Db1OwBTA/2jjhu/fOZhwGo7dWV3mZ40y6hTNCCjaRJQ="; }; nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf pango gettext boost - libvorbis fribidi dbus libpng pcre openssl icu ] + libvorbis fribidi dbus libpng pcre openssl icu lua curl ] ++ lib.optionals stdenv.isDarwin [ Cocoa Foundation]; + cmakeFlags = [ + "-DENABLE_SYSTEM_LUA=ON" + ]; + NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework AppKit"; meta = with lib; { |