cataclysm-dda: 0.G -> 0.H

Release announcement:
https://cataclysmdda.org/releases/#0h-release-herbert

Changelog:
https://github.com/CleverRaven/Cataclysm-DDA/blob/0.H-RELEASE/data/changelog.txt

+25 -100
+4 -5
pkgs/games/cataclysm-dda/common.nix
··· 1 - { lib, stdenv, runtimeShell, pkg-config, gettext, ncurses, CoreFoundation 2 - , tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa, zlib 3 , debug 4 , useXdgDir 5 }: ··· 10 commonDeps = [ 11 gettext 12 zlib 13 - ] ++ optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ]; 14 15 cursesDeps = commonDeps ++ [ ncurses ]; 16 ··· 22 SDL2_mixer 23 SDL2_ttf 24 freetype 25 - ] 26 - ++ optionals stdenv.hostPlatform.isDarwin [ Cocoa ]; 27 28 patchDesktopFile = '' 29 substituteInPlace $out/share/applications/org.cataclysmdda.CataclysmDDA.desktop \
··· 1 + { lib, stdenv, runtimeShell, pkg-config, gettext, ncurses 2 + , tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, zlib 3 , debug 4 , useXdgDir 5 }: ··· 10 commonDeps = [ 11 gettext 12 zlib 13 + ]; 14 15 cursesDeps = commonDeps ++ [ ncurses ]; 16 ··· 22 SDL2_mixer 23 SDL2_ttf 24 freetype 25 + ]; 26 27 patchDesktopFile = '' 28 substituteInPlace $out/share/applications/org.cataclysmdda.CataclysmDDA.desktop \
+3 -7
pkgs/games/cataclysm-dda/default.nix
··· 1 - { newScope, darwin }: 2 3 let 4 callPackage = newScope self; 5 6 stable = rec { 7 - tiles = callPackage ./stable.nix { 8 - inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa; 9 - }; 10 11 curses = tiles.override { tiles = false; }; 12 }; 13 14 git = rec { 15 - tiles = callPackage ./git.nix { 16 - inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa; 17 - }; 18 19 curses = tiles.override { tiles = false; }; 20 };
··· 1 + { newScope }: 2 3 let 4 callPackage = newScope self; 5 6 stable = rec { 7 + tiles = callPackage ./stable.nix { }; 8 9 curses = tiles.override { tiles = false; }; 10 }; 11 12 git = rec { 13 + tiles = callPackage ./git.nix { }; 14 15 curses = tiles.override { tiles = false; }; 16 };
+4 -4
pkgs/games/cataclysm-dda/git.nix
··· 1 - { lib, callPackage, CoreFoundation, fetchFromGitHub, fetchpatch, pkgs, wrapCDDA, attachPkgs 2 - , tiles ? true, Cocoa 3 , debug ? false 4 , useXdgDir ? false 5 , version ? "2024-07-28" ··· 9 10 let 11 common = callPackage ./common.nix { 12 - inherit CoreFoundation tiles Cocoa debug useXdgDir; 13 }; 14 15 self = common.overrideAttrs (common: rec { ··· 24 25 patches = [ 26 # Unconditionally look for translation files in $out/share/locale 27 - ./locale-path-git.patch 28 ]; 29 30 makeFlags = common.makeFlags ++ [
··· 1 + { lib, callPackage, fetchFromGitHub, fetchpatch, pkgs, wrapCDDA, attachPkgs 2 + , tiles ? true 3 , debug ? false 4 , useXdgDir ? false 5 , version ? "2024-07-28" ··· 9 10 let 11 common = callPackage ./common.nix { 12 + inherit tiles debug useXdgDir; 13 }; 14 15 self = common.overrideAttrs (common: rec { ··· 24 25 patches = [ 26 # Unconditionally look for translation files in $out/share/locale 27 + ./locale-path.patch 28 ]; 29 30 makeFlags = common.makeFlags ++ [
-28
pkgs/games/cataclysm-dda/glibc-2.39.diff
··· 1 - diff --git a/src/debug.cpp b/src/debug.cpp 2 - index fa63a3b..1e8f554 100644 3 - --- a/src/debug.cpp 4 - +++ b/src/debug.cpp 5 - @@ -1494,6 +1494,14 @@ std::string game_info::operating_system() 6 - } 7 - 8 - #if !defined(__CYGWIN__) && !defined (__ANDROID__) && ( defined (__linux__) || defined(unix) || defined(__unix__) || defined(__unix) || ( defined(__APPLE__) && defined(__MACH__) ) || defined(BSD) ) // linux; unix; MacOs; BSD 9 - + // 10 - +class FILEDeleter 11 - +{ 12 - + public: 13 - + void operator()( FILE *f ) const noexcept { 14 - + pclose( f ); 15 - + } 16 - +}; 17 - /** Execute a command with the shell by using `popen()`. 18 - * @param command The full command to execute. 19 - * @note The output buffer is limited to 512 characters. 20 - @@ -1504,7 +1512,7 @@ static std::string shell_exec( const std::string &command ) 21 - std::vector<char> buffer( 512 ); 22 - std::string output; 23 - try { 24 - - std::unique_ptr<FILE, decltype( &pclose )> pipe( popen( command.c_str(), "r" ), pclose ); 25 - + std::unique_ptr<FILE, FILEDeleter> pipe( popen( command.c_str(), "r" ) ); 26 - if( pipe ) { 27 - while( fgets( buffer.data(), buffer.size(), pipe.get() ) != nullptr ) { 28 - output += buffer.data();
···
-17
pkgs/games/cataclysm-dda/locale-path-git.patch
··· 1 - diff --git a/src/translations.cpp b/src/translations.cpp 2 - --- a/src/translations.cpp 3 - +++ b/src/translations.cpp 4 - @@ -52,13 +52,11 @@ std::string locale_dir() 5 - #define CATA_IS_ON_BSD 6 - #endif 7 - 8 - -#if !defined(__ANDROID__) && ((defined(__linux__) || defined(CATA_IS_ON_BSD) || (defined(MACOSX) && !defined(TILES)))) 9 - if( !PATH_INFO::base_path().empty() ) { 10 - loc_dir = PATH_INFO::base_path() + "share/locale"; 11 - } else { 12 - loc_dir = PATH_INFO::langdir(); 13 - } 14 - -#endif 15 - #endif // LOCALIZE 16 - return loc_dir; 17 - }
···
+4 -5
pkgs/games/cataclysm-dda/locale-path.patch
··· 1 diff --git a/src/translations.cpp b/src/translations.cpp 2 - index 76bdfd0..6dd6109 100644 3 --- a/src/translations.cpp 4 +++ b/src/translations.cpp 5 - @@ -61,13 +61,11 @@ std::string locale_dir() 6 - #define BSD 7 #endif 8 - 9 - -#if !defined(__ANDROID__) && ((defined(__linux__) || defined(BSD) || (defined(MACOSX) && !defined(TILES)))) 10 if( !PATH_INFO::base_path().empty() ) { 11 loc_dir = PATH_INFO::base_path() + "share/locale"; 12 } else {
··· 1 diff --git a/src/translations.cpp b/src/translations.cpp 2 --- a/src/translations.cpp 3 +++ b/src/translations.cpp 4 + @@ -52,13 +52,11 @@ std::string locale_dir() 5 + #define CATA_IS_ON_BSD 6 #endif 7 + 8 + -#if !defined(__ANDROID__) && ((defined(__linux__) || defined(CATA_IS_ON_BSD) || (defined(MACOSX) && !defined(TILES)))) 9 if( !PATH_INFO::base_path().empty() ) { 10 loc_dir = PATH_INFO::base_path() + "share/locale"; 11 } else {
+10 -34
pkgs/games/cataclysm-dda/stable.nix
··· 1 { lib 2 , callPackage 3 - , CoreFoundation 4 , fetchFromGitHub 5 , fetchpatch 6 , pkgs 7 , wrapCDDA 8 , attachPkgs 9 , tiles ? true 10 - , Cocoa 11 , debug ? false 12 , useXdgDir ? false 13 }: 14 15 let 16 common = callPackage ./common.nix { 17 - inherit CoreFoundation tiles Cocoa debug useXdgDir; 18 }; 19 20 self = common.overrideAttrs (common: rec { 21 - version = "0.G"; 22 23 src = fetchFromGitHub { 24 owner = "CleverRaven"; 25 repo = "Cataclysm-DDA"; 26 - rev = version; 27 - sha256 = "sha256-Hda0dVVHNeZ8MV5CaCbSpdOCG2iqQEEmXdh16vwIBXk="; 28 }; 29 30 patches = [ 31 - # Unconditionally look for translation files in $out/share/locale 32 - ./locale-path.patch 33 - # Fixes for failing build with GCC 13, remove on updating next release after 0.G 34 - (fetchpatch { 35 - url = "https://sources.debian.org/data/main/c/cataclysm-dda/0.G-4/debian/patches/gcc13-dangling-reference-warning.patch"; 36 - hash = "sha256-9nPbyz49IYBOVHqr7jzCIyS8z/SQgpK4EjEz1fruIPE="; 37 - }) 38 - (fetchpatch { 39 - url = "https://sources.debian.org/data/main/c/cataclysm-dda/0.G-4/debian/patches/gcc13-cstdint.patch"; 40 - hash = "sha256-8IBW2OzAHVgEJZoViQ490n37sl31hA55ePuqDL/lil0="; 41 - }) 42 (fetchpatch { 43 - url = "https://sources.debian.org/data/main/c/cataclysm-dda/0.G-4/debian/patches/gcc13-keyword-requires.patch"; 44 - hash = "sha256-8yvHh0YKC7AC/qzia7AZAfMewMC0RiSepMXpOkMXRd8="; 45 }) 46 - # Fix build w/ glibc-2.39 47 - # From https://github.com/BrettDong/Cataclysm-DDA/commit/9b206e2dc969ad79345596e03c3980bd155d2f48 48 - ./glibc-2.39.diff 49 - ]; 50 - 51 - makeFlags = common.makeFlags ++ [ 52 - # Makefile declares version as 0.F, with no minor release number 53 - "VERSION=${version}" 54 - ]; 55 - 56 - env.NIX_CFLAGS_COMPILE = toString [ 57 - # Needed with GCC 12 58 - "-Wno-error=array-bounds" 59 ]; 60 61 meta = common.meta // { 62 - maintainers = with lib.maintainers; 63 - common.meta.maintainers; 64 changelog = "https://github.com/CleverRaven/Cataclysm-DDA/blob/${version}/data/changelog.txt"; 65 }; 66 });
··· 1 { lib 2 , callPackage 3 , fetchFromGitHub 4 , fetchpatch 5 , pkgs 6 , wrapCDDA 7 , attachPkgs 8 , tiles ? true 9 , debug ? false 10 , useXdgDir ? false 11 }: 12 13 let 14 common = callPackage ./common.nix { 15 + inherit tiles debug useXdgDir; 16 }; 17 18 self = common.overrideAttrs (common: rec { 19 + version = "0.H"; 20 21 src = fetchFromGitHub { 22 owner = "CleverRaven"; 23 repo = "Cataclysm-DDA"; 24 + tag = "${version}-RELEASE"; 25 + sha256 = "sha256-ZCD5qgqYSX7sS+Tc1oNYq9soYwNUUuWamY2uXfLjGoY="; 26 }; 27 28 patches = [ 29 + # fix compilation of the vendored flatbuffers under gcc14 30 (fetchpatch { 31 + name = "fix-flatbuffers-with-gcc14"; 32 + url = "https://github.com/CleverRaven/Cataclysm-DDA/commit/1400b1018ff37196bd24ba4365bd50beb571ac14.patch"; 33 + hash = "sha256-H0jct6lSQxu48eOZ4f8HICxo89qX49Ksw+Xwwtp7iFM="; 34 }) 35 + # Unconditionally look for translation files in $out/share/locale 36 + ./locale-path.patch 37 ]; 38 39 meta = common.meta // { 40 changelog = "https://github.com/CleverRaven/Cataclysm-DDA/blob/${version}/data/changelog.txt"; 41 }; 42 });