Date: Tuesday, April 11, 2023 @ 16:54:46 Author: arojas Revision: 1444702
upgpkg: displaycal 3.9.10-2: Python 3.11 rebuild Added: displaycal/trunk/3762e7be.patch Modified: displaycal/trunk/PKGBUILD ----------------+ 3762e7be.patch | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ PKGBUILD | 13 ++++++-- 2 files changed, 90 insertions(+), 3 deletions(-) Added: 3762e7be.patch =================================================================== --- 3762e7be.patch (rev 0) +++ 3762e7be.patch 2023-04-11 16:54:46 UTC (rev 1444702) @@ -0,0 +1,80 @@ +From 3762e7be0368484d68c4a90923672fdb0f51a5fc Mon Sep 17 00:00:00 2001 +From: Patrick Zwerschke <[email protected]> +Date: Tue, 6 Dec 2022 03:41:27 +0100 +Subject: [PATCH] Update test workflow for python 3.11 (#215) + +- added python 3.11 to test workflow +- catch FileNotFoundError in module defaultpaths +--- + .github/workflows/pytest.yml | 10 +++++++--- + DisplayCAL/RealDisplaySizeMM.py | 2 ++ + DisplayCAL/defaultpaths.py | 17 +++++++++-------- + DisplayCAL/lib64/python311/__init__.py | 0 + README.md | 2 +- + 5 files changed, 19 insertions(+), 12 deletions(-) + create mode 100644 DisplayCAL/lib64/python311/__init__.py + +diff --git a/DisplayCAL/RealDisplaySizeMM.py b/DisplayCAL/RealDisplaySizeMM.py +index 00957692c..25b730d05 100644 +--- a/DisplayCAL/RealDisplaySizeMM.py ++++ b/DisplayCAL/RealDisplaySizeMM.py +@@ -25,6 +25,8 @@ + from DisplayCAL.lib64.python39.RealDisplaySizeMM import * + elif sys.version_info[:2] == (3, 10): + from DisplayCAL.lib64.python310.RealDisplaySizeMM import * ++ elif sys.version_info[:2] == (3, 11): ++ from DisplayCAL.lib64.python311.RealDisplaySizeMM import * + # else: + # pass + +diff --git a/DisplayCAL/defaultpaths.py b/DisplayCAL/defaultpaths.py +index cd11d6d75..59258e79d 100644 +--- a/DisplayCAL/defaultpaths.py ++++ b/DisplayCAL/defaultpaths.py +@@ -235,9 +235,14 @@ def set_translation(obj): + obj.GETTEXT_PACKAGE, locale_dir, codeset="UTF-8" + ) + except TypeError: +- obj.translation = gettext.translation( +- obj.GETTEXT_PACKAGE, locale_dir +- ) ++ try: ++ obj.translation = gettext.translation( ++ obj.GETTEXT_PACKAGE, locale_dir ++ ) ++ except FileNotFoundError as exc: ++ print("XDG:", exc) ++ obj.translation = gettext.NullTranslations() ++ return False + except IOError as exception: + print("XDG:", exception) + obj.translation = gettext.NullTranslations() +@@ -261,11 +266,7 @@ def get_config_files(filename): + + @staticmethod + def shell_unescape(s): +- a = [] +- for i, c in enumerate(s): +- if c == "\\" and len(s) > i + 1: +- continue +- a.append(c) ++ a = [c for i, c in enumerate(s) if c != "\\" or len(s) <= i + 1] + return "".join(a) + + @staticmethod +diff --git a/DisplayCAL/lib64/python311/__init__.py b/DisplayCAL/lib64/python311/__init__.py +new file mode 100644 +index 000000000..e69de29bb +diff --git a/README.md b/README.md +index 3ff3c4ec4..4119ace70 100644 +--- a/README.md ++++ b/README.md +@@ -25,7 +25,7 @@ Here is a screenshots showing the tool working with Python 3.10: + +  + +-Currently, DisplayCAL is working with Python 3.8, 3.9 and 3.10 and wxPython 4.1.1 or 4.2.0. ++Currently, DisplayCAL is working with Python 3.8, 3.9, 3.10 and 3.11 and wxPython 4.1.1 or 4.2.0. + + Here is a list of things that is working: + Modified: PKGBUILD =================================================================== --- PKGBUILD 2023-04-11 16:46:06 UTC (rev 1444701) +++ PKGBUILD 2023-04-11 16:54:46 UTC (rev 1444702) @@ -6,7 +6,7 @@ _pkgname=DisplayCAL pkgname=displaycal pkgver=3.9.10 -pkgrel=1 +pkgrel=2 pkgdesc="Open Source Display Calibration and Characterization powered by Argyll CMS (Formerly known as dispcalGUI)" arch=(x86_64) url="https://github.com/eoyilmaz/displaycal-py3" @@ -18,9 +18,16 @@ python-setuptools python-wheel) optdepends=('gnome-color-manager: profile installation for GNOME' 'colord-kde: profile installation for KDE Plasma') -source=(${url}/releases/download/${pkgver}/${_pkgname}-${pkgver}.tar.gz) -sha256sums=('a031c355bd33b800b8f723df98d7bbc6e14a680d414591abef95f0b0baae807b') +source=(${url}/releases/download/${pkgver}/${_pkgname}-${pkgver}.tar.gz + 3762e7be.patch) +sha256sums=('a031c355bd33b800b8f723df98d7bbc6e14a680d414591abef95f0b0baae807b' + 'a392f409342e7eb7892f0341c550fd26a8a8e65672ed1f039adbf6f524ebd701') +prepare() { + cd ${_pkgname}-${pkgver} + patch -p1 -i ../3762e7be.patch # Fix build with Python 3.11 +} + build() { cd ${_pkgname}-${pkgver} python -m build --wheel --no-isolation
