From patchwork Sun Apr 6 12:37:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 41359 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4D7EE27BBEA; Sun, 6 Apr 2025 13:39:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0095427BBE2 for ; Sun, 6 Apr 2025 13:39:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1PHl-0006ZX-5g; Sun, 06 Apr 2025 08:39:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u1PHJ-0006Mr-Ts for guix-patches@gnu.org; Sun, 06 Apr 2025 08:39:13 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u1PHI-0005U2-0K for guix-patches@gnu.org; Sun, 06 Apr 2025 08:39:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=46aJMrWAhbejX2DNfPLyJS0HEcOv8vBQXd69/Y5+NgE=; b=IoJQvY12YhlcjL8rtSt9x2yAWj2G7zdBm+upAYt3LrfGsLEID4Myf9dN4xMNP4+cm7BvKAUWTGC+rWqTIK8F40wcpanygfI9ML6GAthpEMmo0RXw7vTdMvHkjtkfewfCBaKxANZbqj1emLOsybBqdPIxLenj1PEvsMiHt0/5VKNBECA5nPrg1hfc5NpSJcQcI5tGZOsPQNyOIIUlrnZ9k6sG9RPXOflbXPcYoYVe5KKvFQahIyB7AtGDCJaCs1s/t+PuDZBfLhSmsuju9jvY+RF3RbsiTyZv9IhfHYia55LR17My39xsM7lHKhrj4bMgAmRB8fPSkVUqzhu+xnqDyA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1PHE-0001Yr-O3; Sun, 06 Apr 2025 08:39:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77575] [PATCH 21/21] gnu: python-wxpython: Update to 4.2.2. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Sun, 06 Apr 2025 12:39:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77575 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77575@debbugs.gnu.org Cc: Nicolas Graves , lars@6xq.net, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org X-Debbugs-Original-Xcc: lars@6xq.net, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org Received: via spool by 77575-submit@debbugs.gnu.org id=B77575.17439430945887 (code B ref 77575); Sun, 06 Apr 2025 12:39:04 +0000 Received: (at 77575) by debbugs.gnu.org; 6 Apr 2025 12:38:14 +0000 Received: from localhost ([127.0.0.1]:46477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1PGP-0001Ws-Hm for submit@debbugs.gnu.org; Sun, 06 Apr 2025 08:38:14 -0400 Received: from 5.mo562.mail-out.ovh.net ([46.105.48.192]:39521) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1PGB-0001SC-5Q for 77575@debbugs.gnu.org; Sun, 06 Apr 2025 08:38:00 -0400 Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4ZVsLs4yr0z1g19; Sun, 6 Apr 2025 12:37:57 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <77575@debbugs.gnu.org>; Sun, 6 Apr 2025 12:37:57 +0000 (UTC) Received: from mta6.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.178.179]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4ZVsLs4C73z7wVq; Sun, 6 Apr 2025 12:37:57 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.2]) by mta6.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 4211CD43D68; Sun, 6 Apr 2025 12:37:57 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-103G005cc1c0d3b-e54c-43cd-b260-cd0b6b208b82, C919729AFBE9AB1136EE71DE75FB1B1DBE8A85BF) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 6 Apr 2025 14:37:23 +0200 Message-ID: <20250406123732.31301-21-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250406123732.31301-1-ngraves@ngraves.fr> References: <20250406123732.31301-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 8477181876335207138 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleejvdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeghfeuheefudevveeugeelveeltefffffhiefhkeekjeduieektdffgedtgfetueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdifgihphihthhhonhdrohhrghenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeejheejheesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpoffvtefjohhsthepmhhoheeivdgmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=46aJMrWAhbejX2DNfPLyJS0HEcOv8vBQXd69/Y5+NgE=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1743943077; v=1; b=FLzXPDK0GVXsqpMP239nLqBVwcEFQIlBl66ODYvYMdfaX8fffhtydctm1i6e1VP/T5S6BSVE 5IHlgPUXYdOfT5dXm5/4qJCN2gOQgkwocmetE91YdsBraCdGRQK+9c+SX+4cde+e76VdYw2aXC2 48GrkUPz3Tc6BuA/Nk/971Cn7W55TdP0VjnmhbksCVJi3MCbGlBYF54ATqE0NpviEgEjVAQZxXc NMG0w0FKipqfJxNvoj8Z/bOKJGiwwF45h0DY1WamAGwLF7G/LOwrDAxW0xxlS0KBjCQo5YhYaAM 2kaF501GdcybHQ/0HE5aPGKKvWJiOnJ/KMRwb87Q2IlvQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/wxwidgets.scm (python-wxpython): Update to 4.2.2. [source]: Remove uneeded patch. [arguments]{phases}: Add phase 'patch-avoid-circular-import. Add phase 'add-missing.so. {modules}: Add necessary modules for new phases. [native-inputs]: Add python-setuptools, python-wheel. * gnu/packages/patches/python-wxwidgets-type-errors.patch: Remove patch. * gnu/local.mk: Unregister patch. --- gnu/local.mk | 1 - .../python-wxwidgets-type-errors.patch | 42 --------------- gnu/packages/wxwidgets.scm | 51 +++++++++++++++---- 3 files changed, 40 insertions(+), 54 deletions(-) delete mode 100644 gnu/packages/patches/python-wxwidgets-type-errors.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6c2466114d..01dd31c328 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2023,7 +2023,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-sgmllib3k-assertions.patch \ %D%/packages/patches/python-sphobjinv-defer-ssl-import.patch \ %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch \ - %D%/packages/patches/python-wxwidgets-type-errors.patch \ %D%/packages/patches/qcodeeditor-qt6.patch \ %D%/packages/patches/qtdeclarative-5-disable-qmlcache.patch \ %D%/packages/patches/qtdeclarative-disable-qmlcache.patch \ diff --git a/gnu/packages/patches/python-wxwidgets-type-errors.patch b/gnu/packages/patches/python-wxwidgets-type-errors.patch deleted file mode 100644 index 53e48c0886..0000000000 --- a/gnu/packages/patches/python-wxwidgets-type-errors.patch +++ /dev/null @@ -1,42 +0,0 @@ -Merged upstream but not yet released (see: -https://github.com/wxWidgets/Phoenix/pull/2387/commits/5d9f7aa185cd18da3e93ae1d0033fb9172d7a714). - -From 5d9f7aa185cd18da3e93ae1d0033fb9172d7a714 Mon Sep 17 00:00:00 2001 -From: Maxim Cournoyer -Date: Mon, 1 May 2023 13:53:55 -0400 -Subject: [PATCH] agw: Fix TypeError caused by floats with Python 3.10 - extensions. - -This fixes the following error: - - File "/lib/python3.10/site-packages/wx/lib/agw/pygauge.py", line 380, in OnPaint - dc.DrawText(drawString, textXPos, textYPos) - TypeError: DC.DrawText(): arguments did not match any overloaded call: - overload 1: argument 2 has unexpected type 'float' - overload 2: argument 2 has unexpected type 'float' - TimeLeft: 3.0 - -Visible when using Python 3.10 or newer. ---- - wx/lib/agw/pygauge.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/wx/lib/agw/pygauge.py b/wx/lib/agw/pygauge.py -index b8654436a..da42e6f61 100644 ---- a/wx/lib/agw/pygauge.py -+++ b/wx/lib/agw/pygauge.py -@@ -367,12 +367,12 @@ def OnPaint(self, event): - drawString = self._drawIndicatorText_formatString.format(drawValue) - rect = self.GetClientRect() - (textWidth, textHeight, descent, extraLeading) = dc.GetFullTextExtent(drawString) -- textYPos = (rect.height-textHeight)/2 -+ textYPos = (rect.height-textHeight)//2 - - if textHeight > rect.height: - textYPos = 0-descent+extraLeading - -- textXPos = (rect.width-textWidth)/2 -+ textXPos = (rect.width-textWidth)//2 - - if textWidth>rect.width: - textXPos = 0 diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index 7bbdafeb89..2f806482f9 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2023 Malte Frank Gerdes ;;; Copyright © 2023 Maxim Cournoyer ;;; Copyright © 2025 Ekaitz Zarraga +;;; Copyright © 2025 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,6 +38,7 @@ (define-module (gnu packages wxwidgets) #:use-module ((guix licenses) #:prefix l:) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix utils) #:use-module (gnu packages) @@ -57,7 +59,9 @@ (define-module (gnu packages wxwidgets) #:use-module (gnu packages photo) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages qt) #:use-module (gnu packages sdl) #:use-module (gnu packages video) #:use-module (gnu packages web) @@ -318,26 +322,38 @@ (define-public prusa-wxwidgets (define-public python-wxpython (package (name "python-wxpython") - (version "4.2.0") + (version "4.2.2") (source (origin (method url-fetch) (uri (pypi-uri "wxPython" version)) (sha256 - (base32 - "1iw6xp76b3fmdqwbqmsx9i1razzpfki5z1hq6l8mszlxa32fng36")) + (base32 "1fp2717a96hd5pdai6hlzc4pngdazxas55apjv2w5zb71xjv1g2x")) (modules '((guix build utils))) - (snippet - '(begin - ;; Remove bundled wxwidgets - (delete-file-recursively "ext/wxWidgets"))) - (patches (search-patches "python-wxwidgets-type-errors.patch")))) - (build-system python-build-system) + (snippet #~(begin + ;; Remove bundled wxWidgets + (delete-file-recursively "ext/wxWidgets"))))) + (build-system pyproject-build-system) (outputs '("out" "debug")) (arguments (list + #:modules '((guix build pyproject-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match) + (srfi srfi-26)) #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'patch-avoid-circular-import + (lambda _ + (substitute* "wx/__init__.py" + (("^import wx\\.__version__.*$") "\ +try: + import wx.__version__ +except ImportError: + pass\n") + (("^__version__ = .*") + (format #f "__version__ = ~s~%" #$version))))) (add-before 'build 'configure (lambda* (#:key inputs #:allow-other-keys) ;; Configure the build options provided to the 'build.py' build @@ -357,11 +373,24 @@ (define-public python-wxpython (string-append "#" all))) ;; The build script tries to write to demo/version.py. So, we set ;; correct write permissions. - (chmod "demo/version.py" #o644)))))) + (chmod "demo/version.py" #o644))) + (add-before 'check 'add-missing-.so + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((site (site-packages inputs outputs))) + (with-directory-excursion (string-append site "/wx") + (for-each + (match-lambda + ("siplib" + (rename-file "siplib" "siplib.so")) + ((? (cut string-prefix? "_" <>) file) + (unless (string-prefix? "__" file) + (rename-file file (string-append file ".so")))) + (_ #t)) + (scandir "."))))))))) (inputs (list gtk+ wxwidgets)) (native-inputs - (list pkg-config python-waf)) + (list pkg-config python-setuptools python-waf python-wheel)) (propagated-inputs (list python-attrdict3 python-numpy python-pillow python-six)) (home-page "https://wxpython.org/")