Merge branch 'master' into core-updates
[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 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
7 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages astronomy)
25 #:use-module (guix packages)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages curl)
35 #:use-module (gnu packages fontutils)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages gl)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gnome)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages lua)
43 #:use-module (gnu packages maths)
44 #:use-module (gnu packages netpbm)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages pretty-print)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages version-control)
50 #:use-module (gnu packages xiph)
51 #:use-module (gnu packages xorg)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (srfi srfi-1))
55
56 (define-public cfitsio
57 (package
58 (name "cfitsio")
59 (version "3.47")
60 (source
61 (origin
62 (method url-fetch)
63 (uri (string-append
64 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
65 name "-" version ".tar.gz"))
66 (sha256
67 (base32 "1vzlxnrjckz78p2wf148v2z3krkwnykfqvlj42sz3q711vqid1a1"))))
68 (build-system gnu-build-system)
69 ;; XXX Building with curl currently breaks wcslib. It doesn't use
70 ;; pkg-config and hence won't link with -lcurl.
71 (arguments
72 `(#:tests? #f ; no tests
73 #:phases
74 (modify-phases %standard-phases
75 (add-after 'unpack 'patch-paths
76 (lambda _
77 (substitute* "Makefile.in" (("/bin/") ""))
78 #t)))))
79 (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
80 (synopsis "Library for reading and writing FITS files")
81 (description "CFITSIO provides simple high-level routines for reading and
82 writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
83 programmer from the internal complexities of the FITS format. CFITSIO also
84 provides many advanced features for manipulating and filtering the information
85 in FITS files.")
86 (license (license:non-copyleft "file://License.txt"
87 "See License.txt in the distribution."))))
88
89 (define-public wcslib
90 (package
91 (name "wcslib")
92 (version "6.4")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (string-append
97 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
98 ".tar.bz2"))
99 (sha256
100 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
101 (inputs
102 `(("cfitsio" ,cfitsio)))
103 (build-system gnu-build-system)
104 (arguments
105 `(#:configure-flags
106 (list (string-append "--with-cfitsiolib="
107 (assoc-ref %build-inputs "cfitsio") "/lib")
108 (string-append "--with-cfitsioinc="
109 (assoc-ref %build-inputs "cfitsio") "/include"))
110 #:phases
111 (modify-phases %standard-phases
112 (add-before 'configure 'patch-/bin/sh
113 (lambda _
114 (substitute* "makedefs.in"
115 (("/bin/sh") "sh"))
116 #t))
117 (delete 'install-license-files)) ; installed by ‘make install’
118 ;; Parallel execution of the test suite is not supported.
119 #:parallel-tests? #f))
120 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
121 (synopsis "Library which implements the FITS WCS standard")
122 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
123 defines keywords and usage that provide for the description of astronomical
124 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
125 header.")
126 (license license:lgpl3+)))
127
128 (define-public gnuastro
129 (package
130 (name "gnuastro")
131 (version "0.11")
132 (source
133 (origin
134 (method url-fetch)
135 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
136 version ".tar.lz"))
137 (sha256
138 (base32
139 "0c1yc2qb7vrqad96savfn06rn01izlfz0va738signv93qqj5k3v"))))
140 (inputs
141 `(("cfitsio" ,cfitsio)
142 ("gsl" ,gsl)
143 ("libjpeg" ,libjpeg-turbo)
144 ("libtiff" ,libtiff)
145 ("wcslib" ,wcslib)
146 ("zlib" ,zlib)))
147 (native-inputs
148 `(("libtool" ,libtool)
149 ("lzip" ,lzip)))
150 (build-system gnu-build-system)
151 (home-page "https://www.gnu.org/software/gnuastro/")
152 (synopsis "Astronomy utilities")
153 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
154 programs for the manipulation and analysis of astronomical data.")
155 (license license:gpl3+)))
156
157 (define-public stellarium
158 (package
159 (name "stellarium")
160 (version "0.19.3")
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "https://github.com/Stellarium/stellarium"
165 "/releases/download/v" version
166 "/stellarium-" version ".tar.gz"))
167 (sha256
168 (base32 "0p92rgclag0nkic9gk3p9vclb8xx9hv4zlgyij6cyh43s7c1avhp"))))
169 (build-system cmake-build-system)
170 (inputs
171 `(("qtbase" ,qtbase)
172 ("qtlocation" ,qtlocation)
173 ("qtmultimedia" ,qtmultimedia)
174 ("qtscript" ,qtscript)
175 ("qtserialport" ,qtserialport)
176 ("zlib" ,zlib)))
177 (native-inputs
178 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
179 ("perl" ,perl) ; For pod2man
180 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
181 ("qttools" ,qttools)))
182 (arguments
183 `(#:test-target "test"
184 #:configure-flags (list "-DENABLE_TESTING=1"
185 (string-append
186 "-DCMAKE_CXX_FLAGS=-isystem "
187 (assoc-ref %build-inputs "qtserialport")
188 "/include/qt5"))
189 #:phases (modify-phases %standard-phases
190 (add-before 'check 'set-offscreen-display
191 (lambda _
192 ;; make Qt render "offscreen", required for tests
193 (setenv "QT_QPA_PLATFORM" "offscreen")
194 (setenv "HOME" "/tmp")
195 #t)))))
196 (home-page "https://stellarium.org/")
197 (synopsis "3D sky viewer")
198 (description "Stellarium is a planetarium. It shows a realistic sky in
199 3D, just like what you see with the naked eye, binoculars, or a telescope. It
200 can be used to control telescopes over a serial port for tracking celestial
201 objects.")
202 (license license:gpl2+)))
203
204 (define-public celestia
205 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
206 (package
207 (name "celestia")
208 (version (git-version "1.6.1" "815" commit))
209 (source (origin
210 (method git-fetch)
211 (uri (git-reference
212 (url "https://github.com/celestiaproject/celestia")
213 (commit commit)))
214 (file-name (git-file-name name version))
215 (sha256
216 (base32
217 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
218 (build-system cmake-build-system)
219 (native-inputs
220 `(("perl" ,perl)
221 ("libgit2" ,libgit2)
222 ("pkg-config" ,pkg-config)
223 ("libtool" ,libtool)
224 ("gettext" ,gettext-minimal)))
225 (inputs
226 `(("glu" ,glu)
227 ("glew" ,glew)
228 ("libtheora" ,libtheora)
229 ("libjpeg" ,libjpeg-turbo)
230 ("libpng" ,libpng)
231 ;; maybe required?
232 ("mesa" ,mesa)
233 ;; optional: fmtlib, Eigen3;
234 ("fmt" ,fmt)
235 ("eigen" ,eigen)
236 ;; glut: for glut interface
237 ("freeglut" ,freeglut)))
238 (propagated-inputs
239 `(("lua" ,lua)))
240 (arguments
241 `(#:configure-flags '("-DENABLE_GLUT=ON" "-DENABLE_QT=OFF")
242 #:tests? #f)) ;no tests
243 (home-page "https://celestia.space/")
244 (synopsis "Real-time 3D visualization of space")
245 (description
246 "This simulation program lets you explore our universe in three
247 dimensions. Celestia simulates many different types of celestial objects.
248 From planets and moons to star clusters and galaxies, you can visit every
249 object in the expandable database and view it from any point in space and
250 time. The position and movement of solar system objects is calculated
251 accurately in real time at any rate desired.")
252 (license license:gpl2+))))
253
254 (define-public celestia-gtk
255 (package
256 (inherit celestia)
257 (name "celestia-gtk")
258 (inputs
259 (append (alist-delete "freeglut" (package-inputs celestia))
260 `(("gtk2" ,gtk+-2)
261 ("gtkglext" ,gtkglext))))
262 (arguments
263 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
264 #:tests? #f))))
265
266 (define-public libnova
267 (package
268 (name "libnova")
269 (version "0.16")
270 (source
271 (origin
272 (method git-fetch)
273 (uri (git-reference
274 (url "https://git.code.sf.net/p/libnova/libnova.git")
275 (commit (string-append "v" version))))
276 (file-name (git-file-name name version))
277 (sha256
278 (base32
279 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
280 (build-system gnu-build-system)
281 (arguments
282 `(#:phases
283 (modify-phases %standard-phases
284 (add-after 'unpack 'patch-git-version
285 (lambda _
286 (substitute* "./git-version-gen"
287 (("/bin/sh") (which "sh")))
288 #t)))))
289 (native-inputs
290 `(("autoconf" ,autoconf)
291 ("automake" ,automake)
292 ("libtool" ,libtool)))
293 (synopsis "Celestial mechanics, astrometry and astrodynamics library")
294 (description "Libnova is a general purpose, double precision, Celestial
295 Mechanics, Astrometry and Astrodynamics library.")
296 (home-page "http://libnova.sourceforge.net/")
297 (license (list license:lgpl2.0+
298 license:gpl2+)))) ; examples/transforms.c & lntest/*.c
299
300 (define-public xplanet
301 (package
302 (name "xplanet")
303 (version "1.3.1")
304 (source
305 (origin
306 (method url-fetch)
307 (uri
308 (string-append
309 "mirror://sourceforge/xplanet/xplanet/"
310 version "/xplanet-" version ".tar.gz"))
311 (sha256
312 (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023"))
313 (patches
314 (search-patches
315 "xplanet-1.3.1-cxx11-eof.patch"
316 "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch"
317 "xplanet-1.3.1-libimage_gif.c.patch"
318 "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch"))))
319 (build-system gnu-build-system)
320 (native-inputs
321 `(("pkg-config" ,pkg-config)))
322 (inputs
323 `(("libx11" ,libx11)
324 ("libxscrnsaver" ,libxscrnsaver)
325 ("libice" ,libice)
326 ("freetype" ,freetype)
327 ("pango" ,pango)
328 ("giflib" ,giflib)
329 ("libjpeg", libjpeg-turbo)
330 ("libpng" ,libpng)
331 ("libtiff" ,libtiff)
332 ("netpbm" ,netpbm)
333 ("zlib" ,zlib)))
334 (arguments
335 `(#:configure-flags
336 (let ((netpbm (assoc-ref %build-inputs "netpbm")))
337 (append (list
338 ;; Give correct path for pnm.h header to configure script
339 (string-append "CPPFLAGS=-I" netpbm "/include/netpbm")
340 ;; no nasa jpl cspice support
341 "--without-cspice" )))))
342 (home-page "http://xplanet.sourceforge.net/")
343 (synopsis "Planetary body renderer")
344 (description
345 "Xplanet renders an image of a planet into an X window or file.
346 All of the major planets and most satellites can be drawn and different map
347 projections are also supported, including azimuthal, hemisphere, Lambert,
348 Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.")
349 (license license:gpl2+)))
350
351 (define-public gpredict
352 (package
353 (name "gpredict")
354 (version "2.2.1")
355 (source
356 (origin
357 (method url-fetch)
358 (uri (string-append "https://github.com/csete/gpredict/releases"
359 "/download/v" version
360 "/gpredict-" version ".tar.bz2"))
361 (sha256
362 (base32 "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7"))))
363 (build-system gnu-build-system)
364 (native-inputs
365 `(("intltool" ,intltool)
366 ("gettext" ,gettext-minimal)
367 ("pkg-config" ,pkg-config)))
368 (inputs
369 `(("curl" ,curl)
370 ("glib" ,glib)
371 ("goocanvas" ,goocanvas)
372 ("gtk+" ,gtk+)))
373 (arguments
374 `(#:phases
375 (modify-phases %standard-phases
376 (add-after 'unpack 'fix-tests
377 (lambda _
378 ;; Remove reference to non-existent file.
379 (substitute* "po/POTFILES.in"
380 (("src/gtk-sat-tree\\.c")
381 ""))
382 #t)))))
383 (synopsis "Satellite tracking and orbit prediction application")
384 (description
385 "Gpredict is a real-time satellite tracking and orbit prediction
386 application. It can track a large number of satellites and display their
387 position and other data in lists, tables, maps, and polar plots (radar view).
388 Gpredict can also predict the time of future passes for a satellite, and
389 provide you with detailed information about each pass.")
390 (home-page "http://gpredict.oz9aec.net/index.php")
391 (license license:gpl2+)))