Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] dispcalGUI: update to 3.9.8, change upstream.
@ 2022-11-09 17:56 kruceter
  2022-11-09 18:05 ` [PR PATCH] [Updated] " kruceter
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: kruceter @ 2022-11-09 17:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

There is a new pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 11826 bytes --]

From 070371db43f006bf923b4d0e342ba93713039c7b Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
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 <lemmi@nerd2nerd.org>"
 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
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
@ 2022-11-09 18:05 ` kruceter
  2022-11-10  0:28 ` kruceter
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-09 18:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 11770 bytes --]

From 38e055e3a2415c8f805076489663705fae45a8a5 Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
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 <lemmi@nerd2nerd.org>"
 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
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
  2022-11-09 18:05 ` [PR PATCH] [Updated] " kruceter
@ 2022-11-10  0:28 ` kruceter
  2022-11-10  7:13 ` [PR PATCH] [Updated] " kruceter
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-10  0:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#issuecomment-1309583942

Comment:
Found some flaws in the template, turning into draft until solved.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
  2022-11-09 18:05 ` [PR PATCH] [Updated] " kruceter
  2022-11-10  0:28 ` kruceter
@ 2022-11-10  7:13 ` kruceter
  2022-11-11 16:49 ` kruceter
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-10  7:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 17588 bytes --]

From 478a7e4f1f06e66ec3e334141af132721228fd22 Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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 +++
 .../dispcalGUI/patches/fix-setuptools.patch   |  18 +++
 srcpkgs/dispcalGUI/patches/fix-version.patch  | 111 ++++++++++++++++++
 srcpkgs/dispcalGUI/patches/update-check.patch |  90 ++++++++++++++
 srcpkgs/dispcalGUI/template                   |  39 +++---
 7 files changed, 295 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/fix-setuptools.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/fix-version.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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import *
+ # else:
+ #     pass
+ 
diff --git a/srcpkgs/dispcalGUI/patches/fix-setuptools.patch b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
new file mode 100644
index 000000000000..aa1cdcb768b0
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
@@ -0,0 +1,18 @@
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -453,7 +453,6 @@
+     prefix = ""
+     recordfile_name = None  # record installed files to this file
+     sdist = "sdist" in sys.argv[1:]
+-    setuptools = None
+     skip_postinstall = "--skip-postinstall" in sys.argv[1:]
+     use_distutils = not bdist_bbfreeze and not do_py2app
+     use_setuptools = (
+@@ -480,7 +479,6 @@
+             import setuptools
+             from setuptools import setup, Extension
+ 
+-            setuptools = True
+             print("using setuptools")
+             current_findall = setuptools.findall
+         except ImportError:
diff --git a/srcpkgs/dispcalGUI/patches/fix-version.patch b/srcpkgs/dispcalGUI/patches/fix-version.patch
new file mode 100644
index 000000000000..ae0709b2b68c
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-version.patch
@@ -0,0 +1,111 @@
+setup.py uses package version provided that the builddir is a git
+repository and git is present in hostmakedepends.
+
+Otherwise 0.0.0 is supplied as the version.
+
+--- a/setup.py
++++ b/setup.py
+@@ -445,71 +445,40 @@
+ 
+     from DisplayCAL.util_os import which
+ 
+-    if (
+-        Path(pydir, ".git").is_dir()
+-        and (which("git") or which("git.exe"))
+-        and (not sys.argv[1:] or (len(non_build_args) < len(sys.argv[1:]) and not help))
+-    ):
+-        print("Trying to get git version information...")
+-        git_version = None
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "rev-parse", "--short", "HEAD"],
+-                stdout=subprocess.PIPE,
+-                cwd=pydir,
+-            )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            git_version = p.communicate()[0].strip().decode()
+-            version_base_file_path = Path(pydir, "VERSION_BASE")
+-            version_base = "0.0.0".split(".")
+-
+-            if version_base_file_path.is_file():
+-                with open(version_base_file_path) as version_base_file:
+-                    version_base = version_base_file.read().strip().split(".")
+-
+-        print("Trying to get git information...")
+-        lastmod = ""
+-        timestamp = None
+-        mtime = 0
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "log", "-1", "--format=%ct"], stdout=subprocess.PIPE, cwd=pydir
++    version_base_file_path = Path(pydir, "VERSION_BASE")
++
++    with open(version_base_file_path) as version_base_file:
++        version_base = version_base_file.read().strip().split(".")
++
++    lastmod = ""
++    timestamp = None
++    mtime = 0
++    timestamp = time.gmtime(mtime)
++
++    if timestamp:
++        lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
++
++    if not dry_run:
++        print("Generating __version__.py")
++
++        with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
++            versionpy.write("# generated by setup.py\n\n")
++            build_time = time.time()
++            versionpy.write(
++                f"BUILD_DATE = "
++                f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+             )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            mtime = int(p.communicate()[0].strip().decode())
+-            timestamp = time.gmtime(mtime)
+-
+-        if timestamp:
+-            lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
+-
+-        if not dry_run:
+-            print("Generating __version__.py")
+-
+-            with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
+-                versionpy.write("# generated by setup.py\n\n")
+-                build_time = time.time()
+-                versionpy.write(
+-                    f"BUILD_DATE = "
+-                    f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+-                )
+-
+-                if lastmod:
+-                    versionpy.write(f"LASTMOD = {lastmod!r}\n")
+-
+-                if git_version:
+-                    print("Version", ".".join(version_base))
+-                    versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
+ 
+-                    with open(Path(pydir, "VERSION"), "w") as versiontxt:
+-                        versiontxt.write(".".join(version_base))
++            if lastmod:
++                versionpy.write(f"LASTMOD = {lastmod!r}\n")
++
++            print("Version", ".".join(version_base))
++            versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
++
++            with open(Path(pydir, "VERSION"), "w") as versiontxt:
++                versiontxt.write(".".join(version_base))
+ 
+     backup_setup_path = Path(pydir, "setup.cfg.backup")
+     setup_path = Path(pydir, "setup.cfg")
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template
index 05086b97e5a2..1a82b91e0c20 100644
--- a/srcpkgs/dispcalGUI/template
+++ b/srcpkgs/dispcalGUI/template
@@ -1,25 +1,32 @@
 # 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
