commit:     18a6f5c9cf0c85a300cd8eac4610d6a64b3e9ce7
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 19 05:32:34 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 05:53:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18a6f5c9

games-emulation/pcsx2_patches: add 0_p20231117

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-emulation/pcsx2_patches/Manifest             |  1 +
 .../pcsx2_patches/pcsx2_patches-0_p20231117.ebuild | 55 ++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/games-emulation/pcsx2_patches/Manifest 
b/games-emulation/pcsx2_patches/Manifest
index 93eb1b0071c9..459675564d27 100644
--- a/games-emulation/pcsx2_patches/Manifest
+++ b/games-emulation/pcsx2_patches/Manifest
@@ -1 +1,2 @@
 DIST pcsx2_patches-0_p20231015.tar.gz 626844 BLAKE2B 
cde4e81aa354839f4e49a20cbf3d375704b9a09cf30283bfe61c0b2fcd213dd0e33431875eba3d7f5fc4ca45cb779ba1916f787464a922a5cfc484e75b727205
 SHA512 
6a53806ff8f348946539fb3f960e91bc40d01f8c7d6acd2e07cfbea938bd5abf4d820b1c26f19b46d103438d32325c02942a879ce3f500e30a6f5fe8b776d46c
+DIST pcsx2_patches-0_p20231117.tar.gz 638316 BLAKE2B 
331d2ceec0c9e10d5b8cf344a432561173083a37000f8fa3f3890e001a588884e7253bf93d5ca624d36489c9e2f4c0a865de3357d415e9f25d422bedd1106b93
 SHA512 
7a55a70627b045fd426e88c94e72f191adf72ee01917f9963d4bbfc4a9f96e361efb7bb86487aec4067886458779b42228fd0c5c62f2f07dfada99ba89550d8c

diff --git a/games-emulation/pcsx2_patches/pcsx2_patches-0_p20231117.ebuild 
b/games-emulation/pcsx2_patches/pcsx2_patches-0_p20231117.ebuild
new file mode 100644
index 000000000000..d90b0959a70f
--- /dev/null
+++ b/games-emulation/pcsx2_patches/pcsx2_patches-0_p20231117.ebuild
@@ -0,0 +1,55 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-any-r1
+
+if [[ ${PV} == 9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/PCSX2/pcsx2_patches.git";
+else
+       HASH_PCSX2_PATCHES=d6195fdc69add33dcc29fd973568896a8e8e6247
+       SRC_URI="
+               
https://github.com/PCSX2/pcsx2_patches/archive/${HASH_PCSX2_PATCHES}.tar.gz
+                       -> ${P}.tar.gz
+       "
+       S=${WORKDIR}/${PN}-${HASH_PCSX2_PATCHES}
+       KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Collection of game patches for use with PCSX2 (e.g. widescreen 
hacks)"
+HOMEPAGE="https://github.com/PCSX2/pcsx2_patches/";
+
+# these are normally distributed by upstream with PCSX2 which is GPL-3+
+LICENSE="GPL-3+"
+SLOT="0"
+
+BDEPEND="${PYTHON_DEPS}"
+
+src_compile() {
+       # upstream uses a constantly replaced "latest" patches.zip (currently no
+       # real releases), and github's .zip archives cannot be used either due 
to
+       # having the patches/ subdirectory -- so we use a snapshot and repack
+       # (could use app-arch/zip, but python is more likely to skip a 
dependency)
+       ebegin "Creating patches.zip"
+       "${PYTHON}" - <<-EOF
+               import pathlib
+               from zipfile import ZipFile, ZIP_DEFLATED
+
+               patches = pathlib.Path("patches/")
+
+               with ZipFile("patches.zip", "w", ZIP_DEFLATED, compresslevel=9) 
as archive:
+                   for file in patches.iterdir():
+                       archive.write(file, arcname=file.name)
+       EOF
+       eend ${?} || die
+}
+
+src_install() {
+       insinto /usr/lib/pcsx2/resources
+       doins patches.zip
+
+       einstalldocs
+}

Reply via email to