From patchwork Sun Feb 16 23:41:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 38756 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 CF93927BBEA; Sun, 16 Feb 2025 23:44:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 0893127BBE2 for ; Sun, 16 Feb 2025 23:44:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tjoIu-0007iU-Py; Sun, 16 Feb 2025 18:44:05 -0500 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 1tjoIs-0007hi-P0 for guix-patches@gnu.org; Sun, 16 Feb 2025 18:44:02 -0500 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 1tjoIs-0008Oy-Fg for guix-patches@gnu.org; Sun, 16 Feb 2025 18:44:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Jag8OC5JLZ3ydT4PGfZ/DoyD729ia71Mr9tn6XUloXQ=; b=s8k2rKz/OiVStF8bGvTjh/0QH9P93jbZvn5LN3A4plcIhSNbnzUbGk1exL8ZZMcpxQkOlAAgLypznMwcwjNzKdxyAtPzO75O90cxlVQaQY87vBZz/PC/E1jYivqB1yVGrYh5ObgNKlRRKi49Q+vVpuZb/WET27SUP8M8WCzEEiPcA9SSb2n4XHiaRd8kenfV1r0dAGOfOd8ypAG5ugtCzlHR3vkE+KMd6xMhXaBhb1i3vxpqIpxM5peVYWDk+n4ERgxd98eyycm4dUEAjSbM/LY2RqT7szbP7kCnS3imGXsXvd65ILAJpuJk6ik9HX5xzcXV++RxV6mCu506ftLEIg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tjoIs-0007bV-2Q for guix-patches@gnu.org; Sun, 16 Feb 2025 18:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76354] [PATCH] gnu: Add python-imageio-freeimage. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Feb 2025 23:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76354 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76354@debbugs.gnu.org Cc: Vinicius Monego X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173974941729134 (code B ref -1); Sun, 16 Feb 2025 23:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2025 23:43:37 +0000 Received: from localhost ([127.0.0.1]:39077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjoIO-0007Za-4v for submit@debbugs.gnu.org; Sun, 16 Feb 2025 18:43:37 -0500 Received: from lists.gnu.org ([2001:470:142::17]:39756) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tjoIJ-0007Yu-Pf for submit@debbugs.gnu.org; Sun, 16 Feb 2025 18:43:30 -0500 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 1tjoIE-0007YM-CS for guix-patches@gnu.org; Sun, 16 Feb 2025 18:43:22 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tjoIA-0008Na-Mr for guix-patches@gnu.org; Sun, 16 Feb 2025 18:43:22 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 410FA240027 for ; Mon, 17 Feb 2025 00:43:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1739749395; bh=mkNzf+vNeDh8GQai3nh7+H4F76jcoWGUaHtfp8huI5w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=dWHkBo2NXiPWMRBTianBZWped4aE36+JWPlIRY29ThoCubNYJNfy59FoNj6zrHghm StQExiFmNYT3Jdm58cSvABK5c4tHB9TOQ6RDXKJ7+R6ukzfoa96ajkJBvPrgXtIW8p nL3LuXz+OBsm2UAJ/tRGMt1C2NpWhkWVW7rePvkiDIuTN0vqDkvsIVLWaxfcXU3YO+ VYfOotuIXhHcca7+I6K5Cs1QT3wQ5JZWfXVPZT4EdCv8xNEbudHRbpfLTGa1Zi9e2u 8Zu3b+7YnxLCYju6u0zGYIRiEQh323YU96u3MykrGaSXqWDJRMVHngyZ+JS50fpTyP +QoS2ZLosMYYQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Yx2R6025Xz9rxB; Mon, 17 Feb 2025 00:43:13 +0100 (CET) From: Vinicius Monego Date: Sun, 16 Feb 2025 23:41:56 +0000 Message-ID: <0a6be0beacf3a8eab021bb32670e02ccf520f038.1739748428.git.monego@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=monego@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , 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/python-xyz.scm (python-imageio-freeimage): New variable. (python-imageio)[arguments]: Remove the freeimage substitution from the 'fix-source phase. [inputs]: Remove freeimage. Change-Id: I842998baea1568e1d9d1328e4387d14867bd3bb2 --- This patch is intended to clear transitive dependencies on openexr@2 and freeimage via imageio, which includes a freeimage plugin. Imageio has around ~100 packages to rebuild. Freeimage last release was back in 2018, it is unknown to me whether it is still maintained and it may contain known and unpatched vulnerabilities (guix lint -c cve freeimage). OpenEXR 2 was also abandoned in favor of OpenEXR 3. It seems that Debian has a patch to make freeimage work with OpenEXR 3. I may have a look at this later. I noticed that imageio made a separate package for freeimage due to license concerns but I thought it would be a good fit for Guix for the reasons aforementioend. Anyway, freeimage is slowly being deprecated in imageio: https://github.com/imageio/imageio/issues/892 gnu/packages/python-xyz.scm | 51 +++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) base-commit: b4dc8eb4adff9d824ff7df704e134964b3b47396 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index bb0ab777d5..0a9d0e02b0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -80,7 +80,7 @@ ;;; Copyright © 2020 Josh Holland ;;; Copyright © 2020 Yuval Kogman ;;; Copyright © 2020, 2022 Michael Rohleder -;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego +;;; Copyright © 2020, 2021, 2022, 2023, 2024, 2025 Vinicius Monego ;;; Copyright © 2020 Guy Fleury Iteriteka ;;; Copyright © 2020 Hendursaga ;;; Copyright © 2020 Malte Frank Gerdes @@ -11892,6 +11892,48 @@ (define-public python-imageio-ffmpeg from FFMPEG, reliably terminating the process when done.") (license license:bsd-2))) +(define-public python-imageio-freeimage + (package + (name "python-imageio-freeimage") + (version "0.1.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "imageio_freeimage" version)) + (sha256 + (base32 "1la0iv3617m52dnidhhrdaz9dpnlfqs7b83550d3jkjavv30md72")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f ; tests need internet and are not distributed in PyPI + #:phases + #~(modify-phases %standard-phases + ;; imageio_freeimage expects a copy of the library in its source + ;; tree. Changing this would require hacky substitutions. + (add-after 'install 'freeimage-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((pylib (string-append #$output "/lib/python" + #$(version-major+minor + (package-version python)) + "/site-packages")) + (iofi (string-append pylib "/imageio_freeimage"))) + (mkdir-p (string-append iofi "/_lib")) + (symlink (search-input-file inputs "lib/libfreeimage.so") + (string-append iofi "/_lib/libfreeimage.so")))))))) + (native-inputs (list python-poetry-core python-requests python-setuptools + python-wheel)) + (inputs (list freeimage)) + (propagated-inputs (list python-imageio)) + (home-page "https://github.com/imageio/imageio-freeimage") + (synopsis "Plugin for ImageIO that wraps the FreeImage library") + (description + "This package provides a plugin for @code{ImageIO} that wraps the +@code{FreeImage} library.") + ;; As a derivative work of FreeImage, imageio_freeimage is licensed under + ;; GPLv2 or GPLv3, and the FreeImage Public License (FIPL). + ;; For more information, see the LICENSE file. + (license (list license:gplv2 license:gplv3 license:non-copyleft)))) + (define-public python-imageio (package (name "python-imageio") @@ -11911,12 +11953,6 @@ (define-public python-imageio #~(modify-phases %standard-phases (add-after 'unpack 'fix-source (lambda* (#:key inputs #:allow-other-keys) - (substitute* "imageio/plugins/_freeimage.py" - (("os\\.getenv\\(\"IMAGEIO_FREEIMAGE_LIB\".*\\)" all) - (string-append - "(" all " or \"" - (search-input-file inputs "lib/libfreeimage.so") - "\")"))) (substitute* "imageio/core/util.py" (("\"/var/tmp\"") "os.getenv(\"TMPDIR\", \"/tmp\")")))) @@ -11927,7 +11963,6 @@ (define-public python-imageio all fun args) (string-append "raises(ValueError, " fun ", " args ")"))) (delete-file "tests/test_freeimage.py")))))) - (inputs (list freeimage)) (propagated-inputs (list python-imageio-ffmpeg python-numpy python-pillow python-tifffile)) (native-inputs