pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / cataclysm-dda / stable.nix
blob5c3ccb4bf28764b88bb05ad6804273fe6f4f04d7
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
15 let
16   common = callPackage ./common.nix {
17     inherit CoreFoundation tiles Cocoa debug useXdgDir;
18   };
20   self = common.overrideAttrs (common: rec {
21     version = "0.G";
23     src = fetchFromGitHub {
24       owner = "CleverRaven";
25       repo = "Cataclysm-DDA";
26       rev = version;
27       sha256 = "sha256-Hda0dVVHNeZ8MV5CaCbSpdOCG2iqQEEmXdh16vwIBXk=";
28     };
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     ];
51     makeFlags = common.makeFlags ++ [
52       # Makefile declares version as 0.F, with no minor release number
53       "VERSION=${version}"
54     ];
56     env.NIX_CFLAGS_COMPILE = toString [
57       # Needed with GCC 12
58       "-Wno-error=array-bounds"
59     ];
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   });
69 attachPkgs pkgs self