all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#68596] [PATCH] gnu: Add viz1090.
@ 2024-01-19 23:29 Leo Famulari
  2024-01-31 10:03 ` Guillaume Le Vaillant
  2024-02-01 21:11 ` Leo Famulari
  0 siblings, 2 replies; 6+ messages in thread
From: Leo Famulari @ 2024-01-19 23:29 UTC (permalink / raw)
  To: 68596; +Cc: glv

* gnu/packages/radio.scm (viz1090): New variable.

Change-Id: I1bee79df0906075728d0faee80eb0ccbbdb368dc
---
 gnu/packages/radio.scm | 141 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index f34511b352..f8b10e7061 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2022 Ryan Tolboom <ryan@using.tech>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Leo Famulari <leo@famulari.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1890,6 +1891,146 @@ (define-public dump1090
     (home-page "https://github.com/flightaware/dump1090")
     (license license:gpl2+)))
 
+(define-public viz1090
+  (let ((commit "ec055e1220f897b393f033a4cee02771c69dadc3")
+        (revision "0"))
+    (package
+      (name "viz1090")
+      ;; There are no "releases" of this program yet.
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                       (url "https://www.github.com/nmatsuda/viz1090")
+                       (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0gksr6dsaa4rffwrfcbhhnclmj5yabrv0dc8mb8q7hmbv8znd232"))))
+      (build-system gnu-build-system)
+      (arguments
+        (list
+          #:tests? #f ; No test suite
+          #:make-flags
+          #~(list (string-append "CXXFLAGS=-I"
+                                 #$(this-package-input "sdl-union")
+                                 "/include/SDL2")
+                  (string-append "CC=" #+(cc-for-target)))
+          #:phases
+          #~(modify-phases %standard-phases
+             (delete 'configure) ; No ./configure script
+             (add-before 'build 'build-map-data
+               (lambda _
+                 (let* ((share (string-append #$output "/share/viz1090")))
+                   ;; Disable the build-time maps downloader and adjust the
+                   ;; decompression procedure accordingly.
+                   (substitute* "getmap.sh"
+                     (("wget") "#wget")
+                     (("unzip.*")
+                      (string-append
+                        "unzip " #$(this-package-native-input "political-maps") " && \n"
+                        "unzip " #$(this-package-native-input "population-maps") " && \n"
+                        "unzip " #$(this-package-native-input "airports-map") " && \n"
+                        "unzip " #$(this-package-native-input "arcgis-data") " && \n")))
+                   ;; Adjust the run-time paths of the map data
+                   (substitute* "Map.cpp"
+                     (("mapdata.bin")
+                      (string-append share "/mapdata.bin"))
+                     (("airportdata.bin")
+                      (string-append share "/airportdata.bin"))
+                     (("\\\(\"mapnames")
+                      (string-append "\(\"" share "/mapnames"))
+                     (("\\\(\"airportnames")
+                      (string-append "\(\"" share "/airportnames")))
+                   (invoke "./getmap.sh"))))
+             (add-before 'build 'patch-font-path
+               (lambda _
+                 (substitute* "View.cpp"
+                   (("font\\/")
+                    (string-append #$output "/font/")))))
+             (replace 'install ; No install target
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let* ((bin (string-append #$output "/bin"))
+                        (share (string-append #$output "/share/viz1090"))
+                        (doc (string-append share "-" #$(package-version this-package) "/doc"))
+                        (fonts (string-append #$output "/font")))
+                   (install-file "viz1090" bin)
+                   (install-file "mapdata.bin" share)
+                   (install-file "airportdata.bin" share)
+                   (install-file "mapnames" share)
+                   (install-file "airportnames" share)
+                   (install-file "README.md" doc)
+                   (mkdir fonts)
+                   (copy-recursively "font" fonts)))))))
+      (native-inputs
+       `(("political-maps"
+          ;; version 5.1.1 of this data
+          ;; The upstream site does not version the URL for the most recent
+          ;; release, so we store them on archive.org to create a stable URL.
+          ;; See 'getmap.sh' in the viz1090 source distribution.
+          ,(origin
+             (method url-fetch)
+             (uri
+               "https://archive.org/download/ne_10m_admin_1_states_provinces/ne_10m_admin_1_states_provinces.zip")
+               ;"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip")
+             (sha256
+              (base32
+               "019bp9ccna1xxrk3c1af6k6pjcb7jvf0l8a6jj7ha8vk6ck9gigg"))))
+         ("population-maps"
+          ;; version 5.1.2 of this data
+          ;; The upstream site does not version the URL for the most recent
+          ;; release, so we store them on archive.org to create a stable URL.
+          ;; See 'getmap.sh' in the viz1090 source distribution.
+          ,(origin
+             (method url-fetch)
+             (uri
+               "https://archive.org/download/ne_10m_populated_places/ne_10m_populated_places.zip")
+               ;"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip")
+             (sha256
+              (base32
+               "0yqxqkydzlwylh2j6fidqc57sdd4h2wrk8qd87h069ixy239256d"))))
+         ("airports-map"
+          ;; version 5.0.0 of this data
+          ;; The upstream site does not version the URL for the most recent
+          ;; release, so we store them on archive.org to create a stable URL.
+          ;; See 'getmap.sh' in the viz1090 source distribution.
+          ,(origin
+             (method url-fetch)
+             (uri
+               "https://archive.org/download/ne_10m_airports/ne_10m_airports.zip")
+               ;"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_airports.zip")
+             (sha256
+              (base32
+               "1cvxgp141i7jy9fd49xxfz3g2k07szh745zd3l9lq7kynrf377m2"))))
+         ("arcgis-data"
+          ;; See 'getmap.sh' in the viz1090 source distribution.
+          ,(origin
+             (method url-fetch)
+             (uri
+               "https://opendata.arcgis.com/datasets/4d8fa46181aa470d809776c57a8ab1f6_0.zip")
+             (sha256
+              (base32
+               "1aqa7dc3xp1mcz7zm3v5m2qjdkzgyzgzlif4cvqsba2l2flc3v74"))))
+         ;; For building the map data
+         ("unzip" ,unzip)
+         ("python" ,python)
+         ("python-numpy" ,python-numpy)
+         ("python-tqdm" ,python-tqdm)))
+      (inputs
+        (list gdal
+              rtl-sdr
+              (sdl-union (list sdl2 sdl2-ttf sdl2-gfx))
+              python-fiona
+              python-shapely
+              python-requests))
+      (synopsis "Visualizer for dump1090 ADS-B data")
+      (description "Viz1090 provides a visual map-based display of
+@acronym{ADS-B, Automatic Dependent Surveillance–Broadcast} data that is
+broadcast from airborne aircraft.  It reads data provided by @code{dump1090} as
+described in @file{README.md} to show nearby aircraft on a map.")
+      (home-page "https://github.com/nmatsuda/viz1090")
+      (license license:bsd-2))))
+
 (define-public rtl-433
   (package
     (name "rtl-433")

base-commit: f7c0ccb1866b559dc2ce0c538d10a150822824c8
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#68596] [PATCH] gnu: Add viz1090.
  2024-01-19 23:29 [bug#68596] [PATCH] gnu: Add viz1090 Leo Famulari
@ 2024-01-31 10:03 ` Guillaume Le Vaillant
  2024-01-31 10:22   ` Guillaume Le Vaillant
  2024-02-01 21:14   ` Leo Famulari
  2024-02-01 21:11 ` Leo Famulari
  1 sibling, 2 replies; 6+ messages in thread
From: Guillaume Le Vaillant @ 2024-01-31 10:03 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 68596

Leo Famulari <leo@famulari.name> skribis:

> +(define-public viz1090
> [...]
> +      (native-inputs
> +       `(("political-maps"
> +          ;; version 5.1.1 of this data
> +          ;; The upstream site does not version the URL for the most recent
> +          ;; release, so we store them on archive.org to create a stable URL.
> +          ;; See 'getmap.sh' in the viz1090 source distribution.
> +          ,(origin
> +             (method url-fetch)
> +             (uri
> +               "https://archive.org/download/ne_10m_admin_1_states_provinces/ne_10m_admin_1_states_provinces.zip")
> +               ;"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip")
> +             (sha256
> +              (base32
> +               "019bp9ccna1xxrk3c1af6k6pjcb7jvf0l8a6jj7ha8vk6ck9gigg"))))
> +         ("population-maps"
> +          ;; version 5.1.2 of this data
> +          ;; The upstream site does not version the URL for the most recent
> +          ;; release, so we store them on archive.org to create a stable URL.
> +          ;; See 'getmap.sh' in the viz1090 source distribution.
> [...]

Hi.
It looks like the NaturalEarthData files can also be found in the Git
repository at <https://github.com/nvkelso/natural-earth-vector>. Maybe
you could use that instead of archiving the files by hand to get
a stable URL...




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#68596] [PATCH] gnu: Add viz1090.
  2024-01-31 10:03 ` Guillaume Le Vaillant
@ 2024-01-31 10:22   ` Guillaume Le Vaillant
  2024-02-01 21:12     ` Leo Famulari
  2024-02-01 21:14   ` Leo Famulari
  1 sibling, 1 reply; 6+ messages in thread
From: Guillaume Le Vaillant @ 2024-01-31 10:22 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 68596

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

> Leo Famulari <leo@famulari.name> skribis:
>
>  ("arcgis-data"
>   ;; See 'getmap.sh' in the viz1090 source distribution.
>   ,(origin
>      (method url-fetch)
>      (uri
>        "https://opendata.arcgis.com/datasets/4d8fa46181aa470d809776c57a8ab1f6_0.zip")
>      (sha256
>       (base32
>        "1aqa7dc3xp1mcz7zm3v5m2qjdkzgyzgzlif4cvqsba2l2flc3v74"))))

When I downloaded this file, I got a different hash
(1327vq7k5rw8b7fc1765w33k01zc84r2cnn5wv7b6pm0i5yg8zw1).
So I guess this URL is not stable.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#68596] [PATCH] gnu: Add viz1090.
  2024-01-19 23:29 [bug#68596] [PATCH] gnu: Add viz1090 Leo Famulari
  2024-01-31 10:03 ` Guillaume Le Vaillant
@ 2024-02-01 21:11 ` Leo Famulari
  1 sibling, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2024-02-01 21:11 UTC (permalink / raw)
  To: 68596; +Cc: glv

On Fri, Jan 19, 2024 at 06:29:03PM -0500, Leo Famulari wrote:
> +         ("arcgis-data"
> +          ;; See 'getmap.sh' in the viz1090 source distribution.
> +          ,(origin
> +             (method url-fetch)
> +             (uri
> +               "https://opendata.arcgis.com/datasets/4d8fa46181aa470d809776c57a8ab1f6_0.zip")

I had assumed that this file would be, if not versioned, at least
immutable, due to the filename looking like a hash of some sort. But it
was changed upstream recently. So, I'd need to provide an immutable
source for this as well.

I wonder if it would be better to take another approach here. I don't
want to have to create a new archive.org upload every time something
changes in the data set, which could be quite often given the scope of
information it includes.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#68596] [PATCH] gnu: Add viz1090.
  2024-01-31 10:22   ` Guillaume Le Vaillant
@ 2024-02-01 21:12     ` Leo Famulari
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2024-02-01 21:12 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 68596

On Wed, Jan 31, 2024 at 10:22:12AM +0000, Guillaume Le Vaillant wrote:
> When I downloaded this file, I got a different hash
> (1327vq7k5rw8b7fc1765w33k01zc84r2cnn5wv7b6pm0i5yg8zw1).
> So I guess this URL is not stable.

Oh, I just saw your replies, after I sent my own. Yes, this file is
sadly not immutable.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#68596] [PATCH] gnu: Add viz1090.
  2024-01-31 10:03 ` Guillaume Le Vaillant
  2024-01-31 10:22   ` Guillaume Le Vaillant
@ 2024-02-01 21:14   ` Leo Famulari
  1 sibling, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2024-02-01 21:14 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 68596

On Wed, Jan 31, 2024 at 10:03:43AM +0000, Guillaume Le Vaillant wrote:
> It looks like the NaturalEarthData files can also be found in the Git
> repository at <https://github.com/nvkelso/natural-earth-vector>. Maybe
> you could use that instead of archiving the files by hand to get
> a stable URL...

I looked into this, but I couldn't find the data used by helper scripts
in viz1090.

It seems like the Git repo contains something closer to source data,
whereas the files available from naturalearthdata.com are an artifact of
some process performed upstream.

It would be great if I was wrong about that...

This patch may be more trouble than it's worth to me.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-01 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19 23:29 [bug#68596] [PATCH] gnu: Add viz1090 Leo Famulari
2024-01-31 10:03 ` Guillaume Le Vaillant
2024-01-31 10:22   ` Guillaume Le Vaillant
2024-02-01 21:12     ` Leo Famulari
2024-02-01 21:14   ` Leo Famulari
2024-02-01 21:11 ` Leo Famulari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.