1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages astronomy)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
24 #:use-module (guix utils)
25 #:use-module (gnu packages image)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages gl)
30 #:use-module (gnu packages qt)
31 #:use-module (gnu packages maths)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu))
35 (define-public cfitsio
43 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
44 name (string-replace-substring version "." "") ".tar.gz"))
46 (base32 "1f0nmki45h9kw7vxpxiav9cb6vs3qqi6zrp2lpci5yhqc5isl43c"))))
47 (build-system gnu-build-system)
48 ;; XXX Building with curl currently breaks wcslib. It doesn't use
49 ;; pkg-config and hence won't link with -lcurl.
51 `(#:tests? #f ; no tests
53 (modify-phases %standard-phases
54 (add-after 'unpack 'patch-paths
56 (substitute* "Makefile.in" (("/bin/") ""))
58 (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
59 (synopsis "Library for reading and writing FITS files")
60 (description "CFITSIO provides simple high-level routines for reading and
61 writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
62 programmer from the internal complexities of the FITS format. CFITSIO also
63 provides many advanced features for manipulating and filtering the information
65 (license (license:non-copyleft "file://License.txt"
66 "See License.txt in the distribution."))))
76 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/" name "-" version
79 (base32 "16jh568k99c9p0y3qzcgps2rii933x9wlay7q1xm0lr59zqzp4xn"))))
81 `(("cfitsio" ,cfitsio)))
82 (build-system gnu-build-system)
85 (modify-phases %standard-phases
86 (add-before 'configure 'patch-/bin/sh
88 (substitute* "makedefs.in"
91 (delete 'install-license-files)) ; installed by ‘make install’
92 ;; Both the build and tests fail randomly when run in parallel.
94 #:parallel-tests? #f))
95 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
96 (synopsis "Library which implements the FITS WCS standard")
97 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
98 defines keywords and usage that provide for the description of astronomical
99 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
101 (license license:lgpl3+)))
103 (define-public gnuastro
110 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
114 "16a212j9ghdirm11d25s5q5qw32bkjrxsh3rblfyyv29djch34w6"))))
116 `(("cfitsio" ,cfitsio)
120 (build-system gnu-build-system)
121 (home-page "https://www.gnu.org/software/gnuastro/")
122 (synopsis "Astronomy utilities")
123 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
124 programs for the manipulation and analysis of astronomical data.")
125 (license license:gpl3+)))
127 (define-public stellarium
133 (uri (string-append "https://github.com/Stellarium/" name
134 "/releases/download/v" version
135 "/" name "-" version ".tar.gz"))
136 (file-name (string-append name "-" version ".tar.gz"))
139 "0d6b3fs5aify7i1lwgkcickppnj73cbh24g8qschnfs3ypdf48fc"))))
140 (build-system cmake-build-system)
143 ("qtlocation" ,qtlocation)
144 ("qtmultimedia" ,qtmultimedia)
145 ("qtscript" ,qtscript)
146 ("qtserialport" ,qtserialport)
149 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
150 ("perl" ,perl) ; For pod2man
151 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
152 ("qttools" ,qttools)))
154 `(#:test-target "test"
155 #:configure-flags (list "-DENABLE_TESTING=1"
157 "-DCMAKE_CXX_FLAGS=-isystem "
158 (assoc-ref %build-inputs "qtserialport")
160 #:phases (modify-phases %standard-phases
161 (add-before 'check 'set-offscreen-display
163 ;; make Qt render "offscreen", required for tests
164 (setenv "QT_QPA_PLATFORM" "offscreen")
165 (setenv "HOME" "/tmp")
167 (home-page "http://www.stellarium.org/")
168 (synopsis "3D sky viewer")
169 (description "Stellarium is a planetarium. It shows a realistic sky in
170 3D, just like what you see with the naked eye, binoculars, or a telescope. It
171 can be used to control telescopes over a serial port for tracking celestial
173 (license license:gpl2+)))