+# uses distutils without these options
+make_build_args="--use-setuptools"
+make_install_args="--use-setuptools"
+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 <lemmi@nerd2nerd.org>"
 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() {
+	# set the hardcoded version of python 3 to the latest one
+	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
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (2 preceding siblings ...)
  2022-11-10  7:13 ` [PR PATCH] [Updated] " kruceter
@ 2022-11-11 16:49 ` kruceter
  2022-11-11 16:51 ` kruceter
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-11 16:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 22681 bytes --]

From a487b243979532bd6c81fc8972791d8561c0362a Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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).
---
 .../dispcalGUI/patches/enable-appdata.patch   |  28 +++++
 srcpkgs/dispcalGUI/patches/error.patch        |  44 +++----
 srcpkgs/dispcalGUI/patches/fix-gettext.patch  |  13 ++
 .../patches/fix-hardcoded-import.patch        |  18 +++
 .../dispcalGUI/patches/fix-setuptools.patch   |  95 +++++++++++++++
 srcpkgs/dispcalGUI/patches/fix-version.patch  | 111 ++++++++++++++++++
 .../dispcalGUI/patches/rm-xdg-autostart.patch |  16 +++
 srcpkgs/dispcalGUI/patches/update-check.patch |  90 ++++++++++++++
 srcpkgs/dispcalGUI/template                   |  37 +++---
 9 files changed, 416 insertions(+), 36 deletions(-)
 create mode 100644 srcpkgs/dispcalGUI/patches/enable-appdata.patch
 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/fix-setuptools.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/fix-version.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/rm-xdg-autostart.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/update-check.patch

diff --git a/srcpkgs/dispcalGUI/patches/enable-appdata.patch b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
new file mode 100644
index 000000000000..cb1af7fed688
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
@@ -0,0 +1,28 @@
+create_appdata and buildservice are not set to True after calling
+setup.py externally ("sdist" and/or "install" are not used), leading to
+net.displaycal.DisplayCAL.appdata.xml not being found for copying in
+the build phase.
+
+--- a/setup.py
++++ b/setup.py
+@@ -639,18 +639,8 @@
+         if len(sys.argv) == 1 or (len(sys.argv) == 2 and dry_run):
+             return
+ 
+-    create_appdata = (
+-        (appdata or "install" in sys.argv[1:] or "sdist" in sys.argv[1:])
+-        and not help
+-        and not dry_run
+-    )
+-
+-    if (
+-        "sdist" in sys.argv[1:]
+-        or "install" in sys.argv[1:]
+-        or "bdist_deb" in sys.argv[1:]
+-    ) and not help:
+-        buildservice = True
++    create_appdata = True
++    buildservice = True
+ 
+     if create_appdata or buildservice:
+         with codecs.open(str(Path(pydir, "CHANGES.html")), "r", "UTF-8") as f:
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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import *
+ # else:
+ #     pass
+ 
diff --git a/srcpkgs/dispcalGUI/patches/fix-setuptools.patch b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
new file mode 100644
index 000000000000..47ef0ea2f6c9
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
@@ -0,0 +1,95 @@
+setuptools for some reason is used as a variable and a module.
+
+Initially this leads to "setuptools.findall" not being recognized as
+a command related to the module at all.
+
+Any use of module name in conditional statements also leads to error,
+hence simple solution: rename the variable.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -453,7 +453,7 @@
+     prefix = ""
+     recordfile_name = None  # record installed files to this file
+     sdist = "sdist" in sys.argv[1:]
+-    setuptools = None
++    setools = None
+     skip_postinstall = "--skip-postinstall" in sys.argv[1:]
+     use_distutils = not bdist_bbfreeze and not do_py2app
+     use_setuptools = (
+@@ -480,7 +480,7 @@
+             import setuptools
+             from setuptools import setup, Extension
+ 
+-            setuptools = True
++            setools = True
+             print("using setuptools")
+             current_findall = setuptools.findall
+         except ImportError:
+@@ -509,7 +509,7 @@
+ 
+         distutils.filelist.findall = findall
+ 
+-    if not setuptools:
++    if not setools:
+         from distutils.core import setup, Extension
+ 
+         print("using distutils")
+@@ -945,7 +945,7 @@
+     ext_modules = [RealDisplaySizeMM]
+ 
+     requires = []
+-    if not setuptools or sys.platform != "win32":
++    if not setools or sys.platform != "win32":
+         # wxPython windows installer doesn't add egg-info entry, so
+         # a dependency check from pkg_resources would always fail
+         requires.append("wxPython (>= %s)" % ".".join(str(n) for n in wx_minversion))
+@@ -1021,7 +1021,7 @@
+         "version": msiversion if "bdist_msi" in sys.argv[1:] else version,
+     }
+ 
+-    if setuptools:
++    if setools:
+         attrs["entry_points"] = {
+             "gui_scripts": [
+                 "%s = %s.main:main%s"
+@@ -1278,7 +1278,7 @@
+             attrs["options"]["py2exe"].update(
+                 {"bundle_files": 3, "compressed": 0, "optimize": 0, "skip_archive": 1}
+             )
+-        if setuptools:
++        if setools:
+             attrs["setup_requires"] = ["py2exe"]
+         attrs["zipfile"] = os.path.join("lib", "library.zip")
+ 
+@@ -1328,10 +1328,10 @@
+         # site-packages (on Mac and Windows) and when we want to make them
+         # absolute (Linux)
+         linux = sys.platform not in ("darwin", "win32") and (
+-            not cmd.root and setuptools
++            not cmd.root and setools
+         )
+         dar_win = (
+-            sys.platform in ("darwin", "win32") and (cmd.root or not setuptools)
++            sys.platform in ("darwin", "win32") and (cmd.root or not setools)
+         ) or bdist_win
+         if (
+             not do_uninstall
+@@ -1380,7 +1380,7 @@
+             # logic to find them
+             paths = safe_glob(os.path.join(cmd.install_scripts, name))
+             if sys.platform == "win32":
+-                if setuptools:
++                if setools:
+                     paths += safe_glob(os.path.join(cmd.install_scripts, f"{name}.exe"))
+                     paths += safe_glob(
+                         os.path.join(cmd.install_scripts, f"{name}-script.py")
+@@ -1587,7 +1587,7 @@
+         manifest_in.append("include " + os.path.join("tests", "*"))
+         manifest_in.append("recursive-include theme *")
+         manifest_in.append("recursive-include util *.cmd *.py *.sh")
+-        if sys.platform == "win32" and not setuptools:
++        if sys.platform == "win32" and not setools:
+             # Only needed under Windows
+             manifest_in.append("global-exclude .svn/*")
+         manifest_in.append("global-exclude *~")
diff --git a/srcpkgs/dispcalGUI/patches/fix-version.patch b/srcpkgs/dispcalGUI/patches/fix-version.patch
new file mode 100644
index 000000000000..ae0709b2b68c
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-version.patch
@@ -0,0 +1,111 @@
+setup.py uses package version provided that the builddir is a git
+repository and git is present in hostmakedepends.
+
+Otherwise 0.0.0 is supplied as the version.
+
+--- a/setup.py
++++ b/setup.py
+@@ -445,71 +445,40 @@
+ 
+     from DisplayCAL.util_os import which
+ 
+-    if (
+-        Path(pydir, ".git").is_dir()
+-        and (which("git") or which("git.exe"))
+-        and (not sys.argv[1:] or (len(non_build_args) < len(sys.argv[1:]) and not help))
+-    ):
+-        print("Trying to get git version information...")
+-        git_version = None
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "rev-parse", "--short", "HEAD"],
+-                stdout=subprocess.PIPE,
+-                cwd=pydir,
+-            )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            git_version = p.communicate()[0].strip().decode()
+-            version_base_file_path = Path(pydir, "VERSION_BASE")
+-            version_base = "0.0.0".split(".")
+-
+-            if version_base_file_path.is_file():
+-                with open(version_base_file_path) as version_base_file:
+-                    version_base = version_base_file.read().strip().split(".")
+-
+-        print("Trying to get git information...")
+-        lastmod = ""
+-        timestamp = None
+-        mtime = 0
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "log", "-1", "--format=%ct"], stdout=subprocess.PIPE, cwd=pydir
++    version_base_file_path = Path(pydir, "VERSION_BASE")
++
++    with open(version_base_file_path) as version_base_file:
++        version_base = version_base_file.read().strip().split(".")
++
++    lastmod = ""
++    timestamp = None
++    mtime = 0
++    timestamp = time.gmtime(mtime)
++
++    if timestamp:
++        lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
++
++    if not dry_run:
++        print("Generating __version__.py")
++
++        with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
++            versionpy.write("# generated by setup.py\n\n")
++            build_time = time.time()
++            versionpy.write(
++                f"BUILD_DATE = "
++                f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+             )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            mtime = int(p.communicate()[0].strip().decode())
+-            timestamp = time.gmtime(mtime)
+-
+-        if timestamp:
+-            lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
+-
+-        if not dry_run:
+-            print("Generating __version__.py")
+-
+-            with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
+-                versionpy.write("# generated by setup.py\n\n")
+-                build_time = time.time()
+-                versionpy.write(
+-                    f"BUILD_DATE = "
+-                    f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+-                )
+-
+-                if lastmod:
+-                    versionpy.write(f"LASTMOD = {lastmod!r}\n")
+-
+-                if git_version:
+-                    print("Version", ".".join(version_base))
+-                    versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
+ 
+-                    with open(Path(pydir, "VERSION"), "w") as versiontxt:
+-                        versiontxt.write(".".join(version_base))
++            if lastmod:
++                versionpy.write(f"LASTMOD = {lastmod!r}\n")
++
++            print("Version", ".".join(version_base))
++            versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
++
++            with open(Path(pydir, "VERSION"), "w") as versiontxt:
++                versiontxt.write(".".join(version_base))
+ 
+     backup_setup_path = Path(pydir, "setup.cfg.backup")
+     setup_path = Path(pydir, "setup.cfg")
diff --git a/srcpkgs/dispcalGUI/patches/rm-xdg-autostart.patch b/srcpkgs/dispcalGUI/patches/rm-xdg-autostart.patch
new file mode 100644
index 000000000000..7f95e07521f2
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/rm-xdg-autostart.patch
@@ -0,0 +1,16 @@
+Tries to install a desktop file in /usr/share/tmp instead of
+/etc/xdg/autostart.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -709,9 +709,7 @@
+             )
+             data_files.append(
+                 (
+-                    autostart
+-                    if os.geteuid() == 0 or prefix.startswith("/")
+-                    else autostart_home,
++                    autostart,
+                     [
+                         os.path.join(
+                             pydir,
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template
index 05086b97e5a2..b68465fcc3ad 100644
--- a/srcpkgs/dispcalGUI/template
+++ b/srcpkgs/dispcalGUI/template
@@ -1,25 +1,34 @@
 # 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-pep517
+hostmakedepends="python3-setuptools python3-wheel"
+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
+ python3-certifi argyllcms"
 short_desc="Display Calibration and Characterization"
 maintainer="lemmi <lemmi@nerd2nerd.org>"
 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 X11 server and dbus-daemon
+make_check=no
+
+post_patch() {
+	# set the hardcoded version of python 3 to the latest one
+	sed -i "s|^\(py_maxversion =\).*|\1 (${py3_ver%.*}, ${py3_ver#*.})|" DisplayCAL/meta.py
+
+	sed -i "s|@PY_VER@|${py3_ver/./}|g" DisplayCAL/RealDisplaySizeMM.py
+}
 
 pre_configure() {
 	sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop
 }
 
-post_install() {
-	find ${DESTDIR}/usr/ -exec chmod a+r \{\} +
-	find ${DESTDIR}/usr/ -type d -exec chmod a+x \{\} +
+do_install() {
+	python3 -m installer --destdir ${DESTDIR} dist/*.whl
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (3 preceding siblings ...)
  2022-11-11 16:49 ` kruceter
@ 2022-11-11 16:51 ` kruceter
  2022-11-12 19:59 ` kruceter
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-11 16:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 22669 bytes --]

