summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-09-16 21:38:36 +0100
committerGitHub <noreply@github.com>2022-09-16 21:38:36 +0100
commitbd1afa8a6db0061fd964a1bb2c70a7e37db1f1e4 (patch)
tree995f14d655f5f6c979b537e4140d25899a1056ae
parent88cebdd4c7bb8f292c055e274c64a8c014ccb015 (diff)
parent02646c661e46e929924bca1efdd788460c7b78bf (diff)
Merge pull request #189729 from azahi/vcmi
vcmi: init at 1.0.0
-rw-r--r--pkgs/games/vcmi/default.nix97
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 99 insertions, 0 deletions
diff --git a/pkgs/games/vcmi/default.nix b/pkgs/games/vcmi/default.nix
new file mode 100644
index 000000000000..d16f3870d828
--- /dev/null
+++ b/pkgs/games/vcmi/default.nix
@@ -0,0 +1,97 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
+, SDL2_image
+, SDL2_mixer
+, SDL2_ttf
+, boost
+, cmake
+, ffmpeg
+, innoextract
+, luajit
+, minizip
+, ninja
+, pkg-config
+, python3
+, qtbase
+, tbb
+, wrapQtAppsHook
+, zlib
+, testers
+, vcmi
+}:
+
+stdenv.mkDerivation rec {
+ pname = "vcmi";
+ version = "1.0.0";
+
+ src = fetchFromGitHub {
+ owner = "vcmi";
+ repo = "vcmi";
+ rev = version;
+ fetchSubmodules = true;
+ hash = "sha256-5PuFq6wDSj5Ye2fUjqcr/VRU0ocus6h2nn+myQTOrhU=";
+ };
+
+ postPatch = ''
+ substituteInPlace Version.cpp.in \
+ --subst-var-by GIT_SHA1 "0000000";
+ '';
+
+ nativeBuildInputs = [
+ cmake
+ ninja
+ pkg-config
+ python3
+ wrapQtAppsHook
+ ];
+
+ buildInputs = [
+ SDL2
+ SDL2_image
+ SDL2_mixer
+ SDL2_ttf
+ boost
+ ffmpeg
+ luajit
+ minizip
+ qtbase
+ tbb
+ zlib
+ ];
+
+ cmakeFlags = [
+ "-DENABLE_TEST:BOOL=NO"
+ "-DENABLE_PCH:BOOL=NO"
+ # Make libvcmi.so discoverable in a non-standard location.
+ "-DCMAKE_INSTALL_RPATH:STRING=${placeholder "out"}/lib/vcmi"
+ # Upstream assumes relative value while Nixpkgs passes absolute.
+ # Both should be allowed: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
+ # Meanwhile work it around by passing a relative value.
+ "-DCMAKE_INSTALL_LIBDIR:STRING=lib"
+ ];
+
+ postFixup = ''
+ wrapProgram $out/bin/vcmibuilder \
+ --prefix PATH : "${lib.makeBinPath [ innoextract ]}"
+ '';
+
+ 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; {
+ description = "Open-source engine for Heroes of Might and Magic III";
+ 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;
+ mainProgram = "vcmiclient";
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cfafedc083a3..cc020572f8f7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12018,6 +12018,8 @@ with pkgs;
vcftools = callPackage ../applications/science/biology/vcftools { };
+ vcmi = libsForQt5.callPackage ../games/vcmi { };
+
vcsh = callPackage ../applications/version-management/vcsh { };
vcs_query = callPackage ../tools/misc/vcs_query { };