aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2021-06-30 08:31:41 +0000
committerKai Knoblich <kai@FreeBSD.org>2021-06-30 08:56:01 +0000
commitcb3b365038fcaee997eb9e4006a7e2bfed6e5ab0 (patch)
tree3717e2466d7efcab36a668e0c6564e4d54afe01c
parente34785f48f2eac31014d722e58fa7e84e031245d (diff)
downloadports-cb3b365038fcaee997eb9e4006a7e2bfed6e5ab0.tar.gz
ports-cb3b365038fcaee997eb9e4006a7e2bfed6e5ab0.zip
games/pysolfc: Fix runtime issues with Python 3.8+
* The deprecated function "time.clock()" has been removed in Python 3.8 and "time.perf_counter()" should be used instead. Because updating to a newer version of PySolFC requires a bit more work, use a backport for now to remedy the runtime issues. * Bump PORTREVISION due changed package contents. PR: 256504 Reported by: <sven.a.jonsson@bahnhof.se> MFH: 2021Q2 (cherry picked from commit 91cf30435554dda6bf71dc566f91352dd469d816)
-rw-r--r--games/pysolfc/Makefile2
-rw-r--r--games/pysolfc/files/patch-pysollib_mfxutil.py21
2 files changed, 22 insertions, 1 deletions
diff --git a/games/pysolfc/Makefile b/games/pysolfc/Makefile
index 8a26d7761010..7d564b06430d 100644
--- a/games/pysolfc/Makefile
+++ b/games/pysolfc/Makefile
@@ -1,7 +1,7 @@
PORTNAME= pysolfc
DISTVERSION= 2.6.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= games python
MASTER_SITES= SF/${PORTNAME}/PySolFC/${PYSOLFCDIR} \
SF/${PORTNAME}/PySolFC-Cardsets/${CARDSETDIR}:cardsets
diff --git a/games/pysolfc/files/patch-pysollib_mfxutil.py b/games/pysolfc/files/patch-pysollib_mfxutil.py
new file mode 100644
index 000000000000..a76d320c68ae
--- /dev/null
+++ b/games/pysolfc/files/patch-pysollib_mfxutil.py
@@ -0,0 +1,21 @@
+Fix runtime errors with Python 3.8+ because the function time.clock() has been
+removed in Python 3.8, after having been deprecated since Python 3.3.
+
+Obtained from:
+https://github.com/shlomif/PySolFC/commit/0961401105850a18ff129e2c25cfffae45a81752
+
+--- pysollib/mfxutil.py.orig 2021-06-09 18:23:28 UTC
++++ pysollib/mfxutil.py
+@@ -143,7 +143,11 @@ def getprefdir(package):
+
+
+ # high resolution clock() and sleep()
+-uclock = time.clock
++try:
++ uclock = time.perf_counter
++except Exception:
++ uclock = time.clock
++
+ usleep = time.sleep
+ if os.name == "posix":
+ uclock = time.time