games-emulation/pcsx2_patches: new package, add 0_p20230623 + 9999

This is distributed with PCSX2's appimage but tracked in a separate
repo. Simpler to handle as a separate package as bump may not be needed
at same time and updates tend to be non-urgent + game-specific (and
all patches are disabled by default).

PCSX2 newly gives a warning if patches.zip is missing (formerly
cheats_ws.zip, but now using its own patches interface), and will look
for it on the system's resources path. So this gives more reasons to
package this.

Provide 9999 as well given this does not get releases and users may
want fixes earlier than we do snapshots (albeit ~/.config/PCSX2/patches
or so should work afaik).

Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2023-06-23 22:44:35 -04:00
parent 462c48d61e
commit d502302aee
4 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST pcsx2_patches-0_p20230623.tar.gz 598611 BLAKE2B 5a2fb1b31f9448064d7ce46c11b1dadbf1960403c082c8cee5a4c897e9c7db334a70d1f088ad18893bad89e12ef4369e2a6cba3e493fe11846848180a755b0c4 SHA512 55b7221c8f5124a44f73aa552491d1ceac796e0c34179439ba2a599891691ece19ad35b16600fa3eea1031fdcf6f5f2ee2d9da9226656ade1413b83c983383a9

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>games@gentoo.org</email>
<name>Gentoo Games Project</name>
</maintainer>
<stabilize-allarches/>
<upstream>
<remote-id type="github">PCSX2/pcsx2_patches</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,54 @@
# 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=665e8779d10ef046da2a46118c2d1efc02d8cb2c
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/share/pcsx2/resources
doins patches.zip
einstalldocs
}

View File

@@ -0,0 +1,54 @@
# 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=
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/share/pcsx2/resources
doins patches.zip
einstalldocs
}