guix: qt-build-system, qt-utils: Unify wrapping of qt-programs.
[jackhill/guix/guix.git] / gnu / packages / geo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019, 2020 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
16 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages geo)
34 #:use-module (guix build-system ant)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system glib-or-gtk)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system go)
39 #:use-module (guix build-system meson)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system qt)
42 #:use-module (guix build-system scons)
43 #:use-module (guix build-system r)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix svn-download)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (guix packages)
49 #:use-module (guix utils)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages algebra)
52 #:use-module (gnu packages astronomy)
53 #:use-module (gnu packages audio)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages backup)
56 #:use-module (gnu packages bash)
57 #:use-module (gnu packages bison)
58 #:use-module (gnu packages boost)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages curl)
62 #:use-module (gnu packages databases)
63 #:use-module (gnu packages datastructures)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages documentation)
66 #:use-module (gnu packages elf)
67 #:use-module (gnu packages flex)
68 #:use-module (gnu packages fonts)
69 #:use-module (gnu packages fontutils)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages gl)
72 #:use-module (gnu packages glib)
73 #:use-module (gnu packages gnome)
74 #:use-module (gnu packages gps)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages haskell-apps)
77 #:use-module (gnu packages image)
78 #:use-module (gnu packages image-processing)
79 #:use-module (gnu packages icu4c)
80 #:use-module (gnu packages java)
81 #:use-module (gnu packages kde)
82 #:use-module (gnu packages lua)
83 #:use-module (gnu packages maths)
84 #:use-module (gnu packages pcre)
85 #:use-module (gnu packages pdf)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages photo)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages protobuf)
90 #:use-module (gnu packages pulseaudio)
91 #:use-module (gnu packages python)
92 #:use-module (gnu packages python-check)
93 #:use-module (gnu packages python-web)
94 #:use-module (gnu packages python-xyz)
95 #:use-module (gnu packages qt)
96 #:use-module (gnu packages readline)
97 #:use-module (gnu packages swig)
98 #:use-module (gnu packages sqlite)
99 #:use-module (gnu packages textutils)
100 #:use-module (gnu packages time)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages webkit)
103 #:use-module (gnu packages wxwidgets)
104 #:use-module (gnu packages xml)
105 #:use-module (gnu packages xorg))
106
107 (define-public memphis
108 (package
109 (name "memphis")
110 (version "0.2.3")
111 (source
112 (origin
113 (method git-fetch)
114 (uri
115 (git-reference
116 (url "https://github.com/jiuka/memphis")
117 (commit version)))
118 (file-name (git-file-name name version))
119 (sha256
120 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
121 (build-system glib-or-gtk-build-system)
122 (outputs '("out" "doc"))
123 (arguments
124 `(#:configure-flags
125 (list
126 "--disable-static"
127 "--enable-gtk-doc"
128 "--enable-vala"
129 (string-append "--with-html-dir="
130 (assoc-ref %outputs "doc")
131 "/share/gtk-doc/html"))
132 #:phases
133 (modify-phases %standard-phases
134 (add-after 'unpack 'patch-autogen
135 (lambda _
136 (substitute* "autogen.sh"
137 (("\\./configure \"\\$@\"")
138 ""))
139 #t))
140 (add-after 'patch-autogen 'patch-docbook-xml
141 (lambda* (#:key inputs #:allow-other-keys)
142 (with-directory-excursion "docs/reference"
143 (substitute* "libmemphis-docs.sgml"
144 (("http://www.oasis-open.org/docbook/xml/4.3/")
145 (string-append (assoc-ref inputs "docbook-xml")
146 "/xml/dtd/docbook/"))))
147 #t)))))
148 (native-inputs
149 `(("autoconf" ,autoconf)
150 ("automake" ,automake)
151 ("docbook-xml" ,docbook-xml-4.3)
152 ("gobject-introspection" ,gobject-introspection)
153 ("gtk-doc" ,gtk-doc)
154 ("libtool" ,libtool)
155 ("pkg-config" ,pkg-config)
156 ("python" ,python-wrapper)
157 ("seed" ,seed)
158 ("vala" ,vala)))
159 (inputs
160 `(("expat" ,expat)
161 ("glib" ,glib)))
162 (propagated-inputs
163 `(("cairo" ,cairo)))
164 (synopsis "Map-rendering for OpenSteetMap")
165 (description "Memphis is a map-rendering application and a library for
166 OpenStreetMap written in C using eXpat, Cairo and GLib.")
167 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
168 (license license:lgpl2.1+)))
169
170 (define-public geos
171 (package
172 (name "geos")
173 (version "3.8.1")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "http://download.osgeo.org/geos/geos-"
177 version
178 ".tar.bz2"))
179 (sha256
180 (base32
181 "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
182 (build-system gnu-build-system)
183 (arguments `(#:phases
184 (modify-phases %standard-phases
185 (add-after
186 'unpack 'patch-test-shebangs
187 (lambda _
188 (substitute* '("tests/xmltester/testrunner.sh"
189 "tests/geostest/testrunner.sh")
190 (("/bin/sh") (which "sh")))
191 #t)))))
192 (inputs
193 `(("glib" ,glib)))
194 (home-page "https://geos.osgeo.org/")
195 (synopsis "Geometry Engine for Geographic Information Systems")
196 (description
197 "GEOS provides a spatial object model and fundamental geometric
198 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
199 it aims to contain the complete functionality of JTS in C++. This
200 includes all the OpenGIS Simple Features for SQL spatial predicate
201 functions and spatial operators, as well as specific JTS enhanced
202 topology functions.")
203 (license (list license:lgpl2.1+ ; Main distribution.
204 license:zlib ; tests/xmltester/tinyxml/*
205 license:public-domain)))) ; include/geos/timeval.h
206
207 (define-public gnome-maps
208 (package
209 (name "gnome-maps")
210 (version "3.34.2")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "mirror://gnome/sources/" name "/"
214 (version-major+minor version) "/"
215 name "-" version ".tar.xz"))
216 (sha256
217 (base32
218 "00xslcnhhwslqglgfv2im7vq3awa49y2jxzr8wsby7f713k28vf5"))))
219 (build-system meson-build-system)
220 (arguments
221 `(#:glib-or-gtk? #t
222 #:phases
223 (modify-phases %standard-phases
224 (add-after 'unpack 'skip-gtk-update-icon-cache
225 ;; Don't create 'icon-theme.cache'.
226 (lambda _
227 (substitute* "meson_post_install.py"
228 (("gtk-update-icon-cache") "true"))
229 #t))
230 (add-after 'unpack 'patch-dbus-service
231 (lambda* (#:key outputs #:allow-other-keys)
232 (substitute* "data/org.gnome.Maps.service.in"
233 (("@pkgdatadir@/org.gnome.Maps")
234 (string-append (assoc-ref outputs "out") "/bin/gnome-maps")))
235 #t))
236 (add-after 'install 'wrap
237 (lambda* (#:key inputs outputs #:allow-other-keys)
238 (let ((out (assoc-ref outputs "out"))
239 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
240 (geocode-glib-path (string-append
241 (assoc-ref inputs "geocode-glib")
242 "/lib"))
243 (goa-path (string-append
244 (assoc-ref inputs "gnome-online-accounts:lib")
245 "/lib"))
246 (gdk-pixbuf-path (string-append
247 (assoc-ref inputs "gdk-pixbuf")
248 "/lib"))
249 (webkitgtk-path (string-append
250 (assoc-ref inputs "webkitgtk")
251 "/lib")))
252 (wrap-program (string-append out "/bin/gnome-maps")
253 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
254
255 ;; There seems to be no way to embed the path of
256 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
257 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
258 ;; libgeocode-glib.so.0
259 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
260 ,webkitgtk-path
261 ,gdk-pixbuf-path
262 ,geocode-glib-path)))
263 #t))))))
264 (native-inputs
265 `(("gettext" ,gettext-minimal)
266 ("gobject-introspection" ,gobject-introspection)
267 ("pkg-config" ,pkg-config)))
268 (inputs
269 `(("evolution-data-server" ,evolution-data-server)
270 ("folks" ,folks)
271 ("libchamplain" ,libchamplain)
272 ("libgee" ,libgee)
273 ("libsecret" ,libsecret)
274 ("libsoup" ,libsoup)
275 ("libgweather" ,libgweather)
276 ("libxml2" ,libxml2)
277 ("gdk-pixbuf" ,gdk-pixbuf+svg)
278 ("glib-networking" ,glib-networking)
279 ("geoclue" ,geoclue)
280 ("geocode-glib" ,geocode-glib)
281 ("gfbgraph" ,gfbgraph)
282 ("gjs" ,gjs)
283 ("glib" ,glib)
284 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
285 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
286 ("gtk+" ,gtk+)
287 ("rest" ,rest)
288 ("webkitgtk" ,webkitgtk)))
289 (synopsis "Graphical map viewer and wayfinding program")
290 (description "GNOME Maps is a graphical map viewer. It uses map data from
291 the OpenStreetMap project. It can provide directions for walking, bicycling,
292 and driving.")
293 (home-page "https://wiki.gnome.org/Apps/Maps")
294 (license license:gpl2+)))
295
296 (define-public libgaiagraphics
297 (package
298 (name "libgaiagraphics")
299 (version "0.5")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
304 version ".tar.gz"))
305 (sha256
306 (base32
307 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
308 (build-system gnu-build-system)
309 (native-inputs
310 `(("pkg-config" ,pkg-config)))
311 (inputs
312 `(("cairo" ,cairo)
313 ("libpng" ,libpng)
314 ("libjpeg-turbo" ,libjpeg-turbo)
315 ("libtiff" ,libtiff)
316 ("libgeotiff" ,libgeotiff)
317 ("proj.4" ,proj.4)
318 ("libxml2" ,libxml2)
319 ("zlib" ,zlib)))
320 (synopsis "Gaia common graphics support")
321 (description "libgaiagraphics is a library supporting
322 common-utility raster handling methods.")
323 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
324 (license license:lgpl3+)))
325
326 (define-public libgeotiff
327 (package
328 (name "libgeotiff")
329 (version "1.5.1")
330 (source
331 (origin
332 (method url-fetch)
333 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
334 version ".tar.gz"))
335 (patches (search-patches
336 ;; See libgeotiff 1.5.1 issue
337 ;; https://github.com/OSGeo/libgeotiff/issues/22
338 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
339 (sha256
340 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
341 (modules '((guix build utils)))
342 (snippet
343 '(begin
344 ;; Remove .csv files, distributed from EPSG under a restricted
345 ;; license. See LICENSE for full license text.
346 (for-each delete-file (find-files "." "\\.csv$"))
347 #t))))
348 (build-system gnu-build-system)
349 (inputs
350 `(("libjpeg-turbo" ,libjpeg-turbo)
351 ("libtiff" ,libtiff)
352 ("zlib" ,zlib)))
353 (propagated-inputs
354 `(;; libgeotiff headers include proj headers, so ensure those are available.
355 ("proj" ,proj)))
356 (arguments
357 `(#:configure-flags
358 (list "--disable-static"
359 "--with-zlib" "--with-jpeg"
360 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
361 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
362 (description "libgeotiff is a library on top of libtiff for reading and
363 writing GeoTIFF information tags.")
364 (home-page "https://trac.osgeo.org/geotiff/")
365 ;; This is a mixture of various contributions under different licenses.
366 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
367 ;; states, as its commercial redistribution is restricted. Hence, we have
368 ;; removed it from the package.
369 (license (list license:public-domain
370 license:x11
371 license:bsd-3
372 (license:non-copyleft "file://LICENSE"
373 "See LICENSE in the distribution.")))))
374
375 (define-public librttopo
376 (package
377 (name "librttopo")
378 (version "1.1.0")
379 (source
380 (origin
381 (method git-fetch)
382 (uri (git-reference
383 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
384 (commit (string-append "librttopo-" version))))
385 (file-name (git-file-name name version))
386 (sha256
387 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
388 (build-system gnu-build-system)
389 (arguments
390 `(#:phases
391 (modify-phases %standard-phases
392 (add-after 'unpack 'patch-autogen
393 (lambda _
394 (let ((autoconf (which "autoconf"))
395 (autoheader (which "autoheader"))
396 (aclocal (which "aclocal"))
397 (automake (which "automake"))
398 (libtoolize (which "libtoolize")))
399 (substitute* "autogen.sh"
400 (("`which autoconf 2>/dev/null`") autoconf)
401 (("`which autoheader 2>/dev/null`") autoheader)
402 (("ACLOCAL=.*$")
403 (string-append "ACLOCAL=" aclocal "\n"))
404 (("AUTOMAKE=.*$")
405 (string-append "AUTOMAKE=" automake "\n"))
406 (("LIBTOOLIZE=.*$")
407 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
408 #t)))))
409 (native-inputs
410 `(("autoconf" ,autoconf)
411 ("automake" ,automake)
412 ("libtool" ,libtool)
413 ("pkg-config" ,pkg-config)))
414 (inputs
415 `(("geos" ,geos)))
416 (synopsis "Library to handle SQL/MM topologies")
417 (description
418 "The RT Topology Library exposes an API to create and manage standard
419 (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
420 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
421 (license license:gpl2+)))
422
423 (define-public libspatialite
424 (package
425 (name "libspatialite")
426 (version "5.0.0")
427 (source
428 (origin
429 (method url-fetch)
430 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
431 version ".tar.gz"))
432 (sha256
433 (base32
434 "1b3dmkgwbfi43hj3jzy2mh707khavrnw91vdd5sv387m8c1dfzvv"))))
435 (build-system gnu-build-system)
436 (native-inputs
437 `(("pkg-config" ,pkg-config)))
438 (inputs
439 `(("freexl" ,freexl)
440 ("geos" ,geos)
441 ("librttopo" ,librttopo)
442 ("libxml2" ,libxml2)
443 ("minizip" ,minizip)
444 ("proj.4" ,proj.4)
445 ("sqlite" ,sqlite)
446 ("zlib" ,zlib)))
447 (arguments
448 `(#:configure-flags
449 '("--enable-rttopo=yes")
450 #:phases
451 (modify-phases %standard-phases
452 ;; 3 tests are failing, ignore them:
453 (add-after 'unpack 'ignore-broken-tests
454 (lambda _
455 (substitute* '("test/Makefile.in")
456 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
457 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
458 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
459 #t)))))
460 (synopsis "Extend SQLite to support Spatial SQL capabilities")
461 (description
462 "SpatiaLite is a library intended to extend the SQLite core to support
463 fully fledged Spatial SQL capabilities.")
464 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
465 ;; For the genuine libspatialite-sources holds:
466 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
467 ;; Files under src/control_points are from GRASS
468 ;; and are licensed under GPL2+ only.
469 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
470 (license (list license:gpl2+
471 license:lgpl2.1+
472 license:mpl1.1
473 license:public-domain))))
474
475 (define-public proj
476 (package
477 (name "proj")
478 (version "6.3.1")
479 (source
480 (origin
481 (method url-fetch)
482 (uri (string-append "http://download.osgeo.org/proj/proj-"
483 version ".tar.gz"))
484 (sha256
485 (base32
486 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
487 (build-system gnu-build-system)
488 (inputs
489 `(("sqlite" ,sqlite)))
490 (native-inputs
491 `(("pkg-config" ,pkg-config)))
492 (home-page "https://proj.org/")
493 (synopsis "Coordinate transformation software")
494 (description
495 "Proj is a generic coordinate transformation software that transforms
496 geospatial coordinates from one coordinate reference system (CRS) to another.
497 This includes cartographic projections as well as geodetic transformations.
498 PROJ includes command line applications for easy conversion of coordinates
499 from text files or directly from user input. In addition, proj also exposes
500 an application programming interface that lets developers use the
501 functionality of proj in their own software.")
502 (license (list license:expat
503 ;; src/projections/patterson.cpp
504 license:asl2.0
505 ;; src/geodesic.*, src/tests/geodtest.cpp
506 license:x11))))
507
508 (define-public proj.4
509 (package
510 (name "proj.4")
511 (version "4.9.3")
512 (source (origin
513 (method url-fetch)
514 (uri (string-append "http://download.osgeo.org/proj/proj-"
515 version ".tar.gz"))
516 (sha256
517 (base32
518 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
519 (build-system gnu-build-system)
520 (arguments
521 `(#:phases
522 (modify-phases %standard-phases
523 (add-after 'unpack 'patch-test-paths
524 (lambda _
525 (substitute* '("nad/test27"
526 "nad/test83"
527 "nad/testvarious"
528 "nad/testdatumfile"
529 "nad/testflaky"
530 "nad/testIGNF")
531 (("/bin/rm") (which "rm")))
532 #t))
533 ;; Precision problems on i686 and other platforms. See:
534 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
535 ;; Disable failing test.
536 (add-after 'patch-test-paths 'ignore-failing-tests
537 (lambda _
538 (substitute* '("nad/Makefile.in")
539 (("\tPROJ_LIB.*" all) (string-append "#" all)))
540 #t)))))
541 (inputs
542 `(("glib" ,glib)))
543 (home-page "https://proj.org/")
544 (synopsis "Cartographic Projections Library")
545 (description
546 "Proj.4 is a library for converting coordinates between cartographic
547 projections.")
548 (license (list license:expat
549 ;; src/PJ_patterson.c
550 license:asl2.0
551 ;; src/geodesic.c/h
552 license:x11
553 ;; Embedded EPSG database.
554 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
555 ;; cmake/*
556 license:boost1.0))))
557
558 (define-public mapnik
559 (package
560 (name "mapnik")
561 (version "3.0.18")
562 (source
563 (origin
564 (method url-fetch)
565 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
566 version "/mapnik-v" version ".tar.bz2"))
567 (sha256
568 (base32
569 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
570 (build-system scons-build-system)
571 (inputs
572 `(("boost" ,boost)
573 ("cairo" ,cairo)
574 ("freetype" ,freetype)
575 ("harfbuzz" ,harfbuzz)
576 ("icu4c" ,icu4c)
577 ("libjpeg-turbo" ,libjpeg-turbo)
578 ("libpng" ,libpng)
579 ("libtiff" ,libtiff)
580 ("libwebp" ,libwebp)
581 ("libxml2" ,libxml2)
582 ("proj.4" ,proj.4)
583 ("sqlite" ,sqlite)
584 ("zlib" ,zlib)))
585 (native-inputs
586 `(("pkg-config" ,pkg-config)))
587 (arguments
588 `(#:scons ,scons-python2
589 #:scons-flags
590 (list "CC=gcc"
591 (string-append "PREFIX=" %output)
592 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
593 (home-page "https://mapnik.org/")
594 (synopsis "Toolkit for developing mapping applications")
595 (description "Mapnik is a toolkit for developing mapping applications. It
596 is basically a collection of geographic objects like maps, layers,
597 datasources, features, and geometries. At its core is a C++ shared library
598 providing algorithms and patterns for spatial data access and visualization.
599 The library does not rely on any specific windowing system and can be deployed
600 to any server environment. It is intended to play fair in a multi-threaded
601 environment and is aimed primarily, but not exclusively, at web-based
602 development.")
603 (license (list license:lgpl2.1+
604 ;; demo/viewer, demo/python/rundemo.py
605 license:gpl2+
606 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
607 license:boost1.0
608 ;; deps/mapnik/sparsehash
609 license:bsd-3
610 ;; deps/agg
611 (license:non-copyleft "file://deps/agg/copying")))))
612
613 (define-public python2-mapnik
614 (package
615 (name "python2-mapnik")
616 (version "3.0.16")
617 (source
618 (origin
619 (method url-fetch)
620 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
621 version ".tar.gz"))
622 (file-name (string-append name "-" version ".tar.gz"))
623 (sha256
624 (base32
625 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
626 (build-system python-build-system)
627 (inputs
628 `(("boost" ,boost)
629 ("harfbuzz" ,harfbuzz)
630 ("icu4c" ,icu4c)
631 ("libjpeg-turbo" ,libjpeg-turbo)
632 ("libpng" ,libpng)
633 ("libtiff" ,libtiff)
634 ("libwebp" ,libwebp)
635 ("mapnik" ,mapnik)
636 ("proj.4" ,proj.4)
637 ("python2-pycairo" ,python2-pycairo)))
638 (native-inputs
639 (let ((test-data-input
640 (lambda (repository version hash)
641 (origin
642 (method url-fetch)
643 (uri (string-append "https://github.com/mapnik/" repository
644 "/archive/v" version ".tar.gz"))
645 (file-name (string-append "python-mapnik-" repository
646 "-" version ".tar.gz"))
647 (sha256 (base32 hash))))))
648 `(("python2-nose" ,python2-nose)
649 ;; Test data is released as separate tarballs
650 ("test-data"
651 ,(test-data-input "test-data" "3.0.18"
652 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
653 ("test-data-visual"
654 ,(test-data-input "test-data-visual" "3.0.18"
655 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
656 (arguments
657 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
658 #:phases
659 (modify-phases %standard-phases
660 ;; Unpack test data into the source tree
661 (add-after 'unpack 'unpack-submodules
662 (lambda* (#:key inputs #:allow-other-keys)
663 (let ((unpack (lambda (source target)
664 (with-directory-excursion target
665 (invoke "tar" "xvf" (assoc-ref inputs source)
666 "--strip-components=1")))))
667 (unpack "test-data" "test/data")
668 (unpack "test-data-visual" "test/data-visual"))))
669 ;; Skip failing tests
670 (add-after 'unpack 'skip-tests
671 (lambda _
672 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
673 "test_unicode_regex_replace"
674 "test_proj_antimeridian_bbox"
675 "test_render_with_scale_factor")))
676 (substitute* "setup.cfg"
677 (("\\[nosetests\\]" all)
678 (string-append all "\nexclude=^("
679 (string-join skipped-tests "|") ")$")))))))))
680 (home-page "https://github.com/mapnik/python-mapnik")
681 (synopsis "Python bindings for Mapnik")
682 (description "This package provides Python bindings for Mapnik.")
683 (license license:lgpl2.1+)))
684
685 (define-public spatialite-gui
686 (package
687 (name "spatialite-gui")
688 (version "1.7.1")
689 (source
690 (origin
691 (method url-fetch)
692 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
693 version ".tar.gz"))
694 (sha256
695 (base32
696 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
697 (build-system gnu-build-system)
698 (native-inputs
699 `(("pkg-config" ,pkg-config)))
700 (inputs
701 `(("freexl" ,freexl)
702 ("geos" ,geos)
703 ("libgaiagraphics" ,libgaiagraphics)
704 ("libjpeg-turbo" ,libjpeg-turbo)
705 ("libspatialite" ,libspatialite)
706 ("libxml2" ,libxml2)
707 ("proj.4" ,proj.4)
708 ("sqlite" ,sqlite)
709 ("wxwidgets" ,wxwidgets-2)
710 ("zlib" ,zlib)))
711 (arguments
712 `(#:phases (modify-phases %standard-phases
713 (add-after 'unpack 'fix-gui
714 (lambda _
715 ;; Fix for the GUI not showing up.
716 (substitute* "Main.cpp"
717 (("Hide\\(\\);") ""))
718 #t)))))
719 (synopsis "Graphical user interface for SpatiaLite")
720 (description "Spatialite-gui provides a visual interface for viewing and
721 maintaining a spatialite database. You can easily see the structure of the
722 tables and data contents using point and click functions, many of which
723 construct common SQL queries, or craft your own SQL queries.")
724 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
725 (license license:gpl3+)))
726
727 (define-public gdal
728 (package
729 (name "gdal")
730 (version "3.1.2")
731 (source (origin
732 (method url-fetch)
733 (uri (string-append
734 "http://download.osgeo.org/gdal/" version "/gdal-"
735 version ".tar.gz"))
736 (sha256
737 (base32
738 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
739 (modules '((guix build utils)))
740 (snippet
741 `(begin
742 ;; TODO: frmts contains a lot more bundled code.
743 (for-each delete-file-recursively
744 ;; bundled code
745 '("frmts/png/libpng"
746 "frmts/gif/giflib"
747 "frmts/jpeg/libjpeg"
748 "frmts/jpeg/libjpeg12"
749 "frmts/gtiff/libtiff"
750 "frmts/gtiff/libgeotiff"
751 "frmts/zlib"
752 "ogr/ogrsf_frmts/geojson/libjson"))))))
753 (build-system gnu-build-system)
754 (arguments
755 `(#:tests? #f
756 #:configure-flags
757 (let-syntax ((with (syntax-rules ()
758 ((_ option input)
759 (string-append option "="
760 (assoc-ref %build-inputs input))))))
761 (list
762 ;; TODO: --with-pcidsk, --with-pcraster
763 (with "--with-freexl" "freexl")
764 (with "--with-libjson-c" "json-c")
765 (with "--with-png" "libpng")
766 (with "--with-webp" "libwebp")
767 (with "--with-gif" "giflib")
768 (with "--with-jpeg" "libjpeg-turbo")
769 (with "--with-libtiff" "libtiff")
770 (with "--with-geotiff" "libgeotiff")
771 (with "--with-libz" "zlib")
772 (with "--with-expat" "expat")
773 (with "--with-sqlite3" "sqlite")
774 "--with-pcre"))
775 #:phases
776 (modify-phases %standard-phases
777 (add-before 'build 'fix-path
778 (lambda _
779 (substitute* "frmts/mrf/mrf_band.cpp"
780 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
781 (inputs
782 `(("expat" ,expat)
783 ("freexl" ,freexl)
784 ("geos" ,geos)
785 ("giflib" ,giflib)
786 ("json-c" ,json-c)
787 ("libgeotiff" ,libgeotiff)
788 ("libjpeg-turbo" ,libjpeg-turbo)
789 ("libpng" ,libpng)
790 ("libtiff" ,libtiff)
791 ("libwebp" ,libwebp)
792 ("netcdf" ,netcdf)
793 ("pcre" ,pcre)
794 ("postgresql" ,postgresql) ; libpq
795 ("proj" ,proj)
796 ("sqlite" ,sqlite)
797 ("zlib" ,zlib)))
798 (native-inputs
799 `(("pkg-config" ,pkg-config)))
800 (home-page "https://gdal.org/")
801 (synopsis "Raster and vector geospatial data format library")
802 (description "GDAL is a translator library for raster and vector geospatial
803 data formats. As a library, it presents a single raster abstract data model
804 and single vector abstract data model to the calling application for all
805 supported formats. It also comes with a variety of useful command line
806 utilities for data translation and processing.")
807 (license (list
808 ;; general license
809 license:expat
810 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
811 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
812 ;; frmts/mrf/
813 license:bsd-3
814 ;; frmts/hdf4/hdf-eos/*
815 ;; similar to the expat license, but without guarantee exclusion
816 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
817 ;; frmts/grib/degrib/
818 license:public-domain ; with guarantee exclusion
819 ;; port/cpl_minizip*
820 ;; Some bsd-inspired license
821 (license:non-copyleft "file://port/LICENCE_minizip")
822 ;; alg/internal_libqhull
823 ;; Some 5-clause license
824 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
825 ;; frmts/mrf/libLERC
826 license:asl2.0))))
827
828 (define-public python-gdal
829 (package (inherit gdal)
830 (name "python-gdal")
831 (build-system python-build-system)
832 (arguments
833 '(#:tests? #f ; no tests
834 #:phases
835 (modify-phases %standard-phases
836 (add-before 'build 'chdir
837 (lambda _
838 (chdir "swig/python")
839 #t)))))
840 (native-inputs '())
841 (propagated-inputs
842 `(("python-numpy" ,python-numpy)))
843 (inputs
844 `(("gdal" ,gdal)))
845 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
846
847 (define-public postgis
848 (package
849 (name "postgis")
850 (version "3.0.3")
851 (source (origin
852 (method url-fetch)
853 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
854 version ".tar.gz"))
855 (sha256
856 (base32
857 "05s8cx1rlysiq7dd44kf7cid0la61a4p895j9g95bvfb8v8dpzh7"))))
858 (build-system gnu-build-system)
859 (arguments
860 `(#:tests? #f
861 #:make-flags
862 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
863 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
864 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
865 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
866 #:phases
867 (modify-phases %standard-phases
868 (add-before 'build 'fix-install-path
869 (lambda* (#:key outputs #:allow-other-keys)
870 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
871 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
872 (string-append (assoc-ref outputs "out") "/bin"))))))))
873 (inputs
874 `(("gdal" ,gdal)
875 ("geos" ,geos)
876 ("giflib" ,giflib)
877 ("json-c" ,json-c)
878 ("libjpeg" ,libjpeg-turbo)
879 ("libxml2" ,libxml2)
880 ("pcre" ,pcre)
881 ("postgresql" ,postgresql)
882 ("proj" ,proj)))
883 (native-inputs
884 `(("perl" ,perl)
885 ("pkg-config" ,pkg-config)))
886 (home-page "https://postgis.net")
887 (synopsis "Spatial database extender for PostgreSQL")
888 (description "PostGIS is a spatial database extender for PostgreSQL
889 object-relational database. It adds support for geographic objects allowing
890 location queries to be run in SQL. This package provides a PostgreSQL
891 extension.")
892 (license (list
893 ;; General license
894 license:gpl2+
895 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
896 license:expat
897 ;; loader/getopt.*
898 license:public-domain
899 ;; doc/xsl
900 license:bsd-3 ; files only say "BSD"
901 ;; doc
902 license:cc-by-sa3.0))))
903
904 (define-public tegola
905 (package
906 (name "tegola")
907 (version "0.7.0")
908 (source (origin
909 (method url-fetch)
910 (uri (string-append
911 "https://github.com/go-spatial/tegola/archive/v"
912 version ".tar.gz"))
913 (file-name (string-append name "-" version ".tar.gz"))
914 (sha256
915 (base32
916 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
917 (build-system go-build-system)
918 (arguments
919 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
920 #:unpack-path "github.com/go-spatial/tegola"
921 #:phases
922 (modify-phases %standard-phases
923 (add-before 'build 'set-version
924 (lambda _
925 (with-directory-excursion "src/github.com/go-spatial/tegola"
926 (substitute* '("cmd/tegola/cmd/root.go"
927 "cmd/tegola_lambda/main.go")
928 (("version not set") ,version)))
929 #t)))))
930 (home-page "https://tegola.io")
931 (synopsis "Vector tile server for maps")
932 (description "Tegola is a free vector tile server written in Go. Tegola
933 takes geospatial data and slices it into vector tiles that can be efficiently
934 delivered to any client.")
935 (license (list
936 license:expat
937 ;; Some packages in vendor have other licenses
938 license:asl2.0
939 license:bsd-2
940 license:bsd-3
941 license:wtfpl2))))
942
943 (define-public imposm3
944 (package
945 (name "imposm3")
946 (version "0.6.0-alpha.4")
947 (source
948 (origin
949 (method url-fetch)
950 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
951 version ".tar.gz"))
952 (file-name (string-append name "-" version ".tar.gz"))
953 (sha256
954 (base32
955 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
956 (build-system go-build-system)
957 (arguments
958 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
959 #:unpack-path "github.com/omniscale/imposm3"
960 #:phases
961 (modify-phases %standard-phases
962 (add-before 'build 'set-version
963 (lambda _
964 (substitute* "src/github.com/omniscale/imposm3/version.go"
965 (("0.0.0-dev") ,version))
966 #t)))))
967 (inputs
968 `(("geos" ,geos)
969 ("leveldb" ,leveldb)))
970 (home-page "https://imposm.org/")
971 (synopsis "OpenStreetMap importer for PostGIS")
972 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
973 files and imports the data into PostgreSQL/PostGIS databases. It is designed
974 to create databases that are optimized for rendering/tile/map-services.")
975 (license (list
976 license:asl2.0
977 ;; Some dependencies in vendor have different licenses
978 license:expat
979 license:bsd-2
980 license:bsd-3))))
981
982 (define-public libosmium
983 (package
984 (name "libosmium")
985 (version "2.15.6")
986 (source
987 (origin
988 (method git-fetch)
989 (uri (git-reference
990 (url "https://github.com/osmcode/libosmium")
991 (commit (string-append "v" version))))
992 (file-name (git-file-name name version))
993 (sha256
994 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
995 (build-system cmake-build-system)
996 (propagated-inputs
997 `(("boost" ,boost)
998 ("bzip2" ,bzip2)
999 ("expat" ,expat)
1000 ("gdal" ,gdal)
1001 ("geos" ,geos)
1002 ("proj" ,proj)
1003 ("protozero" ,protozero)
1004 ("sparsehash" ,sparsehash)
1005 ("utfcpp" ,utfcpp)
1006 ("zlib" ,zlib)))
1007 (native-inputs
1008 `(("doxygen" ,doxygen)))
1009 (home-page "https://osmcode.org/libosmium/")
1010 (synopsis "C++ library for working with OpenStreetMap data")
1011 (description "Libosmium is a fast and flexible C++ library for working with
1012 OpenStreetMap data.")
1013 (license license:boost1.0)))
1014
1015 (define-public osm2pgsql
1016 (package
1017 (name "osm2pgsql")
1018 (version "1.2.2")
1019 (source
1020 (origin
1021 (method git-fetch)
1022 (uri (git-reference
1023 (url "https://github.com/openstreetmap/osm2pgsql")
1024 (commit version)))
1025 (file-name (git-file-name name version))
1026 (sha256
1027 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
1028 (modules '((guix build utils)))
1029 (snippet
1030 '(begin
1031 (delete-file-recursively "contrib/protozero")
1032 (delete-file-recursively "contrib/libosmium")
1033 #t))))
1034 (build-system cmake-build-system)
1035 (arguments
1036 `(#:tests? #f; tests fail because we need to setup a database
1037 #:configure-flags
1038 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1039 (assoc-ref %build-inputs "libosmium")
1040 "/include")
1041 (string-append "-DPROTOZERO_INCLUDE_DIR="
1042 (assoc-ref %build-inputs "protozero")
1043 "/include"))))
1044 (inputs
1045 `(("boost" ,boost)
1046 ("bzip2" ,bzip2)
1047 ("expat" ,expat)
1048 ("libosmium" ,libosmium)
1049 ("lua" ,lua)
1050 ("postgresql" ,postgresql)
1051 ("proj" ,proj)
1052 ("protozero" ,protozero)
1053 ("zlib" ,zlib)))
1054 (native-inputs
1055 `(("python" ,python)
1056 ("python-psycopg2" ,python-psycopg2)))
1057 (home-page "https://github.com/openstreetmap/osm2pgsql")
1058 (synopsis "OSM data importer to postgresql")
1059 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1060 PostgreSQL / PostGIS database suitable for applications like rendering into a
1061 map, geocoding with Nominatim, or general analysis.")
1062 (license license:gpl2+)))
1063
1064 (define-public tippecanoe
1065 (package
1066 (name "tippecanoe")
1067 (version "1.31.5")
1068 (source
1069 (origin
1070 (method git-fetch)
1071 (uri (git-reference
1072 (url "https://github.com/mapbox/tippecanoe")
1073 (commit version)))
1074 (file-name (git-file-name name version))
1075 (sha256
1076 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
1077 (build-system gnu-build-system)
1078 (arguments
1079 `(#:phases
1080 (modify-phases %standard-phases (delete 'configure))
1081 #:test-target "test"
1082 #:make-flags
1083 (list "CC=gcc"
1084 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1085 (inputs
1086 `(("perl" ,perl)
1087 ("sqlite" ,sqlite)
1088 ("zlib" ,zlib)))
1089 (home-page "https://github.com/mapbox/tippecanoe")
1090 (synopsis "Vector tile server for maps")
1091 (description "Tippecanoe creates scale-independent view of data, so that
1092 the texture and density of features is visible at every zoom level, instead of
1093 dropping features at lower levels.")
1094 (license license:bsd-2)))
1095
1096 (define-public osmctools
1097 (package
1098 (name "osmctools")
1099 (version "0.9")
1100 (source
1101 (origin
1102 (method git-fetch)
1103 (uri (git-reference
1104 (url "https://gitlab.com/osm-c-tools/osmctools")
1105 (commit version)))
1106 (file-name (git-file-name name version))
1107 (sha256
1108 (base32
1109 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1110 (build-system gnu-build-system)
1111 (native-inputs
1112 `(("autoconf" ,autoconf)
1113 ("automake" ,automake)))
1114 (inputs
1115 `(("zlib" ,zlib)))
1116 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1117 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1118 (description "This project contains a few tools which are used in the
1119 OpenStreetMap project. They can be used to convert, filter and update
1120 OpenStreetMap data files.")
1121 (license license:agpl3)))
1122
1123 (define-public osm-gps-map
1124 (package
1125 (name "osm-gps-map")
1126 (version "1.1.0")
1127 (source
1128 (origin
1129 (method url-fetch)
1130 (uri (string-append
1131 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1132 version "/osm-gps-map-" version ".tar.gz"))
1133 (sha256
1134 (base32
1135 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1136 (build-system gnu-build-system)
1137 (native-inputs
1138 `(("gnome-common" ,gnome-common)
1139 ("gtk-doc" ,gtk-doc)
1140 ("pkg-config" ,pkg-config)))
1141 (inputs
1142 `(("cairo" ,cairo)
1143 ("glib" ,glib)
1144 ("gobject-introspection" ,gobject-introspection)
1145 ("gtk+" ,gtk+)
1146 ("libsoup" ,libsoup)))
1147 (home-page "https://nzjrs.github.io/osm-gps-map/")
1148 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1149 (description
1150 "This package provides a GTK+ widget (and Python bindings) that when
1151 given GPS coordinates,draws a GPS track, and points of interest on a moving
1152 map display. Downloads map data from a number of websites, including
1153 @url{https://www.openstreetmap.org}.")
1154 (license license:gpl2+)))
1155
1156 (define-public xygrib
1157 (package
1158 (name "xygrib")
1159 (version "1.2.6.1")
1160 (source (origin
1161 (method git-fetch)
1162 (uri (git-reference
1163 (url "https://github.com/opengribs/XyGrib")
1164 (commit (string-append "v" version))))
1165 (file-name (git-file-name name version))
1166 (sha256
1167 (base32
1168 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1169 (modules '((guix build utils)))
1170 (snippet
1171 '(begin (delete-file-recursively "data/fonts") #t))))
1172 (build-system cmake-build-system)
1173 (arguments
1174 `(#:phases
1175 (modify-phases %standard-phases
1176 (add-after 'unpack 'patch-directories
1177 (lambda* (#:key inputs #:allow-other-keys)
1178 (let ((jpeg (assoc-ref inputs "openjpeg"))
1179 (font (assoc-ref inputs "font-liberation")))
1180 (substitute* "CMakeLists.txt"
1181 ;; Find libjpeg.
1182 (("/usr") jpeg)
1183 ;; Fix install locations.
1184 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1185 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1186 ;; Skip looking for the static library.
1187 (("\"libnova.a\"") ""))
1188 ;; Don't use the bundled font-liberation.
1189 (substitute* "src/util/Font.cpp"
1190 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1191 (string-append "\"" font "/share/fonts/truetype/\"")))
1192 (substitute* "src/util/Util.h"
1193 (("pathData\\(\\)\\+\"data/fonts/\"")
1194 (string-append "\"" font "/share/fonts/\""))))
1195 #t)))
1196 #:tests? #f)) ; no tests
1197 (native-inputs
1198 `(("qttools" ,qttools)))
1199 (inputs
1200 `(("bzip2" ,bzip2)
1201 ("font-liberation" ,font-liberation)
1202 ("libnova" ,libnova)
1203 ("libpng" ,libpng)
1204 ("openjpeg" ,openjpeg)
1205 ("proj.4" ,proj.4)
1206 ("qtbase" ,qtbase)
1207 ("zlib" ,zlib)))
1208 (synopsis "Weather Forecast Visualization")
1209 (description
1210 "XyGrib is a Grib file reader and visualizes meteorological data providing
1211 an off-line capability to analyse weather forecasts or hindcasts. It is
1212 intended to be used as a capable weather work station for anyone with a serious
1213 interest in examining weather. This would include members of the sailing
1214 community, private and sport aviators, farmers, weather buffs and many more.
1215 XyGrib is the continuation of the zyGrib software package with a new team of
1216 volunteers.")
1217 (home-page "https://opengribs.org")
1218 (license license:gpl3+)))
1219
1220 (define-public libspatialindex
1221 (package
1222 (name "libspatialindex")
1223 (version "1.9.3")
1224 (source
1225 (origin
1226 (method url-fetch)
1227 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1228 "releases/download/" version "/spatialindex-src-"
1229 version ".tar.bz2"))
1230 (sha256
1231 (base32
1232 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1233 (build-system cmake-build-system)
1234 (home-page "https://libspatialindex.org")
1235 (synopsis "Spatial indexing library")
1236 (description "The purpose of this library is to provide:
1237
1238 @itemize
1239 @item An extensible framework that will support robust spatial indexing
1240 methods.
1241 @item Support for sophisticated spatial queries. Range, point location,
1242 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1243 by spatial constraints) should be easy to deploy and run.
1244 @item Easy to use interfaces for inserting, deleting and updating information.
1245 @item Wide variety of customization capabilities. Basic index and storage
1246 characteristics like the page size, node capacity, minimum fan-out, splitting
1247 algorithm, etc. should be easy to customize.
1248 @item Index persistence. Internal memory and external memory structures
1249 should be supported. Clustered and non-clustered indices should be easy to be
1250 persisted.
1251 @end itemize
1252 ")
1253 (license license:expat)))
1254
1255 (define-public java-jmapviewer
1256 (package
1257 (name "java-jmapviewer")
1258 (version "2.13")
1259 (source (origin
1260 (method url-fetch)
1261 (uri (string-append "https://svn.openstreetmap.org/applications/"
1262 "viewer/jmapviewer/releases/" version
1263 "/JMapViewer-" version "-Source.zip"))
1264 (sha256
1265 (base32
1266 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1267 (build-system ant-build-system)
1268 (native-inputs
1269 `(("unzip" ,unzip)))
1270 (arguments
1271 `(#:build-target "pack"
1272 #:tests? #f; No tests
1273 #:phases
1274 (modify-phases %standard-phases
1275 (add-before 'build 'clean
1276 (lambda* _
1277 (invoke "ant" "clean")))
1278 (replace 'install
1279 (lambda* (#:key outputs #:allow-other-keys)
1280 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1281 (mkdir-p dir)
1282 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1283 #t))))))
1284 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1285 (synopsis "OSM map integration in Java")
1286 (description "JMapViewer is a Java component which easily
1287 integrates an OSM map view into your Java application. It is maintained as
1288 an independent project by the JOSM team.")
1289 (license license:gpl2)))
1290
1291 (define-public java-opening-hours-parser
1292 (package
1293 (name "java-opening-hours-parser")
1294 (version "0.21.4")
1295 (source (origin
1296 (method git-fetch)
1297 (uri (git-reference
1298 (url "https://github.com/simonpoole/OpeningHoursParser")
1299 (commit version)))
1300 (file-name (git-file-name name version))
1301 (sha256
1302 (base32
1303 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1304 (build-system ant-build-system)
1305 (arguments
1306 `(#:jar-name "java-opening-hours-parser.jar"
1307 #:source-dir "src/main/java"
1308 #:phases
1309 (modify-phases %standard-phases
1310 (add-before 'build 'copy-resources
1311 (lambda _
1312 (copy-recursively "src/main/resources" "build/classes")
1313 #t))
1314 (add-before 'build 'generate-parser
1315 (lambda* _
1316 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1317 (file (string-append dir "/OpeningHoursParser.jj")))
1318 (invoke "javacc" "-DEBUG_PARSER=false"
1319 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1320 "-GRAMMAR_ENCODING=UTF-8"
1321 (string-append "-OUTPUT_DIRECTORY=" dir)
1322 file))
1323 #t)))))
1324 (inputs
1325 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1326 (native-inputs
1327 `(("javacc" ,javacc)
1328 ("java-junit" ,java-junit)
1329 ("java-hamcrest-core" ,java-hamcrest-core)))
1330 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1331 (synopsis "Java parser for the OpenStreetMap opening hour format")
1332 (description "This is a very simplistic parser for string values according
1333 to the OSM opening hours specification.")
1334 (license license:expat)))
1335
1336 (define-public josm
1337 (package
1338 (name "josm")
1339 (version "17329")
1340 (source (origin
1341 (method svn-fetch)
1342 (uri (svn-reference
1343 (url "https://josm.openstreetmap.de/svn/trunk")
1344 (revision (string->number version))
1345 (recursive? #f)))
1346 (sha256
1347 (base32
1348 "0bq6mirdsi0kmhjfzfp3innxi5a4395d7mas7ikxaz0cziljrz1i"))
1349 (file-name (string-append name "-" version "-checkout"))
1350 (modules '((guix build utils)))
1351 (snippet
1352 '(begin
1353 (for-each delete-file (find-files "." ".*.jar$"))
1354 #t))))
1355 (build-system ant-build-system)
1356 (native-inputs
1357 `(("javacc" ,javacc)))
1358 (inputs
1359 `(("java-commons-jcs" ,java-commons-jcs)
1360 ("java-commons-compress" ,java-commons-compress)
1361 ("java-jmapviewer" ,java-jmapviewer)
1362 ("java-jsonp-api" ,java-jsonp-api)
1363 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1364 ("java-metadata-extractor" ,java-metadata-extractor)
1365 ("java-opening-hours-parser" ,java-opening-hours-parser)
1366 ("java-openjfx-media" ,java-openjfx-media)
1367 ("java-signpost-core" ,java-signpost-core)
1368 ("java-svg-salamander" ,java-svg-salamander)))
1369 (arguments
1370 `(#:tests? #f
1371 #:jar-name "josm.jar"
1372 #:phases
1373 (modify-phases %standard-phases
1374 (add-after 'unpack 'rm-build.xml
1375 (lambda* _
1376 (delete-file "build.xml")
1377 #t))
1378 (add-before 'build 'fix-revision
1379 (lambda* _
1380 (with-output-to-file "REVISION.XML"
1381 (lambda _
1382 (display
1383 (string-append "<info><entry><commit revision=\"" ,version "\">"
1384 "<date>1970-01-01 00:00:00 +0000</date>"
1385 "</commit></entry></info>"))))
1386 #t))
1387 (add-before 'build 'fix-jcs
1388 (lambda _
1389 ;; This version of JOSM uses an unreleased version of commons-jcs,
1390 ;; which has renamed its classes to another namespace. Rename them
1391 ;; back so they can be used with our version of jcs.
1392 (substitute* (find-files "." ".*.java$")
1393 (("jcs3") "jcs"))
1394 #t))
1395 (add-before 'build 'fix-classpath
1396 (lambda* (#:key inputs #:allow-other-keys)
1397 (setenv "CLASSPATH"
1398 (string-join
1399 (filter
1400 (lambda (s)
1401 (let ((source (assoc-ref inputs "source")))
1402 (not (equal? (substring s 0 (string-length source))
1403 source))))
1404 (string-split (getenv "CLASSPATH") #\:))
1405 ":"))
1406 #t))
1407 (add-before 'build 'generate-parser
1408 (lambda* _
1409 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1410 (out (string-append dir "/parsergen"))
1411 (file (string-append dir "/MapCSSParser.jj")))
1412 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1413 (invoke "javacc" "-DEBUG_PARSER=false"
1414 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1415 "-GRAMMAR_ENCODING=UTF-8"
1416 (string-append "-OUTPUT_DIRECTORY=" out)
1417 file))
1418 #t))
1419 (add-after 'build 'generate-epsg
1420 (lambda _
1421 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1422 "-cp" "build/classes")
1423 (mkdir-p "data/projection")
1424 (with-output-to-file "data/projection/custom-epsg"
1425 (lambda _ (display "")))
1426 (invoke "java" "-cp" "build/classes:scripts:."
1427 "BuildProjectionDefinitions" ".")
1428 #t))
1429 (add-after 'generate-epsg 'copy-resources
1430 (lambda _
1431 (copy-recursively "resources" "build/classes")
1432 #t))
1433 (add-before 'install 'regenerate-jar
1434 (lambda _
1435 ;; We need to regenerate the jar file to add data.
1436 (delete-file "build/jar/josm.jar")
1437 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1438 "build/classes" ".")
1439 #t))
1440 (add-before 'build 'copy-revision
1441 (lambda _
1442 (mkdir-p "build/classes")
1443 (with-output-to-file "build/classes/REVISION"
1444 (lambda _
1445 (display
1446 (string-append "Revision: " ,version "\n"
1447 "Is-Local-Build: true\n"
1448 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1449 #t))
1450 (add-after 'install 'install-share-directories
1451 (lambda* (#:key outputs #:allow-other-keys)
1452 (let ((out (assoc-ref outputs "out"))
1453 (share-directories '("applications" "icons" "man" "menu"
1454 "metainfo" "mime" "pixmaps")))
1455 (for-each (lambda (directory)
1456 (copy-recursively (string-append
1457 "native/linux/tested/usr/share/"
1458 directory)
1459 (string-append
1460 out "/share/" directory)))
1461 share-directories))
1462 #t))
1463 (add-after 'install 'install-bin
1464 (lambda* (#:key outputs inputs #:allow-other-keys)
1465 (let* ((out (assoc-ref outputs "out"))
1466 (bin (string-append out "/bin")))
1467 (mkdir-p bin)
1468 (with-output-to-file (string-append bin "/josm")
1469 (lambda _
1470 (display
1471 (string-append "#!/bin/sh\n"
1472 (assoc-ref inputs "jdk") "/bin/java"
1473 " -cp " out "/share/java/josm.jar:"
1474 (getenv "CLASSPATH")
1475 " org.openstreetmap.josm.gui.MainApplication"))))
1476 (chmod (string-append bin "/josm") #o755))
1477 #t)))))
1478 (home-page "https://josm.openstreetmap.de")
1479 (synopsis "OSM editor")
1480 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1481 supports loading GPX tracks, background imagery and OSM data from local
1482 sources as well as from online sources and allows editing the OSM data (nodes,
1483 ways, and relations) and their metadata tags.")
1484 (license license:gpl2+)))
1485
1486 (define-public libmaxminddb
1487 (package
1488 (name "libmaxminddb")
1489 (version "1.4.3")
1490 (source
1491 (origin
1492 (method url-fetch)
1493 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1494 "/releases/download/" version "/"
1495 "/libmaxminddb-" version ".tar.gz"))
1496 (sha256
1497 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1498 (build-system gnu-build-system)
1499 (arguments
1500 `(#:make-flags
1501 (list ,(string-append "CC=" (cc-for-target)))))
1502 (native-inputs
1503 `(("perl" ,perl)))
1504 (home-page "https://maxmind.github.io/libmaxminddb/")
1505 (synopsis "C library for the MaxMind DB file format")
1506 (description "The libmaxminddb library provides a C library for reading
1507 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1508 format is a custom, but open, binary format designed to facilitate fast
1509 lookups of IP addresses while allowing flexibility in the type of data
1510 associated with an address.")
1511 (license license:asl2.0)))
1512
1513 (define-public python-maxminddb
1514 (package
1515 (name "python-maxminddb")
1516 (version "1.5.1")
1517 (source
1518 (origin
1519 (method url-fetch)
1520 (uri (pypi-uri "maxminddb" version))
1521 (sha256
1522 (base32
1523 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1524 (build-system python-build-system)
1525 (arguments
1526 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1527 (inputs
1528 `(("libmaxminddb" ,libmaxminddb)))
1529 (home-page "https://www.maxmind.com/")
1530 (synopsis "Reader for the MaxMind DB format")
1531 (description "MaxMind DB is a binary file format that stores data indexed
1532 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1533 MaxMind DB files.")
1534 (license license:asl2.0)))
1535
1536 (define-public python-geoip2
1537 (package
1538 (name "python-geoip2")
1539 (version "2.9.0")
1540 (source
1541 (origin
1542 (method url-fetch)
1543 (uri (pypi-uri "geoip2" version))
1544 (sha256
1545 (base32
1546 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1547 (build-system python-build-system)
1548 (arguments
1549 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1550 (inputs
1551 `(("python-maxminddb" ,python-maxminddb)
1552 ("python-requests" ,python-requests)))
1553 (home-page "https://www.maxmind.com/")
1554 (synopsis "MaxMind GeoIP2 API")
1555 (description "Provides an API for the GeoIP2 web services and databases.
1556 The API also works with MaxMind’s free GeoLite2 databases.")
1557 (license license:asl2.0)))
1558
1559 (define-public routino
1560 (package
1561 (name "routino")
1562 (version "3.3.3")
1563 (source
1564 (origin
1565 (method url-fetch)
1566 (uri (string-append "http://www.routino.org/download/routino-"
1567 version ".tgz"))
1568 (sha256
1569 (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
1570 (build-system gnu-build-system)
1571 (native-inputs
1572 `(("perl" ,perl)))
1573 (inputs
1574 `(("bzip2" ,bzip2)
1575 ("xz" ,xz)
1576 ("zlib" ,zlib)))
1577 (arguments
1578 `(#:test-target "test"
1579 #:phases
1580 (modify-phases %standard-phases
1581 (replace 'configure
1582 (lambda* (#:key outputs #:allow-other-keys)
1583 (substitute* "Makefile.conf"
1584 (("prefix=/usr/local")
1585 (string-append "prefix=" (assoc-ref outputs "out")))
1586 (("LDFLAGS_LDSO=-Wl,-R\\.")
1587 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1588 (("#CFLAGS\\+=-DUSE_XZ")
1589 "CFLAGS+=-DUSE_XZ")
1590 (("#LDFLAGS\\+=-llzma")
1591 "LDFLAGS+=-llzma"))
1592 #t)))))
1593 (synopsis "Routing application for OpenStreetMap data")
1594 (description
1595 "Routino is an application for finding a route between two points
1596 using the dataset of topographical information collected by
1597 @url{https://www.OpenStreetMap.org}.")
1598 (home-page "https://www.routino.org/")
1599 (license license:agpl3+)))
1600
1601 (define-public qmapshack
1602 (package
1603 (name "qmapshack")
1604 (version "1.14.0")
1605 (source
1606 (origin
1607 (method git-fetch)
1608 (uri (git-reference
1609 (url "https://github.com/Maproom/qmapshack")
1610 (commit (string-append "V_" version))))
1611 (file-name (git-file-name name version))
1612 (sha256
1613 (base32
1614 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1615 (build-system qt-build-system)
1616 (native-inputs
1617 `(("pkg-config" ,pkg-config)
1618 ("qttools" ,qttools)))
1619 (inputs
1620 `(("gdal" ,gdal)
1621 ("libjpeg-turbo" ,libjpeg-turbo)
1622 ("proj" ,proj)
1623 ("qtbase" ,qtbase)
1624 ("qtdeclarative" ,qtdeclarative)
1625 ("qtlocation" ,qtlocation)
1626 ("qtwebchannel" ,qtwebchannel)
1627 ("qtwebengine" ,qtwebengine)
1628 ("quazip" ,quazip)
1629 ("routino" ,routino)
1630 ("sqlite" ,sqlite) ; See wrap phase
1631 ("zlib" ,zlib)))
1632 (arguments
1633 `(#:tests? #f
1634 #:phases
1635 (modify-phases %standard-phases
1636 (add-after 'unpack 'fix-cmake-modules
1637 (lambda* (#:key inputs #:allow-other-keys)
1638 (substitute* "CMakeLists.txt"
1639 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1640 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1641 (substitute* "cmake/Modules/FindROUTINO.cmake"
1642 (("/usr/local")
1643 (assoc-ref inputs "routino")))
1644 ;; The following fixes are included as patches in the sources
1645 ;; of QMapShack, but they are not applied by default, for
1646 ;; some reason...
1647 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1648 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1649 #t))
1650 (add-after 'install 'wrap
1651 ;; The program fails to find the QtWebEngineProcess program,
1652 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1653 (lambda* (#:key inputs outputs #:allow-other-keys)
1654 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1655 (qtwebengineprocess (string-append
1656 (assoc-ref inputs "qtwebengine")
1657 "/lib/qt5/libexec/QtWebEngineProcess")))
1658 (for-each (lambda (program)
1659 (wrap-program program
1660 `("QTWEBENGINEPROCESS_PATH" =
1661 (,qtwebengineprocess))))
1662 (find-files bin ".*")))
1663 #t)))))
1664 (synopsis "GPS mapping application")
1665 (description
1666 "QMapShack can be used to plan your next outdoor trip or to visualize and
1667 archive all the GPS recordings of your past trips. It is the successor of the
1668 QLandkarte GT application.")
1669 (home-page "https://github.com/Maproom/qmapshack/wiki")
1670 (license license:gpl3+)))
1671
1672 (define-public readosm
1673 (package
1674 (name "readosm")
1675 (version "1.1.0a")
1676 (source
1677 (origin
1678 (method url-fetch)
1679 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1680 "readosm-" version ".tar.gz"))
1681 (sha256
1682 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
1683 (build-system gnu-build-system)
1684 (inputs
1685 `(("expat" ,expat)
1686 ("zlib" ,zlib)))
1687 (synopsis "Data extractor for OpenStreetMap files")
1688 (description
1689 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1690 input file (in @code{.osm} or @code{.osm.pbf} format).")
1691 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1692 (license (list license:gpl2+
1693 license:lgpl2.1+
1694 license:mpl1.1))))
1695
1696 (define-public spatialite-tools
1697 (package
1698 (name "spatialite-tools")
1699 (version "5.0.0")
1700 (source
1701 (origin
1702 (method url-fetch)
1703 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1704 "spatialite-tools-" version ".tar.gz"))
1705 (sha256
1706 (base32 "0ckddgdpxhy6vkpr9q2hnx5qmanrd8g4pqnifbrq1i5jrj82s2dd"))))
1707 (build-system gnu-build-system)
1708 (native-inputs
1709 `(("pkg-config" ,pkg-config)))
1710 (inputs
1711 `(("expat" ,expat)
1712 ("freexl" ,freexl)
1713 ("geos" ,geos)
1714 ("librttopo" ,librttopo)
1715 ("libspatialite" ,libspatialite)
1716 ("libxml2" ,libxml2)
1717 ("minizip" ,minizip)
1718 ("proj.4" ,proj.4)
1719 ("readosm" ,readosm)
1720 ("sqlite" ,sqlite)
1721 ("zlib" ,zlib)))
1722 (synopsis "Collection of command line tools for SpatiaLite")
1723 (description
1724 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1725 tools supporting SpatiaLite.")
1726 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1727 (license license:gpl3+)))
1728
1729 (define-public virtualpg
1730 (package
1731 (name "virtualpg")
1732 (version "1.0.2")
1733 (source
1734 (origin
1735 (method url-fetch)
1736 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1737 "virtualpg-" version ".tar.gz"))
1738 (sha256
1739 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1740 (build-system gnu-build-system)
1741 (inputs
1742 `(("postgresql" ,postgresql)
1743 ("sqlite" ,sqlite)))
1744 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1745 (description
1746 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1747 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1748 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1749 exchanged form one Spatial DBMS and the other.")
1750 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1751 (license (list license:gpl2+
1752 license:lgpl2.1+
1753 license:mpl1.1))))
1754
1755 (define-public opencpn
1756 (package
1757 (name "opencpn")
1758 (version "5.0.0")
1759 (source
1760 (origin
1761 (method git-fetch)
1762 (uri (git-reference
1763 (url "https://github.com/OpenCPN/OpenCPN")
1764 (commit (string-append "v" version))))
1765 (file-name (git-file-name name version))
1766 (sha256
1767 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1768 (build-system cmake-build-system)
1769 (native-inputs
1770 `(("gettext" ,gettext-minimal)
1771 ("pkg-config" ,pkg-config)))
1772 (inputs
1773 `(("bzip2" ,bzip2)
1774 ("cairo" ,cairo)
1775 ("curl" ,curl)
1776 ("glu" ,glu)
1777 ("gtk+" ,gtk+)
1778 ("libarchive" ,libarchive)
1779 ("libelf" ,libelf)
1780 ("libexif" ,libexif)
1781 ("libsndfile" ,libsndfile)
1782 ("lz4" ,lz4)
1783 ("mesa" ,mesa)
1784 ("pango" ,pango)
1785 ("portaudio" ,portaudio)
1786 ("sqlite" ,sqlite)
1787 ("tinyxml" ,tinyxml)
1788 ("wxsvg" ,wxsvg)
1789 ("wxwidgets" ,wxwidgets)
1790 ("xz" ,xz)
1791 ("zlib" ,zlib)))
1792 (arguments
1793 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1794 "-DENABLE_SNDFILE=ON"
1795 "-DBUNDLE_TCDATA=ON"
1796 "-DBUNDLE_GSHHS=CRUDE")
1797 #:tests? #f ; No tests defined
1798 #:phases
1799 (modify-phases %standard-phases
1800 (add-after 'unpack 'fix-build
1801 (lambda _
1802 (substitute* "CMakeLists.txt"
1803 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1804 (string-append all " --libs all")))
1805 #t)))))
1806 (synopsis "Chart plotter and marine GPS navigation software")
1807 (description
1808 "OpenCPN is a chart plotter and marine navigation software designed to be
1809 used at the helm station of your boat while underway. Chart a course and
1810 track your position right from your laptop.")
1811 (home-page "https://opencpn.org/")
1812 (license (list license:asl2.0
1813 license:cc0
1814 license:bsd-2
1815 license:bsd-3
1816 license:expat
1817 license:gpl3+
1818 license:lgpl2.1+
1819 license:lgpl3+
1820 license:sgifreeb2.0
1821 license:zlib))))
1822
1823 (define-public grass
1824 (let* ((version "7.8.5")
1825 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1826 (grassxx (string-append "grass" majorminor)))
1827 (package
1828 (name "grass")
1829 (version version)
1830 (source
1831 (origin
1832 (method url-fetch)
1833 (uri (string-append "https://grass.osgeo.org/" grassxx
1834 "/source/grass-" version ".tar.gz"))
1835 (sha256
1836 (base32 "0dzzhgcsrszzinvjir50nvzq873b8gsp0p9k8fvcrv14amkbnnd3"))))
1837 (build-system gnu-build-system)
1838 (inputs
1839 `(("bzip2" ,bzip2)
1840 ("cairo" ,cairo)
1841 ("fftw" ,fftw)
1842 ("freetype" ,freetype)
1843 ("gdal" ,gdal)
1844 ("geos" ,geos)
1845 ("glu" ,glu)
1846 ("lapack" ,lapack)
1847 ("libpng" ,libpng)
1848 ("libtiff" ,libtiff)
1849 ("mesa" ,mesa)
1850 ("mariadb-dev" ,mariadb "dev")
1851 ("mariadb-lib" ,mariadb "lib")
1852 ("netcdf" ,netcdf)
1853 ("openblas" ,openblas)
1854 ("perl" ,perl)
1855 ("postgresql" ,postgresql)
1856 ("proj.4" ,proj.4)
1857 ("python" ,python)
1858 ("python-dateutil" ,python-dateutil)
1859 ("python-numpy" ,python-numpy)
1860 ("python-wxpython" ,python-wxpython)
1861 ("readline" ,readline)
1862 ("sqlite" ,sqlite)
1863 ("wxwidgets" ,wxwidgets)
1864 ("zlib" ,zlib)
1865 ("zstd" ,zstd "lib")))
1866 (native-inputs
1867 `(("bash" ,bash-minimal)
1868 ("bison" ,bison)
1869 ("flex" ,flex)
1870 ("pkg-config" ,pkg-config)))
1871 (arguments
1872 `(#:tests? #f ; No tests
1873 #:modules ((guix build gnu-build-system)
1874 ((guix build python-build-system) #:prefix python:)
1875 (guix build utils))
1876 #:imported-modules (,@%gnu-build-system-modules
1877 (guix build python-build-system))
1878 #:phases
1879 (modify-phases %standard-phases
1880 (replace 'configure
1881 (lambda* (#:key inputs outputs #:allow-other-keys)
1882 (let ((shell (string-append (assoc-ref inputs "bash")
1883 "/bin/bash")))
1884 (setenv "SHELL" shell)
1885 (setenv "CONFIG_SHELL" shell)
1886 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1887 (assoc-ref outputs "out")
1888 "/" ,grassxx "/lib")))
1889 (invoke "./configure"
1890 (string-append "--prefix="
1891 (assoc-ref outputs "out"))
1892 "--with-blas"
1893 "--with-bzlib"
1894 (string-append "--with-freetype-includes="
1895 (assoc-ref inputs "freetype")
1896 "/include/freetype2")
1897 (string-append "--with-freetype-libs="
1898 (assoc-ref inputs "freetype")
1899 "/lib")
1900 "--with-geos"
1901 "--with-lapack"
1902 "--with-mysql"
1903 (string-append "--with-mysql-includes="
1904 (assoc-ref inputs "mariadb-dev")
1905 "/include/mysql")
1906 (string-append "--with-mysql-libs="
1907 (assoc-ref inputs "mariadb-lib")
1908 "/lib")
1909 "--with-netcdf"
1910 "--with-postgres"
1911 (string-append "--with-proj-share="
1912 (assoc-ref inputs "proj.4")
1913 "/share/proj")
1914 "--with-pthread"
1915 "--with-readline"
1916 "--with-sqlite"
1917 "--with-wxwidgets")))
1918 (add-after 'install 'install-links
1919 (lambda* (#:key outputs #:allow-other-keys)
1920 ;; Put links for includes and libraries in the standard places.
1921 (let* ((out (assoc-ref outputs "out"))
1922 (dir (string-append out "/" ,grassxx)))
1923 (symlink (string-append dir "/include")
1924 (string-append out "/include"))
1925 (symlink (string-append dir "/lib")
1926 (string-append out "/lib")))
1927 #t))
1928 (add-after 'install-links 'python:wrap
1929 (assoc-ref python:%standard-phases 'wrap))
1930 (add-after 'python:wrap 'wrap-with-python-interpreter
1931 (lambda* (#:key outputs #:allow-other-keys)
1932 (let ((out (assoc-ref outputs "out")))
1933 (wrap-program (string-append out "/bin/" ,grassxx)
1934 `("GRASS_PYTHON" = (,(which "python3"))))
1935 #t))))))
1936 (synopsis "GRASS Geographic Information System")
1937 (description
1938 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1939 Information System (GIS) software suite used for geospatial data management and
1940 analysis, image processing, graphics and maps production, spatial modeling, and
1941 visualization.")
1942 (home-page "https://grass.osgeo.org/")
1943 (license license:gpl2+))))
1944
1945 (define-public saga
1946 (package
1947 (name "saga")
1948 (version "7.6.2")
1949 (source
1950 (origin
1951 (method url-fetch)
1952 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1953 (version-major version) "/SAGA%20-%20" version
1954 "/saga-" version ".tar.gz"))
1955 (sha256
1956 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1957 (build-system gnu-build-system)
1958 (native-inputs
1959 `(("pkg-config" ,pkg-config)
1960 ("swig" ,swig)))
1961 (inputs
1962 `(("curl" ,curl)
1963 ("fftw" ,fftw)
1964 ("gdal" ,gdal)
1965 ("hdf5" ,hdf5)
1966 ("jasper" ,jasper)
1967 ("libharu" ,libharu)
1968 ("libtiff" ,libtiff)
1969 ("opencv" ,opencv)
1970 ("postgresql" ,postgresql)
1971 ("proj.4" ,proj.4)
1972 ("python" ,python)
1973 ("qhull" ,qhull)
1974 ("unixodbc" ,unixodbc)
1975 ("vigra" ,vigra)
1976 ("wxwidgets" ,wxwidgets)))
1977 (arguments
1978 '(#:configure-flags '("--enable-python")))
1979 (synopsis "System for Automated Geoscientific Analyses")
1980 (description
1981 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1982 Information System (GIS) software. It has been designed for an easy and
1983 effective implementation of spatial algorithms and it offers a comprehensive,
1984 growing set of geoscientific methods.")
1985 (home-page "http://www.saga-gis.org")
1986 (license (list license:gpl2+ license:lgpl2.1+))))
1987
1988 (define-public qgis
1989 (package
1990 (name "qgis")
1991 (version "3.12.1")
1992 (source
1993 (origin
1994 (method url-fetch)
1995 (uri (string-append "https://qgis.org/downloads/qgis-"
1996 version ".tar.bz2"))
1997 (sha256
1998 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1999 (build-system cmake-build-system)
2000 (arguments
2001 `(#:modules ((guix build cmake-build-system)
2002 ((guix build python-build-system) #:prefix python:)
2003 (guix build qt-utils)
2004 (guix build utils))
2005 #:imported-modules (,@%cmake-build-system-modules
2006 (guix build python-build-system)
2007 (guix build qt-utils))
2008 #:phases
2009 (modify-phases %standard-phases
2010 ;; Configure correct path to PyQt5 SIP directory
2011 (add-after 'unpack 'configure-pyqt5-sip-path
2012 (lambda* (#:key inputs #:allow-other-keys)
2013 (substitute* "cmake/FindPyQt5.cmake"
2014 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
2015 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
2016 "/share/sip\" PYQT5_SIP_DIR")))
2017 (substitute* (list "scripts/prepare-commit.sh"
2018 "scripts/runtests-local-travis-config.sh"
2019 "scripts/sip_include.sh"
2020 "scripts/sipdiff"
2021 "scripts/sipify_all.sh"
2022 "scripts/spell_check/check_spelling.sh"
2023 "scripts/spell_check/spell_test.sh"
2024 "scripts/verify-indentation.sh"
2025 "tests/code_layout/test_banned_keywords.sh"
2026 "tests/code_layout/test_licenses.sh"
2027 "tests/code_layout/test_shellcheck.sh"
2028 "tests/code_layout/test_sip_include.sh"
2029 "tests/code_layout/test_sipfiles_uptodate.sh"
2030 "tests/code_layout/test_sipify.sh")
2031 (("\\$\\(git rev-parse --show-toplevel\\)")
2032 (getcwd)))
2033 (substitute* "tests/code_layout/test_sip_include.sh"
2034 (("^REV=.*") "REV=currentrev\n"))
2035 #t))
2036 (replace 'check
2037 (lambda* (#:key inputs #:allow-other-keys)
2038 (setenv "HOME" "/tmp")
2039 (system (string-append (assoc-ref inputs "xorg-server")
2040 "/bin/Xvfb :1 &"))
2041 (setenv "DISPLAY" ":1")
2042 (setenv "TRAVIS" "true")
2043 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2044 (invoke "ctest"
2045 "-E" (string-join
2046 '(;; Disable tests that require network access
2047 "qgis_filedownloader"
2048 ;; TODO: Find why the following tests fail
2049 "ProcessingQgisAlgorithmsTestPt1"
2050 "ProcessingQgisAlgorithmsTestPt2"
2051 "ProcessingQgisAlgorithmsTestPt3"
2052 "ProcessingQgisAlgorithmsTestPt4"
2053 "ProcessingGdalAlgorithmsRasterTest"
2054 "ProcessingGdalAlgorithmsVectorTest"
2055 "ProcessingGrass7AlgorithmsImageryTest"
2056 "ProcessingGrass7AlgorithmsRasterTest"
2057 "ProcessingGrass7AlgorithmsVectorTest"
2058 "ProcessingOtbAlgorithmsTest"
2059 "qgis_authmanagertest"
2060 "qgis_compositionconvertertest"
2061 "qgis_coordinatereferencesystemtest"
2062 "qgis_geometrytest"
2063 "qgis_layouthtmltest"
2064 "qgis_layoutmaptest"
2065 "qgis_layoutmapgridtest"
2066 "qgis_painteffecttest"
2067 "qgis_pallabelingtest"
2068 "qgis_svgmarkertest"
2069 "qgis_taskmanagertest"
2070 "qgis_ziplayertest"
2071 "qgis_processingtest"
2072 "qgis_wcsprovidertest"
2073 "qgis_arcgisrestutilstest"
2074 "qgis_grassprovidertest7"
2075 "qgis_gpsinformationwidget"
2076 "PyCoreAdittions"
2077 "PyQgsPythonProvider"
2078 "PyQgsAnnotation"
2079 "PyQgsAuthenticationSystem"
2080 "PyQgsProject"
2081 "PyQgsFileUtils"
2082 "PyQgsGeometryTest"
2083 "PyQgsImageCache"
2084 "PyQgsLayerMetadata"
2085 "PyQgsLayout"
2086 "PyQgsLayoutHtml"
2087 "PyQgsLayoutMapGrid"
2088 "PyQgsMetadataBase"
2089 "PyQgsLayoutExporter"
2090 "PyQgsLayoutLegend"
2091 "PyQgsMapLayer"
2092 "PyQgsOGRProviderGpkg"
2093 "PyQgsPalLabelingLayout"
2094 "PyQgsImportIntoPostGIS"
2095 "PyQgsProviderConnectionPostgres"
2096 "PyQgsProviderConnectionGpkg"
2097 "PyQgsShapefileProvider"
2098 "PyQgsSvgCache"
2099 "PyQgsTextRenderer"
2100 "PyQgsOGRProvider"
2101 "PyQgsSpatialiteProvider"
2102 "PyQgsVectorFileWriter"
2103 "PyQgsVectorLayer"
2104 "PyQgsVectorLayerUtils"
2105 "PyQgsVirtualLayerProvider"
2106 "PyQgsWFSProvider"
2107 "PyQgsOapifProvider"
2108 "PyQgsLayerDependencies"
2109 "PyQgsDBManagerGpkg"
2110 "PyQgsDBManagerSpatialite"
2111 "PyQgsSettings"
2112 "PyQgsAuxiliaryStorage"
2113 "PyQgsSelectiveMasking"
2114 "PyQgsAppStartup"
2115 "qgis_geometrycheckstest"
2116 "qgis_shellcheck"
2117 "qgis_sipify"
2118 "qgis_sip_include"
2119 "qgis_sip_uptodate")
2120 "|"))))
2121 (add-after 'install 'wrap-python
2122 (assoc-ref python:%standard-phases 'wrap))
2123 (add-after 'wrap-python 'wrap-qt
2124 (lambda* (#:key outputs inputs #:allow-other-keys)
2125 (let ((out (assoc-ref outputs "out")))
2126 (wrap-qt-program "qgis" #:output out #:inputs inputs))
2127 #t))
2128 (add-after 'wrap-qt 'wrap-gis
2129 (lambda* (#:key inputs outputs #:allow-other-keys)
2130 (let* ((out (assoc-ref outputs "out"))
2131 (saga (string-append (assoc-ref inputs "saga") "/bin"))
2132 (grass-version ,(package-version grass))
2133 (grass-majorminor (string-join
2134 (list-head
2135 (string-split grass-version #\.) 2)
2136 ""))
2137 (grass (string-append (assoc-ref inputs "grass")
2138 "/grass" grass-majorminor)))
2139 (wrap-program (string-append out "/bin/qgis")
2140 `("PATH" ":" prefix (,saga))
2141 `("QGIS_PREFIX_PATH" = (,out))
2142 `("GISBASE" = (,grass))))
2143 #t)))))
2144 (inputs
2145 `(("exiv2" ,exiv2)
2146 ("expat" ,expat)
2147 ("gdal" ,gdal)
2148 ("geos" ,geos)
2149 ("gpsbabel" ,gpsbabel)
2150 ("grass" ,grass)
2151 ("gsl" ,gsl)
2152 ("hdf5" ,hdf5)
2153 ("libspatialindex" ,libspatialindex)
2154 ("libspatialite" ,libspatialite)
2155 ("libxml2" ,libxml2)
2156 ("libzip" ,libzip)
2157 ("netcdf" ,netcdf)
2158 ("postgresql" ,postgresql)
2159 ("proj" ,proj)
2160 ("python" ,python)
2161 ("python-chardet" ,python-chardet)
2162 ("python-dateutil" ,python-dateutil)
2163 ("python-future" ,python-future)
2164 ("python-gdal" ,python-gdal)
2165 ("python-jinja2" ,python-jinja2)
2166 ("python-numpy" ,python-numpy)
2167 ("python-owslib" ,python-owslib)
2168 ("python-psycopg2" ,python-psycopg2)
2169 ("python-pygments" ,python-pygments)
2170 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2171 ("python-pytz" ,python-pytz)
2172 ("python-pyyaml" ,python-pyyaml)
2173 ("python-requests" ,python-requests)
2174 ("python-sip" ,python-sip)
2175 ("python-six" ,python-six)
2176 ("python-urllib3" ,python-urllib3)
2177 ("qca" ,qca)
2178 ("qscintilla" ,qscintilla)
2179 ("qtbase" ,qtbase)
2180 ("qtdeclarative" ,qtdeclarative)
2181 ("qtkeychain" ,qtkeychain)
2182 ("qtlocation" ,qtlocation)
2183 ("qtserialport" ,qtserialport)
2184 ("qtsvg" ,qtsvg)
2185 ("qtwebkit" ,qtwebkit)
2186 ("qwt" ,qwt)
2187 ("saga" ,saga)
2188 ("sqlite" ,sqlite)))
2189 (native-inputs
2190 `(("bison" ,bison)
2191 ("flex" ,flex)
2192 ("perl" ,perl)
2193 ("perl-yaml-tiny" ,perl-yaml-tiny)
2194 ("pkg-config" ,pkg-config)
2195 ("python-mock" ,python-mock)
2196 ("python-nose2" ,python-nose2)
2197 ("qttools" ,qttools)
2198 ("shellcheck" ,shellcheck)
2199 ("xorg-server" ,xorg-server-for-tests)))
2200 (home-page "https://qgis.org")
2201 (synopsis "Geographical information system")
2202 (description "QGIS is an easy to use Geographical Information
2203 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2204 raster and vector data formats, with new support easily added using the plugin
2205 architecture.")
2206 (license
2207 (list
2208 license:asl1.1
2209 license:asl2.0
2210 license:bsd-2
2211 license:bsd-3
2212 license:boost1.0
2213 license:cc-by3.0
2214 license:cc-by4.0
2215 license:cc-by-sa3.0
2216 license:cc-by-sa4.0
2217 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2218 (license:fsf-free "file://debian/copyright" "Go Squared")
2219 license:expat
2220 license:fdl1.2+
2221 (license:fsf-free
2222 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2223 (license:fsf-free
2224 "file://debian/copyright"
2225 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2226 license:gpl2
2227 license:gpl2+
2228 license:gpl3
2229 license:gpl3+
2230 license:isc
2231 license:lgpl2.0+
2232 license:lgpl2.1
2233 license:lgpl2.1+
2234 license:lgpl3
2235 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2236 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2237 (license:non-copyleft
2238 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2239 "NCL Source Code License")
2240 license:ogl-psi1.0
2241 license:opl1.0+
2242 license:public-domain
2243 license:qwt1.0))))
2244
2245 (define-public python-geographiclib
2246 (package
2247 (name "python-geographiclib")
2248 (version "1.50")
2249 (source
2250 (origin
2251 (method url-fetch)
2252 (uri (pypi-uri "geographiclib" version))
2253 (sha256
2254 (base32
2255 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2256 (build-system python-build-system)
2257 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2258 (synopsis "Python geodesic routines from GeographicLib")
2259 (description
2260 "This is a python implementation of the geodesic routines in GeographicLib.")
2261 (license license:expat)))
2262
2263 (define-public python-geopy
2264 (package
2265 (name "python-geopy")
2266 (version "2.0.0")
2267 (source
2268 (origin
2269 (method url-fetch)
2270 (uri (pypi-uri "geopy" version))
2271 (sha256
2272 (base32
2273 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2274 (build-system python-build-system)
2275 (propagated-inputs
2276 `(("python-geographiclib" ,python-geographiclib)))
2277 (native-inputs
2278 `(("python-async-generator" ,python-async-generator)
2279 ("python-coverage" ,python-coverage)
2280 ("python-flake8" ,python-flake8)
2281 ("python-isort" ,python-isort)
2282 ("python-pytest" ,python-pytest)
2283 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2284 ("python-readme-renderer" ,python-readme-renderer)
2285 ("python-pytz" ,python-pytz)))
2286 (home-page "https://github.com/geopy/geopy")
2287 (synopsis "Geocoding library for Python")
2288 (description "@code{geopy} is a Python client for several popular geocoding
2289 web services. @code{geopy} makes it easy for Python developers to locate the
2290 coordinates of addresses, cities, countries, and landmarks across the globe
2291 using third-party geocoders and other data sources.")
2292 (license license:expat)))