astronomy.scm 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  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. (define-public cfitsio
  35. (package
  36. (name "cfitsio")
  37. (version "3.450")
  38. (source
  39. (origin
  40. (method url-fetch)
  41. (uri (string-append
  42. "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
  43. name (string-replace-substring version "." "") ".tar.gz"))
  44. (sha256
  45. (base32 "0bmrkw6w65zb0k3mszaaqy1f4zjm2hl7njww74nb5v38wvdi4q5z"))))
  46. (build-system gnu-build-system)
  47. ;; XXX Building with curl currently breaks wcslib. It doesn't use
  48. ;; pkg-config and hence won't link with -lcurl.
  49. (arguments
  50. `(#:tests? #f ; no tests
  51. #:phases
  52. (modify-phases %standard-phases
  53. (add-after 'unpack 'patch-paths
  54. (lambda _
  55. (substitute* "Makefile.in" (("/bin/") ""))
  56. #t)))))
  57. (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
  58. (synopsis "Library for reading and writing FITS files")
  59. (description "CFITSIO provides simple high-level routines for reading and
  60. writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
  61. programmer from the internal complexities of the FITS format. CFITSIO also
  62. provides many advanced features for manipulating and filtering the information
  63. in FITS files.")
  64. (license (license:non-copyleft "file://License.txt"
  65. "See License.txt in the distribution."))))
  66. (define-public wcslib
  67. (package
  68. (name "wcslib")
  69. (version "5.20")
  70. (source
  71. (origin
  72. (method url-fetch)
  73. (uri (string-append
  74. "ftp://ftp.atnf.csiro.au/pub/software/wcslib/" name "-" version
  75. ".tar.bz2"))
  76. (sha256
  77. (base32 "1c8g9kv4dxrnawnqi4spi2p10s2xs7x75pdfxhbqxgcc97dkgh0b"))))
  78. (inputs
  79. `(("cfitsio" ,cfitsio)))
  80. (build-system gnu-build-system)
  81. (arguments
  82. `(#:phases
  83. (modify-phases %standard-phases
  84. (add-before 'configure 'patch-/bin/sh
  85. (lambda _
  86. (substitute* "makedefs.in"
  87. (("/bin/sh") "sh"))
  88. #t))
  89. (delete 'install-license-files)) ; installed by ‘make install’
  90. ;; Parallel execution of the test suite is not supported.
  91. #:parallel-tests? #f))
  92. (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
  93. (synopsis "Library which implements the FITS WCS standard")
  94. (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
  95. defines keywords and usage that provide for the description of astronomical
  96. coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
  97. header.")
  98. (license license:lgpl3+)))
  99. (define-public gnuastro
  100. (package
  101. (name "gnuastro")
  102. (version "0.8")
  103. (source
  104. (origin
  105. (method url-fetch)
  106. (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
  107. version ".tar.lz"))
  108. (sha256
  109. (base32
  110. "0gx6iar3z07k9sdvpa6kchsz6fpk94xn5vcvbcigssl2dwqmlnkb"))))
  111. (inputs
  112. `(("cfitsio" ,cfitsio)
  113. ("gsl" ,gsl)
  114. ("libjpeg" ,libjpeg)
  115. ("libtiff" ,libtiff)
  116. ("wcslib" ,wcslib)
  117. ("zlib" ,zlib)))
  118. (native-inputs
  119. `(("lzip" ,lzip)))
  120. (build-system gnu-build-system)
  121. (home-page "https://www.gnu.org/software/gnuastro/")
  122. (synopsis "Astronomy utilities")
  123. (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
  124. programs for the manipulation and analysis of astronomical data.")
  125. (license license:gpl3+)))
  126. (define-public stellarium
  127. (package
  128. (name "stellarium")
  129. (version "0.18.3")
  130. (source (origin
  131. (method url-fetch)
  132. (uri (string-append "https://github.com/Stellarium/" name
  133. "/releases/download/v" version
  134. "/" name "-" version ".tar.gz"))
  135. (sha256
  136. (base32
  137. "1mm8rjcb8j56m3kfigpix5vxviw1616kvl9ws2s3s5gdyngljrc3"))))
  138. (build-system cmake-build-system)
  139. (inputs
  140. `(("qtbase" ,qtbase)
  141. ("qtlocation" ,qtlocation)
  142. ("qtmultimedia" ,qtmultimedia)
  143. ("qtscript" ,qtscript)
  144. ("qtserialport" ,qtserialport)
  145. ("zlib" ,zlib)))
  146. (native-inputs
  147. `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
  148. ("perl" ,perl) ; For pod2man
  149. ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
  150. ("qttools" ,qttools)))
  151. (arguments
  152. `(#:test-target "test"
  153. #:configure-flags (list "-DENABLE_TESTING=1"
  154. (string-append
  155. "-DCMAKE_CXX_FLAGS=-isystem "
  156. (assoc-ref %build-inputs "qtserialport")
  157. "/include/qt5"))
  158. #:phases (modify-phases %standard-phases
  159. ;; Skip a test that assumes Stellarium is "installed":
  160. ;; https://bugs.gentoo.org/674472
  161. (add-after 'unpack 'patch-tests
  162. (lambda _
  163. (substitute* "src/tests/testEphemeris.cpp"
  164. (("ifndef Q_OS_WIN") "if 0"))
  165. #t))
  166. (add-before 'check 'set-offscreen-display
  167. (lambda _
  168. ;; make Qt render "offscreen", required for tests
  169. (setenv "QT_QPA_PLATFORM" "offscreen")
  170. (setenv "HOME" "/tmp")
  171. #t)))))
  172. (home-page "https://stellarium.org/")
  173. (synopsis "3D sky viewer")
  174. (description "Stellarium is a planetarium. It shows a realistic sky in
  175. 3D, just like what you see with the naked eye, binoculars, or a telescope. It
  176. can be used to control telescopes over a serial port for tracking celestial
  177. objects.")
  178. (license license:gpl2+)))