gnu: Replace uses of 'libjpeg' with 'libjpeg-turbo'.
[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, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2019 by Amar Singh <nly@disroot.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages astronomy)
23 #:use-module (guix packages)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix utils)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages version-control)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages xiph)
35 #:use-module (gnu packages pretty-print)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages lua)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages qt)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages gnome)
43 #:use-module (gnu packages maths)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system gnu)
46 #:use-module (srfi srfi-1))
47
48 (define-public cfitsio
49 (package
50 (name "cfitsio")
51 (version "3.47")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append
56 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
57 name "-" version ".tar.gz"))
58 (sha256
59 (base32 "1vzlxnrjckz78p2wf148v2z3krkwnykfqvlj42sz3q711vqid1a1"))))
60 (build-system gnu-build-system)
61 ;; XXX Building with curl currently breaks wcslib. It doesn't use
62 ;; pkg-config and hence won't link with -lcurl.
63 (arguments
64 `(#:tests? #f ; no tests
65 #:phases
66 (modify-phases %standard-phases
67 (add-after 'unpack 'patch-paths
68 (lambda _
69 (substitute* "Makefile.in" (("/bin/") ""))
70 #t)))))
71 (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
72 (synopsis "Library for reading and writing FITS files")
73 (description "CFITSIO provides simple high-level routines for reading and
74 writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
75 programmer from the internal complexities of the FITS format. CFITSIO also
76 provides many advanced features for manipulating and filtering the information
77 in FITS files.")
78 (license (license:non-copyleft "file://License.txt"
79 "See License.txt in the distribution."))))
80
81 (define-public wcslib
82 (package
83 (name "wcslib")
84 (version "6.4")
85 (source
86 (origin
87 (method url-fetch)
88 (uri (string-append
89 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
90 ".tar.bz2"))
91 (sha256
92 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
93 (inputs
94 `(("cfitsio" ,cfitsio)))
95 (build-system gnu-build-system)
96 (arguments
97 `(#:configure-flags
98 (list (string-append "--with-cfitsiolib="
99 (assoc-ref %build-inputs "cfitsio") "/lib")
100 (string-append "--with-cfitsioinc="
101 (assoc-ref %build-inputs "cfitsio") "/include"))
102 #:phases
103 (modify-phases %standard-phases
104 (add-before 'configure 'patch-/bin/sh
105 (lambda _
106 (substitute* "makedefs.in"
107 (("/bin/sh") "sh"))
108 #t))
109 (delete 'install-license-files)) ; installed by ‘make install’
110 ;; Parallel execution of the test suite is not supported.
111 #:parallel-tests? #f))
112 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
113 (synopsis "Library which implements the FITS WCS standard")
114 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
115 defines keywords and usage that provide for the description of astronomical
116 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
117 header.")
118 (license license:lgpl3+)))
119
120 (define-public gnuastro
121 (package
122 (name "gnuastro")
123 (version "0.11")
124 (source
125 (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
128 version ".tar.lz"))
129 (sha256
130 (base32
131 "0c1yc2qb7vrqad96savfn06rn01izlfz0va738signv93qqj5k3v"))))
132 (inputs
133 `(("cfitsio" ,cfitsio)
134 ("gsl" ,gsl)
135 ("libjpeg" ,libjpeg-turbo)
136 ("libtiff" ,libtiff)
137 ("wcslib" ,wcslib)
138 ("zlib" ,zlib)))
139 (native-inputs
140 `(("libtool" ,libtool)
141 ("lzip" ,lzip)))
142 (build-system gnu-build-system)
143 (home-page "https://www.gnu.org/software/gnuastro/")
144 (synopsis "Astronomy utilities")
145 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
146 programs for the manipulation and analysis of astronomical data.")
147 (license license:gpl3+)))
148
149 (define-public stellarium
150 (package
151 (name "stellarium")
152 (version "0.19.3")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "https://github.com/Stellarium/stellarium"
157 "/releases/download/v" version
158 "/stellarium-" version ".tar.gz"))
159 (sha256
160 (base32 "0p92rgclag0nkic9gk3p9vclb8xx9hv4zlgyij6cyh43s7c1avhp"))))
161 (build-system cmake-build-system)
162 (inputs
163 `(("qtbase" ,qtbase)
164 ("qtlocation" ,qtlocation)
165 ("qtmultimedia" ,qtmultimedia)
166 ("qtscript" ,qtscript)
167 ("qtserialport" ,qtserialport)
168 ("zlib" ,zlib)))
169 (native-inputs
170 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
171 ("perl" ,perl) ; For pod2man
172 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
173 ("qttools" ,qttools)))
174 (arguments
175 `(#:test-target "test"
176 #:configure-flags (list "-DENABLE_TESTING=1"
177 (string-append
178 "-DCMAKE_CXX_FLAGS=-isystem "
179 (assoc-ref %build-inputs "qtserialport")
180 "/include/qt5"))
181 #:phases (modify-phases %standard-phases
182 (add-before 'check 'set-offscreen-display
183 (lambda _
184 ;; make Qt render "offscreen", required for tests
185 (setenv "QT_QPA_PLATFORM" "offscreen")
186 (setenv "HOME" "/tmp")
187 #t)))))
188 (home-page "https://stellarium.org/")
189 (synopsis "3D sky viewer")
190 (description "Stellarium is a planetarium. It shows a realistic sky in
191 3D, just like what you see with the naked eye, binoculars, or a telescope. It
192 can be used to control telescopes over a serial port for tracking celestial
193 objects.")
194 (license license:gpl2+)))
195
196 (define-public celestia
197 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
198 (package
199 (name "celestia")
200 (version (git-version "1.6.1" "815" commit))
201 (source (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://github.com/celestiaproject/celestia")
205 (commit commit)))
206 (file-name (git-file-name name version))
207 (sha256
208 (base32
209 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
210 (build-system cmake-build-system)
211 (native-inputs
212 `(("perl" ,perl)
213 ("libgit2" ,libgit2)
214 ("pkg-config" ,pkg-config)
215 ("libtool" ,libtool)
216 ("gettext" ,gettext-minimal)))
217 (inputs
218 `(("glu" ,glu)
219 ("glew" ,glew)
220 ("libtheora" ,libtheora)
221 ("libjpeg" ,libjpeg-turbo)
222 ("libpng" ,libpng)
223 ;; maybe required?
224 ("mesa" ,mesa)
225 ;; optional: fmtlib, Eigen3;
226 ("fmt" ,fmt)
227 ("eigen" ,eigen)
228 ;; glut: for glut interface
229 ("freeglut" ,freeglut)))
230 (propagated-inputs
231 `(("lua" ,lua)))
232 (arguments
233 `(#:configure-flags '("-DENABLE_GLUT=ON" "-DENABLE_QT=OFF")
234 #:tests? #f)) ;no tests
235 (home-page "https://celestia.space/")
236 (synopsis "Real-time 3D visualization of space")
237 (description
238 "This simulation program lets you explore our universe in three
239 dimensions. Celestia simulates many different types of celestial objects.
240 From planets and moons to star clusters and galaxies, you can visit every
241 object in the expandable database and view it from any point in space and
242 time. The position and movement of solar system objects is calculated
243 accurately in real time at any rate desired.")
244 (license license:gpl2+))))
245
246 (define-public celestia-gtk
247 (package
248 (inherit celestia)
249 (name "celestia-gtk")
250 (inputs
251 (append (alist-delete "freeglut" (package-inputs celestia))
252 `(("gtk2" ,gtk+-2)
253 ("gtkglext" ,gtkglext))))
254 (arguments
255 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
256 #:tests? #f))))
257
258 (define-public libnova
259 (package
260 (name "libnova")
261 (version "0.16")
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://git.code.sf.net/p/libnova/libnova.git")
267 (commit (string-append "v" version))))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32
271 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
272 (build-system gnu-build-system)
273 (arguments
274 `(#:phases
275 (modify-phases %standard-phases
276 (add-after 'unpack 'patch-git-version
277 (lambda _
278 (substitute* "./git-version-gen"
279 (("/bin/sh") (which "sh")))
280 #t)))))
281 (native-inputs
282 `(("autoconf" ,autoconf)
283 ("automake" ,automake)
284 ("libtool" ,libtool)))
285 (synopsis "Celestial mechanics, astrometry and astrodynamics library")
286 (description "Libnova is a general purpose, double precision, Celestial
287 Mechanics, Astrometry and Astrodynamics library.")
288 (home-page "http://libnova.sourceforge.net/")
289 (license (list license:lgpl2.0+
290 license:gpl2+)))) ; examples/transforms.c & lntest/*.c
291