summaryrefslogtreecommitdiff
path: root/games-fps/freedm-data
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-04 03:16:33 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-04 03:16:33 +0100
commitf71e91f3fbcdebf01a5ecf58164716586daeaa5b (patch)
treede424b7f2c5bc642fea9632333bea58bee68c202 /games-fps/freedm-data
parentb0ebd12de22226fd7b69140ccd700efda3eb5fa6 (diff)
gentoo auto-resync : 04:08:2023 - 03:16:33
Diffstat (limited to 'games-fps/freedm-data')
-rw-r--r--games-fps/freedm-data/Manifest3
-rw-r--r--games-fps/freedm-data/files/freedm-data-0.12.1-Python-PIL-10.0.0-support.patch43
-rw-r--r--games-fps/freedm-data/freedm-data-0.12.1-r1.ebuild4
3 files changed, 49 insertions, 1 deletions
diff --git a/games-fps/freedm-data/Manifest b/games-fps/freedm-data/Manifest
index b18e7ceddd1d..8ae2948094c1 100644
--- a/games-fps/freedm-data/Manifest
+++ b/games-fps/freedm-data/Manifest
@@ -1,3 +1,4 @@
+AUX freedm-data-0.12.1-Python-PIL-10.0.0-support.patch 1888 BLAKE2B 0e1d81c95ebd4e8cdbe2ecc026b74f4367fc2f4c637bfc4927f5730007bbc65c441001bf64cb4161273da18af42587adcef30398c0b6a4981da7e2800505f8ac SHA512 9a01d013003d565300e34b270e630db18433bdd52d7f03bd03d9fc4da13e72fc56824b03db2fdf8e21b544444564d94ffedd3a51ab7419c97c6238ede19e548e
DIST freedoom-0.12.1.tar.gz 18405081 BLAKE2B a508d9ce924ff10640d6017302864869efff474c89fe20a866082b565a1ce65182483a5a692c9ce3329b81472ae9e4fee4ac2511670ecb5dd06ccf81930ac70d SHA512 7db65b039ce98593a86a19b46efe629b85a339c4c020750c3abb95d226fca484c63686ab8c88ecc1e16e86a6aca3b8c7952d85103e0f3db07cc7204fa528daf2
-EBUILD freedm-data-0.12.1-r1.ebuild 1098 BLAKE2B 12c9ce52608ebd1753aa7c0a865080cbd9cbad93d713ca8fd27053c9dbf4acbcea795cec82818a673e7cf763fd2f9e9988fe19c90f7762f81d0452ceda1c38d9 SHA512 68960c300f7fd417537054a10c915d08367e1f96ba505255e78a9d364a8980175ea613c0c61032401e06fd0647ad3e6847eb9ac73d2a6f61587dca6b428cb11e
+EBUILD freedm-data-0.12.1-r1.ebuild 1171 BLAKE2B f12a2e04aa538602c1755f56ba525234eff0b172a391232e0172e47b6e23aa15fad19f1110630ef4fc8238a47a67f08c3672e177ba2eeb30047bbc4180f11ba3 SHA512 5d43a092a9eff0d0424e0cf7f4ab10bfa25e77f8876905c79aab874fa8755369253b17485d8750d2ba56611d3ae5bdbe545ae3c62cb6ac80a35972546705e863
MISC metadata.xml 1511 BLAKE2B 83819a1201811582e2b5250598c99dce28d8be5e26833d17fa68d9b49dc493ff195922d55faf00cceb739647d08c573c05998655762e3121144d615f64c57133 SHA512 39ca720f35a6def9804960b9ca6b4ccd5b6b15b25f8a37a449669cfb168eafab1d293a772e1822e1e8d5bad716ee6a7e45ea71b785bbe29bda067f3086c2d17a
diff --git a/games-fps/freedm-data/files/freedm-data-0.12.1-Python-PIL-10.0.0-support.patch b/games-fps/freedm-data/files/freedm-data-0.12.1-Python-PIL-10.0.0-support.patch
new file mode 100644
index 000000000000..9cc65812de85
--- /dev/null
+++ b/games-fps/freedm-data/files/freedm-data-0.12.1-Python-PIL-10.0.0-support.patch
@@ -0,0 +1,43 @@
+https://bugs.gentoo.org/909540
+https://github.com/freedoom/freedoom/issues/1015
+https://github.com/freedoom/freedoom/pull/1027
+
+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/freedm-data/freedm-data-0.12.1-r1.ebuild b/games-fps/freedm-data/freedm-data-0.12.1-r1.ebuild
index 354720400a4a..29b53f429e6a 100644
--- a/games-fps/freedm-data/freedm-data-0.12.1-r1.ebuild
+++ b/games-fps/freedm-data/freedm-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