WIP: bees service
[jackhill/guix/guix.git] / gnu / packages / gps.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
6 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
7 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
8 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
9 ;;; Copyright © 2021 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
10 ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages gps)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system scons)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages docbook)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages libusb)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages ncurses)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages sqlite)
51 #:use-module (gnu packages xml))
52
53 (define-public gpsbabel
54 (package
55 (name "gpsbabel")
56 (version "1.7.0")
57 (source (origin
58 (method git-fetch)
59 (uri (git-reference
60 (url "https://github.com/gpsbabel/gpsbabel")
61 (commit (string-append
62 "gpsbabel_"
63 (string-replace-substring version "." "_")))))
64 (file-name (git-file-name name version))
65 (sha256
66 (base32
67 "010g0vd2f5knpq5p7qfnl31kv3r8m5sjdsafcinbj5gh02j2nzpy"))
68 (patches (search-patches "gpsbabel-fix-i686-test.patch"))
69 (modules '((guix build utils)))
70 (snippet
71 '(begin
72 (delete-file-recursively "zlib")
73 (substitute* "Makefile.in"
74 ((" zlib/z.*\\.h") ""))
75 ;; Delete files under GPL-compatible licences but never used
76 ;; on GNU systems, rather than bloating the LICENSE field.
77 (delete-file "gui/serial_mac.cc") ; Apple MIT
78 (delete-file "mingw/include/ddk/hidsdi.h") ; public domain
79 #t))))
80 (build-system gnu-build-system)
81 ;; TODO: "make doc" requires Docbook & co.
82 (arguments
83 `(#:configure-flags
84 '("--with-zlib=system")))
85 (inputs
86 `(("expat" ,expat)
87 ("libusb" ,libusb)
88 ("qtbase" ,qtbase)
89 ("zlib" ,zlib)))
90 (native-inputs
91 `(("which" ,which)
92 ("qttools" ,qttools)
93 ("libxml2" ,libxml2))) ;'xmllint' needed for the KML tests
94 (home-page "https://www.gpsbabel.org/")
95 (synopsis "Convert and exchange data with GPS and map programs")
96 (description
97 "GPSBabel converts waypoints, tracks, and routes between hundreds of
98 popular GPS receivers and mapping programs. It contains extensive data
99 manipulation abilities making it a convenient for server-side processing or as
100 the back-end for other tools. It does not convert, transfer, send, or
101 manipulate maps.")
102 (license (list license:expat ; shapelib/*.[ch]
103 license:gpl2+)))) ; everything else
104
105 (define-public gpscorrelate
106 (package
107 (name "gpscorrelate")
108 (version "2.0")
109 (source (origin
110 (method git-fetch)
111 (uri (git-reference
112 (url "https://github.com/dfandrich/gpscorrelate")
113 (commit version)))
114 (file-name (git-file-name name version))
115 (sha256
116 (base32
117 "1kvybhfnygz79q3pgwc1q2x4ccmnsfscx2hzxnmzjbnc6arnqari"))))
118 (build-system gnu-build-system)
119 (arguments
120 `(#:phases
121 (modify-phases %standard-phases
122 (replace 'configure
123 (lambda* (#:key inputs outputs #:allow-other-keys)
124 ;; This is a rudimentary build system.
125 (substitute* "Makefile"
126 (("prefix[[:blank:]]*=.*$")
127 (string-append "prefix = " (assoc-ref outputs "out")
128 "\n")))
129 #t)))))
130 (inputs
131 `(("gtk+" ,gtk+)
132 ("libxml2" ,libxml2)
133 ("exiv2" ,exiv2)))
134 (native-inputs
135 `(("pkg-config" ,pkg-config)
136 ("docbook-xml" ,docbook-xml)
137 ("docbook-xsl" ,docbook-xsl)
138 ("libxslt" ,libxslt)))
139 (home-page "https://dfandrich.github.io/gpscorrelate/")
140 (synopsis "GPS photo correlation tool to geo-localize images")
141 (description
142 "GPS Correlate is a program to match a recorded GPS track with the EXIF
143 tags in digital camera photos, and update the EXIF tags with the location that
144 the photo was taken. It does this by using the timestamp in the photo and
145 finding a data point in the GPS track that matches, or interpolating a point
146 between two other data points.")
147 (license license:gpl2+)))
148
149 (define-public gama
150 (package
151 (name "gama")
152 (version "2.14")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "mirror://gnu/gama/gama-"
157 version ".tar.gz"))
158 (sha256
159 (base32
160 "04mhbgpqbynnmm8ww4k2yk1w2j66c276dns9xwn8cvrq58kjimln"))
161 (modules '((guix build utils)))
162 (snippet
163 '(begin
164 (delete-file-recursively "lib/expat")
165 (for-each delete-file (find-files "doc/fig" "\\.pdf$"))
166 #t))))
167 (build-system gnu-build-system)
168 (arguments '(#:parallel-tests? #f)) ; race condition
169 (native-inputs
170 `(("libxml2" ,libxml2)))
171 (inputs
172 `(("expat" ,expat)
173 ("sqlite" ,sqlite)))
174 (home-page "https://www.gnu.org/software/gama")
175 (synopsis "Adjustment of geodetic networks")
176 (description
177 "GNU Gama is a program for the adjustment of geodetic networks. It is
178 useful in measurements where Global Positioning System (GPS) is not available,
179 such as underground. It features the ability to adjust in local Cartesian
180 coordinates as well as partial support for adjustments in global coordinate systems.")
181 (license license:gpl3+)))
182
183 (define-public gpxsee
184 (package
185 (name "gpxsee")
186 (version "7.37")
187 (source (origin
188 (method git-fetch)
189 (uri (git-reference
190 (url "https://github.com/tumic0/GPXSee")
191 (commit version)))
192 (file-name (git-file-name name version))
193 (sha256
194 (base32
195 "0fpb43smh0kwic5pdxs46c0hkqj8g084h72pa024x1my6w12y9b8"))))
196 (build-system gnu-build-system)
197 (arguments
198 '(#:phases
199 (modify-phases %standard-phases
200 (replace 'configure
201 ;; Use lrelease to convert TS translation files into QM files.
202 (lambda* (#:key inputs outputs #:allow-other-keys)
203 (for-each (lambda (file)
204 (invoke "lrelease" file))
205 (find-files "lang" "\\.ts"))
206 (invoke "qmake"
207 (string-append "PREFIX="
208 (assoc-ref outputs "out"))))))))
209 (inputs
210 `(("qtbase" ,qtbase)))
211 (native-inputs
212 `(("qttools" ,qttools)))
213 (home-page "https://www.gpxsee.org")
214 (synopsis "GPS log file viewer and analyzer")
215 (description
216 "GPXSee is a Qt-based GPS log file viewer and analyzer that supports all
217 common GPS log file formats. It can display multiple tracks on various on-
218 and off-line maps. You can easily add more maps and graph other captured data
219 such as elevation, speed, heart rate, power, temperature, and gear shifts.")
220 (license license:gpl3)))
221
222 (define-public gpsd
223 (package
224 (name "gpsd")
225 (version "3.21")
226 (source
227 (origin
228 (method url-fetch)
229 (uri (string-append "https://download-mirror.savannah.gnu.org"
230 "/releases/gpsd/gpsd-" version ".tar.gz"))
231 (sha256
232 (base32 "14gyqrbrq6jz4y6x59rdpv9d4c3pbn0vh1blq3iwrc6kz0x4ql35"))))
233 (build-system scons-build-system)
234 (native-inputs
235 `(("bc" ,bc)
236 ("pkg-config" ,pkg-config)))
237 (inputs
238 `(("bluez" ,bluez)
239 ("dbus" ,dbus)
240 ("gtk+" ,gtk+)
241 ("libcap" ,libcap)
242 ("libusb" ,libusb)
243 ("ncurses" ,ncurses)
244 ("python" ,python)
245 ("python-pycairo" ,python-pycairo)
246 ("python-pygobject" ,python-pygobject)
247 ("python-pyserial" ,python-pyserial)
248 ("python-wrapper" ,python-wrapper)
249 ("qtbase" ,qtbase)))
250 (arguments
251 `(#:scons-flags
252 (list (string-append "prefix=" %output)
253 (let ((version ,(version-major+minor (package-version python))))
254 (string-append "python_libdir=" %output
255 "/lib/python" version
256 "/site-packages"))
257 "qt_versioned=5")
258 #:phases
259 (modify-phases %standard-phases
260 (add-after 'unpack 'fix-build
261 (lambda* (#:key outputs #:allow-other-keys)
262 (substitute* "SConstruct"
263 (("envs = \\{\\}")
264 "envs = os.environ"))
265 #t))
266 (add-after 'install 'wrap-python-scripts
267 (lambda* (#:key inputs outputs #:allow-other-keys)
268 (let* ((out (assoc-ref outputs "out"))
269 (pycairo (assoc-ref inputs "python-pycairo"))
270 (pygobject (assoc-ref inputs "python-pygobject"))
271 (pyserial (assoc-ref inputs "python-pyserial"))
272 (sitedir (lambda (package)
273 (string-append package
274 "/lib/python"
275 ,(version-major+minor
276 (package-version python))
277 "/site-packages")))
278 (pythonpath (string-join (map sitedir
279 (list out pycairo pygobject
280 pyserial))
281 ":")))
282 (for-each (lambda (script)
283 (wrap-program (string-append out "/bin/" script)
284 `("PYTHONPATH" ":" prefix (,pythonpath))))
285 '("gegps" "gpscat" "gpsfake" "gpsprof"
286 "ubxtool" "xgps" "xgpsspeed" "zerk")))
287 #t)))))
288 (synopsis "GPS service daemon")
289 (description
290 "@code{gpsd} is a service daemon that monitors one or more GPSes or AIS
291 receivers attached to a host computer through serial or USB ports, making all
292 data on the location/course/velocity of the sensors available to be queried on
293 TCP port 2947 of the host computer.")
294 (home-page "https://gpsd.gitlab.io/gpsd/")
295 (license license:bsd-2)))