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