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