nixpkgs/pkgs/games/vcmi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

103 lines
1.9 KiB
Nix
Raw Normal View History

2022-09-11 12:40:06 +00:00
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, SDL2_image
, SDL2_mixer
, SDL2_ttf
, boost
, cmake
, ffmpeg
2023-05-01 09:13:42 +00:00
, fuzzylite
2022-09-11 12:40:06 +00:00
, innoextract
, luajit
, minizip
, ninja
, pkg-config
, python3
, qtbase
2023-05-01 09:13:42 +00:00
, qttools
2022-09-11 12:40:06 +00:00
, tbb
2023-05-01 09:13:42 +00:00
, unshield
2022-09-11 12:40:06 +00:00
, wrapQtAppsHook
2024-05-29 08:11:47 +00:00
, xz
2022-09-11 12:40:06 +00:00
, zlib
, testers
, vcmi
}:
stdenv.mkDerivation rec {
pname = "vcmi";
2024-08-05 16:35:43 +00:00
version = "1.5.6";
2022-09-11 12:40:06 +00:00
src = fetchFromGitHub {
owner = "vcmi";
repo = "vcmi";
rev = version;
2024-05-29 08:11:47 +00:00
fetchSubmodules = true;
2024-08-05 16:35:43 +00:00
hash = "sha256-jdqhHxUJchc0d9wy5Fh/ZHJkMPffLP5aldNMg/+bRAM=";
2022-09-11 12:40:06 +00:00
};
nativeBuildInputs = [
cmake
ninja
pkg-config
python3
wrapQtAppsHook
];
buildInputs = [
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
boost
ffmpeg
2023-05-01 09:13:42 +00:00
fuzzylite
2022-09-11 12:40:06 +00:00
luajit
minizip
qtbase
2023-05-01 09:13:42 +00:00
qttools
2022-09-11 12:40:06 +00:00
tbb
2024-05-29 08:11:47 +00:00
xz
2022-09-11 12:40:06 +00:00
zlib
];
cmakeFlags = [
2023-05-01 09:13:42 +00:00
"-DENABLE_LUA:BOOL=ON"
2023-12-09 10:53:31 +00:00
"-DENABLE_ERM:BOOL=ON"
2024-05-29 08:11:47 +00:00
"-DENABLE_GOLDMASTER:BOOL=ON"
2023-05-01 09:13:42 +00:00
"-DENABLE_PCH:BOOL=OFF"
2023-12-09 10:53:31 +00:00
"-DENABLE_TEST:BOOL=OFF" # Tests require HOMM3 data files.
2023-05-01 09:13:42 +00:00
"-DFORCE_BUNDLED_MINIZIP:BOOL=OFF"
"-DFORCE_BUNDLED_FL:BOOL=OFF"
"-DCMAKE_INSTALL_RPATH:STRING=$out/lib/vcmi"
"-DCMAKE_INSTALL_BINDIR:STRING=bin"
2022-09-11 12:40:06 +00:00
"-DCMAKE_INSTALL_LIBDIR:STRING=lib"
"-DCMAKE_INSTALL_DATAROOTDIR:STRING=share"
2022-09-11 12:40:06 +00:00
];
postFixup = ''
wrapProgram $out/bin/vcmibuilder \
2023-05-01 09:13:42 +00:00
--prefix PATH : "${lib.makeBinPath [ innoextract ffmpeg unshield ]}"
2022-09-11 12:40:06 +00:00
'';
passthru.tests.version = testers.testVersion {
package = vcmi;
command = ''
2023-12-09 10:53:31 +00:00
XDG_DATA_HOME="$TMPDIR" XDG_CACHE_HOME="$TMPDIR" XDG_CONFIG_HOME="$TMPDIR" \
2022-09-11 12:40:06 +00:00
vcmiclient --version
'';
};
meta = with lib; {
2023-05-01 09:13:42 +00:00
description = "Open-source engine for Heroes of Might and Magic III";
2022-09-11 12:40:06 +00:00
homepage = "https://vcmi.eu";
2023-12-09 10:53:31 +00:00
changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog.md";
license = with licenses; [ gpl2Plus cc-by-sa-40 ];
2022-09-11 12:40:06 +00:00
maintainers = with maintainers; [ azahi ];
platforms = platforms.linux;
2023-05-01 09:13:42 +00:00
mainProgram = "vcmilauncher";
2022-09-11 12:40:06 +00:00
};
}