gnu: texlive-latex-seminar: Declare a source file-name.
[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 (modify-phases %standard-phases
85 (add-before 'configure 'patch-/bin/sh
86 (lambda _
87 (substitute* "makedefs.in"
88 (("/bin/sh") "sh"))
89 #t)))))
90 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
91 (synopsis "Library which implements the FITS WCS standard")
92 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
93 defines keywords and usage that provide for the description of astronomical
94 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
95 header.")
96 (license license:lgpl3+)))
97
98 (define-public gnuastro
99 (package
100 (name "gnuastro")
101 (version "0.5")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
106 version ".tar.gz"))
107 (sha256
108 (base32
109 "10lxzxyrf30hj3bqdgprvaj9phzdi816khjmr0vmjf8pmsr8bqqr"))))
110 (inputs
111 `(("cfitsio" ,cfitsio)
112 ("gsl" ,gsl)
113 ("libjpeg" ,libjpeg)
114 ("wcslib" ,wcslib)))
115 (build-system gnu-build-system)
116 (home-page "https://www.gnu.org/software/gnuastro/")
117 (synopsis "Astronomy utilities")
118 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
119 programs for the manipulation and analysis of astronomical data.")
120 (license license:gpl3+)))
121
122 (define-public stellarium
123 (package
124 (name "stellarium")
125 (version "0.17.0")
126 (source (origin
127 (method url-fetch)
128 (uri (string-append "https://github.com/Stellarium/" name
129 "/releases/download/v" version
130 "/" name "-" version ".tar.gz"))
131 (file-name (string-append name "-" version ".tar.gz"))
132 (sha256
133 (base32
134 "0d6b3fs5aify7i1lwgkcickppnj73cbh24g8qschnfs3ypdf48fc"))))
135 (build-system cmake-build-system)
136 (inputs
137 `(("qtbase" ,qtbase)
138 ("qtlocation" ,qtlocation)
139 ("qtmultimedia" ,qtmultimedia)
140 ("qtscript" ,qtscript)
141 ("qtserialport" ,qtserialport)
142 ("zlib" ,zlib)))
143 (native-inputs
144 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
145 ("perl" ,perl) ; For pod2man
146 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
147 ("qttools" ,qttools)))
148 (arguments
149 `(#:test-target "test"
150 #:configure-flags (list "-DENABLE_TESTING=1"
151 (string-append
152 "-DCMAKE_CXX_FLAGS=-isystem "
153 (assoc-ref %build-inputs "qtserialport")
154 "/include/qt5"))
155 #:phases (modify-phases %standard-phases
156 (add-before 'check 'set-offscreen-display
157 (lambda _
158 ;; make Qt render "offscreen", required for tests
159 (setenv "QT_QPA_PLATFORM" "offscreen")
160 (setenv "HOME" "/tmp")
161 #t)))))
162 (home-page "http://www.stellarium.org/")
163 (synopsis "3D sky viewer")
164 (description "Stellarium is a planetarium. It shows a realistic sky in
165 3D, just like what you see with the naked eye, binoculars, or a telescope. It
166 can be used to control telescopes over a serial port for tracking celestial
167 objects.")
168 (license license:gpl2+)))