gnu: gnuastro: Update to 0.6.
[jackhill/guix/guix.git] / gnu / packages / astronomy.scm
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>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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.
11 ;;;
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.
16 ;;;
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/>.
19
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))
34
35 (define-public cfitsio
36 (package
37 (name "cfitsio")
38 (version "3.420")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (string-append
43 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
44 name (string-replace-substring version "." "") ".tar.gz"))
45 (sha256
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.
50 (arguments
51 `(#:tests? #f ; no tests
52 #:phases
53 (modify-phases %standard-phases
54 (add-after 'unpack 'patch-paths
55 (lambda _
56 (substitute* "Makefile.in" (("/bin/") ""))
57 #t)))))
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
64 in FITS files.")
65 (license (license:non-copyleft "file://License.txt"
66 "See License.txt in the distribution."))))
67
68 (define-public wcslib
69 (package
70 (name "wcslib")
71 (version "5.18")
72 (source
73 (origin
74 (method url-fetch)
75 (uri (string-append
76 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/" name "-" version
77 ".tar.bz2"))
78 (sha256
79 (base32 "16jh568k99c9p0y3qzcgps2rii933x9wlay7q1xm0lr59zqzp4xn"))))
80 (inputs
81 `(("cfitsio" ,cfitsio)))
82 (build-system gnu-build-system)
83 (arguments
84 `(#:phases
85 (modify-phases %standard-phases
86 (add-before 'configure 'patch-/bin/sh
87 (lambda _
88 (substitute* "makedefs.in"
89 (("/bin/sh") "sh"))
90 #t))
91 (delete 'install-license-files)) ; installed by ‘make install’
92 ;; Both the build and tests fail randomly when run in parallel.
93 #:parallel-build? #f
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
100 header.")
101 (license license:lgpl3+)))
102
103 (define-public gnuastro
104 (package
105 (name "gnuastro")
106 (version "0.6")
107 (source
108 (origin
109 (method url-fetch)
110 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
111 version ".tar.gz"))
112 (sha256
113 (base32
114 "16a212j9ghdirm11d25s5q5qw32bkjrxsh3rblfyyv29djch34w6"))))
115 (inputs
116 `(("cfitsio" ,cfitsio)
117 ("gsl" ,gsl)
118 ("libjpeg" ,libjpeg)
119 ("wcslib" ,wcslib)))
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+)))
126
127 (define-public stellarium
128 (package
129 (name "stellarium")
130 (version "0.17.0")
131 (source (origin
132 (method url-fetch)
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"))
137 (sha256
138 (base32
139 "0d6b3fs5aify7i1lwgkcickppnj73cbh24g8qschnfs3ypdf48fc"))))
140 (build-system cmake-build-system)
141 (inputs
142 `(("qtbase" ,qtbase)
143 ("qtlocation" ,qtlocation)
144 ("qtmultimedia" ,qtmultimedia)
145 ("qtscript" ,qtscript)
146 ("qtserialport" ,qtserialport)
147 ("zlib" ,zlib)))
148 (native-inputs
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)))
153 (arguments
154 `(#:test-target "test"
155 #:configure-flags (list "-DENABLE_TESTING=1"
156 (string-append
157 "-DCMAKE_CXX_FLAGS=-isystem "
158 (assoc-ref %build-inputs "qtserialport")
159 "/include/qt5"))
160 #:phases (modify-phases %standard-phases
161 (add-before 'check 'set-offscreen-display
162 (lambda _
163 ;; make Qt render "offscreen", required for tests
164 (setenv "QT_QPA_PLATFORM" "offscreen")
165 (setenv "HOME" "/tmp")
166 #t)))))
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
172 objects.")
173 (license license:gpl2+)))