projects/guix·blob python-team · refs

318 lines · 12.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015 Ludovic Courtès <[email protected]>
3;;; Copyright © 2016-2024 Efraim Flashner <[email protected]>
4;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2018 Mathieu Othacehe <[email protected]>
6;;; Copyright © 2020 Guillaume Le Vaillant <[email protected]>
7;;; Copyright © 2020 Vincent Legoll <[email protected]>
8;;; Copyright © 2020 Marius Bakke <[email protected]>
9;;; Copyright © 2021 Björn Höfling <[email protected]>
10;;; Copyright © 2024 Andy Tai <[email protected]>
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 gexp)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system scons)
35 #:use-module (guix build-system qt)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix utils)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bash)
42 #:use-module (gnu packages build-tools)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages docbook)
45 #:use-module (gnu packages geo)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages libusb)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages python-xyz)
55 #:use-module (gnu packages qt)
56 #:use-module (gnu packages serialization)
57 #:use-module (gnu packages sqlite)
58 #:use-module (gnu packages xdisorg)
59 #:use-module (gnu packages xml))
60
61(define-public gpsbabel
62 (package
63 (name "gpsbabel")
64 (version "1.9.0")
65 (source (origin
66 (method git-fetch)
67 (uri (git-reference
68 (url "https://github.com/gpsbabel/gpsbabel")
69 (commit (string-append
70 "gpsbabel_"
71 (string-replace-substring version "." "_")))))
72 (file-name (git-file-name name version))
73 (sha256
74 (base32
75 "0pyrbykf15znn63y9j1npdv148i9b8sgc947xq6dqw8gwx023ji5"))
76 (modules '((guix build utils)))
77 (snippet
78 '(begin
79 (delete-file-recursively "zlib")
80 (delete-file-recursively "shapelib")
81 (delete-file-recursively "mac")
82 #t))))
83 ;; TODO: "make doc" requires Docbook & co.
84 (build-system cmake-build-system)
85 (arguments
86 (list #:phases
87 #~(modify-phases %standard-phases
88 (add-before 'check 'set-up-test-environment
89 (lambda* (#:key inputs #:allow-other-keys)
90 (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo"))))
91
92 (replace 'install
93 (lambda _
94 (install-file "gpsbabel" (string-append #$output "/bin")))))
95
96 #:configure-flags
97 #~(list
98 "-DGPSBABEL_MAPPREVIEW=OFF"
99 "-DGPSBABEL_WITH_LIBUSB=pkgconfig"
100 "-DGPSBABEL_WITH_SHAPELIB=pkgconfig"
101 "-DGPSBABEL_WITH_ZLIB=pkgconfig")))
102 (inputs
103 (list expat
104 libusb
105 libxkbcommon
106 qt5compat
107 qtbase
108 qtserialport
109 qttranslations
110 shapelib
111 zlib))
112 (native-inputs
113 (list (libc-utf8-locales-for-target)
114 libxml2 ;'xmllint' needed for the KML tests
115 pkg-config
116 qttools
117 tzdata-for-tests
118 which))
119 (home-page "https://www.gpsbabel.org/")
120 (synopsis "Convert and exchange data with GPS and map programs")
121 (description
122 "GPSBabel converts waypoints, tracks, and routes between hundreds of
123popular GPS receivers and mapping programs. It contains extensive data
124manipulation abilities making it a convenient for server-side processing or as
125the back-end for other tools. It does not convert, transfer, send, or
126manipulate maps.")
127 (license (list license:gpl2+))))
128
129(define-public gpscorrelate
130 (package
131 (name "gpscorrelate")
132 (version "2.3")
133 (source (origin
134 (method git-fetch)
135 (uri (git-reference
136 (url "https://github.com/dfandrich/gpscorrelate")
137 (commit version)))
138 (file-name (git-file-name name version))
139 (sha256
140 (base32
141 "0b074zd2jvn0rm0mkjdah61cmg3xvzqmllc9sijzpq45sm87gigq"))))
142 (build-system gnu-build-system)
143 (arguments
144 `(#:phases
145 (modify-phases %standard-phases
146 (replace 'configure
147 (lambda* (#:key inputs outputs #:allow-other-keys)
148 ;; This is a rudimentary build system.
149 (substitute* "Makefile"
150 (("prefix[[:blank:]]*=.*$")
151 (string-append "prefix = " (assoc-ref outputs "out")
152 "\n")))
153 #t)))))
154 (inputs
155 (list gtk+ libxml2 exiv2))
156 (native-inputs
157 (list pkg-config docbook-xml docbook-xsl libxslt))
158 (home-page "https://dfandrich.github.io/gpscorrelate/")
159 (synopsis "GPS photo correlation tool to geo-localize images")
160 (description
161 "GPS Correlate is a program to match a recorded GPS track with the EXIF
162tags in digital camera photos, and update the EXIF tags with the location that
163the photo was taken. It does this by using the timestamp in the photo and
164finding a data point in the GPS track that matches, or interpolating a point
165between two other data points.")
166 (license license:gpl2+)))
167
168(define-public gama
169 (package
170 (name "gama")
171 (version "2.33")
172 (source
173 (origin
174 (method url-fetch)
175 (uri (string-append "mirror://gnu/gama/gama-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "0pgv8ggf0h1fmhs07kgfh975zfv3fygh45lmyp09l3590b2ama51"))
180 (modules '((guix build utils)))
181 (snippet
182 '(begin
183 (delete-file-recursively "lib/expat")
184 (for-each delete-file (find-files "doc/fig" "\\.pdf$"))))))
185 (build-system gnu-build-system)
186 (arguments
187 (list
188 #:configure-flags #~(list
189 ;; force not to use of bundled copy of expat
190 "--enable-expat_1_1=no")
191 #:parallel-tests? #f)) ; race condition
192 (native-inputs
193 (list libxml2 yaml-cpp))
194 (inputs
195 (list expat sqlite))
196 (home-page "https://www.gnu.org/software/gama/")
197 (synopsis "Adjustment of geodetic networks")
198 (description
199 "GNU Gama is a program for the adjustment of geodetic networks. It is
200useful in measurements where Global Positioning System (GPS) is not available,
201such as underground. It features the ability to adjust in local Cartesian
202coordinates as well as partial support for adjustments in global coordinate systems.")
203 (license license:gpl3+)))
204
205(define-public gpxsee
206 (package
207 (name "gpxsee")
208 (version "15.6")
209 (source
210 (origin
211 (method git-fetch)
212 (uri (git-reference
213 (url "https://github.com/tumic0/GPXSee")
214 (commit version)))
215 (file-name (git-file-name name version))
216 (sha256
217 (base32 "0kfbx7vv740fkx96v3m1gywl0mdfs3mxq84hmipjksm59qi4s3yy"))))
218 (build-system qt-build-system)
219 (arguments
220 (list
221 #:qtbase qtbase
222 #:tests? #f ; no tests
223 #:modules '((guix build qt-build-system)
224 ((guix build gnu-build-system) #:prefix gnu:)
225 (guix build utils))
226 #:phases #~(modify-phases %standard-phases
227 (replace 'configure
228 ;; Use lrelease to convert TS translation files into QM files.
229 (lambda _
230 (apply invoke "lrelease"
231 (find-files "lang" "\\.ts"))
232 (invoke "qmake"
233 (string-append "PREFIX=" #$output))))
234 (replace 'build (assoc-ref gnu:%standard-phases 'build))
235 (replace 'install (assoc-ref gnu:%standard-phases 'install)))))
236 (inputs
237 (list libxkbcommon qtbase qtpositioning qtserialport qtsvg qtwayland))
238 (native-inputs (list qttools))
239 (home-page "https://www.gpxsee.org")
240 (synopsis "GPS log file viewer and analyzer")
241 (description
242 "GPXSee is a Qt-based GPS log file viewer and analyzer that supports all
243common GPS log file formats. It can display multiple tracks on various on-
244and off-line maps. You can easily add more maps and graph other captured data
245such as elevation, speed, heart rate, power, temperature, and gear shifts.")
246 (license license:gpl3)))
247
248(define-public gpsd
249 (package
250 (name "gpsd")
251 (version "3.27.3")
252 (source
253 (origin
254 (method url-fetch)
255 (uri (string-append "mirror://savannah/gpsd/gpsd-" version ".tar.xz"))
256 (sha256
257 (base32 "0lsnmp61jih5yaf3zz87zssyrcwad937rkahxxlblhh2l1wck8z4"))))
258 (build-system scons-build-system)
259 (native-inputs
260 (list bc pkg-config))
261 (inputs
262 (list bash-minimal
263 bluez
264 dbus
265 gtk+
266 libcap
267 libusb
268 ncurses
269 python
270 python-pycairo
271 python-pygobject
272 python-pyserial
273 python-wrapper
274 qtbase))
275 (arguments
276 `(#:scons-flags
277 (list (string-append "prefix=" %output)
278 (let ((version ,(version-major+minor (package-version python))))
279 (string-append "python_libdir=" %output
280 "/lib/python" version
281 "/site-packages")))
282 #:phases
283 (modify-phases %standard-phases
284 (add-after 'unpack 'fix-build
285 (lambda* (#:key outputs #:allow-other-keys)
286 (setenv "TAR" "noop")
287 (substitute* "SConscript"
288 (("envs = \\{\\}")
289 "envs = os.environ"))))
290 (add-after 'install 'wrap-python-scripts
291 (lambda* (#:key inputs outputs #:allow-other-keys)
292 (let* ((out (assoc-ref outputs "out"))
293 (pycairo (assoc-ref inputs "python-pycairo"))
294 (pygobject (assoc-ref inputs "python-pygobject"))
295 (pyserial (assoc-ref inputs "python-pyserial"))
296 (sitedir (lambda (package)
297 (string-append package
298 "/lib/python"
299 ,(version-major+minor
300 (package-version python))
301 "/site-packages")))
302 (pythonpath (string-join (map sitedir
303 (list out pycairo pygobject
304 pyserial))
305 ":")))
306 (for-each (lambda (script)
307 (wrap-program (string-append out "/bin/" script)
308 `("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
309 '("gegps" "gpscat" "gpsfake" "gpsprof"
310 "ubxtool" "xgps" "xgpsspeed" "zerk"))))))))
311 (synopsis "GPS service daemon")
312 (description
313 "@code{gpsd} is a service daemon that monitors one or more GPSes or AIS
314receivers attached to a host computer through serial or USB ports, making all
315data on the location/course/velocity of the sensors available to be queried on
316TCP port 2947 of the host computer.")
317 (home-page "https://gpsd.gitlab.io/gpsd/")
318 (license license:bsd-2)))