From 334f938028242cdffb2d1b7fcbac684a9e32b5e2 Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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).
---
 .../dispcalGUI/patches/enable-appdata.patch   |  28 +++++
 srcpkgs/dispcalGUI/patches/error.patch        |  44 +++----
 srcpkgs/dispcalGUI/patches/fix-gettext.patch  |  13 ++
 .../patches/fix-hardcoded-import.patch        |  18 +++
 .../dispcalGUI/patches/fix-setuptools.patch   |  95 +++++++++++++++
 srcpkgs/dispcalGUI/patches/fix-version.patch  | 111 ++++++++++++++++++
 srcpkgs/dispcalGUI/patches/update-check.patch |  90 ++++++++++++++
 .../dispcalGUI/patches/xdg-autostart.patch    |  16 +++
 srcpkgs/dispcalGUI/template                   |  37 +++---
 9 files changed, 416 insertions(+), 36 deletions(-)
 create mode 100644 srcpkgs/dispcalGUI/patches/enable-appdata.patch
 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/fix-setuptools.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/fix-version.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/update-check.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/xdg-autostart.patch

diff --git a/srcpkgs/dispcalGUI/patches/enable-appdata.patch b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
new file mode 100644
index 000000000000..cb1af7fed688
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
@@ -0,0 +1,28 @@
+create_appdata and buildservice are not set to True after calling
+setup.py externally ("sdist" and/or "install" are not used), leading to
+net.displaycal.DisplayCAL.appdata.xml not being found for copying in
+the build phase.
+
+--- a/setup.py
++++ b/setup.py
+@@ -639,18 +639,8 @@
+         if len(sys.argv) == 1 or (len(sys.argv) == 2 and dry_run):
+             return
+ 
+-    create_appdata = (
+-        (appdata or "install" in sys.argv[1:] or "sdist" in sys.argv[1:])
+-        and not help
+-        and not dry_run
+-    )
+-
+-    if (
+-        "sdist" in sys.argv[1:]
+-        or "install" in sys.argv[1:]
+-        or "bdist_deb" in sys.argv[1:]
+-    ) and not help:
+-        buildservice = True
++    create_appdata = True
++    buildservice = True
+ 
+     if create_appdata or buildservice:
+         with codecs.open(str(Path(pydir, "CHANGES.html")), "r", "UTF-8") as f:
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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import *
+ # else:
+ #     pass
+ 
diff --git a/srcpkgs/dispcalGUI/patches/fix-setuptools.patch b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
new file mode 100644
index 000000000000..47ef0ea2f6c9
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
@@ -0,0 +1,95 @@
+setuptools for some reason is used as a variable and a module.
+
+Initially this leads to "setuptools.findall" not being recognized as
+a command related to the module at all.
+
+Any use of module name in conditional statements also leads to error,
+hence simple solution: rename the variable.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -453,7 +453,7 @@
+     prefix = ""
+     recordfile_name = None  # record installed files to this file
+     sdist = "sdist" in sys.argv[1:]
+-    setuptools = None
++    setools = None
+     skip_postinstall = "--skip-postinstall" in sys.argv[1:]
+     use_distutils = not bdist_bbfreeze and not do_py2app
+     use_setuptools = (
+@@ -480,7 +480,7 @@
+             import setuptools
+             from setuptools import setup, Extension
+ 
+-            setuptools = True
++            setools = True
+             print("using setuptools")
+             current_findall = setuptools.findall
+         except ImportError:
+@@ -509,7 +509,7 @@
+ 
+         distutils.filelist.findall = findall
+ 
+-    if not setuptools:
++    if not setools:
+         from distutils.core import setup, Extension
+ 
+         print("using distutils")
+@@ -945,7 +945,7 @@
+     ext_modules = [RealDisplaySizeMM]
+ 
+     requires = []
+-    if not setuptools or sys.platform != "win32":
++    if not setools or sys.platform != "win32":
+         # wxPython windows installer doesn't add egg-info entry, so
+         # a dependency check from pkg_resources would always fail
+         requires.append("wxPython (>= %s)" % ".".join(str(n) for n in wx_minversion))
+@@ -1021,7 +1021,7 @@
+         "version": msiversion if "bdist_msi" in sys.argv[1:] else version,
+     }
+ 
+-    if setuptools:
++    if setools:
+         attrs["entry_points"] = {
+             "gui_scripts": [
+                 "%s = %s.main:main%s"
+@@ -1278,7 +1278,7 @@
+             attrs["options"]["py2exe"].update(
+                 {"bundle_files": 3, "compressed": 0, "optimize": 0, "skip_archive": 1}
+             )
+-        if setuptools:
++        if setools:
+             attrs["setup_requires"] = ["py2exe"]
+         attrs["zipfile"] = os.path.join("lib", "library.zip")
+ 
+@@ -1328,10 +1328,10 @@
+         # site-packages (on Mac and Windows) and when we want to make them
+         # absolute (Linux)
+         linux = sys.platform not in ("darwin", "win32") and (
+-            not cmd.root and setuptools
++            not cmd.root and setools
+         )
+         dar_win = (
+-            sys.platform in ("darwin", "win32") and (cmd.root or not setuptools)
++            sys.platform in ("darwin", "win32") and (cmd.root or not setools)
+         ) or bdist_win
+         if (
+             not do_uninstall
+@@ -1380,7 +1380,7 @@
+             # logic to find them
+             paths = safe_glob(os.path.join(cmd.install_scripts, name))
+             if sys.platform == "win32":
+-                if setuptools:
++                if setools:
+                     paths += safe_glob(os.path.join(cmd.install_scripts, f"{name}.exe"))
+                     paths += safe_glob(
+                         os.path.join(cmd.install_scripts, f"{name}-script.py")
+@@ -1587,7 +1587,7 @@
+         manifest_in.append("include " + os.path.join("tests", "*"))
+         manifest_in.append("recursive-include theme *")
+         manifest_in.append("recursive-include util *.cmd *.py *.sh")
+-        if sys.platform == "win32" and not setuptools:
++        if sys.platform == "win32" and not setools:
+             # Only needed under Windows
+             manifest_in.append("global-exclude .svn/*")
+         manifest_in.append("global-exclude *~")
diff --git a/srcpkgs/dispcalGUI/patches/fix-version.patch b/srcpkgs/dispcalGUI/patches/fix-version.patch
new file mode 100644
index 000000000000..ae0709b2b68c
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-version.patch
@@ -0,0 +1,111 @@
+setup.py uses package version provided that the builddir is a git
+repository and git is present in hostmakedepends.
+
+Otherwise 0.0.0 is supplied as the version.
+
+--- a/setup.py
++++ b/setup.py
+@@ -445,71 +445,40 @@
+ 
+     from DisplayCAL.util_os import which
+ 
+-    if (
+-        Path(pydir, ".git").is_dir()
+-        and (which("git") or which("git.exe"))
+-        and (not sys.argv[1:] or (len(non_build_args) < len(sys.argv[1:]) and not help))
+-    ):
+-        print("Trying to get git version information...")
+-        git_version = None
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "rev-parse", "--short", "HEAD"],
+-                stdout=subprocess.PIPE,
+-                cwd=pydir,
+-            )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            git_version = p.communicate()[0].strip().decode()
+-            version_base_file_path = Path(pydir, "VERSION_BASE")
+-            version_base = "0.0.0".split(".")
+-
+-            if version_base_file_path.is_file():
+-                with open(version_base_file_path) as version_base_file:
+-                    version_base = version_base_file.read().strip().split(".")
+-
+-        print("Trying to get git information...")
+-        lastmod = ""
+-        timestamp = None
+-        mtime = 0
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "log", "-1", "--format=%ct"], stdout=subprocess.PIPE, cwd=pydir
++    version_base_file_path = Path(pydir, "VERSION_BASE")
++
++    with open(version_base_file_path) as version_base_file:
++        version_base = version_base_file.read().strip().split(".")
++
++    lastmod = ""
++    timestamp = None
++    mtime = 0
++    timestamp = time.gmtime(mtime)
++
++    if timestamp:
++        lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
++
++    if not dry_run:
++        print("Generating __version__.py")
++
++        with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
++            versionpy.write("# generated by setup.py\n\n")
++            build_time = time.time()
++            versionpy.write(
++                f"BUILD_DATE = "
++                f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+             )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            mtime = int(p.communicate()[0].strip().decode())
+-            timestamp = time.gmtime(mtime)
+-
+-        if timestamp:
+-            lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
+-
+-        if not dry_run:
+-            print("Generating __version__.py")
+-
+-            with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
+-                versionpy.write("# generated by setup.py\n\n")
+-                build_time = time.time()
+-                versionpy.write(
+-                    f"BUILD_DATE = "
+-                    f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+-                )
+-
+-                if lastmod:
+-                    versionpy.write(f"LASTMOD = {lastmod!r}\n")
+-
+-                if git_version:
+-                    print("Version", ".".join(version_base))
+-                    versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
+ 
+-                    with open(Path(pydir, "VERSION"), "w") as versiontxt:
+-                        versiontxt.write(".".join(version_base))
++            if lastmod:
++                versionpy.write(f"LASTMOD = {lastmod!r}\n")
++
++            print("Version", ".".join(version_base))
++            versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
++
++            with open(Path(pydir, "VERSION"), "w") as versiontxt:
++                versiontxt.write(".".join(version_base))
+ 
+     backup_setup_path = Path(pydir, "setup.cfg.backup")
+     setup_path = Path(pydir, "setup.cfg")
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
diff --git a/srcpkgs/dispcalGUI/patches/xdg-autostart.patch b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
new file mode 100644
index 000000000000..7f95e07521f2
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
@@ -0,0 +1,16 @@
+Tries to install a desktop file in /usr/share/tmp instead of
+/etc/xdg/autostart.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -709,9 +709,7 @@
+             )
+             data_files.append(
+                 (
+-                    autostart
+-                    if os.geteuid() == 0 or prefix.startswith("/")
+-                    else autostart_home,
++                    autostart,
+                     [
+                         os.path.join(
+                             pydir,
diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template
index 05086b97e5a2..b68465fcc3ad 100644
--- a/srcpkgs/dispcalGUI/template
+++ b/srcpkgs/dispcalGUI/template
@@ -1,25 +1,34 @@
 # 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-pep517
+hostmakedepends="python3-setuptools python3-wheel"
+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
+ python3-certifi argyllcms"
 short_desc="Display Calibration and Characterization"
 maintainer="lemmi <lemmi@nerd2nerd.org>"
 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 X11 server and dbus-daemon
+make_check=no
+
+post_patch() {
+	# set the hardcoded version of python 3 to the latest one
+	sed -i "s|^\(py_maxversion =\).*|\1 (${py3_ver%.*}, ${py3_ver#*.})|" DisplayCAL/meta.py
+
+	sed -i "s|@PY_VER@|${py3_ver/./}|g" DisplayCAL/RealDisplaySizeMM.py
+}
 
 pre_configure() {
 	sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop
 }
 
-post_install() {
-	find ${DESTDIR}/usr/ -exec chmod a+r \{\} +
-	find ${DESTDIR}/usr/ -type d -exec chmod a+x \{\} +
+do_install() {
+	python3 -m installer --destdir ${DESTDIR} dist/*.whl
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (4 preceding siblings ...)
  2022-11-11 16:51 ` kruceter
@ 2022-11-12 19:59 ` kruceter
  2022-11-12 21:54 ` [PR REVIEW] " paper42
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-12 19:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 22680 bytes --]

From b9e031d66bdad4cedf2e9c306ca569204e4c887c Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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-linux/void-packages#38229).
---
 .../dispcalGUI/patches/enable-appdata.patch   |  28 +++++
 srcpkgs/dispcalGUI/patches/error.patch        |  44 +++----
 srcpkgs/dispcalGUI/patches/fix-gettext.patch  |  13 ++
 .../patches/fix-hardcoded-import.patch        |  18 +++
 .../dispcalGUI/patches/fix-setuptools.patch   |  95 +++++++++++++++
 srcpkgs/dispcalGUI/patches/fix-version.patch  | 111 ++++++++++++++++++
 srcpkgs/dispcalGUI/patches/update-check.patch |  90 ++++++++++++++
 .../dispcalGUI/patches/xdg-autostart.patch    |  16 +++
 srcpkgs/dispcalGUI/template                   |  37 +++---
 9 files changed, 416 insertions(+), 36 deletions(-)
 create mode 100644 srcpkgs/dispcalGUI/patches/enable-appdata.patch
 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/fix-setuptools.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/fix-version.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/update-check.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/xdg-autostart.patch

diff --git a/srcpkgs/dispcalGUI/patches/enable-appdata.patch b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
new file mode 100644
index 000000000000..cb1af7fed688
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
@@ -0,0 +1,28 @@
+create_appdata and buildservice are not set to True after calling
+setup.py externally ("sdist" and/or "install" are not used), leading to
+net.displaycal.DisplayCAL.appdata.xml not being found for copying in
+the build phase.
+
+--- a/setup.py
++++ b/setup.py
+@@ -639,18 +639,8 @@
+         if len(sys.argv) == 1 or (len(sys.argv) == 2 and dry_run):
+             return
+ 
+-    create_appdata = (
+-        (appdata or "install" in sys.argv[1:] or "sdist" in sys.argv[1:])
+-        and not help
+-        and not dry_run
+-    )
+-
+-    if (
+-        "sdist" in sys.argv[1:]
+-        or "install" in sys.argv[1:]
+-        or "bdist_deb" in sys.argv[1:]
+-    ) and not help:
+-        buildservice = True
++    create_appdata = True
++    buildservice = True
+ 
+     if create_appdata or buildservice:
+         with codecs.open(str(Path(pydir, "CHANGES.html")), "r", "UTF-8") as f:
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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import *
+ # else:
+ #     pass
+ 
diff --git a/srcpkgs/dispcalGUI/patches/fix-setuptools.patch b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
new file mode 100644
index 000000000000..47ef0ea2f6c9
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
@@ -0,0 +1,95 @@
+setuptools for some reason is used as a variable and a module.
+
+Initially this leads to "setuptools.findall" not being recognized as
+a command related to the module at all.
+
+Any use of module name in conditional statements also leads to error,
+hence simple solution: rename the variable.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -453,7 +453,7 @@
+     prefix = ""
+     recordfile_name = None  # record installed files to this file
+     sdist = "sdist" in sys.argv[1:]
+-    setuptools = None
++    setools = None
+     skip_postinstall = "--skip-postinstall" in sys.argv[1:]
+     use_distutils = not bdist_bbfreeze and not do_py2app
+     use_setuptools = (
+@@ -480,7 +480,7 @@
+             import setuptools
+             from setuptools import setup, Extension
+ 
+-            setuptools = True
++            setools = True
+             print("using setuptools")
+             current_findall = setuptools.findall
+         except ImportError:
+@@ -509,7 +509,7 @@
+ 
+         distutils.filelist.findall = findall
+ 
+-    if not setuptools:
++    if not setools:
+         from distutils.core import setup, Extension
+ 
+         print("using distutils")
+@@ -945,7 +945,7 @@
+     ext_modules = [RealDisplaySizeMM]
+ 
+     requires = []
+-    if not setuptools or sys.platform != "win32":
++    if not setools or sys.platform != "win32":
+         # wxPython windows installer doesn't add egg-info entry, so
+         # a dependency check from pkg_resources would always fail
+         requires.append("wxPython (>= %s)" % ".".join(str(n) for n in wx_minversion))
+@@ -1021,7 +1021,7 @@
+         "version": msiversion if "bdist_msi" in sys.argv[1:] else version,
+     }
+ 
+-    if setuptools:
++    if setools:
+         attrs["entry_points"] = {
+             "gui_scripts": [
+                 "%s = %s.main:main%s"
+@@ -1278,7 +1278,7 @@
+             attrs["options"]["py2exe"].update(
+                 {"bundle_files": 3, "compressed": 0, "optimize": 0, "skip_archive": 1}
+             )
+-        if setuptools:
++        if setools:
+             attrs["setup_requires"] = ["py2exe"]
+         attrs["zipfile"] = os.path.join("lib", "library.zip")
+ 
+@@ -1328,10 +1328,10 @@
+         # site-packages (on Mac and Windows) and when we want to make them
+         # absolute (Linux)
+         linux = sys.platform not in ("darwin", "win32") and (
+-            not cmd.root and setuptools
++            not cmd.root and setools
+         )
+         dar_win = (
+-            sys.platform in ("darwin", "win32") and (cmd.root or not setuptools)
++            sys.platform in ("darwin", "win32") and (cmd.root or not setools)
+         ) or bdist_win
+         if (
+             not do_uninstall
+@@ -1380,7 +1380,7 @@
+             # logic to find them
+             paths = safe_glob(os.path.join(cmd.install_scripts, name))
+             if sys.platform == "win32":
+-                if setuptools:
++                if setools:
+                     paths += safe_glob(os.path.join(cmd.install_scripts, f"{name}.exe"))
+                     paths += safe_glob(
+                         os.path.join(cmd.install_scripts, f"{name}-script.py")
+@@ -1587,7 +1587,7 @@
+         manifest_in.append("include " + os.path.join("tests", "*"))
+         manifest_in.append("recursive-include theme *")
+         manifest_in.append("recursive-include util *.cmd *.py *.sh")
+-        if sys.platform == "win32" and not setuptools:
++        if sys.platform == "win32" and not setools:
+             # Only needed under Windows
+             manifest_in.append("global-exclude .svn/*")
+         manifest_in.append("global-exclude *~")
diff --git a/srcpkgs/dispcalGUI/patches/fix-version.patch b/srcpkgs/dispcalGUI/patches/fix-version.patch
new file mode 100644
index 000000000000..ae0709b2b68c
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-version.patch
@@ -0,0 +1,111 @@
+setup.py uses package version provided that the builddir is a git
+repository and git is present in hostmakedepends.
+
+Otherwise 0.0.0 is supplied as the version.
+
+--- a/setup.py
++++ b/setup.py
+@@ -445,71 +445,40 @@
+ 
+     from DisplayCAL.util_os import which
+ 
+-    if (
+-        Path(pydir, ".git").is_dir()
+-        and (which("git") or which("git.exe"))
+-        and (not sys.argv[1:] or (len(non_build_args) < len(sys.argv[1:]) and not help))
+-    ):
+-        print("Trying to get git version information...")
+-        git_version = None
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "rev-parse", "--short", "HEAD"],
+-                stdout=subprocess.PIPE,
+-                cwd=pydir,
+-            )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            git_version = p.communicate()[0].strip().decode()
+-            version_base_file_path = Path(pydir, "VERSION_BASE")
+-            version_base = "0.0.0".split(".")
+-
+-            if version_base_file_path.is_file():
+-                with open(version_base_file_path) as version_base_file:
+-                    version_base = version_base_file.read().strip().split(".")
+-
+-        print("Trying to get git information...")
+-        lastmod = ""
+-        timestamp = None
+-        mtime = 0
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "log", "-1", "--format=%ct"], stdout=subprocess.PIPE, cwd=pydir
++    version_base_file_path = Path(pydir, "VERSION_BASE")
++
++    with open(version_base_file_path) as version_base_file:
++        version_base = version_base_file.read().strip().split(".")
++
++    lastmod = ""
++    timestamp = None
++    mtime = 0
++    timestamp = time.gmtime(mtime)
++
++    if timestamp:
++        lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
++
++    if not dry_run:
++        print("Generating __version__.py")
++
++        with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
++            versionpy.write("# generated by setup.py\n\n")
++            build_time = time.time()
++            versionpy.write(
++                f"BUILD_DATE = "
++                f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+             )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            mtime = int(p.communicate()[0].strip().decode())
+-            timestamp = time.gmtime(mtime)
+-
+-        if timestamp:
+-            lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
+-
+-        if not dry_run:
+-            print("Generating __version__.py")
+-
+-            with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
+-                versionpy.write("# generated by setup.py\n\n")
+-                build_time = time.time()
+-                versionpy.write(
+-                    f"BUILD_DATE = "
+-                    f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+-                )
+-
+-                if lastmod:
+-                    versionpy.write(f"LASTMOD = {lastmod!r}\n")
+-
+-                if git_version:
+-                    print("Version", ".".join(version_base))
+-                    versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
+ 
+-                    with open(Path(pydir, "VERSION"), "w") as versiontxt:
+-                        versiontxt.write(".".join(version_base))
++            if lastmod:
++                versionpy.write(f"LASTMOD = {lastmod!r}\n")
++
++            print("Version", ".".join(version_base))
++            versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
++
++            with open(Path(pydir, "VERSION"), "w") as versiontxt:
++                versiontxt.write(".".join(version_base))
+ 
+     backup_setup_path = Path(pydir, "setup.cfg.backup")
+     setup_path = Path(pydir, "setup.cfg")
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
diff --git a/srcpkgs/dispcalGUI/patches/xdg-autostart.patch b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
new file mode 100644
index 000000000000..7f95e07521f2
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
@@ -0,0 +1,16 @@
+Tries to install a desktop file in /usr/share/tmp instead of
+/etc/xdg/autostart.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -709,9 +709,7 @@
+             )
+             data_files.append(
+                 (
+-                    autostart
+-                    if os.geteuid() == 0 or prefix.startswith("/")
+-                    else autostart_home,
++                    autostart,
+                     [
+                         os.path.join(
+                             pydir,
diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template
index 05086b97e5a2..b68465fcc3ad 100644
--- a/srcpkgs/dispcalGUI/template
+++ b/srcpkgs/dispcalGUI/template
@@ -1,25 +1,34 @@
 # 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-pep517
+hostmakedepends="python3-setuptools python3-wheel"
+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
+ python3-certifi argyllcms"
 short_desc="Display Calibration and Characterization"
 maintainer="lemmi <lemmi@nerd2nerd.org>"
 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 X11 server and dbus-daemon
+make_check=no
+
+post_patch() {
+	# set the hardcoded version of python 3 to the latest one
+	sed -i "s|^\(py_maxversion =\).*|\1 (${py3_ver%.*}, ${py3_ver#*.})|" DisplayCAL/meta.py
+
+	sed -i "s|@PY_VER@|${py3_ver/./}|g" DisplayCAL/RealDisplaySizeMM.py
+}
 
 pre_configure() {
 	sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop
 }
 
-post_install() {
-	find ${DESTDIR}/usr/ -exec chmod a+r \{\} +
-	find ${DESTDIR}/usr/ -type d -exec chmod a+x \{\} +
+do_install() {
+	python3 -m installer --destdir ${DESTDIR} dist/*.whl
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (5 preceding siblings ...)
  2022-11-12 19:59 ` kruceter
@ 2022-11-12 21:54 ` paper42
  2022-11-12 21:54 ` paper42
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: paper42 @ 2022-11-12 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#discussion_r1020810311

Comment:
would this help?
```
checkdepends="xvfb-run dbus"
make_check_pre="xvfb-run dbus-run-session"
```

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (6 preceding siblings ...)
  2022-11-12 21:54 ` [PR REVIEW] " paper42
@ 2022-11-12 21:54 ` paper42
  2022-11-12 22:30 ` kruceter
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: paper42 @ 2022-11-12 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#discussion_r1020810354

Comment:
replace all seds with vsed to make sure we know when they stop changing anything

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (7 preceding siblings ...)
  2022-11-12 21:54 ` paper42
@ 2022-11-12 22:30 ` kruceter
  2022-11-12 22:35 ` kruceter
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-12 22:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

New review comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#discussion_r1020813580

Comment:
It did solve the issue with X11, but dbus is persistent as ever.

[dispcalgui.txt](https://github.com/void-linux/void-packages/files/9996060/dispcalgui.txt)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (8 preceding siblings ...)
  2022-11-12 22:30 ` kruceter
@ 2022-11-12 22:35 ` kruceter
  2022-11-12 22:45 ` [PR REVIEW] " paper42
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-12 22:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#issuecomment-1312587278

Comment:
> Could you try upstreaming the patches?

I will try to upstream them.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (9 preceding siblings ...)
  2022-11-12 22:35 ` kruceter
@ 2022-11-12 22:45 ` paper42
  2022-11-12 22:57 ` [PR PATCH] [Updated] " kruceter
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: paper42 @ 2022-11-12 22:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#discussion_r1020814978

Comment:
I would guess it needs a running system dbus service, so just adjust the comment.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (10 preceding siblings ...)
  2022-11-12 22:45 ` [PR REVIEW] " paper42
@ 2022-11-12 22:57 ` kruceter
  2022-11-22  1:15 ` kruceter
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-12 22:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages dispcalgui
https://github.com/void-linux/void-packages/pull/40420

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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/40420.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dispcalgui-40420.patch --]
[-- Type: text/x-diff, Size: 22795 bytes --]

From 487efff6cc4a197211fdf6fac95c958e6b51d289 Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
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-linux/void-packages#38229).
---
 .../dispcalGUI/patches/enable-appdata.patch   |  28 +++++
 srcpkgs/dispcalGUI/patches/error.patch        |  44 +++----
 srcpkgs/dispcalGUI/patches/fix-gettext.patch  |  13 ++
 .../patches/fix-hardcoded-import.patch        |  18 +++
 .../dispcalGUI/patches/fix-setuptools.patch   |  95 +++++++++++++++
 srcpkgs/dispcalGUI/patches/fix-version.patch  | 111 ++++++++++++++++++
 srcpkgs/dispcalGUI/patches/update-check.patch |  90 ++++++++++++++
 .../dispcalGUI/patches/xdg-autostart.patch    |  16 +++
 srcpkgs/dispcalGUI/template                   |  39 +++---
 9 files changed, 417 insertions(+), 37 deletions(-)
 create mode 100644 srcpkgs/dispcalGUI/patches/enable-appdata.patch
 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/fix-setuptools.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/fix-version.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/update-check.patch
 create mode 100644 srcpkgs/dispcalGUI/patches/xdg-autostart.patch

diff --git a/srcpkgs/dispcalGUI/patches/enable-appdata.patch b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
new file mode 100644
index 000000000000..cb1af7fed688
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/enable-appdata.patch
@@ -0,0 +1,28 @@
+create_appdata and buildservice are not set to True after calling
+setup.py externally ("sdist" and/or "install" are not used), leading to
+net.displaycal.DisplayCAL.appdata.xml not being found for copying in
+the build phase.
+
+--- a/setup.py
++++ b/setup.py
+@@ -639,18 +639,8 @@
+         if len(sys.argv) == 1 or (len(sys.argv) == 2 and dry_run):
+             return
+ 
+-    create_appdata = (
+-        (appdata or "install" in sys.argv[1:] or "sdist" in sys.argv[1:])
+-        and not help
+-        and not dry_run
+-    )
+-
+-    if (
+-        "sdist" in sys.argv[1:]
+-        or "install" in sys.argv[1:]
+-        or "bdist_deb" in sys.argv[1:]
+-    ) and not help:
+-        buildservice = True
++    create_appdata = True
++    buildservice = True
+ 
+     if create_appdata or buildservice:
+         with codecs.open(str(Path(pydir, "CHANGES.html")), "r", "UTF-8") as f:
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..e327cc512fc4
--- /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,7 @@
+         # 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 *
++    from DisplayCAL.lib64.python@PY_VER@.RealDisplaySizeMM import *
+ # else:
+ #     pass
+ 
diff --git a/srcpkgs/dispcalGUI/patches/fix-setuptools.patch b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
new file mode 100644
index 000000000000..47ef0ea2f6c9
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-setuptools.patch
@@ -0,0 +1,95 @@
+setuptools for some reason is used as a variable and a module.
+
+Initially this leads to "setuptools.findall" not being recognized as
+a command related to the module at all.
+
+Any use of module name in conditional statements also leads to error,
+hence simple solution: rename the variable.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -453,7 +453,7 @@
+     prefix = ""
+     recordfile_name = None  # record installed files to this file
+     sdist = "sdist" in sys.argv[1:]
+-    setuptools = None
++    setools = None
+     skip_postinstall = "--skip-postinstall" in sys.argv[1:]
+     use_distutils = not bdist_bbfreeze and not do_py2app
+     use_setuptools = (
+@@ -480,7 +480,7 @@
+             import setuptools
+             from setuptools import setup, Extension
+ 
+-            setuptools = True
++            setools = True
+             print("using setuptools")
+             current_findall = setuptools.findall
+         except ImportError:
+@@ -509,7 +509,7 @@
+ 
+         distutils.filelist.findall = findall
+ 
+-    if not setuptools:
++    if not setools:
+         from distutils.core import setup, Extension
+ 
+         print("using distutils")
+@@ -945,7 +945,7 @@
+     ext_modules = [RealDisplaySizeMM]
+ 
+     requires = []
+-    if not setuptools or sys.platform != "win32":
++    if not setools or sys.platform != "win32":
+         # wxPython windows installer doesn't add egg-info entry, so
+         # a dependency check from pkg_resources would always fail
+         requires.append("wxPython (>= %s)" % ".".join(str(n) for n in wx_minversion))
+@@ -1021,7 +1021,7 @@
+         "version": msiversion if "bdist_msi" in sys.argv[1:] else version,
+     }
+ 
+-    if setuptools:
++    if setools:
+         attrs["entry_points"] = {
+             "gui_scripts": [
+                 "%s = %s.main:main%s"
+@@ -1278,7 +1278,7 @@
+             attrs["options"]["py2exe"].update(
+                 {"bundle_files": 3, "compressed": 0, "optimize": 0, "skip_archive": 1}
+             )
+-        if setuptools:
++        if setools:
+             attrs["setup_requires"] = ["py2exe"]
+         attrs["zipfile"] = os.path.join("lib", "library.zip")
+ 
+@@ -1328,10 +1328,10 @@
+         # site-packages (on Mac and Windows) and when we want to make them
+         # absolute (Linux)
+         linux = sys.platform not in ("darwin", "win32") and (
+-            not cmd.root and setuptools
++            not cmd.root and setools
+         )
+         dar_win = (
+-            sys.platform in ("darwin", "win32") and (cmd.root or not setuptools)
++            sys.platform in ("darwin", "win32") and (cmd.root or not setools)
+         ) or bdist_win
+         if (
+             not do_uninstall
+@@ -1380,7 +1380,7 @@
+             # logic to find them
+             paths = safe_glob(os.path.join(cmd.install_scripts, name))
+             if sys.platform == "win32":
+-                if setuptools:
++                if setools:
+                     paths += safe_glob(os.path.join(cmd.install_scripts, f"{name}.exe"))
+                     paths += safe_glob(
+                         os.path.join(cmd.install_scripts, f"{name}-script.py")
+@@ -1587,7 +1587,7 @@
+         manifest_in.append("include " + os.path.join("tests", "*"))
+         manifest_in.append("recursive-include theme *")
+         manifest_in.append("recursive-include util *.cmd *.py *.sh")
+-        if sys.platform == "win32" and not setuptools:
++        if sys.platform == "win32" and not setools:
+             # Only needed under Windows
+             manifest_in.append("global-exclude .svn/*")
+         manifest_in.append("global-exclude *~")
diff --git a/srcpkgs/dispcalGUI/patches/fix-version.patch b/srcpkgs/dispcalGUI/patches/fix-version.patch
new file mode 100644
index 000000000000..ae0709b2b68c
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/fix-version.patch
@@ -0,0 +1,111 @@
+setup.py uses package version provided that the builddir is a git
+repository and git is present in hostmakedepends.
+
+Otherwise 0.0.0 is supplied as the version.
+
+--- a/setup.py
++++ b/setup.py
+@@ -445,71 +445,40 @@
+ 
+     from DisplayCAL.util_os import which
+ 
+-    if (
+-        Path(pydir, ".git").is_dir()
+-        and (which("git") or which("git.exe"))
+-        and (not sys.argv[1:] or (len(non_build_args) < len(sys.argv[1:]) and not help))
+-    ):
+-        print("Trying to get git version information...")
+-        git_version = None
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "rev-parse", "--short", "HEAD"],
+-                stdout=subprocess.PIPE,
+-                cwd=pydir,
+-            )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            git_version = p.communicate()[0].strip().decode()
+-            version_base_file_path = Path(pydir, "VERSION_BASE")
+-            version_base = "0.0.0".split(".")
+-
+-            if version_base_file_path.is_file():
+-                with open(version_base_file_path) as version_base_file:
+-                    version_base = version_base_file.read().strip().split(".")
+-
+-        print("Trying to get git information...")
+-        lastmod = ""
+-        timestamp = None
+-        mtime = 0
+-
+-        try:
+-            p = subprocess.Popen(
+-                ["git", "log", "-1", "--format=%ct"], stdout=subprocess.PIPE, cwd=pydir
++    version_base_file_path = Path(pydir, "VERSION_BASE")
++
++    with open(version_base_file_path) as version_base_file:
++        version_base = version_base_file.read().strip().split(".")
++
++    lastmod = ""
++    timestamp = None
++    mtime = 0
++    timestamp = time.gmtime(mtime)
++
++    if timestamp:
++        lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
++
++    if not dry_run:
++        print("Generating __version__.py")
++
++        with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
++            versionpy.write("# generated by setup.py\n\n")
++            build_time = time.time()
++            versionpy.write(
++                f"BUILD_DATE = "
++                f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+             )
+-        except Exception as exception:
+-            print("...failed:", exception)
+-        else:
+-            mtime = int(p.communicate()[0].strip().decode())
+-            timestamp = time.gmtime(mtime)
+-
+-        if timestamp:
+-            lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"
+-
+-        if not dry_run:
+-            print("Generating __version__.py")
+-
+-            with open(Path(pydir, "DisplayCAL", "__version__.py"), "w") as versionpy:
+-                versionpy.write("# generated by setup.py\n\n")
+-                build_time = time.time()
+-                versionpy.write(
+-                    f"BUILD_DATE = "
+-                    f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
+-                )
+-
+-                if lastmod:
+-                    versionpy.write(f"LASTMOD = {lastmod!r}\n")
+-
+-                if git_version:
+-                    print("Version", ".".join(version_base))
+-                    versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
+-                    versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
+ 
+-                    with open(Path(pydir, "VERSION"), "w") as versiontxt:
+-                        versiontxt.write(".".join(version_base))
++            if lastmod:
++                versionpy.write(f"LASTMOD = {lastmod!r}\n")
++
++            print("Version", ".".join(version_base))
++            versionpy.write("VERSION = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_BASE = (%s)\n" % ", ".join(version_base))
++            versionpy.write("VERSION_STRING = %r\n" % ".".join(version_base))
++
++            with open(Path(pydir, "VERSION"), "w") as versiontxt:
++                versiontxt.write(".".join(version_base))
+ 
+     backup_setup_path = Path(pydir, "setup.cfg.backup")
+     setup_path = Path(pydir, "setup.cfg")
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 @@
+         <label>bug_report</label>
+       </object>
+       <object class="separator"/>
+-      <object class="wxMenuItem" name="update_check.onstartup">
+-        <label>update_check.onstartup</label>
+-        <checkable>1</checkable>
+-      </object>
+-      <object class="wxMenuItem" name="update_check">
+-        <label>update_check</label>
+-      </object>
+-      <object class="separator"/>
+       <label>menu.help</label>
+     </object>
+   </object>
diff --git a/srcpkgs/dispcalGUI/patches/xdg-autostart.patch b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
new file mode 100644
index 000000000000..7f95e07521f2
--- /dev/null
+++ b/srcpkgs/dispcalGUI/patches/xdg-autostart.patch
@@ -0,0 +1,16 @@
+Tries to install a desktop file in /usr/share/tmp instead of
+/etc/xdg/autostart.
+
+--- a/DisplayCAL/setup.py
++++ b/DisplayCAL/setup.py
+@@ -709,9 +709,7 @@
+             )
+             data_files.append(
+                 (
+-                    autostart
+-                    if os.geteuid() == 0 or prefix.startswith("/")
+-                    else autostart_home,
++                    autostart,
+                     [
+                         os.path.join(
+                             pydir,
diff --git a/srcpkgs/dispcalGUI/template b/srcpkgs/dispcalGUI/template
index 05086b97e5a2..167b5df53191 100644
--- a/srcpkgs/dispcalGUI/template
+++ b/srcpkgs/dispcalGUI/template
@@ -1,25 +1,34 @@
 # 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-pep517
+hostmakedepends="python3-setuptools python3-wheel"
+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
+ python3-certifi argyllcms"
 short_desc="Display Calibration and Characterization"
 maintainer="lemmi <lemmi@nerd2nerd.org>"
 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 a running system dbus service
+make_check=no
+
+post_patch() {
+	# set the hardcoded version of python 3 to the latest one
+	vsed -i "s|^\(py_maxversion =\).*|\1 (${py3_ver%.*}, ${py3_ver#*.})|" DisplayCAL/meta.py
+
+	vsed -i "s|@PY_VER@|${py3_ver/./}|g" DisplayCAL/RealDisplaySizeMM.py
+}
 
 pre_configure() {
-	sed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop
+	vsed -i 's|MimeType=model/vrml;x-world/x-vrml;|MimeType=model/vrml;|' misc/displaycal-vrml-to-x3d-converter.desktop
 }
 
-post_install() {
-	find ${DESTDIR}/usr/ -exec chmod a+r \{\} +
-	find ${DESTDIR}/usr/ -type d -exec chmod a+x \{\} +
+do_install() {
+	python3 -m installer --destdir ${DESTDIR} dist/*.whl
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (11 preceding siblings ...)
  2022-11-12 22:57 ` [PR PATCH] [Updated] " kruceter
@ 2022-11-22  1:15 ` kruceter
  2022-11-22  1:15 ` [PR PATCH] [Closed]: " kruceter
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-22  1:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#issuecomment-1322870538

Comment:
Unfortunately, my efforts to fix upstream issues are futile.

With the new upstream being as it is at present time, I find the idea of porting this package to be an eternal game of Whac-A-Mole.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Closed]: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (12 preceding siblings ...)
  2022-11-22  1:15 ` kruceter
@ 2022-11-22  1:15 ` kruceter
  2023-07-04 21:42 ` lemmi
  2023-07-04 21:43 ` lemmi
  15 siblings, 0 replies; 17+ messages in thread
From: kruceter @ 2022-11-22  1:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

There's a closed pull request on the void-packages repository

dispcalGUI: update to 3.9.8, change upstream.
https://github.com/void-linux/void-packages/pull/40420

Description:
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 #38229).

cc: @lemmi 

#### Testing the changes
- I tested the changes in this PR: **briefly**

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (13 preceding siblings ...)
  2022-11-22  1:15 ` [PR PATCH] [Closed]: " kruceter
@ 2023-07-04 21:42 ` lemmi
  2023-07-04 21:43 ` lemmi
  15 siblings, 0 replies; 17+ messages in thread
From: lemmi @ 2023-07-04 21:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

New comment by lemmi on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#issuecomment-1620773754

Comment:
@classabbyamp pointed out the new release of `dispcalgui-py3`: https://github.com/eoyilmaz/displaycal-py3/releases/tag/3.9.11
Maybe this is worth another look and if it works, it's probably best to add a new `dispcalgui-py3` package that ships with `replaces=dispcalgui`.
@kruceter interested in giving this another go?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: dispcalGUI: update to 3.9.8, change upstream.
  2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
                   ` (14 preceding siblings ...)
  2023-07-04 21:42 ` lemmi
@ 2023-07-04 21:43 ` lemmi
  15 siblings, 0 replies; 17+ messages in thread
From: lemmi @ 2023-07-04 21:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

New comment by lemmi on void-packages repository

https://github.com/void-linux/void-packages/pull/40420#issuecomment-1620773754

Comment:
@classabbyamp pointed out the new release of `dispcalgui-py3`: https://github.com/eoyilmaz/displaycal-py3/releases/tag/3.9.11
Maybe this is worth another look and if it works, it's probably best to add a new `dispcalgui-py3` package that ships with `replaces=dispcalgui`.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-07-04 21:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 17:56 [PR PATCH] dispcalGUI: update to 3.9.8, change upstream kruceter
2022-11-09 18:05 ` [PR PATCH] [Updated] " kruceter
2022-11-10  0:28 ` kruceter
2022-11-10  7:13 ` [PR PATCH] [Updated] " kruceter
2022-11-11 16:49 ` kruceter
2022-11-11 16:51 ` kruceter
2022-11-12 19:59 ` kruceter
2022-11-12 21:54 ` [PR REVIEW] " paper42
2022-11-12 21:54 ` paper42
2022-11-12 22:30 ` kruceter
2022-11-12 22:35 ` kruceter
2022-11-12 22:45 ` [PR REVIEW] " paper42
2022-11-12 22:57 ` [PR PATCH] [Updated] " kruceter
2022-11-22  1:15 ` kruceter
2022-11-22  1:15 ` [PR PATCH] [Closed]: " kruceter
2023-07-04 21:42 ` lemmi
2023-07-04 21:43 ` lemmi

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 NNTP newsgroup(s).