From patchwork Fri Oct 1 17:03:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Hinsen X-Patchwork-Id: 33528 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 5DD8727BBE3; Fri, 1 Oct 2021 18:06:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A851727BBE1 for ; Fri, 1 Oct 2021 18:06:18 +0100 (BST) Received: from localhost ([::1]:39304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWLzF-00069o-Cg for patchwork@mira.cbaines.net; Fri, 01 Oct 2021 13:06:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWLx4-0004uP-MW for guix-patches@gnu.org; Fri, 01 Oct 2021 13:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWLx4-0006S5-E7 for guix-patches@gnu.org; Fri, 01 Oct 2021 13:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWLx4-0003lL-9T for guix-patches@gnu.org; Fri, 01 Oct 2021 13:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50887] [PATCH] gnu: Add python-fitsio. Resent-From: Konrad Hinsen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Oct 2021 17:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50887 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen , 50887@debbugs.gnu.org Received: via spool by 50887-submit@debbugs.gnu.org id=B50887.163310780714420 (code B ref 50887); Fri, 01 Oct 2021 17:04:02 +0000 Received: (at 50887) by debbugs.gnu.org; 1 Oct 2021 17:03:27 +0000 Received: from localhost ([127.0.0.1]:57249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWLwQ-0003kQ-HA for submit@debbugs.gnu.org; Fri, 01 Oct 2021 13:03:27 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:50103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWLwM-0003kB-H7 for 50887@debbugs.gnu.org; Fri, 01 Oct 2021 13:03:20 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 674BD3202834; Fri, 1 Oct 2021 13:03:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 01 Oct 2021 13:03:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm1; bh=YElrlFj0pLcnZmhk+d20YnG8zO MFcXgFhamG1AK8qco=; b=hPbignTWkhKkYiQ6Wg1qSCzD7VBddlC9HiovCPVre+ zBgcWzkHGuqqYikEqrTH7KmXw7Ie60Qwq9Vd7U7qnYJ/K+RaseF201T6TIuR8Sh7 yMjJCtwbLFb63rnPD3vNWl04p09KtcQ5sUXan/3DtcSVwVndNlZWTJEGOCr6Wie2 ZH8DdRG/lpPYt2XM4ltJftZQ+NGanWhuaZRtcAcxl+c+vH1MfpkuXjuCjHITVwTG rBSwG/YUQVPxVXlv09h22pMTJ+D6trTuPWLqrdgGUNBjExO8tCchvyP4XJYWCt4F IhZy0nKFQNHgybh59XnQswHUcYL2SIjO52O7ngHAMpyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YElrlF j0pLcnZmhk+d20YnG8zOMFcXgFhamG1AK8qco=; b=hVi7rRABNcZTafDKM2KY3Y 581bAVbCCmFz4yUO25Vt54/uL6WxEsi0KykkhpOxM0meEmd03uEalu+Pi0aBRBTZ sZAHUtxgu++EKGDgvGWAfUVromJM4A1Ex8Q9fz6FxwrI64Y6/lWFTUNXhx/oZd/a GFlclPahI7RvXbbnCSEUQPU38OOE40kCCWQ3ZKlEgm7TQtm4FJczLcPNn936txSZ 3kFAKqKzCVE5UQZ5aLMg8axdLqqmIj4oXgzo0YD61d4gi0oPo+Kuwj2n5ajB74nM xHkfhAd8eWUIRc/Gv2Tz9tJ7EXPgcmOQv635YMONOzC6dXYHGnEvt6bXoERlHJ7Q == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdefhedmnecujfgurhephf fvufgjfhffkfggtgesmhdtreertddttdenucfhrhhomhepmfhonhhrrgguucfjihhnshgv nhcuoehkohhnrhgrugdrhhhinhhsvghnsehfrghsthhmrghilhdrnhgvtheqnecuggftrf grthhtvghrnhephedvgedvjedvtdeuueduueegvdeuhfefueeffeetvedtvdelveekveeg gefggfeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epkhhonhhrrggurdhhihhnshgvnhesfhgrshhtmhgrihhlrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 13:03:11 -0400 (EDT) From: Konrad Hinsen In-Reply-To: <87r1d4lu13.fsf@yoctocell.xyz> References: <87r1d4lu13.fsf@yoctocell.xyz> Date: Fri, 01 Oct 2021 19:03:10 +0200 Message-ID: MIME-Version: 1.0 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 Xinglu Chen writes: > Could you send an updated patch? Here it comes. Thanks for the careful code review! I learned a few things from this: I didn't know about snippets, nor about the subtle differences between gpl2 and gpl2+. Thanks, Konrad. From c95c0b18b4c2da6af7432a3dcf11c5f9984772f8 Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Wed, 29 Sep 2021 10:47:39 +0200 Subject: [PATCH] gnu: Add python-fitsio. * gnu/packages/astronomy.scm (python-fitsio): New variable. --- gnu/packages/astronomy.scm | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index a3f7d5cbf4..287cf4a94c 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -96,6 +96,71 @@ in FITS files.") (license (license:non-copyleft "file://License.txt" "See License.txt in the distribution.")))) +(define-public python-fitsio + (package + (name "python-fitsio") + (version "1.1.5") + (source + (origin + (method url-fetch) + (uri (pypi-uri "fitsio" version)) + (sha256 + (base32 "1llql2i6xr9lkdl81jx5nvz80kspamvira90546y32ldy551hq1l")) + (modules '((guix build utils))) + (snippet + ;; Remove the bundled cfitsio + `(begin + (delete-file-recursively "cfitsio3490") + (substitute* "MANIFEST.in" + (("recursive-include cfitsio3490.*$\n") "")) + #t)))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'unbundle-cfitsio + (lambda* (#:key inputs #:allow-other-keys) + (let* ((cfitsio (assoc-ref inputs "cfitsio")) + (includedir (string-append "\"" cfitsio "/include\"")) + (libdir (string-append "\"" cfitsio "/lib\""))) + ;; Use Guix' cfitsio instead of the bundled one + (substitute* "setup.py" + (("self.use_system_fitsio = False") "pass") + (("self.system_fitsio_includedir = None") "pass") + (("self.system_fitsio_libdir = None") "pass") + (("self.use_system_fitsio") "True") + (("self.system_fitsio_includedir") includedir) + (("self.system_fitsio_libdir") libdir))))) + (add-after 'unpack 'skip-bzip2-test + (lambda* (#:key inputs #:allow-other-keys) + ;; The bzip2 test fails because Guix' cfitsio + ;; is built without bzip2 support. + (substitute* "fitsio/test.py" + (("'SKIP_BZIP_TEST' in os.environ") "True"))))))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("cfitsio" ,cfitsio))) + (home-page "https://github.com/esheldon/fitsio") + (synopsis + "Python library to read from and write to FITS files") + (description + "This package provides a Python library for reading from and writing +to @acronym{FITS, Flexible Image Transport System} files using the +CFITSIO library. Among other things, it can + +@itemize +@item read and write image, binary, and ascii table extensions; + +@item read arbitrary subsets of tables in a lazy manner; + +@item query the rows and columns of a table; + +@item read and write header keywords; + +@item read and write Gzip files. +@end itemize") + (license license:gpl2+))) + (define-public qfits (package (name "qfits") -- 2.33.0