From 80956ee6b7b48841f7357d27728e20170ed174a2 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Fri, 18 Apr 2025 14:45:35 -0400 Subject: [PATCH] crossfire-*: move to pkgs/by-name/ This covers the server, maps, arch, and client packages. It also gets rid of the whole hashes-and-versions-in-a-separate-file thing which made sense when I first wrote it but is kind of clunky now. --- .../cr/crossfire-arch/package.nix} | 12 ++++---- .../cr/crossfire-client/package.nix} | 8 ++--- .../cr/crossfire-maps/package.nix} | 12 ++++---- .../cr/crossfire-server/package.nix} | 14 ++++----- ...-cstdint-include-to-crossfire-server.patch | 13 --------- pkgs/games/crossfire/default.nix | 29 ------------------- pkgs/top-level/all-packages.nix | 7 ----- 7 files changed, 24 insertions(+), 71 deletions(-) rename pkgs/{games/crossfire/crossfire-arch.nix => by-name/cr/crossfire-arch/package.nix} (73%) rename pkgs/{games/crossfire/crossfire-client.nix => by-name/cr/crossfire-client/package.nix} (87%) rename pkgs/{games/crossfire/crossfire-maps.nix => by-name/cr/crossfire-maps/package.nix} (73%) rename pkgs/{games/crossfire/crossfire-server.nix => by-name/cr/crossfire-server/package.nix} (75%) delete mode 100644 pkgs/games/crossfire/add-cstdint-include-to-crossfire-server.patch delete mode 100644 pkgs/games/crossfire/default.nix diff --git a/pkgs/games/crossfire/crossfire-arch.nix b/pkgs/by-name/cr/crossfire-arch/package.nix similarity index 73% rename from pkgs/games/crossfire/crossfire-arch.nix rename to pkgs/by-name/cr/crossfire-arch/package.nix index 5b46a61ad61c..ca29d5ababd1 100644 --- a/pkgs/games/crossfire/crossfire-arch.nix +++ b/pkgs/by-name/cr/crossfire-arch/package.nix @@ -2,23 +2,25 @@ stdenv, lib, fetchgit, - version, - rev, - hash, }: stdenv.mkDerivation { pname = "crossfire-arch"; - version = rev; + version = "2025-04"; src = fetchgit { url = "https://git.code.sf.net/p/crossfire/crossfire-arch"; - inherit hash rev; + rev = "876eb50b9199e9aa06175b7a7d85832662be3f78"; + hash = "sha256-jDiAKcjWYvjGiD68LuKlZS4sOR9jW3THp99kAEdE+y0="; }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -a . "$out/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/crossfire/crossfire-client.nix b/pkgs/by-name/cr/crossfire-client/package.nix similarity index 87% rename from pkgs/games/crossfire/crossfire-client.nix rename to pkgs/by-name/cr/crossfire-client/package.nix index af29da33cf68..58bc840c8c1e 100644 --- a/pkgs/games/crossfire/crossfire-client.nix +++ b/pkgs/by-name/cr/crossfire-client/package.nix @@ -22,18 +22,16 @@ SDL2_mixer, libselinux, libsepol, - version, - rev, - hash, }: stdenv.mkDerivation { pname = "crossfire-client"; - version = rev; + version = "2025-01"; src = fetchgit { url = "https://git.code.sf.net/p/crossfire/crossfire-client"; - inherit hash rev; + hash = "sha256-iFm9yVEIBwngr8/0f9TRS4Uw0hnjrW6ngMRfsWY6TX0="; + rev = "c69f578add358c1db567f6b46f532dd038d2ade0"; }; nativeBuildInputs = [ diff --git a/pkgs/games/crossfire/crossfire-maps.nix b/pkgs/by-name/cr/crossfire-maps/package.nix similarity index 73% rename from pkgs/games/crossfire/crossfire-maps.nix rename to pkgs/by-name/cr/crossfire-maps/package.nix index 3bbdb2945167..35575bbaa6b0 100644 --- a/pkgs/games/crossfire/crossfire-maps.nix +++ b/pkgs/by-name/cr/crossfire-maps/package.nix @@ -2,23 +2,25 @@ stdenv, lib, fetchgit, - version, - rev, - hash, }: stdenv.mkDerivation { pname = "crossfire-maps"; - version = rev; + version = "2025-04"; src = fetchgit { url = "https://git.code.sf.net/p/crossfire/crossfire-maps"; - inherit hash rev; + rev = "ec57d473064ed1732adb1897415b56f96fbd9382"; + hash = "sha256-hJOMa8c80T4/NC37NKM270LDHNqWK6NZfKvKnFno9TE="; }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -a . "$out/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/crossfire/crossfire-server.nix b/pkgs/by-name/cr/crossfire-server/package.nix similarity index 75% rename from pkgs/games/crossfire/crossfire-server.nix rename to pkgs/by-name/cr/crossfire-server/package.nix index 8e2368d97d77..58d8d510ff74 100644 --- a/pkgs/games/crossfire/crossfire-server.nix +++ b/pkgs/by-name/cr/crossfire-server/package.nix @@ -1,6 +1,7 @@ { stdenv, lib, + pkgs, fetchgit, autoconf, automake, @@ -10,20 +11,19 @@ check, pkg-config, python3, - version, - rev, - hash, - maps, - arch, + # Included here so that hosts using custom maps/archetypes can easily override. + maps ? pkgs.crossfire-maps, + arch ? pkgs.crossfire-arch, }: stdenv.mkDerivation { pname = "crossfire-server"; - version = rev; + version = "2025-04"; src = fetchgit { url = "https://git.code.sf.net/p/crossfire/crossfire-server"; - inherit hash rev; + rev = "5f742b9f9f785e4a59a3a463bee1f31c9bc67098"; + hash = "sha256-e7e3xN7B1cv9+WkZGzOJgrFer50Cs0L/2dYB9RmGCiE="; }; nativeBuildInputs = [ diff --git a/pkgs/games/crossfire/add-cstdint-include-to-crossfire-server.patch b/pkgs/games/crossfire/add-cstdint-include-to-crossfire-server.patch deleted file mode 100644 index 73c69f533613..000000000000 --- a/pkgs/games/crossfire/add-cstdint-include-to-crossfire-server.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/Treasures.h b/include/Treasures.h -index 614078f..a00b4f6 100644 ---- a/include/Treasures.h -+++ b/include/Treasures.h -@@ -13,6 +13,8 @@ - #ifndef TREASURES_H - #define TREASURES_H - -+#include -+ - #include "AssetsCollection.h" - - extern "C" { diff --git a/pkgs/games/crossfire/default.nix b/pkgs/games/crossfire/default.nix deleted file mode 100644 index 48993b49d8e7..000000000000 --- a/pkgs/games/crossfire/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ callPackage, ... }: - -rec { - crossfire-client = callPackage ./crossfire-client.nix { - version = "latest"; - rev = "c69f578add358c1db567f6b46f532dd038d2ade0"; - hash = "sha256-iFm9yVEIBwngr8/0f9TRS4Uw0hnjrW6ngMRfsWY6TX0="; - }; - - crossfire-server = callPackage ./crossfire-server.nix { - version = "latest"; - rev = "5f742b9f9f785e4a59a3a463bee1f31c9bc67098"; - hash = "sha256-e7e3xN7B1cv9+WkZGzOJgrFer50Cs0L/2dYB9RmGCiE="; - maps = crossfire-maps; - arch = crossfire-arch; - }; - - crossfire-arch = callPackage ./crossfire-arch.nix { - version = "latest"; - rev = "876eb50b9199e9aa06175b7a7d85832662be3f78"; - hash = "sha256-jDiAKcjWYvjGiD68LuKlZS4sOR9jW3THp99kAEdE+y0="; - }; - - crossfire-maps = callPackage ./crossfire-maps.nix { - version = "latest"; - rev = "ec57d473064ed1732adb1897415b56f96fbd9382"; - hash = "sha256-hJOMa8c80T4/NC37NKM270LDHNqWK6NZfKvKnFno9TE="; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index edb35316c35e..826a65dff892 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17238,13 +17238,6 @@ with pkgs; crawl = callPackage ../games/crawl { }; - inherit (import ../games/crossfire pkgs) - crossfire-server - crossfire-arch - crossfire-maps - crossfire-client - ; - curseofwar = callPackage ../games/curseofwar { SDL = null; }; curseofwar-sdl = callPackage ../games/curseofwar { ncurses = null; };