From patchwork Sat Jul 2 20:34:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 40479 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 7DB1027BBEA; Sat, 2 Jul 2022 21:36:12 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 5C03627BBE9 for ; Sat, 2 Jul 2022 21:36:11 +0100 (BST) Received: from localhost ([::1]:59212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7jqc-0005gb-Fu for patchwork@mira.cbaines.net; Sat, 02 Jul 2022 16:36:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7jqV-0005gS-Bq for guix-patches@gnu.org; Sat, 02 Jul 2022 16:36:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7jqV-0000Ee-3H for guix-patches@gnu.org; Sat, 02 Jul 2022 16:36:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7jqT-00041I-UG for guix-patches@gnu.org; Sat, 02 Jul 2022 16:36:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56364] [PATCH] gnu: Add glymur Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Jul 2022 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56364 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56364@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165679410315375 (code B ref -1); Sat, 02 Jul 2022 20:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jul 2022 20:35:03 +0000 Received: from localhost ([127.0.0.1]:42947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7jpP-0003zO-5e for submit@debbugs.gnu.org; Sat, 02 Jul 2022 16:35:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:56974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7jpJ-0003zB-Nn for submit@debbugs.gnu.org; Sat, 02 Jul 2022 16:34:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7jpJ-0005dg-HW for guix-patches@gnu.org; Sat, 02 Jul 2022 16:34:49 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:43950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7jpH-0007pJ-Ly for guix-patches@gnu.org; Sat, 02 Jul 2022 16:34:49 -0400 Received: by mail-ed1-x534.google.com with SMTP id c13so6844965eds.10 for ; Sat, 02 Jul 2022 13:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Usxwi3QUpBmG2nRR3bqSwcijbB+bwhz7bUe9X1kbFcw=; b=CBYkbft//Wm1iRrrW0vr/5emQFF26KC7XsP4QAvLSKgDahh5fSCjZSfjc7N2+YRKwF buwg+knABVA5nyUWfK1vcP152OBoz6Mk16oL759lHK2npXncs6dZyHZGOLUnlYZa+uqe OHDLwP8dqnM5ha2RXeuGYIIVxlPL1nA0UoVsvaj8Qmdli3R8W/S8K+JrEQ8RPpJgc+9L ZwkrlVV2kjDCN/1A8YFT9K4hcQPxDntdaGv5wT92lDReeaZwVdXhpFNGLtGganguuUK2 JwYtc+DTq5CsX+KTwmDUNB2WKZDEkgl+1oZT5H1pCmUChMAx3XSIPR32RwSAW3Erg5YI nNGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Usxwi3QUpBmG2nRR3bqSwcijbB+bwhz7bUe9X1kbFcw=; b=Vx+/PTIOVPc+hP0vU7C7NZTej0JQtW2K91Q4CfF+BPkmmGolP5g/nm3u3nq9hoNPDf T5mpQ/z5lLq3PQDATQpUBb60Ufuibke7XgHoYZihLATASBe8f21TOh7HrWu7ZYV56XOw XhIMG26Rj1wtyY8zSMT2JtddTdwZtyD5HBM99ygr4N/v8SwAdsVbuctiXIkY7DLx89Wp 50XY1uw9k4HysnMlH19JFRs8bQZifUQNYMj16r7rRNVqc3ClSnjEj55xcW9RaeJi5Ron v9wY8NPxK7TleNC7CJeoLN2xtesze3yms9w7NReIPJVi7cBJgP2hkF5pLqRhHQB8VkBg NsnQ== X-Gm-Message-State: AJIora8D/TJ/040t9Mg6gsYrZ3PV1h2epQd2qpBkicb0oOzcsaUVxdby Ozjx3F3MMBnY+XEdzc91n6/24VcdAwmDMp3HaNSdWTTHNtw= X-Google-Smtp-Source: AGRyM1veSLhfETmN37YlqnW4kflbRmPY3jqubc4xCMZiO9ghvXEI50NiWZwEwFOgF4VUzpqImUgvusUPdDWAfcIYJHU= X-Received: by 2002:a05:6402:3587:b0:435:b9a1:d5c5 with SMTP id y7-20020a056402358700b00435b9a1d5c5mr27488244edc.219.1656794085055; Sat, 02 Jul 2022 13:34:45 -0700 (PDT) MIME-Version: 1.0 From: Sharlatan Hellseher Date: Sat, 2 Jul 2022 21:34:33 +0100 Message-ID: Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=sharlatanus@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-getmail-retrieved-from-mailbox: Patches Hi Guix team! This package contains Python interface to OpenJEPEG and LibTIFF which requires some tweaks to let it find system library. It's goes as one of the SunPy dependence I've started packing. > ./pre-inst-env guix build python-glymur --rounds=2 --check successfully built /gnu/store/r77vwchzhhfi40xlmffwxyjpa4x8wxzv-python-glymur-0.10.1.drv successfully built /gnu/store/r77vwchzhhfi40xlmffwxyjpa4x8wxzv-python-glymur-0.10.1.drv /gnu/store/nx10j711hps4glkxfw17gx0np1wnz1vh-python-glymur-0.10.1 --- … наш разум - превосходная объяснительная машина которая способна найти смысл почти в чем угодно, истолковать любой феномен, но совершенно не в состоянии принять мысль о непредсказуемости. From 776f0ce0a22c83809d9a3dc4752180580e3632df Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sat, 2 Jul 2022 21:28:39 +0100 Subject: [PATCH] gnu: Add glymur * gnu/packages/python-xyz.scm (python-glymur): New variable. --- gnu/packages/python-xyz.scm | 74 ++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1d43049776..994045645d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -94,7 +94,7 @@ ;;; Copyright © 2020, 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2020 EuAndreh ;;; Copyright © 2021, 2022 Morgan Smith -;;; Copyright © 2021 Sharlatan Hellseher +;;; Copyright © 2021, 2022 Sharlatan Hellseher ;;; Copyright © 2021 Ellis Kenyő ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Xinglu Chen @@ -912,6 +912,78 @@ (define-public python-pyprind of a loop structure or other iterative computation.") (license license:bsd-3))) +(define-public python-glymur + (package + (name "python-glymur") + (version "0.10.1") + (source + (origin + (method git-fetch) ; no tests data in PyPi package + (uri (git-reference + (url "https://github.com/quintusdias/glymur") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1cq9r8vzwvds1kasy5gc2rxw034jh9l43rraps1n739072pfz6qg")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-library-locations + (lambda _ + ;; XXX: It's a workaround for Python inability to find the + ;; .so libraries with ctypes.util.find_library() + (substitute* '("glymur/config.py") + (("path = find_library\\(libname\\)") + (string-append + "if libname == \"openjp2\":\n" + " path = \"" + #$(this-package-input "openjpeg") "/lib/libopenjp2.so\"\n" + " elif libname == \"tiff\":\n" + " path = \"" + #$(this-package-input "libtiff") "/lib/libtiff.so\"\n" + " elif libname == \"c\":\n" + " path = \"" + #$(this-package-input "glibc") "/lib/libc.so.6\"\n"))))) + ;; TODO: implement as a feature of python-build-system (PEP-621, + ;; PEP-631, PEP-660) + (replace 'build + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) + ;; ZIP does not support timestamps before 1980. + (setenv "SOURCE_DATE_EPOCH" "315532800") + (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" "--no-cache-dir" "--no-input" + "install" "--no-deps" "--prefix" #$output whl)))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; Failing test due to inability of + ;; ctypes.util.find_library() to determine library path, + ;; which is patched above. + (delete-file "tests/test_config.py") + (invoke "python" "-m" "pytest" "-vv" "tests"))))))) + (native-inputs + (list python-pypa-build python-pytest)) + (inputs + (list openjpeg ; glymur/lib/openjp2.py + libtiff ; glymur/lib/tiff.py + glibc)) + (propagated-inputs + (list python-lxml + python-numpy + python-packaging)) + (home-page "https://github.com/quintusdias/glymur") + (synopsis "Python interface to OpenJPEG and LibTIFF") + (description + "This package provides Python interface to the OpenJPEG library which +allows one to read and write JPEG 2000 files") + (license license:expat))) + (define-public python-gphoto2 (package (name "python-gphoto2") -- 2.36.1