gps.scm 12 KB

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