From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uDwWNiDdimbehQEAe85BDQ:P1 (envelope-from ) for ; Sun, 07 Jul 2024 18:23:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id uDwWNiDdimbehQEAe85BDQ (envelope-from ) for ; Sun, 07 Jul 2024 20:23:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=j3mIKDpQ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720375654; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Rvd1KjQd8bZl4rE+dE8sZ56Skjty2B6qzihCc5D05sU=; b=V9eQJMMPUFGt4xsbNg2t4s5XvRNVa+J9pC4mg19wSSihhi0ckfaIXj4x/AbtAncWAyxFIj wQXnBTqEbYGXr5sweufrrgX35fvJzwEKAoVmPfjpja0slb2JSQ0eq4/HEgLUH0YQ0GD7Mr I9LGuCnDK2GxkK2tpO67NzYLWyTPQOhUWs5CEnhe5VSgG/Cy3O211Gjlo/gl6tcM9Pwv/P yWydwiB/RjSzmm47gRBv3ZMS59xVbnUQoyqqBOUvnAh6OB5O3zkHucUoK4eWYCWaYsB3GP Voq38SL2t21OjSXA8J76xmH/WcV8BfXn50Yjn3oYrbTda5JCkCM5dBhrcFVeBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=j3mIKDpQ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720375654; a=rsa-sha256; cv=none; b=gPz1/3DLFKKDSVSiVh7vAfr6lY8x6UmbaxGUaKpUApcjB+EWlpMbBU6VJH41AQ7O1fK/Dj R6Yr7vmaQ9v1fmRyd2BdC3IsuU41gTSl5v4Oam/3oZwIO6OQ3AGHyQoRu5+9pmlyXNU6E9 xtdin8MPq6W/SrcB07zdJ7N4jQmrL1TPiC6ZGPDiv1JJizBykczdB0WRsnMML80sUpBE/9 Qm8G991Kh3yCLRd0gWotx8UMGiF7uOtq6DUUqLqm9SQ/x25+uh7VzvYMXoyz0Ql9CHIh11 NRHjRrkKgsvbDLermFpzsnbzo61KIqruiYAhmriHXVzrxuU8RY9c6c7S83C77g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CDEC46E588 for ; Sun, 7 Jul 2024 20:07:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQWI4-0001rh-31; Sun, 07 Jul 2024 14:07:12 -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 1sQWI2-0001qm-6b for guix-patches@gnu.org; Sun, 07 Jul 2024 14:07:10 -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 1sQWI1-0007Uj-UZ; Sun, 07 Jul 2024 14:07:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQWHt-0006fe-Ue; Sun, 07 Jul 2024 14:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69389] [PATCH v2] 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, tanguy@bioneland.org, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Sun, 07 Jul 2024 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 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 , Tanguy Le Carrour , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart Received: via spool by 69389-submit@debbugs.gnu.org id=B69389.172037557825593 (code B ref 69389); Sun, 07 Jul 2024 18:07:01 +0000 Received: (at 69389) by debbugs.gnu.org; 7 Jul 2024 18:06:18 +0000 Received: from localhost ([127.0.0.1]:49134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQWHC-0006ej-1U for submit@debbugs.gnu.org; Sun, 07 Jul 2024 14:06:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]:46985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQWH9-0006eU-7M for 69389@debbugs.gnu.org; Sun, 07 Jul 2024 14:06:17 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9DE9824002A for <69389@debbugs.gnu.org>; Sun, 7 Jul 2024 20:06:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720375562; bh=KfZPX5HSla1XucvTw4/B9nftFXWRD/2nHTDMTfbD5DY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=j3mIKDpQy6yPFZIBR6jMkmwVLp93sHZJuJsmShqVD0Y5EDirCWnnCpzsIanQstfS6 J1y+G04SMzDk0DYVcznQgvzotNMqkLhtZDG9qWm2Y55DRe42cagN5gAz8A3jVDzy62 EGItD60/dZW3kb+SGrFLXuxeErCUIxOmi/SGe5HyJuFL41COviz/SLb1bcTx/cu5py juvfN+sGpNpp8gR5Q6DGYKW+PlpRhdxuJ15RXgHM6rUDPUi/bfxODGmE1SvX094NX+ OsBLVTIuuOXen16EIDknmjZ0jU7jFo58GeL9EfuXF+WcKL3HdxalHXTlUhtmw3qICH h7n0cwtc5bXhA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WHFYP4sVLz9rxK; Sun, 7 Jul 2024 20:06:01 +0200 (CEST) From: Felix Gruber Date: Sun, 7 Jul 2024 18:04:24 +0000 Message-ID: <57da7e86196bc817b481796db56caa2e20a00dfb.1720375464.git.felgru@posteo.net> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 3.91 X-Migadu-Queue-Id: CDEC46E588 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 3.91 X-TUID: E/at7N3M3qGp * 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 | 49 ++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch diff --git a/gnu/local.mk b/gnu/local.mk index 329eaf9358..7d0cdc7db0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1987,6 +1987,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-7.2.4-build-info-manual.patch \ %D%/packages/patches/qemu-build-info-manual.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 1c432e9b65..2e6ffd675a 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -37095,6 +37095,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 base-commit: 5217ea6d45bef053844d8360a06252b9436783b3 -- 2.43.0