From 070371db43f006bf923b4d0e342ba93713039c7b Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Wed, 9 Nov 2022 20:08:17 +0300 Subject: [PATCH] dispcalGUI: update to 3.9.8, change upstream. dispcalGUI is not maintained by its original authors anymore. The significant advantage of the fork is python 3 support which excludes python 2 from dependencies (related to void-packages#38229). --- srcpkgs/dispcalGUI/patches/error.patch | 44 ++++----- srcpkgs/dispcalGUI/patches/fix-gettext.patch | 13 +++ .../patches/fix-hardcoded-import.patch | 18 ++++ srcpkgs/dispcalGUI/patches/update-check.patch | 90 +++++++++++++++++++ srcpkgs/dispcalGUI/template | 36 ++++---- 5 files changed, 163 insertions(+), 38 deletions(-) create mode 100644 srcpkgs/dispcalGUI/patches/fix-gettext.patch create mode 100644 srcpkgs/dispcalGUI/patches/fix-hardcoded-import.patch create mode 100644 srcpkgs/dispcalGUI/patches/update-check.patch diff --git a/srcpkgs/dispcalGUI/patches/error.patch b/srcpkgs/dispcalGUI/patches/error.patch index 169fc528b138..757a906b9ddc 100644 --- a/srcpkgs/dispcalGUI/patches/error.patch +++ b/srcpkgs/dispcalGUI/patches/error.patch @@ -4,30 +4,30 @@ Therefore the current code either results in garbled output or doesn't work at all. Replace it with a simple printf. --- ---- a/DisplayCAL/RealDisplaySizeMM.c 2018-07-25 16:47:01.000000000 +0200 -+++ b/DisplayCAL/RealDisplaySizeMM.c 2018-07-25 16:47:01.000000000 +0200 -@@ -822,13 +822,13 @@ - sprintf(desc1, "_ICC_PROFILE_%d",disps[ndisps]->uscreen); +--- a/DisplayCAL/RealDisplaySizeMM.c ++++ b/DisplayCAL/RealDisplaySizeMM.c +@@ -835,13 +835,13 @@ + sprintf(desc1, "_ICC_PROFILE_%d",disps[ndisps]->uscreen); - if ((disps[ndisps]->icc_atom = XInternAtom(mydisplay, desc1, False)) == None) -- error("Unable to intern atom '%s'",desc1); -+ fprintf(stderr, "Unable to intern atom '%s'",desc1); + if ((disps[ndisps]->icc_atom = XInternAtom(mydisplay, desc1, False)) == None) +- error("Unable to intern atom '%s'",desc1); ++ fprintf(stderr, "Unable to intern atom '%s'",desc1); - debugrr2((errout,"Root atom '%s'\n",desc1)); + debugrr2((errout,"Root atom '%s'\n",desc1)); - /* Create the atom of the output that may contain the associated ICC profile */ - if ((disps[ndisps]->icc_out_atom = XInternAtom(mydisplay, "_ICC_PROFILE", False)) == None) -- error("Unable to intern atom '%s'","_ICC_PROFILE"); -+ fprintf(stderr, "Unable to intern atom '%s'","_ICC_PROFILE"); - - /* Grab the EDID from the output */ - { -@@ -993,7 +993,7 @@ - sprintf(desc1, "_ICC_PROFILE_%d",disps[i]->uscreen); + /* Create the atom of the output that may contain the associated ICC profile */ + if ((disps[ndisps]->icc_out_atom = XInternAtom(mydisplay, "_ICC_PROFILE", False)) == None) +- error("Unable to intern atom '%s'","_ICC_PROFILE"); ++ fprintf(stderr, "Unable to intern atom '%s'","_ICC_PROFILE"); - if ((disps[i]->icc_atom = XInternAtom(mydisplay, desc1, False)) == None) -- error("Unable to intern atom '%s'",desc1); -+ fprintf(stderr, "Unable to intern atom '%s'",desc1); + /* Grab the EDID from the output */ + { +@@ -1007,7 +1007,7 @@ + sprintf(desc1, "_ICC_PROFILE_%d",disps[i]->uscreen); - /* See if we can locate the EDID of the monitor for this screen */ - for (j = 0; j < 2; j++) { + if ((disps[i]->icc_atom = XInternAtom(mydisplay, desc1, False)) == None) +- error("Unable to intern atom '%s'",desc1); ++ fprintf(stderr, "Unable to intern atom '%s'",desc1); + + /* See if we can locate the EDID of the monitor for this screen */ + for (j = 0; j < 2; j++) { diff --git a/srcpkgs/dispcalGUI/patches/fix-gettext.patch b/srcpkgs/dispcalGUI/patches/fix-gettext.patch new file mode 100644 index 000000000000..8236dca857c1 --- /dev/null +++ b/srcpkgs/dispcalGUI/patches/fix-gettext.patch @@ -0,0 +1,13 @@ +"codeset" in gettext.translation() is deprecated with python 3.11 + +--- a/DisplayCAL/defaultpaths.py ++++ b/DisplayCAL/defaultpaths.py +@@ -231,7 +231,7 @@ + + try: + obj.translation = gettext.translation( +- obj.GETTEXT_PACKAGE, locale_dir, codeset="UTF-8" ++ obj.GETTEXT_PACKAGE, locale_dir + ) + except IOError as exception: + print("XDG:", exception) diff --git a/srcpkgs/dispcalGUI/patches/fix-hardcoded-import.patch b/srcpkgs/dispcalGUI/patches/fix-hardcoded-import.patch new file mode 100644 index 000000000000..2d2f8ff6209d --- /dev/null +++ b/srcpkgs/dispcalGUI/patches/fix-hardcoded-import.patch @@ -0,0 +1,18 @@ +--- a/DisplayCAL/RealDisplaySizeMM.py ++++ b/DisplayCAL/RealDisplaySizeMM.py +@@ -17,14 +17,10 @@ + # TODO: Intel vs ARM (Apple Silicon) distinction + from DisplayCAL.lib64.RealDisplaySizeMM import * + else: +- # elif sys.platform == "win32": +- # Windows have separate files +- if sys.version_info[:2] == (3, 8): +- from DisplayCAL.lib64.python38.RealDisplaySizeMM import * +- elif sys.version_info[:2] == (3, 9): +- from DisplayCAL.lib64.python39.RealDisplaySizeMM import * +- elif sys.version_info[:2] == (3, 10): +- from DisplayCAL.lib64.python310.RealDisplaySizeMM import * ++ if platform.architecture()[0].startswith("64"): ++ from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import * + # else: + # pass diff --git a/srcpkgs/dispcalGUI/patches/update-check.patch b/srcpkgs/dispcalGUI/patches/update-check.patch new file mode 100644 index 000000000000..382943a6724e --- /dev/null +++ b/srcpkgs/dispcalGUI/patches/update-check.patch @@ -0,0 +1,90 @@ +Quite a crude attempt to remove update checks, but it should work. + +Update checks also used to trigger popup donation window at startup, +but not anymore with these patches. + +--- a/DisplayCAL/display_cal.py ++++ b/DisplayCAL/display_cal.py +@@ -3119,16 +3119,6 @@ + self.Bind(wx.EVT_MENU, self.help_support_handler, menuitem) + menuitem = help.FindItemById(help.FindItem("bug_report")) + self.Bind(wx.EVT_MENU, self.bug_report_handler, menuitem) +- self.menuitem_app_auto_update_check = help.FindItemById( +- help.FindItem("update_check.onstartup") +- ) +- self.Bind( +- wx.EVT_MENU, +- self.app_auto_update_check_handler, +- self.menuitem_app_auto_update_check, +- ) +- menuitem = help.FindItemById(help.FindItem("update_check")) +- self.Bind(wx.EVT_MENU, self.app_update_check_handler, menuitem) + + if sys.platform == "darwin": + wx.GetApp().SetMacAboutMenuItemId(self.menuitem_about.GetId()) +@@ -3257,7 +3247,6 @@ + self.menuitem_show_log.Check(bool(getcfg("log.show"))) + self.menuitem_log_autoshow.Enable(not bool(getcfg("log.show"))) + self.menuitem_log_autoshow.Check(bool(getcfg("log.autoshow"))) +- self.menuitem_app_auto_update_check.Check(bool(getcfg("update_check"))) + + def init_controls(self): + """Initialize the main window controls and their event handlers.""" +@@ -4047,7 +4036,6 @@ + "untethered.max_delta.chroma", + "untethered.min_delta", + "untethered.min_delta.lightness", +- "update_check", + "webserver.portnumber", + "whitepoint.visual_editor.bg_v", + "whitepoint.visual_editor.b", +@@ -19474,19 +19462,6 @@ + app.frame.Show() + app.process_argv(1) + wx.CallAfter(app.frame.Raise) +- # Check for updates if configured +- if getcfg("update_check"): +- # Give time for the main window to gain focus before checking for +- # update, otherwise the main window may steal the update +- # confirmation dialog's focus which looks weird +- wx.CallAfter(app.frame.app_update_check_handler, None, silent=True) +- else: +- # Check if we need to run instrument setup +- wx.CallAfter( +- app.frame.check_instrument_setup, +- check_donation, +- (app.frame, VERSION > VERSION_BASE), +- ) + # If resources are missing, XRC shows an error dialog which immediately + # gets hidden when we close ourselves because we are the parent. + # Hide instead. +--- a/DisplayCAL/worker.py ++++ b/DisplayCAL/worker.py +@@ -1610,10 +1610,6 @@ + dlg_result = dlg.ShowModal() + dlg.Destroy() + if dlg_result == wx.ID_OK: +- # Download Argyll CMS +- from DisplayCAL.display_cal import app_update_check +- +- app_update_check(parent, silent, argyll=True) + return False + elif dlg_result == wx.ID_CANCEL: + if callafter: +--- a/DisplayCAL/xrc/mainmenu.xrc ++++ b/DisplayCAL/xrc/mainmenu.xrc +@@ -231,14 +231,6 @@ + + + +- +- +- 1 +- +- +- +- +- + + + diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template index 05086b97e5a2..5832f0e119c6 100644 --- a/srcpkgs/dispcalGUI/template +++ b/srcpkgs/dispcalGUI/template @@ -1,25 +1,29 @@ # Template file for 'dispcalGUI' pkgname=dispcalGUI -version=3.8.9.3 -revision=5 -_name="DisplayCAL" -build_style=python2-module -hostmakedepends="python" -makedepends="python-devel libXxf86vm-devel libXinerama-devel libXrandr-devel" -depends="python-dbus python-numpy wxPython argyllcms" +version=3.9.8 +revision=1 +build_style=python3-module +hostmakedepends="python3-setuptools" +makedepends="python3-devel libXxf86vm-devel libXinerama-devel libXrandr-devel" +depends="python3-distro python3-dbus python3-numpy python3-Pillow + python3-chromecast python3-send2trash wxPython4 python3-zeroconf argyllcms" short_desc="Display Calibration and Characterization" maintainer="lemmi " license="GPL-3.0-or-later" -homepage="https://displaycal.net/" -changelog="https://displaycal.net/CHANGES.html" -distfiles="${SOURCEFORGE_SITE}/dispcalgui/${_name}-${version}.tar.gz" -checksum=7c34dfbd9f66f24f1d4c88de4a5a0de688aad719f095874b6259637d30893bea +homepage="https://github.com/eoyilmaz/displaycal-py3" +changelog="https://github.com/eoyilmaz/displaycal-py3/releases/tag/${version}" +distfiles="https://github.com/eoyilmaz/displaycal-py3/archive/${version}.tar.gz" +checksum=a9e8bba02f9bdf8df506f0dcbbea4eae48795001cb81ea5968fbfc41f4b72e1d +# requires running dbus-daemon +make_check=no -pre_configure() { - sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop +post_patch() { + # bump to the latest version of python + sed -i "s|^\(py_maxversion =\).*|\1 (${py3_ver%.*}, ${py3_ver#*.})|" DisplayCAL/meta.py + + sed -i "s|@PY_VER@|${py3_ver/./}|g" DisplayCAL/RealDisplaySizeMM.py } -post_install() { - find ${DESTDIR}/usr/ -exec chmod a+r \{\} + - find ${DESTDIR}/usr/ -type d -exec chmod a+x \{\} + +pre_configure() { + sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop }