* [gentoo-commits] repo/gentoo:master commit in: games-fps/freedoom-data/files/, games-fps/freedoom-data/
@ 2019-09-07 17:46 James Le Cuirot
0 siblings, 0 replies; 2+ messages in thread
From: James Le Cuirot @ 2019-09-07 17:46 UTC (permalink / raw
To: gentoo-commits
commit: 6e1214a616443a221efb504663087ee6976d02c1
Author: William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com>
AuthorDate: Fri Sep 6 07:42:00 2019 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Sep 7 17:46:31 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e1214a6
games-fps/freedoom-data: Set DOOMWADPATH in freedoom launch script
Package-Manager: Portage-2.3.73, Repoman-2.3.17
Signed-off-by: William Breathitt Gray <vilhelm.gray <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/12871
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
.../freedoom-data-0.11.3-Set-DOOMWADPATH.patch | 38 ++++++++++++++
.../freedoom-data/freedoom-data-0.11.3-r2.ebuild | 61 ++++++++++++++++++++++
2 files changed, 99 insertions(+)
diff --git a/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch b/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch
new file mode 100644
index 00000000000..0998cc45ebd
--- /dev/null
+++ b/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch
@@ -0,0 +1,38 @@
+From 19b8fe33843b1e431fb0737a57087f58c168952c Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <vilhelm.gray@gmail.com>
+Date: Fri, 6 Sep 2019 16:20:49 +0900
+Subject: [PATCH] dist/freedoom: Set DOOMWADPATH with sensible default value if
+ unset
+
+Engines such as Odamex may not have a default search path and simply
+search for freedoom1.wad relative to the current directory. This can
+cause an unexpected WAD file not found error when executing the freedoom
+script.
+
+This issue is mitigated by setting a default DOOMWADPATH environment
+variable with sensible search paths, if it is not already set. All
+engines listed in the PORTS variable support the DOOMWADPATH environment
+variable, which makes it a simple and convenient way of helping prevent
+this error.
+---
+ dist/freedoom | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/dist/freedoom b/dist/freedoom
+index 62e3c4d5..0c0961a5 100755
+--- a/dist/freedoom
++++ b/dist/freedoom
+@@ -31,6 +31,10 @@ case "$(basename "$0")" in
+ ;;
+ esac
+
++if [ -z "$DOOMWADPATH" ]; then
++ export DOOMWADPATH="/usr/share/doom:/usr/share/games/doom:/usr/local/share/doom:/usr/local/share/games/doom"
++fi
++
+ if [ -z "$PORT" ] && [ -h "$HOME"/.doomport ]; then
+ if [ -f "$(readlink -f "$HOME"/.doomport)" ] \
+ && [ -x "$(readlink -f "$HOME"/.doomport)" ]; then
+--
+2.23.0
+
diff --git a/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild b/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild
new file mode 100644
index 00000000000..83aced1b3be
--- /dev/null
+++ b/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
+
+inherit prefix python-any-r1 xdg
+
+DESCRIPTION="Game resources for Freedoom: Phase 1+2"
+HOMEPAGE="https://freedoom.github.io"
+SRC_URI="https://github.com/freedoom/freedoom/archive/v${PV}.tar.gz -> freedoom-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+BDEPEND="
+ $(python_gen_any_dep 'dev-python/pillow[${PYTHON_USEDEP}]')
+ app-text/asciidoc
+ games-util/deutex
+ virtual/imagemagick-tools[png]"
+
+S="${WORKDIR}/freedoom-${PV}"
+
+PATCHES="${FILESDIR}/${P}-Set-DOOMWADPATH.patch"
+
+DOOMWADPATH=share/doom
+
+python_check_deps() {
+ has_version -b "dev-python/pillow[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # This is to enable usage of the 'PS' coder, which is
+ # disabled by default (https://bugs.gentoo.org/664236)
+ install -D -t ~/.config/ImageMagick "${FILESDIR}"/ImageMagick/policy.xml || die
+
+ xdg_src_prepare
+ eapply_user
+
+ hprefixify dist/freedoom
+}
+
+src_compile() {
+ emake wads/freedoom{1,2}.wad
+}
+
+src_install() {
+ emake install-freedoom{1,2} \
+ prefix="${ED}/usr/" \
+ bindir="bin/" \
+ mandir="share/man/" \
+ waddir="${DOOMWADPATH}/"
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+
+ elog "Freedoom WAD files installed into ${EPREFIX}/usr/${DOOMWADPATH} directory."
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: games-fps/freedoom-data/files/, games-fps/freedoom-data/
@ 2023-08-03 22:11 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-08-03 22:11 UTC (permalink / raw
To: gentoo-commits
commit: 23a7ff2f75f4083bbe22e8f75ed17ea2e4380cd8
Author: William Breathitt Gray <william.gray <AT> linaro <DOT> org>
AuthorDate: Sun Jul 30 12:46:51 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 3 22:11:26 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23a7ff2f
games-fps/freedoom-data: Support Python PIL 10.0.0
Closes: https://bugs.gentoo.org/909548
Signed-off-by: William Breathit Gray <william.gray <AT> linaro.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
...oom-data-0.12.1-Python-PIL-10.0.0-support.patch | 39 ++++++++++++++++++++++
.../freedoom-data/freedoom-data-0.12.1-r1.ebuild | 4 +++
2 files changed, 43 insertions(+)
diff --git a/games-fps/freedoom-data/files/freedoom-data-0.12.1-Python-PIL-10.0.0-support.patch b/games-fps/freedoom-data/files/freedoom-data-0.12.1-Python-PIL-10.0.0-support.patch
new file mode 100644
index 000000000000..130e1636374d
--- /dev/null
+++ b/games-fps/freedoom-data/files/freedoom-data-0.12.1-Python-PIL-10.0.0-support.patch
@@ -0,0 +1,39 @@
+From d64ddc6ea90406e21b4b93f5a1e7f99abfaac0d9 Mon Sep 17 00:00:00 2001
+From: Steven Elliott <selliott512@gmail.com>
+Date: Sun, 16 Jul 2023 14:52:04 -0400
+Subject: [PATCH] create_caption: Python PIL 10.0.0 support (#1027)
+
+To support Python PIL 10.0.0 this change uses newer API textbbox() when
+available, and older API textsize() when not.
+---
+ graphics/text/create_caption | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/graphics/text/create_caption b/graphics/text/create_caption
+index 7ddbd8d66..22bc0507d 100755
+--- a/graphics/text/create_caption
++++ b/graphics/text/create_caption
+@@ -18,8 +18,21 @@ background_image.load()
+ background_image = background_image.convert("RGBA")
+ image = Image.new("RGBA", background_image.size, (0, 0, 0, 0))
+ draw = ImageDraw.Draw(image)
+-txt1_size = draw.textsize(txt1, font=font)
+-txt2_size = draw.textsize(txt2, font=font)
++
++# Getting the text size is tricky since for newer PIL, such as 10.0.0, only
++# textbbox() is supported, but for older PIL, such 7.2.0, only textsize()
++# is supported. The solution is to default to the newer API, but fallback to
++# the older one when it is not available.
++try:
++ # This newer API returns a four item tuple. The "xy" kwarg is returned in
++ # the first two items, and last two items is the size needed, but with "xy"
++ # added, so passing "(0, 0)" returns the size needed.
++ txt1_size = draw.textbbox(xy=(0, 0), text=txt1, font=font)[2:]
++ txt2_size = draw.textbbox(xy=(0, 0), text=txt2, font=font)[2:]
++except:
++ # This older API simply returns the size needed.
++ txt1_size = draw.textsize(txt1, font=font)
++ txt2_size = draw.textsize(txt2, font=font)
+
+ draw.text(
+ (5, int(image.height - txt1_size[1] - 5)),
diff --git a/games-fps/freedoom-data/freedoom-data-0.12.1-r1.ebuild b/games-fps/freedoom-data/freedoom-data-0.12.1-r1.ebuild
index 62bcb30b42a9..f50e3558ffb1 100644
--- a/games-fps/freedoom-data/freedoom-data-0.12.1-r1.ebuild
+++ b/games-fps/freedoom-data/freedoom-data-0.12.1-r1.ebuild
@@ -20,6 +20,10 @@ BDEPEND="
app-text/asciidoc
games-util/deutex[png]"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.12.1-Python-PIL-10.0.0-support.patch
+)
+
S="${WORKDIR}/freedoom-${PV}"
DOOMWADPATH=share/doom
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-03 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-07 17:46 [gentoo-commits] repo/gentoo:master commit in: games-fps/freedoom-data/files/, games-fps/freedoom-data/ James Le Cuirot
-- strict thread matches above, loose matches on Subject: below --
2023-08-03 22:11 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox