2022-09-11 14:40:06 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, SDL2_mixer
|
|
|
|
, SDL2_ttf
|
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, ffmpeg
|
2023-05-01 11:13:42 +02:00
|
|
|
, fuzzylite
|
2022-09-11 14:40:06 +02:00
|
|
|
, innoextract
|
|
|
|
, luajit
|
|
|
|
, minizip
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, qtbase
|
2023-05-01 11:13:42 +02:00
|
|
|
, qttools
|
2022-09-11 14:40:06 +02:00
|
|
|
, tbb
|
2023-05-01 11:13:42 +02:00
|
|
|
, unshield
|
2022-09-11 14:40:06 +02:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, zlib
|
|
|
|
, testers
|
|
|
|
, vcmi
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vcmi";
|
2023-05-01 11:13:42 +02:00
|
|
|
version = "1.2.1";
|
2022-09-11 14:40:06 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vcmi";
|
|
|
|
repo = "vcmi";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2023-05-01 11:13:42 +02:00
|
|
|
hash = "sha256-F1g3ric23jKetl5aBG5NRpT4LnGXhBKZmGp2hg6Io9s=";
|
2022-09-11 14:40:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
SDL2_mixer
|
|
|
|
SDL2_ttf
|
|
|
|
boost
|
|
|
|
ffmpeg
|
2023-05-01 11:13:42 +02:00
|
|
|
fuzzylite
|
2022-09-11 14:40:06 +02:00
|
|
|
luajit
|
|
|
|
minizip
|
|
|
|
qtbase
|
2023-05-01 11:13:42 +02:00
|
|
|
qttools
|
2022-09-11 14:40:06 +02:00
|
|
|
tbb
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2023-05-01 11:13:42 +02:00
|
|
|
"-DENABLE_LUA:BOOL=ON"
|
|
|
|
"-DENABLE_ERM:BOOL=ON"
|
|
|
|
"-DENABLE_GITVERSION:BOOL=OFF"
|
|
|
|
"-DENABLE_PCH:BOOL=OFF"
|
|
|
|
"-DENABLE_TEST:BOOL=OFF"
|
|
|
|
"-DFORCE_BUNDLED_MINIZIP:BOOL=OFF"
|
|
|
|
"-DFORCE_BUNDLED_FL:BOOL=OFF"
|
|
|
|
"-DCMAKE_INSTALL_RPATH:STRING=$out/lib/vcmi"
|
2023-02-03 20:20:51 +01:00
|
|
|
"-DCMAKE_INSTALL_BINDIR:STRING=bin"
|
2022-09-11 14:40:06 +02:00
|
|
|
"-DCMAKE_INSTALL_LIBDIR:STRING=lib"
|
2023-02-03 20:20:51 +01:00
|
|
|
"-DCMAKE_INSTALL_DATAROOTDIR:STRING=share"
|
2022-09-11 14:40:06 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/vcmibuilder \
|
2023-05-01 11:13:42 +02:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ innoextract ffmpeg unshield ]}"
|
2022-09-11 14:40:06 +02:00
|
|
|
'';
|
|
|
|
|
2023-05-01 11:13:42 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
2022-09-11 14:40:06 +02:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = vcmi;
|
|
|
|
command = ''
|
|
|
|
XDG_DATA_HOME=$PWD XDG_CACHE_HOME=$PWD XDG_CONFIG_HOME=$PWD \
|
|
|
|
vcmiclient --version
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-05-01 11:13:42 +02:00
|
|
|
description = "An open-source engine for Heroes of Might and Magic III";
|
2022-09-11 14:40:06 +02:00
|
|
|
homepage = "https://vcmi.eu";
|
|
|
|
changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog";
|
|
|
|
license = with licenses; [ gpl2Only cc-by-sa-40 ];
|
|
|
|
maintainers = with maintainers; [ azahi ];
|
|
|
|
platforms = platforms.linux;
|
2023-05-01 11:13:42 +02:00
|
|
|
mainProgram = "vcmilauncher";
|
2022-09-11 14:40:06 +02:00
|
|
|
};
|
|
|
|
}
|