commit:     e478c4fe27a9f64db6413699c7b19ccdf76d155e
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Fri Jun 13 07:47:26 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul  4 20:01:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e478c4fe

games-engines/fheroes2: add 1.1.9

Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/42573
Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-engines/fheroes2/Manifest              |  1 +
 games-engines/fheroes2/fheroes2-1.1.9.ebuild | 82 ++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/games-engines/fheroes2/Manifest b/games-engines/fheroes2/Manifest
index fddc6db72073..83b1604a3aac 100644
--- a/games-engines/fheroes2/Manifest
+++ b/games-engines/fheroes2/Manifest
@@ -1 +1,2 @@
 DIST fheroes2-1.1.8.tar.gz 12293726 BLAKE2B 
3245e699a845c42b7895243246f9bd8577261e9408381a6e3033db4aa1bf67841b48c94a8e0bd8d75e710789df681a0fa69b51bce490c4812bb32ac55027de21
 SHA512 
475fa3525fe2bf51014751dc27181b86220c73336f64fb3940b664701d0be5beadf5f42fd8b00749b8df44520e5c51709faaa08fd2ec98a11dcfa2c74b9872ae
+DIST fheroes2-1.1.9.tar.gz 12435585 BLAKE2B 
f8363a7c06682d28bc8a8c4f566bef0da053eae7f5fb48082a999f222d1778cc4d288074ee6e76fd01a6bf18cd0d6ef9bccca0946c9b914fc2852281f1dc086a
 SHA512 
8e54f0f8074b03ca383fe630e6cefa8b1d01db5a59b27587dc965b78d4caccdf5271ae7c9964a8aaa7ece8b483d20672d31afd8b30f6da0676e071f9eef8fc29

diff --git a/games-engines/fheroes2/fheroes2-1.1.9.ebuild 
b/games-engines/fheroes2/fheroes2-1.1.9.ebuild
new file mode 100644
index 000000000000..ed88993e3571
--- /dev/null
+++ b/games-engines/fheroes2/fheroes2-1.1.9.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..13} )
+inherit cmake python-single-r1 xdg
+
+DESCRIPTION="Recreation of HoMM2 game engine"
+HOMEPAGE="https://ihhub.github.io/fheroes2/";
+SRC_URI="https://github.com/ihhub/fheroes2/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+IUSE="tools"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+       media-libs/libpng:=
+       media-libs/libsdl2[video]
+       media-libs/sdl2-image
+       media-libs/sdl2-mixer
+       sys-libs/zlib
+"
+RDEPEND="
+       ${DEPEND}
+       ${PYTHON_DEPS}
+       app-arch/libarchive
+       virtual/libintl
+"
+BDEPEND="
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}/fheroes2-1.0.4-scripts.patch"
+)
+
+src_prepare() {
+       sed -i -e "s/python3/${EPYTHON}/" 
script/homm2/extract_homm2_resources.sh || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       # Not using dev-games/libsmacker because the game crashes with it
+       local mycmakeargs=(
+               -DENABLE_IMAGE=ON
+               -DENABLE_TOOLS=$(usex tools)
+       )
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake_src_compile
+       emake -C files/lang
+}
+
+src_install() {
+       cmake_src_install
+
+       if use tools; then
+               local file
+               for file in 82m2wav bin2txt extractor h2dmgr icn2img pal2img 
til2img xmi2midi; do
+                       newbin "${BUILD_DIR}/${file}" "fheroes2-${file}"
+               done
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       elog "You need original HoMM2 data files to play fheroes2."
+       elog "If you have an installer (.exe) from GOG, install:"
+       elog "  games-strategy/homm2-gold-gog"
+       elog "If you have the original game installed somewhere already, run:"
+       elog "  ${EPREFIX}/usr/share/fheroes2/extract_homm2_resources.sh"
+       elog "Also you can automatically get a demo version for free by 
installing:"
+       elog "  games-strategy/homm2-demo"
+}

Reply via email to