gnu: rust-xdg-2: Drop minor version from variable name.
[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.13")
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 "041cprbj4lfs42i7sd1c2zlx3r16g6c5shz3qls79gxb7kqflkgb"))
161 (modules '((guix build utils)))
162 (snippet
163 '(begin
164 (delete-file-recursively "lib/expat")
165 #t))))
166 (build-system gnu-build-system)
167 (arguments '(#:parallel-tests? #f)) ; race condition
168 (native-inputs
169 `(("libxml2" ,libxml2)))
170 (inputs
171 `(("expat" ,expat)
172 ("sqlite" ,sqlite)))
173 (home-page "https://www.gnu.org/software/gama")
174 (synopsis "Adjustment of geodetic networks")
175 (description
176 "GNU Gama is a program for the adjustment of geodetic networks. It is
177 useful in measurements where Global Positioning System (GPS) is not available,
178 such as underground. It features the ability to adjust in local Cartesian
179 coordinates as well as partial support for adjustments in global coordinate systems.")
180 (license license:gpl3+)))
181
182 (define-public gpxsee
183 (package
184 (name "gpxsee")
185 (version "7.37")
186 (source (origin
187 (method git-fetch)
188 (uri (git-reference
189 (url "https://github.com/tumic0/GPXSee")
190 (commit version)))
191 (file-name (git-file-name name version))
192 (sha256
193 (base32
194 "0fpb43smh0kwic5pdxs46c0hkqj8g084h72pa024x1my6w12y9b8"))))
195 (build-system gnu-build-system)
196 (arguments
197 '(#:phases
198 (modify-phases %standard-phases
199 (replace 'configure
200 ;; Use lrelease to convert TS translation files into QM files.
201 (lambda* (#:key inputs outputs #:allow-other-keys)
202 (for-each (lambda (file)
203 (invoke "lrelease" file))
204 (find-files "lang" "\\.ts"))
205 (invoke "qmake"
206 (string-append "PREFIX="
207 (assoc-ref outputs "out"))))))))
208 (inputs
209 `(("qtbase" ,qtbase)))
210 (native-inputs
211 `(("qttools" ,qttools)))
212 (home-page "https://www.gpxsee.org")
213 (synopsis "GPS log file viewer and analyzer")
214 (description
215 "GPXSee is a Qt-based GPS log file viewer and analyzer that supports all
216 common GPS log file formats. It can display multiple tracks on various on-
217 and off-line maps. You can easily add more maps and graph other captured data
218 such as elevation, speed, heart rate, power, temperature, and gear shifts.")
219 (license license:gpl3)))
220
221 (define-public gpsd
222 (package
223 (name "gpsd")
224 (version "3.21")
225 (source
226 (origin
227 (method url-fetch)
228 (uri (string-append "https://download-mirror.savannah.gnu.org"
229 "/releases/gpsd/gpsd-" version ".tar.gz"))
230 (sha256
231 (base32 "14gyqrbrq6jz4y6x59rdpv9d4c3pbn0vh1blq3iwrc6kz0x4ql35"))))
232 (build-system scons-build-system)
233 (native-inputs
234 `(("bc" ,bc)
235 ("pkg-config" ,pkg-config)))
236 (inputs
237 `(("bluez" ,bluez)
238 ("dbus" ,dbus)
239 ("gtk+" ,gtk+)
240 ("libcap" ,libcap)
241 ("libusb" ,libusb)
242 ("ncurses" ,ncurses)
243 ("python" ,python)
244 ("python-pycairo" ,python-pycairo)
245 ("python-pygobject" ,python-pygobject)
246 ("python-pyserial" ,python-pyserial)
247 ("python-wrapper" ,python-wrapper)
248 ("qtbase" ,qtbase)))
249 (arguments
250 `(#:scons-flags
251 (list (string-append "prefix=" %output)
252 (let ((version ,(version-major+minor (package-version python))))
253 (string-append "python_libdir=" %output
254 "/lib/python" version
255 "/site-packages"))
256 "qt_versioned=5")
257 #:phases
258 (modify-phases %standard-phases
259 (add-after 'unpack 'fix-build
260 (lambda* (#:key outputs #:allow-other-keys)
261 (substitute* "SConstruct"
262 (("envs = \\{\\}")
263 "envs = os.environ"))
264 #t))
265 (add-after 'install 'wrap-python-scripts
266 (lambda* (#:key inputs outputs #:allow-other-keys)
267 (let* ((out (assoc-ref outputs "out"))
268 (pycairo (assoc-ref inputs "python-pycairo"))
269 (pygobject (assoc-ref inputs "python-pygobject"))
270 (pyserial (assoc-ref inputs "python-pyserial"))
271 (sitedir (lambda (package)
272 (string-append package
273 "/lib/python"
274 ,(version-major+minor
275 (package-version python))
276 "/site-packages")))
277 (pythonpath (string-join (map sitedir
278 (list out pycairo pygobject
279 pyserial))
280 ":")))
281 (for-each (lambda (script)
282 (wrap-program (string-append out "/bin/" script)
283 `("PYTHONPATH" ":" prefix (,pythonpath))))
284 '("gegps" "gpscat" "gpsfake" "gpsprof"
285 "ubxtool" "xgps" "xgpsspeed" "zerk")))
286 #t)))))
287 (synopsis "GPS service daemon")
288 (description
289 "@code{gpsd} is a service daemon that monitors one or more GPSes or AIS
290 receivers attached to a host computer through serial or USB ports, making all
291 data on the location/course/velocity of the sensors available to be queried on
292 TCP port 2947 of the host computer.")
293 (home-page "https://gpsd.gitlab.io/gpsd/")
294 (license license:bsd-2)))