1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2018, 2019 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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
48 (define-public cfitsio
56 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
57 name "-" version ".tar.gz"))
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.
64 `(#:tests? #f ; no tests
66 (modify-phases %standard-phases
67 (add-after 'unpack 'patch-paths
69 (substitute* "Makefile.in" (("/bin/") ""))
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
78 (license (license:non-copyleft "file://License.txt"
79 "See License.txt in the distribution."))))
89 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
92 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
94 `(("cfitsio" ,cfitsio)))
95 (build-system gnu-build-system)
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"))
103 (modify-phases %standard-phases
104 (add-before 'configure 'patch-/bin/sh
106 (substitute* "makedefs.in"
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
118 (license license:lgpl3+)))
120 (define-public gnuastro
127 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
131 "0gmhmh0yddb2aql4hd5ffrr0d4hrmh4pa3yln0n186hslqinp81b"))))
133 `(("cfitsio" ,cfitsio)
140 `(("libtool" ,libtool)
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+)))
149 (define-public stellarium
156 (uri (string-append "https://github.com/Stellarium/stellarium"
157 "/releases/download/v" version
158 "/stellarium-" version ".tar.gz"))
160 (base32 "0s7v5iyhah258k83kvy2a91a3mdf34r150lcar4mmdsrrcmas98g"))))
161 (build-system cmake-build-system)
164 ("qtlocation" ,qtlocation)
165 ("qtmultimedia" ,qtmultimedia)
166 ("qtscript" ,qtscript)
167 ("qtserialport" ,qtserialport)
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)))
175 `(#:test-target "test"
176 #:configure-flags (list "-DENABLE_TESTING=1"
178 "-DCMAKE_CXX_FLAGS=-isystem "
179 (assoc-ref %build-inputs "qtserialport")
181 #:phases (modify-phases %standard-phases
182 (add-before 'check 'set-offscreen-display
184 ;; make Qt render "offscreen", required for tests
185 (setenv "QT_QPA_PLATFORM" "offscreen")
186 (setenv "HOME" "/tmp")
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
194 (license license:gpl2+)))
196 (define-public celestia
197 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
200 (version (git-version "1.6.1" "815" commit))
204 (url "https://github.com/celestiaproject/celestia")
206 (file-name (git-file-name name version))
209 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
210 (build-system cmake-build-system)
214 ("pkg-config" ,pkg-config)
216 ("gettext" ,gettext-minimal)))
220 ("libtheora" ,libtheora)
225 ;; optional: fmtlib, Eigen3;
228 ;; glut: for glut interface
229 ("freeglut" ,freeglut)))
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")
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+))))
246 (define-public celestia-gtk
249 (name "celestia-gtk")
251 (append (alist-delete "freeglut" (package-inputs celestia))
253 ("gtkglext" ,gtkglext))))
255 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
258 (define-public libnova
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))
271 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
272 (build-system gnu-build-system)
275 (modify-phases %standard-phases
276 (add-after 'unpack 'patch-git-version
278 (substitute* "./git-version-gen"
279 (("/bin/sh") (which "sh")))
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