pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / vcmi / default.nix
bloba6bc05d8bbff519f211aa2bcf54ff57debe7c269
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , SDL2
5 , SDL2_image
6 , SDL2_mixer
7 , SDL2_ttf
8 , boost
9 , cmake
10 , ffmpeg
11 , fuzzylite
12 , innoextract
13 , luajit
14 , minizip
15 , ninja
16 , pkg-config
17 , python3
18 , qtbase
19 , qttools
20 , tbb
21 , unshield
22 , wrapQtAppsHook
23 , xz
24 , zlib
25 , testers
26 , vcmi
29 stdenv.mkDerivation rec {
30   pname = "vcmi";
31   version = "1.5.7";
33   src = fetchFromGitHub {
34     owner = "vcmi";
35     repo = "vcmi";
36     rev = version;
37     fetchSubmodules = true;
38     hash = "sha256-Op5cnp/gO3PPv/QyrashFDBCyqwlO6wkv5Ni5jpRWd8=";
39   };
41   nativeBuildInputs = [
42     cmake
43     ninja
44     pkg-config
45     python3
46     wrapQtAppsHook
47   ];
49   buildInputs = [
50     SDL2
51     SDL2_image
52     SDL2_mixer
53     SDL2_ttf
54     boost
55     ffmpeg
56     fuzzylite
57     luajit
58     minizip
59     qtbase
60     qttools
61     tbb
62     xz
63     zlib
64   ];
66   cmakeFlags = [
67     "-DENABLE_LUA:BOOL=ON"
68     "-DENABLE_ERM:BOOL=ON"
69     "-DENABLE_GOLDMASTER:BOOL=ON"
70     "-DENABLE_PCH:BOOL=OFF"
71     "-DENABLE_TEST:BOOL=OFF" # Tests require HOMM3 data files.
72     "-DFORCE_BUNDLED_MINIZIP:BOOL=OFF"
73     "-DFORCE_BUNDLED_FL:BOOL=OFF"
74     "-DCMAKE_INSTALL_RPATH:STRING=$out/lib/vcmi"
75     "-DCMAKE_INSTALL_BINDIR:STRING=bin"
76     "-DCMAKE_INSTALL_LIBDIR:STRING=lib"
77     "-DCMAKE_INSTALL_DATAROOTDIR:STRING=share"
78   ];
80   postFixup = ''
81     wrapProgram $out/bin/vcmibuilder \
82       --prefix PATH : "${lib.makeBinPath [ innoextract ffmpeg unshield ]}"
83   '';
85   passthru.tests.version = testers.testVersion {
86     package = vcmi;
87     command = ''
88       XDG_DATA_HOME="$TMPDIR" XDG_CACHE_HOME="$TMPDIR" XDG_CONFIG_HOME="$TMPDIR" \
89         vcmiclient --version
90     '';
91   };
93   meta = with lib; {
94     description = "Open-source engine for Heroes of Might and Magic III";
95     homepage = "https://vcmi.eu";
96     changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog.md";
97     license = with licenses; [ gpl2Plus cc-by-sa-40 ];
98     maintainers = with maintainers; [ azahi ];
99     platforms = platforms.linux;
100     mainProgram = "vcmilauncher";
101   };