From patchwork Sun Feb 25 17:42:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Gruber X-Patchwork-Id: 61112 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 0BCC227BBEA; Sun, 25 Feb 2024 17:43:58 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 9689727BBE2 for ; Sun, 25 Feb 2024 17:43:56 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reIXP-0004Wm-Pb; Sun, 25 Feb 2024 12:43:43 -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 1reIXN-0004WS-SV for guix-patches@gnu.org; Sun, 25 Feb 2024 12:43:41 -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 1reIXN-000895-KH; Sun, 25 Feb 2024 12:43:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reIXi-0006gv-1o; Sun, 25 Feb 2024 12:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69389] [PATCH] gnu: Add python-xmp-toolkit. Resent-From: Felix Gruber Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, sharlatanus@gmail.com, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Sun, 25 Feb 2024 17:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69389 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69389@debbugs.gnu.org Cc: Felix Gruber , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , jgart X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , jgart Received: via spool by submit@debbugs.gnu.org id=B.170888298225558 (code B ref -1); Sun, 25 Feb 2024 17:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2024 17:43:02 +0000 Received: from localhost ([127.0.0.1]:33804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reIWj-0006dz-Ha for submit@debbugs.gnu.org; Sun, 25 Feb 2024 12:43:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:47468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reIWg-0006dZ-58 for submit@debbugs.gnu.org; Sun, 25 Feb 2024 12:43:00 -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 1reIWG-00049m-Me for guix-patches@gnu.org; Sun, 25 Feb 2024 12:42:32 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reIWD-0007yG-Pc for guix-patches@gnu.org; Sun, 25 Feb 2024 12:42:32 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EA132240104 for ; Sun, 25 Feb 2024 18:42:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1708882944; bh=mcZDb5pzXQ48znF2cNqsIVd6c2+kjUDIN5eYLFmKxOE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=PmOjt1Sqkpn7p+Rd4ZfKZbZCFaDYRALo8dHNMlNAvzwzqpEVFJxe1/rcZ10mH2Vjr sNOozV+O4ps4YVjq1ny7YgE+vvTGOdiIXgHQJuu9ys/HcypLDv+XT36DqxvPBSOty/ kX30lPDDidia30MBnBsWZVV+tdErPom53PWeSjvlTjSeWy2QvJCXUl5QMCROZbBJS4 vU4ojVKoyOtdX3Wpr4He6W9s3MS9hi35bThtiehGG2BwYQPhzOctm+NDh6Gx0WaPb6 m19CORSyVEIh/jdln1ZCV5qpgbXZqVorKLC6KYgLdIMKS3U+i0woo9kB2oXloxQtXF oJukmryv5P16A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TjWKW29Ylz9rxW; Sun, 25 Feb 2024 18:42:22 +0100 (CET) From: Felix Gruber Date: Sun, 25 Feb 2024 17:42:12 +0000 Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.66; envelope-from=felgru@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-xmp-toolkit): New variable. * gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: Ibce05155961eb5ba199754646e08acff2410f95d --- gnu/local.mk | 1 + ...-xmp-toolkit-add-missing-error-codes.patch | 51 +++++++++++++++++++ gnu/packages/python-xyz.scm | 51 ++++++++++++++++++- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch base-commit: b25b94335a3ee8d68d2145da8e5ea0325ecea451 diff --git a/gnu/local.mk b/gnu/local.mk index 741c72a653..b10063678e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1943,6 +1943,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-versioneer-guix-support.patch \ %D%/packages/patches/python-waitress-fix-tests.patch \ %D%/packages/patches/python-werkzeug-tests.patch \ + %D%/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch \ %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ %D%/packages/patches/qemu-disable-some-qtests-tests.patch \ diff --git a/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch new file mode 100644 index 0000000000..17bdae188f --- /dev/null +++ b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch @@ -0,0 +1,51 @@ +From fd9e887a1853d9b4bc3fce20d414d648fb5abbfc Mon Sep 17 00:00:00 2001 +From: Asher Glick +Date: Mon, 1 Mar 2021 14:35:46 -0600 +Subject: [PATCH] Add missing error codes and graceful handling of possible + future missing codes. + +--- + libxmp/exempi.py | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/libxmp/exempi.py b/libxmp/exempi.py +index 683e240..f58003c 100644 +--- a/libxmp/exempi.py ++++ b/libxmp/exempi.py +@@ -85,6 +85,7 @@ ERROR_MESSAGE = { 0: "unknown error", + -13: "std exception", + -14: "unknown exception", + -15: "no memory", ++ -16: "progress abort", + -101: "bad schema", + -102: "bad XPath", + -103: "bad options", +@@ -95,6 +96,14 @@ ERROR_MESSAGE = { 0: "unknown error", + -108: "bad file format", + -109: "no file handler", + -110: "too large for JPEG", ++ -111: "no file", ++ -112: "file permission error", ++ -113: "disk space", ++ -114: "read error", ++ -115: "write error", ++ -116: "bad block format", ++ -117: "file path not a file", ++ -118: "rejected file extension", + -201: "bad XML", + -202: "bad RDF", + -203: "bad XMP", +@@ -1697,6 +1706,9 @@ def check_error(success): + # so we supplement it by explicitly checking the error code. + ecode = EXEMPI.xmp_get_error() + if not success or ecode != 0: +- error_msg = ERROR_MESSAGE[ecode] ++ if ecode in ERROR_MESSAGE: ++ error_msg = ERROR_MESSAGE[ecode] ++ else: ++ error_msg = "Unexpected error code " + str(ecode) + msg = 'Exempi function failure ("{0}").'.format(error_msg) + raise XMPError(msg) +-- +2.30.2 + diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a051f5a8db..6cbedcb5e9 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -108,7 +108,7 @@ ;;; Copyright © 2021 Simon Streit ;;; Copyright © 2021, 2022, 2023 Daniel Meißner ;;; Copyright © 2021, 2022 Pradana Aumars -;;; Copyright © 2021, 2022, 2023 Felix Gruber +;;; Copyright © 2021–2024 Felix Gruber ;;; Copyright © 2021 Sébastien Lerique ;;; Copyright © 2021 Raphaël Mélotte ;;; Copyright © 2021 ZmnSCPxj @@ -35628,6 +35628,55 @@ (define-public python-zeroc-ice-3.6 (base32 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2")))))) +(define-public python-xmp-toolkit + (package + (name "python-xmp-toolkit") + (version "2.0.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "python-xmp-toolkit" version)) + (sha256 + (base32 "12x6lyaxjpbl8ll3cj97039kwvsha2nkx2v8v8irfbi2p0dl721s")) + (patches (search-patches + "python-xmp-toolkit-add-missing-error-codes.patch")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + '(list "-k" (string-append "not test_can_put_xmp and " + "not test_exempi_bad_combinations and " + "not test_formats and " + "not test_get_xmp and " + "not test_open_file_with_options")) + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'configure-environment + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((exempi #$(this-package-input "exempi"))) + (setenv "LD_LIBRARY_PATH" + (string-append exempi "/lib")))))))) + (inputs (list exempi)) + (propagated-inputs (list python-pytz)) + (native-inputs (list python-pytest)) + (home-page "https://github.com/python-xmp-toolkit/python-xmp-toolkit") + (synopsis "Python XMP Toolkit for working with metadata.") + (description "Python XMP Toolkit is a library for working with XMP +metadata, as well as reading/writing XMP metadata stored in many different +file formats. + +Python XMP Toolkit is wrapping Exempi (using ctypes), a C/C++ XMP library +based on Adobe XMP Toolkit, ensuring that future updates to the XMP standard +are easily incorporated into the library with a minimum amount of work. + +Python XMP Toolkit has been developed by: +@itemize +@item ESA/Hubble - European Space Agency +@item ESO - European Southern Observatory +@item CRS4 - Centre for Advanced Studies, Research and Development in Sardinia +@end itemize") + (license license:bsd-3))) + ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances ;;; of a merge conflict, place them above by existing packages with similar