public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: games-strategy/homm2-gold-gog/
@ 2023-06-19 20:15 James Le Cuirot
  0 siblings, 0 replies; only message in thread
From: James Le Cuirot @ 2023-06-19 20:15 UTC (permalink / raw
  To: gentoo-commits

commit:     9603c7f75f4c4d524accea7aa7bb330d6f8efc4c
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Mon May 29 22:37:05 2023 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 19 20:14:30 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9603c7f7

games-strategy/homm2-gold-gog: new package, add 1.1.2.1.33438

Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/31222
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 games-strategy/homm2-gold-gog/Manifest             |  2 +
 .../homm2-gold-gog-1.1.2.1.33438.ebuild            | 73 ++++++++++++++++++++++
 games-strategy/homm2-gold-gog/metadata.xml         | 16 +++++
 3 files changed, 91 insertions(+)

diff --git a/games-strategy/homm2-gold-gog/Manifest b/games-strategy/homm2-gold-gog/Manifest
new file mode 100644
index 000000000000..6b304eae8e3d
--- /dev/null
+++ b/games-strategy/homm2-gold-gog/Manifest
@@ -0,0 +1,2 @@
+DIST homm_2_ost_flac.zip 350318438 BLAKE2B d87dd7a97a74c28f6f6f969d7c46e9a8f8a8db8222f1d8ca9e9e0c28a5848bef257c4eaabc8148d0c0b1828103a3c4091f041111f8f94f33ce378e75df1d93e1 SHA512 41bbd3578ca7d0e19a6a0346740af3386c6349c1ed198b9315d53c8e2166d1f9add5d58e217028131d5f2227ec81ad044b4bf22b6a14b96e050d05f7af65584f
+DIST setup_heroes_of_might_and_magic_2_gold_1.01_(2.1)_(33438).exe 489016360 BLAKE2B 17d77c8d2448eec94febd4d7a3a03fbeed97d5af77f7eb2f5c48ef3999df546bdc3ab403e3f151902907e05e16d3cf8fc5a12845e76c52f39eaaa343aab7fe05 SHA512 60d3ab715dbfeb32cf4b9b033d97bf557cceefd0c1ecb2004aef3379bc209d533ca0e4f9ef14658e0c8bd6353ea14f12a58808b5cae1c922256d26b86938aa4a

diff --git a/games-strategy/homm2-gold-gog/homm2-gold-gog-1.1.2.1.33438.ebuild b/games-strategy/homm2-gold-gog/homm2-gold-gog-1.1.2.1.33438.ebuild
new file mode 100644
index 000000000000..d4d93866acd7
--- /dev/null
+++ b/games-strategy/homm2-gold-gog/homm2-gold-gog-1.1.2.1.33438.ebuild
@@ -0,0 +1,73 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Data files for HoMM II Gold from gog.com"
+HOMEPAGE="https://www.gog.com/en/game/heroes_of_might_and_magic_2_gold_edition"
+SRC_URI="
+	setup_heroes_of_might_and_magic_2_gold_1.01_(2.1)_(33438).exe
+	flac? ( homm_2_ost_flac.zip )
+"
+
+LICENSE="GOG-EULA"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="flac"
+RESTRICT="bindist fetch"
+
+DEPEND="games-engines/fheroes2"
+RDEPEND="
+	${DEPEND}
+	!games-strategy/homm2-demo
+"
+BDEPEND="
+	app-arch/innoextract
+	flac? ( app-arch/unzip )
+"
+
+S="${WORKDIR}"
+
+pkg_nofetch() {
+	einfo "Please buy and download ${SRC_URI} from:"
+	einfo "  ${HOMEPAGE}"
+	einfo "and move it to your distfiles directory."
+}
+
+src_install() {
+	mkdir -p "${ED}/usr/share/fheroes2/" || die
+	"${ESYSROOT}"/usr/share/fheroes2/extract_homm2_resources.sh \
+		"${DISTDIR}"/setup_heroes*.exe \
+		"${ED}/usr/share/fheroes2/" || die
+	chmod -R a+r "${ED}/usr/share/fheroes2/anim" || die
+
+	if use flac; then
+		rm -r "${ED}/usr/share/fheroes2/music" || die
+		cd homm_2_ost_flac || die
+		# This abomination is loosely based on
+		# https://github.com/ihhub/fheroes2/blob/48c4740e9349c04209a204b9627ebd174a5051e5/script/homm2/resource_extraction_toolset.ps1#L52
+		for ((i=1; i<=43; i++)); do
+			local ii="$(printf "%.2d" "${i}")"
+			local filename="$(echo *${ii}*)"
+			local extension="${filename##*.}"
+			if ((i>=5 && i<=10)); then
+				insinto /usr/share/fheroes2/music/sw
+				newins "${filename}" "Track${ii}.${extension}"
+
+				local pol=$((i+39))
+				local polfile=$(echo *${pol}*)
+				local polext="${polfile##*.}"
+				insinto /usr/share/fheroes2/music/pol
+				newins "${polfile}" "Track${ii}.${polext}"
+			else
+				insinto /usr/share/fheroes2/music
+				newins "${filename}" "Track${ii}.${extension}"
+			fi
+		done
+		cp "${ED}"/usr/share/fheroes2/music/pol/* "${ED}"/usr/share/fheroes2/music/ || die
+	fi
+}
+
+pkg_postinst() {
+	elog "Run the game using ${EPREFIX}/usr/bin/fheroes2"
+}

diff --git a/games-strategy/homm2-gold-gog/metadata.xml b/games-strategy/homm2-gold-gog/metadata.xml
new file mode 100644
index 000000000000..b527e33f3679
--- /dev/null
+++ b/games-strategy/homm2-gold-gog/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>alexey+gentoo@asokolov.org</email>
+		<name>Alexey Sokolov</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>games@gentoo.org</email>
+		<name>Gentoo Games Project</name>
+	</maintainer>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-19 20:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19 20:15 [gentoo-commits] repo/gentoo:master commit in: games-strategy/homm2-gold-gog/ James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox