vcmi: 1.1.1 -> 1.2.1

This commit is contained in:
Azat Bahawi 2023-05-01 12:13:42 +03:00
parent 6aed0cf741
commit be3a867936
No known key found for this signature in database
GPG Key ID: C8C6BDDB3847F72B

@ -8,6 +8,7 @@
, boost , boost
, cmake , cmake
, ffmpeg , ffmpeg
, fuzzylite
, innoextract , innoextract
, luajit , luajit
, minizip , minizip
@ -15,7 +16,9 @@
, pkg-config , pkg-config
, python3 , python3
, qtbase , qtbase
, qttools
, tbb , tbb
, unshield
, wrapQtAppsHook , wrapQtAppsHook
, zlib , zlib
, testers , testers
@ -24,21 +27,16 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "vcmi"; pname = "vcmi";
version = "1.1.1"; version = "1.2.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "vcmi"; owner = "vcmi";
repo = "vcmi"; repo = "vcmi";
rev = version; rev = version;
fetchSubmodules = true; fetchSubmodules = true;
hash = "sha256-/BHpAXOCLi6d0+/uE79g8p6YO1swizItAwVlPVf/nkQ="; hash = "sha256-F1g3ric23jKetl5aBG5NRpT4LnGXhBKZmGp2hg6Io9s=";
}; };
postPatch = ''
substituteInPlace Version.cpp.in \
--subst-var-by GIT_SHA1 "0000000";
'';
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
ninja ninja
@ -54,21 +52,24 @@ stdenv.mkDerivation rec {
SDL2_ttf SDL2_ttf
boost boost
ffmpeg ffmpeg
fuzzylite
luajit luajit
minizip minizip
qtbase qtbase
qttools
tbb tbb
zlib zlib
]; ];
cmakeFlags = [ cmakeFlags = [
"-DENABLE_TEST:BOOL=NO" "-DENABLE_LUA:BOOL=ON"
"-DENABLE_PCH:BOOL=NO" "-DENABLE_ERM:BOOL=ON"
# Make libvcmi.so discoverable in a non-standard location. "-DENABLE_GITVERSION:BOOL=OFF"
"-DCMAKE_INSTALL_RPATH:STRING=${placeholder "out"}/lib/vcmi" "-DENABLE_PCH:BOOL=OFF"
# Upstream assumes relative value while Nixpkgs passes absolute. "-DENABLE_TEST:BOOL=OFF"
# Both should be allowed: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html "-DFORCE_BUNDLED_MINIZIP:BOOL=OFF"
# Meanwhile work it around by passing a relative value. "-DFORCE_BUNDLED_FL:BOOL=OFF"
"-DCMAKE_INSTALL_RPATH:STRING=$out/lib/vcmi"
"-DCMAKE_INSTALL_BINDIR:STRING=bin" "-DCMAKE_INSTALL_BINDIR:STRING=bin"
"-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_LIBDIR:STRING=lib"
"-DCMAKE_INSTALL_DATAROOTDIR:STRING=share" "-DCMAKE_INSTALL_DATAROOTDIR:STRING=share"
@ -76,9 +77,11 @@ stdenv.mkDerivation rec {
postFixup = '' postFixup = ''
wrapProgram $out/bin/vcmibuilder \ wrapProgram $out/bin/vcmibuilder \
--prefix PATH : "${lib.makeBinPath [ innoextract ]}" --prefix PATH : "${lib.makeBinPath [ innoextract ffmpeg unshield ]}"
''; '';
doCheck = true;
passthru.tests.version = testers.testVersion { passthru.tests.version = testers.testVersion {
package = vcmi; package = vcmi;
command = '' command = ''
@ -88,12 +91,12 @@ stdenv.mkDerivation rec {
}; };
meta = with lib; { meta = with lib; {
description = "Open-source engine for Heroes of Might and Magic III"; description = "An open-source engine for Heroes of Might and Magic III";
homepage = "https://vcmi.eu"; homepage = "https://vcmi.eu";
changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog"; changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog";
license = with licenses; [ gpl2Only cc-by-sa-40 ]; license = with licenses; [ gpl2Only cc-by-sa-40 ];
maintainers = with maintainers; [ azahi ]; maintainers = with maintainers; [ azahi ];
platforms = platforms.linux; platforms = platforms.linux;
mainProgram = "vcmiclient"; mainProgram = "vcmilauncher";
}; };
} }