From 8124a94557dc7d13608cdef3d5cdfb47d8b5f2c8 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Fri, 18 Apr 2025 13:35:35 -0400 Subject: [PATCH 1/5] crossfire-server: r22111 -> git@2025-04-16 This updates the server, maps, and archetypes in lockstep, since changes to the server means it needs updated data files and changes to the data need the new server to load them. It also updates the build configuration to use the new git repo, and drops the no longer needed cstdint patch. --- pkgs/games/crossfire/crossfire-arch.nix | 11 +++++------ pkgs/games/crossfire/crossfire-maps.nix | 11 +++++------ pkgs/games/crossfire/crossfire-server.nix | 16 +++++----------- pkgs/games/crossfire/default.nix | 12 ++++++------ 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/pkgs/games/crossfire/crossfire-arch.nix b/pkgs/games/crossfire/crossfire-arch.nix index 0d3b3c0e6ed2..5b46a61ad61c 100644 --- a/pkgs/games/crossfire/crossfire-arch.nix +++ b/pkgs/games/crossfire/crossfire-arch.nix @@ -1,20 +1,19 @@ { stdenv, lib, - fetchsvn, + fetchgit, version, rev, - sha256, + hash, }: stdenv.mkDerivation { pname = "crossfire-arch"; version = rev; - src = fetchsvn { - url = "http://svn.code.sf.net/p/crossfire/code/arch/trunk/"; - inherit sha256; - rev = "r${rev}"; + src = fetchgit { + url = "https://git.code.sf.net/p/crossfire/crossfire-arch"; + inherit hash rev; }; installPhase = '' diff --git a/pkgs/games/crossfire/crossfire-maps.nix b/pkgs/games/crossfire/crossfire-maps.nix index 32f2330b23b8..3bbdb2945167 100644 --- a/pkgs/games/crossfire/crossfire-maps.nix +++ b/pkgs/games/crossfire/crossfire-maps.nix @@ -1,20 +1,19 @@ { stdenv, lib, - fetchsvn, + fetchgit, version, rev, - sha256, + hash, }: stdenv.mkDerivation { pname = "crossfire-maps"; version = rev; - src = fetchsvn { - url = "http://svn.code.sf.net/p/crossfire/code/maps/trunk/"; - inherit sha256; - rev = "r${rev}"; + src = fetchgit { + url = "https://git.code.sf.net/p/crossfire/crossfire-maps"; + inherit hash rev; }; installPhase = '' diff --git a/pkgs/games/crossfire/crossfire-server.nix b/pkgs/games/crossfire/crossfire-server.nix index 435d87beb547..8e2368d97d77 100644 --- a/pkgs/games/crossfire/crossfire-server.nix +++ b/pkgs/games/crossfire/crossfire-server.nix @@ -1,7 +1,7 @@ { stdenv, lib, - fetchsvn, + fetchgit, autoconf, automake, libtool, @@ -12,7 +12,7 @@ python3, version, rev, - sha256, + hash, maps, arch, }: @@ -21,16 +21,11 @@ stdenv.mkDerivation { pname = "crossfire-server"; version = rev; - src = fetchsvn { - url = "http://svn.code.sf.net/p/crossfire/code/server/trunk/"; - inherit sha256; - rev = "r${rev}"; + src = fetchgit { + url = "https://git.code.sf.net/p/crossfire/crossfire-server"; + inherit hash rev; }; - patches = [ - ./add-cstdint-include-to-crossfire-server.patch - ]; - nativeBuildInputs = [ autoconf automake @@ -56,7 +51,6 @@ stdenv.mkDerivation { ''; meta = with lib; { - broken = true; # cfpython.c:63:10: fatal error: node.h: No such file or directory description = "Server for the Crossfire free MMORPG"; homepage = "http://crossfire.real-time.com/"; license = licenses.gpl2Plus; diff --git a/pkgs/games/crossfire/default.nix b/pkgs/games/crossfire/default.nix index f494592d6f0a..6ce42386c036 100644 --- a/pkgs/games/crossfire/default.nix +++ b/pkgs/games/crossfire/default.nix @@ -9,21 +9,21 @@ rec { crossfire-server = callPackage ./crossfire-server.nix { version = "latest"; - rev = "22111"; - sha256 = "04fjif6zv642n2zlw27cgzkak2kknwrxqzg42bvzl7q901bsr9l7"; + rev = "5f742b9f9f785e4a59a3a463bee1f31c9bc67098"; + hash = "sha256-e7e3xN7B1cv9+WkZGzOJgrFer50Cs0L/2dYB9RmGCiE="; maps = crossfire-maps; arch = crossfire-arch; }; crossfire-arch = callPackage ./crossfire-arch.nix { version = "latest"; - rev = "22111"; - sha256 = "0l4rp3idvbhknpxxs0w4i4nqfg01wblzm4v4j375xwxxbf00j0ms"; + rev = "876eb50b9199e9aa06175b7a7d85832662be3f78"; + hash = "sha256-jDiAKcjWYvjGiD68LuKlZS4sOR9jW3THp99kAEdE+y0="; }; crossfire-maps = callPackage ./crossfire-maps.nix { version = "latest"; - rev = "22111"; - sha256 = "1dwfc84acjvbjgjakkb8z8pdlksbsn90j0z8z8rq37lqx0kx1sap"; + rev = "ec57d473064ed1732adb1897415b56f96fbd9382"; + hash = "sha256-hJOMa8c80T4/NC37NKM270LDHNqWK6NZfKvKnFno9TE="; }; } From 4bf4ae1bba65071717a8175f8e096a7a3951ab62 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Fri, 18 Apr 2025 13:54:04 -0400 Subject: [PATCH 2/5] crossfire-client: 0.75.0 -> git@2025-01-06 Latest stable is last year, and there have been some significant fixes and features since. There's also a gtk3 branch now, but it's not ready for general use, so this just updates the gtk2 version. --- pkgs/games/crossfire/crossfire-client.nix | 23 +++++++++++------------ pkgs/games/crossfire/default.nix | 6 +++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pkgs/games/crossfire/crossfire-client.nix b/pkgs/games/crossfire/crossfire-client.nix index 2d3401914109..af29da33cf68 100644 --- a/pkgs/games/crossfire/crossfire-client.nix +++ b/pkgs/games/crossfire/crossfire-client.nix @@ -1,7 +1,7 @@ { stdenv, lib, - fetchsvn, + fetchgit, cmake, pkg-config, perl, @@ -17,24 +17,23 @@ xorg, util-linux, curl, - SDL, - SDL_image, - SDL_mixer, + SDL2, + SDL2_image, + SDL2_mixer, libselinux, libsepol, version, rev, - sha256, + hash, }: stdenv.mkDerivation { pname = "crossfire-client"; version = rev; - src = fetchsvn { - url = "http://svn.code.sf.net/p/crossfire/code/client/trunk/"; - inherit sha256; - rev = "r${rev}"; + src = fetchgit { + url = "https://git.code.sf.net/p/crossfire/crossfire-client"; + inherit hash rev; }; nativeBuildInputs = [ @@ -55,9 +54,9 @@ stdenv.mkDerivation { xorg.libpthreadstubs xorg.libXdmcp curl - SDL - SDL_image - SDL_mixer + SDL2 + SDL2_image + SDL2_mixer util-linux libselinux libsepol diff --git a/pkgs/games/crossfire/default.nix b/pkgs/games/crossfire/default.nix index 6ce42386c036..48993b49d8e7 100644 --- a/pkgs/games/crossfire/default.nix +++ b/pkgs/games/crossfire/default.nix @@ -2,9 +2,9 @@ rec { crossfire-client = callPackage ./crossfire-client.nix { - version = "1.75.0"; - rev = "21760"; - sha256 = "0b42sak8hj60nywfswkps777asy9p8r9wsn7pmj2nqbd29ng1p9d"; + version = "latest"; + rev = "c69f578add358c1db567f6b46f532dd038d2ade0"; + hash = "sha256-iFm9yVEIBwngr8/0f9TRS4Uw0hnjrW6ngMRfsWY6TX0="; }; crossfire-server = callPackage ./crossfire-server.nix { From 80956ee6b7b48841f7357d27728e20170ed174a2 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Fri, 18 Apr 2025 14:45:35 -0400 Subject: [PATCH 3/5] 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; }; From b622ce87a8996d78a438ad74b71e8b04cdc79a00 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Fri, 18 Apr 2025 21:47:55 -0400 Subject: [PATCH 4/5] crossfire-jxclient: init at 2025-01 This is an alternate, fullscreen, Java-based client for Crossfire, usable on the same servers as the "main" GTK client. As with many things Crossfire, it hasn't had an official release in a long time but is still under active development, so I identify it by date of commit. --- .../by-name/cr/crossfire-jxclient/package.nix | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pkgs/by-name/cr/crossfire-jxclient/package.nix diff --git a/pkgs/by-name/cr/crossfire-jxclient/package.nix b/pkgs/by-name/cr/crossfire-jxclient/package.nix new file mode 100644 index 000000000000..e5297d6fab50 --- /dev/null +++ b/pkgs/by-name/cr/crossfire-jxclient/package.nix @@ -0,0 +1,73 @@ +{ + stdenv, + lib, + fetchgit, + makeWrapper, + gradle, + jre, + ffmpeg, +}: + +stdenv.mkDerivation rec { + name = "crossfire-jxclient"; + version = "2025-01"; + + src = fetchgit { + url = "https://git.code.sf.net/p/crossfire/jxclient"; + rev = "01471f0fdf7a5fd8b4ea6d5b49bde7edead5c505"; + hash = "sha256-NGBj3NUBZIfS9J3FHqER8lblPuFEEH9dsTKFBqioiik="; + # For some reason, submodule fetching fails in nix even though it works in + # the shell. So we fetch the sounds repo separately below. + fetchSubmodules = false; + }; + + sounds = fetchgit { + url = "https://git.code.sf.net/p/crossfire/crossfire-sounds"; + rev = "b53f436e1d1cca098c641f34c46f15c828ea9c8f"; + hash = "sha256-zA+SaQAaNxNroHESCSonDiUsCuCzjZp+WZNzvsJHNXY="; + }; + + nativeBuildInputs = [ + jre + gradle + makeWrapper + ffmpeg + ]; + + patchPhase = '' + runHook prePatch + + rm -rf sounds + ln -s ${sounds} sounds + + runHook postPatch + ''; + + buildPhase = '' + runHook preBuild + gradle :createJar + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -pv $out/share/java $out/bin + cp jxclient.jar $out/share/java/jxclient.jar + + makeWrapper ${jre}/bin/java $out/bin/crossfire-jxclient \ + --add-flags "-jar $out/share/java/jxclient.jar" \ + --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=on' \ + --set _JAVA_AWT_WM_NONREPARENTING 1 + + runHook postInstall + ''; + + meta = with lib; { + description = "Java-based fullscreen client for the Crossfire free MMORPG"; + homepage = "http://crossfire.real-time.com/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + }; +} From 2386aba1fdc41f1c3047e7b176127fa47e2efae7 Mon Sep 17 00:00:00 2001 From: Rebecca Kelly Date: Sat, 19 Apr 2025 11:28:38 -0400 Subject: [PATCH 5/5] crossfire-gridarta: init at 2025-04 This is the editor for Crossfire map and archetype data. --- .../by-name/cr/crossfire-gridarta/package.nix | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 pkgs/by-name/cr/crossfire-gridarta/package.nix diff --git a/pkgs/by-name/cr/crossfire-gridarta/package.nix b/pkgs/by-name/cr/crossfire-gridarta/package.nix new file mode 100644 index 000000000000..59d274d9774b --- /dev/null +++ b/pkgs/by-name/cr/crossfire-gridarta/package.nix @@ -0,0 +1,53 @@ +{ + stdenv, + lib, + fetchgit, + makeWrapper, + jre, + gradle, +}: + +stdenv.mkDerivation rec { + name = "crossfire-gridarta"; + version = "2025-04"; + + src = fetchgit { + url = "https://git.code.sf.net/p/gridarta/gridarta"; + rev = "9ff39a63071fc76141117eac97a27c07d312cfb5"; + hash = "sha256-UotvRJey0SXhKjyKo0L7MiDtqvsBOUcT0315fkAKwb0="; + }; + + nativeBuildInputs = [ + jre + gradle + makeWrapper + ]; + + buildPhase = '' + runHook preBuild + gradle :src:crossfire:createEditorJar + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -pv $out/share/java $out/bin + cp src/crossfire/build/libs/CrossfireEditor.jar $out/share/java/ + + makeWrapper ${jre}/bin/java $out/bin/crossfire-gridarta \ + --add-flags "-jar $out/share/java/CrossfireEditor.jar" \ + --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=on' \ + --set _JAVA_AWT_WM_NONREPARENTING 1 + + runHook postInstall + ''; + + meta = with lib; { + description = "Map and archetype editor for the Crossfire free MMORPG"; + homepage = "http://crossfire.real-time.com/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + }; +}