Skip to content

Commit

Permalink
games-puzzle/pathological: Fixes from Debian, python3 support
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: Pacho Ramos <[email protected]>
  • Loading branch information
pacho2 committed Dec 25, 2019
1 parent cbf1997 commit e9b10ea
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
1 change: 1 addition & 0 deletions games-puzzle/pathological/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
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
12 changes: 12 additions & 0 deletions games-puzzle/pathological/files/pathological-1.1.3-build-r1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- 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
105 changes: 105 additions & 0 deletions games-puzzle/pathological/pathological-1.1.3_p16.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )

inherit desktop python-single-r1

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}
>=dev-python/pygame-1.5.5[${PYTHON_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
}

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

dodoc changelog README TODO
doman ${PN}.6
use doc && dohtml -r html/*

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

}

0 comments on commit e9b10ea

Please sign in to comment.