unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon South <simon@simonsouth.net>
To: 66173@debbugs.gnu.org
Subject: bug#66173: [PATCH 1/2] gnu: fifengine: Fix runtime error when using Python 3.9 or newer.
Date: Thu,  4 Jan 2024 15:33:55 -0500	[thread overview]
Message-ID: <6a115cc55b808c3776c80f809542e53937dbc8a6.1704399085.git.simon@simonsouth.net> (raw)
In-Reply-To: <cover.1704399085.git.simon@simonsouth.net>

* gnu/packages/patches/fifengine-python-3.9-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/games.scm (fifengine)[source]: Apply it.

Change-Id: I61001d6b87db00c71f1e2e6ca3bac8581e941451
---
 gnu/local.mk                                  |  1 +
 gnu/packages/games.scm                        |  3 +-
 .../patches/fifengine-python-3.9-compat.patch | 81 +++++++++++++++++++
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/fifengine-python-3.9-compat.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f804f4ef5b..f66db809a9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1166,6 +1166,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/fenics-dolfin-boost.patch		\
   %D%/packages/patches/fenics-dolfin-config-slepc.patch		\
   %D%/packages/patches/fifengine-boost-compat.patch		\
+  %D%/packages/patches/fifengine-python-3.9-compat.patch	\
   %D%/packages/patches/fifengine-swig-compat.patch		\
   %D%/packages/patches/fifo-map-fix-flags-for-gcc.patch		\
   %D%/packages/patches/fifo-map-remove-catch.hpp.patch		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c7813790a1..333dbfcec5 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4060,7 +4060,8 @@ (define-public fifengine
                                   "fifengine/tar.gz/" version))
               (file-name (string-append name "-" version ".tar.gz"))
               (patches (search-patches "fifengine-swig-compat.patch"
-                                       "fifengine-boost-compat.patch"))
+                                       "fifengine-boost-compat.patch"
+                                       "fifengine-python-3.9-compat.patch"))
               (sha256
                (base32
                 "1y4grw25cq5iqlg05rnbyxw1njl11ypidnlsm3qy4sm3xxdvb0p8"))))
diff --git a/gnu/packages/patches/fifengine-python-3.9-compat.patch b/gnu/packages/patches/fifengine-python-3.9-compat.patch
new file mode 100644
index 0000000000..2def4681cd
--- /dev/null
+++ b/gnu/packages/patches/fifengine-python-3.9-compat.patch
@@ -0,0 +1,81 @@
+Fix runtime error when using Python 3.9 or newer.
+
+Taken from upstream:
+https://github.com/fifengine/fifengine/commit/cf295fd98a8fba080f6305c27be56d10ab7ce94d
+
+diff --git a/engine/python/fife/extensions/serializers/simplexml.py b/engine/python/fife/extensions/serializers/simplexml.py
+index c4e10f4f8..d05567936 100644
+--- a/engine/python/fife/extensions/serializers/simplexml.py
++++ b/engine/python/fife/extensions/serializers/simplexml.py
+@@ -200,7 +200,7 @@ def get(self, module, name, defaultValue=None):
+ 		#get the module tree: for example find tree under module FIFE
+ 		moduleTree = self._getModuleTree(module)
+ 		element = None
+-		for e in moduleTree.getchildren():
++		for e in moduleTree:
+ 			if e.tag == "Setting" and e.get("name", "") == name:
+ 				element = e
+ 				break
+@@ -275,7 +275,7 @@ def set(self, module, name, value, extra_attrs={}):
+ 			e_type = "str"
+ 			value = str(value)
+ 
+-		for e in moduleTree.getchildren():
++		for e in moduleTree:
+ 			if e.tag != "Setting": continue
+ 			if e.get("name", "") == name:
+ 				e.text = value
+@@ -305,7 +305,7 @@ def remove(self, module, name):
+ 
+ 		moduleTree = self._getModuleTree(module)
+ 
+-		for e in moduleTree.getchildren():
++		for e in moduleTree:
+ 			if e.tag != "Setting": continue
+ 			if e.get("name", "") == name:
+ 				moduleTree.remove(e)
+@@ -321,7 +321,7 @@ def getModuleNameList(self):
+ 			self._initialized = True
+ 
+ 		moduleNames = []
+-		for c in self._root_element.getchildren():
++		for c in self._root_element:
+ 			if c.tag == "Module":
+ 				name = c.get("name","")
+ 				if not isinstance(name, basestring):
+@@ -344,7 +344,7 @@ def getAllSettings(self, module):
+ 		
+ 		# now from the tree read every value, and put the necessary values
+ 		# to the list
+-		for e in moduleTree.getchildren():
++		for e in moduleTree:
+ 			if e.tag == "Setting":
+ 				name = e.get("name", "")
+ 	
+@@ -383,7 +383,7 @@ def _validateTree(self):
+ 		
+ 		Raises an InvalidFormat exception if there is a format error.
+ 		"""
+-		for c in self._root_element.getchildren():
++		for c in self._root_element:
+ 			if c.tag != "Module":
+ 				raise InvalidFormat("Invalid tag in " + self._file + \
+ 									". Expected Module, got: " + c.tag)
+@@ -391,7 +391,7 @@ def _validateTree(self):
+ 				raise InvalidFormat("Invalid tag in " + self._file + \
+ 									". Module name is empty.")
+ 			else:
+-				for e in c.getchildren():
++				for e in c:
+ 					if e.tag != "Setting":
+ 						raise InvalidFormat("Invalid tag in " + self._file + \
+ 											" in module: " + c.tag + \
+@@ -414,7 +414,7 @@ def _getModuleTree(self, module):
+ 			raise AttributeError("Settings:_getModuleTree: Invalid type for "
+ 								 "module argument.")
+ 
+-		for c in self._root_element.getchildren():
++		for c in self._root_element:
+ 			if c.tag == "Module" and c.get("name", "") == module:
+ 				return c
+ 
-- 
2.41.0





  reply	other threads:[~2024-01-04 20:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24  2:35 bug#66173: [BUG] Package unknown-horizons fails during build process Rodrigo Morales
2023-09-26 22:04 ` bug#66173: " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2024-01-04 20:33 ` bug#66173: [PATCH 0/2] unknown-horizons: Fix build, runtime errors Simon South
2024-01-04 20:33   ` Simon South [this message]
2024-01-04 20:33   ` bug#66173: [PATCH 2/2] gnu: unknown-horizons: Fix build and " Simon South
2024-01-13 15:50 ` bug#66173: Package unknown-horizons fails during build process Simon South
2024-01-14 12:08   ` Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a115cc55b808c3776c80f809542e53937dbc8a6.1704399085.git.simon@simonsouth.net \
    --to=simon@simonsouth.net \
    --cc=66173@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).