Subject: [PATCH v2 2/2] gnu: Add astroterm.

From: [email-masked]
Date: Sun, 9 Feb 2025 14:12:41 +0100

From: Vasilii Smirnov <[email-masked]>

* gnu/packages/astronomy.scm (astroterm): New variable.

Change-Id: Ie724bbfc238bee4a1603f5dbff9bc734ec65ff3e
---
 gnu/packages/astronomy.scm | 45 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 5eb9883464..282664bfcb 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -78,6 +78,7 @@ (define-module (gnu packages astronomy)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages plotutils)
+  #:use-module (gnu packages popt)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -89,14 +90,16 @@ (define-module (gnu packages astronomy)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
-  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages specifications)
   #:use-module (gnu packages sphinx)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages vim)
   #:use-module (gnu packages web)
   #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xiph)
@@ -260,6 +263,46 @@ (define-public aoflagger
 wide set of telescopes.")
     (license license:gpl3+)))
 
+(define-public astroterm
+  (package
+    (name "astroterm")
+    (version "1.0.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/da-luce/astroterm")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "03vfjcf8y039xbkigc3wy1sccbmk7zyy2nkfp984nbdxgr1pj129"))))
+    (build-system meson-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'configure 'copy-bsc5
+            (lambda _
+              (let* ((ybsc-input #+(this-package-native-input "specification-ybsc"))
+                     (ybsc-file (string-append ybsc-input "/share/BSC5")))
+                (copy-file ybsc-file "./data/bsc5"))))
+          (add-before 'configure 'fix-embed-sh-ref
+            (lambda _
+              (substitute* "meson.build"
+                (("'../scripts/embed.sh'")
+                 "meson.source_root() / 'scripts/embed.sh'")))))))
+    (native-inputs
+     (list pkg-config specification-ybsc xxd))
+    (inputs
+     (list ncurses argtable))
+    (home-page "https://github.com/da-luce/astroterm")
+    (synopsis "Planetarium for your terminal")
+    (description
+     "@code{astroterm} is a terminal-based star map written in C. It displays
+the real-time positions of stars, planets, constellations, and more, all
+within your terminal - no telescope required!")
+    (license license:expat)))
+
 (define-public calceph
   (package
     (name "calceph")
-- 
2.48.1