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