summaryrefslogtreecommitdiff
path: root/games-puzzle/pathological
diff options
context:
space:
mode:
Diffstat (limited to 'games-puzzle/pathological')
-rw-r--r--games-puzzle/pathological/Manifest4
-rw-r--r--games-puzzle/pathological/files/pathological-1.1.3-build-r1.patch12
-rw-r--r--games-puzzle/pathological/files/pathological-1.1.3_p16-pygame2-compat.patch68
-rw-r--r--games-puzzle/pathological/pathological-1.1.3_p16-r1.ebuild110
-rw-r--r--games-puzzle/pathological/pathological-1.1.3_p16-r3.ebuild74
5 files changed, 144 insertions, 124 deletions
diff --git a/games-puzzle/pathological/Manifest b/games-puzzle/pathological/Manifest
index a32894b72615..ae4aa152cbcd 100644
--- a/games-puzzle/pathological/Manifest
+++ b/games-puzzle/pathological/Manifest
@@ -1,5 +1,5 @@
-AUX pathological-1.1.3-build-r1.patch 294 BLAKE2B ca608731e0e25134f2ce66d8336e73fceb9a4201199a770857e6a5e8235ef387ab2bd9f7fb27f9434c8042131d09fb49eec39582d59bca3661a4ab489d181159 SHA512 ae7ba9c82cc51232b69fe5756ca5ae17d816c395b091f43c344f86439b3e08bdf2c4bcb9272f2b4e47ab1756432a9455c25c94dfe914ab2d2e5bfde99839483a
+AUX pathological-1.1.3_p16-pygame2-compat.patch 1954 BLAKE2B e1670210cdad9f957f76f20ca5bbdc2cccfef9c37353dc00ffeb10c87473972b0066d2413c42c80541bfa23059cffe5143ad2791ec816a06654f4e5dedbb8551 SHA512 e63b964849803020cb68ed908b317fea81c60b5360cbd9cf10e3836483250972764352e619afb836196b50732360fac3da88a68d3863431a9b5f8a74535a2023
DIST pathological-1.1.3.tar.gz 6995274 BLAKE2B 2fc891f1d0f15f68d2be3a210f04a64b73896cba92882e24fa60df09752b3235e025c4480510b7eebbf214d8ec4885ea556d76757888b85751a48432ea22709f SHA512 a64e0ca9a3bf86ade4a1abdd4f471c341838f690b2471f21c488471b7800da55f89f42c62a51c9be380cb9f265432db904a5de6f6bb3a9a7dde835da94baf566
DIST pathological_1.1.3-16.debian.tar.xz 12992 BLAKE2B 3209f1d6b867f8d7baf83dda22f94829ba880a7aeff2a7587b883cac406e21b5c20d703a55599bc8692caa49553102ed1b4b0f7ac11c490b400ccbca7608d6cf SHA512 3d946a6d3c0daa4f0dac256c6e5fa053942a101aaae229836c8290dffc4556279169f71eff6bf4814d26ee30f466df9d7014b504c259aba139c3919c704db3ee
-EBUILD pathological-1.1.3_p16-r1.ebuild 2278 BLAKE2B 9204987bdb5da3dc98d9324fe154cc321f801d7f97043d74f3544d4bbda9c316d72319ca6125a4b74af1c3923285dd2a93c934ad2e873fd39f0652c2337cb06e SHA512 56271d57f35448edde4196ee6b62ff0f289a89ed91abd4fd21c0553f57453558ebfccd3bab03cf3918bc76dce4fa588782983a0b0d2cebd7869139a458fa6f87
+EBUILD pathological-1.1.3_p16-r3.ebuild 1680 BLAKE2B 3dbc7ff5690ebb63b60a2b888b86fb204ea7188af81a3db9acf3c23cfdfcc1490c79d3474ad4f044bf7e98295346d5ad2077904608675eb3169188d853ef3548 SHA512 556796261f70f0a868a6d05b5fa9d6c3bc74395739771f3520c1ced91e3b5d9cb330b3661bd968329277ac5ecf98003a38d0cf80a864c88ead05d04581efebf8
MISC metadata.xml 335 BLAKE2B 775a6a1e8fcce8caa16099edfe9513a7dd1528584f8a54090e5064d9dc7b7c956caa585d90878f1f39148faf224fd941c04a2fe1be4cfdc3f1b1c27cf3a2a6c8 SHA512 d37783b18071c416deb0bbc6702ca086e84653bc7a54bc76283285eb0ece1f82a4f1b1a57ae6572b174c21a4d6d629d77f7edb8d2883cd2401f8cb0943646eaa
diff --git a/games-puzzle/pathological/files/pathological-1.1.3-build-r1.patch b/games-puzzle/pathological/files/pathological-1.1.3-build-r1.patch
deleted file mode 100644
index 48038df00036..000000000000
--- a/games-puzzle/pathological/files/pathological-1.1.3-build-r1.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/Makefile.old 2019-12-25 20:55:37.932303932 +0100
-+++ b/Makefile 2019-12-25 20:55:58.584530808 +0100
-@@ -4,9 +4,6 @@
-
- all: write-highscores docs
-
--write-highscores: write-highscores.c
-- gcc -s -o write-highscores write-highscores.c
--
- docs: html/wheel.png
- html/wheel.png:
- ./makehtml
diff --git a/games-puzzle/pathological/files/pathological-1.1.3_p16-pygame2-compat.patch b/games-puzzle/pathological/files/pathological-1.1.3_p16-pygame2-compat.patch
new file mode 100644
index 000000000000..525f30438e17
--- /dev/null
+++ b/games-puzzle/pathological/files/pathological-1.1.3_p16-pygame2-compat.patch
@@ -0,0 +1,68 @@
+These are integers and use of "is" with pygame-2 ignores input events.
+
+https://bugs.gentoo.org/794211
+
+See also: pygame-2.0.1/buildconfig/pygame-stubs/constants.pyi
+--- a/pathological.py
++++ b/pathological.py
+@@ -133,3 +133,3 @@
+ if colorkey is not None:
+- if colorkey is -1:
++ if colorkey == -1:
+ colorkey = image.get_at((0,0))
+@@ -1395,6 +1395,6 @@
+ for event in pygame.event.get():
+- if event.type is QUIT:
++ if event.type == QUIT:
+ return -4
+- elif event.type is KEYDOWN:
+- if event.key is K_ESCAPE: return -3
++ elif event.type == KEYDOWN:
++ if event.key == K_ESCAPE: return -3
+ elif event.key == ord('n'): return 2
+@@ -1419,3 +1419,3 @@
+
+- elif event.type is MOUSEBUTTONDOWN:
++ elif event.type == MOUSEBUTTONDOWN:
+ if self.paused:
+@@ -1713,5 +1713,5 @@
+ for event in pygame.event.get():
+- if event.type is QUIT:
++ if event.type == QUIT:
+ return -2
+- elif event.type is KEYDOWN:
++ elif event.type == KEYDOWN:
+ if event.key == K_ESCAPE: return -1
+@@ -1744,3 +1744,3 @@
+ return 1
+- elif event.type is MOUSEBUTTONDOWN:
++ elif event.type == MOUSEBUTTONDOWN:
+ return 1
+@@ -1799,5 +1799,5 @@
+ for event in pygame.event.get():
+- if event.type is QUIT:
++ if event.type == QUIT:
+ return None
+- elif event.type is KEYUP:
++ elif event.type == KEYUP:
+ if event.key == K_LSHIFT:
+@@ -1806,3 +1806,3 @@
+ shift_state &= ~KMOD_RSHIFT
+- elif event.type is KEYDOWN:
++ elif event.type == KEYDOWN:
+ if event.key == K_LSHIFT:
+@@ -1994,3 +1994,3 @@
+ for event in pygame.event.get():
+- if event.type is QUIT:
++ if event.type == QUIT:
+ if self.curpage == 1:
+@@ -1999,3 +1999,3 @@
+ return -2
+- elif event.type is KEYDOWN:
++ elif event.type == KEYDOWN:
+ if event.key == K_F2:
+@@ -2032,3 +2032,3 @@
+ continue
+- elif event.type is MOUSEBUTTONDOWN:
++ elif event.type == MOUSEBUTTONDOWN:
+ if self.curpage == 1:
diff --git a/games-puzzle/pathological/pathological-1.1.3_p16-r1.ebuild b/games-puzzle/pathological/pathological-1.1.3_p16-r1.ebuild
deleted file mode 100644
index c41cdb26e8ec..000000000000
--- a/games-puzzle/pathological/pathological-1.1.3_p16-r1.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{7,8} )
-
-inherit desktop python-single-r1 toolchain-funcs
-
-DESCRIPTION="An enriched clone of the game 'Logical' by Rainbow Arts"
-HOMEPAGE="http://pathological.sourceforge.net/"
-SRC_URI="
- mirror://sourceforge/${PN}/${P/_p*}.tar.gz
- mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV/_p*}-${PV/*_p}.debian.tar.xz
-"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-
-IUSE="doc"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}
- $(python_gen_cond_dep '
- >=dev-python/pygame-1.5.5[${PYTHON_MULTI_USEDEP}]
- ')
-"
-DEPEND="${RDEPEND}"
-BDEPEND="${PYTHON_DEPS}
- doc? ( media-libs/netpbm )
-"
-
-S="${WORKDIR}/${P/_p*}"
-
-src_unpack() {
- unpack ${A}
- cd "${S}" || die
- unpack ./${PN}.6.gz
-}
-
-src_prepare() {
- default
-
- # Debian fixes
- # We don't face this bug, this way we skip needing to convert the
- # files at build time
- sed -i -e '/60_use_ogg_music.patch/d' "${WORKDIR}"/debian/patches/series || die
-
- for p in $(<"${WORKDIR}"/debian/patches/series) ; do
- eapply -p1 "${WORKDIR}/debian/patches/${p}"
- done
-
- # Fix prestripped files
- eapply "${FILESDIR}/${PN}-1.1.3-build-r1.patch"
-
- if use doc ; then
- sed -i -e '5,$ s/=/ /g' makehtml || die
- else
- echo "#!/bin/sh" > makehtml
- fi
-
- sed -i \
- -e "s:/usr/share/games:/usr/share:" \
- -e "s:exec:exec ${EPYTHON}:" \
- ${PN} || die
-
- sed -i \
- -e 's:\xa9:(C):' \
- -e "s:/usr/lib/${PN}/bin:/usr/$(get_libdir)/${PN}:" \
- ${PN}.py || die
-
- python_fix_shebang ${PN}.py
-
- tc-export CC
-}
-
-src_install() {
- dobin ${PN}
-
- exeinto /usr/"$(get_libdir)"/${PN}
- doexe write-highscores
-
- insinto /usr/share/${PN}
- doins -r circuits graphics music sounds ${PN}.py
-
- insinto /var/games/
- doins ${PN}_scores
- fperms 660 /var/games/${PN}_scores
-
- doman ${PN}.6
- use doc && local HTML_DOCS=( html/. )
- einstalldocs
- dodoc changelog
-
- doicon ${PN}.xpm
- make_desktop_entry ${PN} Pathological ${PN}
-
- # remove some unneeded resource files
- rm -f "${ED}"/usr/share/${PN}/graphics/*.xcf
-}
-
-pkg_postinst() {
- if ! has_version "media-libs/sdl-mixer[mod]" ; then
- echo
- elog "Since you have turned off the 'mod' use flag for media-libs/sdl-mixer"
- elog "no background music will be played."
- echo
- fi
-
-}
diff --git a/games-puzzle/pathological/pathological-1.1.3_p16-r3.ebuild b/games-puzzle/pathological/pathological-1.1.3_p16-r3.ebuild
new file mode 100644
index 000000000000..dc1f36d2d15d
--- /dev/null
+++ b/games-puzzle/pathological/pathological-1.1.3_p16-r3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9} )
+inherit desktop optfeature python-single-r1
+
+MY_P="${PN}-$(ver_cut 1-3)"
+
+DESCRIPTION="Enriched clone of the game 'Logical' by Rainbow Arts"
+HOMEPAGE="https://pathological.sourceforge.net/"
+SRC_URI="
+ mirror://sourceforge/pathological/${MY_P}.tar.gz
+ mirror://debian/pool/main/p/pathological/${MY_P/-/_}-${PV/*_p}.debian.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ media-libs/sdl2-image[jpeg,png]
+ $(python_gen_cond_dep 'dev-python/pygame[${PYTHON_USEDEP}]')"
+BDEPEND="
+ ${PYTHON_DEPS}
+ doc? ( media-libs/netpbm[png] )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-pygame2-compat.patch
+)
+
+src_prepare() {
+ # debian's patches add python3 support and sanitize other aspects
+ # use_ogg_music: excluded given .xm files are fine
+ local debian=($(<"${WORKDIR}"/debian/patches/series))
+ debian=(${debian[@]/60_use_ogg_music.patch/})
+ PATCHES+=("${debian[@]/#/${WORKDIR}/debian/patches/}")
+
+ default
+
+ sed -e "s|^cd .*/|cd ${EPREFIX}/usr/share/|" \
+ -e "s|^exec|exec ${EPYTHON}|" \
+ -i ${PN} || die
+
+ gzip -d ${PN}.6.gz || die
+ rm graphics/*.xcf || die
+}
+
+src_compile() {
+ use doc && emake docs
+}
+
+src_install() {
+ dobin ${PN}
+ doman ${PN}.6
+
+ insinto /usr/share/${PN}
+ doins -r circuits graphics music sounds ${PN}.py
+
+ doicon ${PN}.xpm
+ domenu "${WORKDIR}"/debian/${PN}.desktop
+
+ use doc && local HTML_DOCS=( html/. )
+ dodoc changelog
+ einstalldocs
+}
+
+pkg_postinst() {
+ optfeature "background music support" "media-libs/sdl2-mixer[mod]"
+}