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