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