gnu: gnome-maps: Add missing input.
[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 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019 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 `(("gobject-introspection" ,gobject-introspection)
193 ("intltool" ,intltool)
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 ("rest" ,rest)
214 ("webkitgtk" ,webkitgtk)))
215 (propagated-inputs
216 `(("gtk+3" ,gtk+)))
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.0.4")
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 "10symyajj1b7j98f889lqxxbmhcyvlhq9gg0l42h69bv22wx45gw"))
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 ("proj" ,proj)
671 ("sqlite" ,sqlite)
672 ("zlib" ,zlib)))
673 (home-page "https://gdal.org/")
674 (synopsis "Raster and vector geospatial data format library")
675 (description "GDAL is a translator library for raster and vector geospatial
676 data formats. As a library, it presents a single raster abstract data model
677 and single vector abstract data model to the calling application for all
678 supported formats. It also comes with a variety of useful command line
679 utilities for data translation and processing.")
680 (license (list
681 ;; general license
682 license:expat
683 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
684 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
685 ;; frmts/mrf/
686 license:bsd-3
687 ;; frmts/hdf4/hdf-eos/*
688 ;; similar to the expat license, but without guarantee exclusion
689 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
690 ;; frmts/grib/degrib/
691 license:public-domain ; with guarantee exclusion
692 ;; port/cpl_minizip*
693 ;; Some bsd-inspired license
694 (license:non-copyleft "file://port/LICENCE_minizip")
695 ;; alg/internal_libqhull
696 ;; Some 5-clause license
697 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
698 ;; frmts/mrf/libLERC
699 license:asl2.0))))
700
701 (define-public python-gdal
702 (package (inherit gdal)
703 (name "python-gdal")
704 (build-system python-build-system)
705 (arguments
706 '(#:tests? #f ; no tests
707 #:phases
708 (modify-phases %standard-phases
709 (add-before 'build 'chdir
710 (lambda _
711 (chdir "swig/python")
712 #t)))))
713 (native-inputs '())
714 (propagated-inputs
715 `(("python-numpy" ,python-numpy)))
716 (inputs
717 `(("gdal" ,gdal)))
718 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
719
720 (define-public postgis
721 (package
722 (name "postgis")
723 (version "3.0.0")
724 (source (origin
725 (method url-fetch)
726 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
727 version ".tar.gz"))
728 (sha256
729 (base32
730 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
731 (build-system gnu-build-system)
732 (arguments
733 `(#:tests? #f
734 #:make-flags
735 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
736 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
737 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
738 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
739 #:phases
740 (modify-phases %standard-phases
741 (add-before 'build 'fix-install-path
742 (lambda* (#:key outputs #:allow-other-keys)
743 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
744 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
745 (string-append (assoc-ref outputs "out") "/bin"))))))))
746 (inputs
747 `(("gdal" ,gdal)
748 ("geos" ,geos)
749 ("json-c" ,json-c)
750 ("libjpeg" ,libjpeg-turbo)
751 ("libxml2" ,libxml2)
752 ("pcre" ,pcre)
753 ("postgresql" ,postgresql)
754 ("proj" ,proj)))
755 (native-inputs
756 `(("perl" ,perl)
757 ("pkg-config" ,pkg-config)))
758 (home-page "https://postgis.net")
759 (synopsis "Spatial database extender for PostgreSQL")
760 (description "PostGIS is a spatial database extender for PostgreSQL
761 object-relational database. It adds support for geographic objects allowing
762 location queries to be run in SQL. This package provides a PostgreSQL
763 extension.")
764 (license (list
765 ;; General license
766 license:gpl2+
767 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
768 license:expat
769 ;; loader/getopt.*
770 license:public-domain
771 ;; doc/xsl
772 license:bsd-3 ; files only say "BSD"
773 ;; doc
774 license:cc-by-sa3.0))))
775
776 (define-public tegola
777 (package
778 (name "tegola")
779 (version "0.7.0")
780 (source (origin
781 (method url-fetch)
782 (uri (string-append
783 "https://github.com/go-spatial/tegola/archive/v"
784 version ".tar.gz"))
785 (file-name (string-append name "-" version ".tar.gz"))
786 (sha256
787 (base32
788 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
789 (build-system go-build-system)
790 (arguments
791 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
792 #:unpack-path "github.com/go-spatial/tegola"
793 #:phases
794 (modify-phases %standard-phases
795 (add-before 'build 'set-version
796 (lambda _
797 (with-directory-excursion "src/github.com/go-spatial/tegola"
798 (substitute* '("cmd/tegola/cmd/root.go"
799 "cmd/tegola_lambda/main.go")
800 (("version not set") ,version)))
801 #t)))))
802 (home-page "https://tegola.io")
803 (synopsis "Vector tile server for maps")
804 (description "Tegola is a free vector tile server written in Go. Tegola
805 takes geospatial data and slices it into vector tiles that can be efficiently
806 delivered to any client.")
807 (license (list
808 license:expat
809 ;; Some packages in vendor have other licenses
810 license:asl2.0
811 license:bsd-2
812 license:bsd-3
813 license:wtfpl2))))
814
815 (define-public imposm3
816 (package
817 (name "imposm3")
818 (version "0.6.0-alpha.4")
819 (source
820 (origin
821 (method url-fetch)
822 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
823 version ".tar.gz"))
824 (file-name (string-append name "-" version ".tar.gz"))
825 (sha256
826 (base32
827 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
828 (build-system go-build-system)
829 (arguments
830 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
831 #:unpack-path "github.com/omniscale/imposm3"
832 #:phases
833 (modify-phases %standard-phases
834 (add-before 'build 'set-version
835 (lambda _
836 (substitute* "src/github.com/omniscale/imposm3/version.go"
837 (("0.0.0-dev") ,version))
838 #t)))))
839 (inputs
840 `(("geos" ,geos)
841 ("leveldb" ,leveldb)))
842 (home-page "https://imposm.org/")
843 (synopsis "OpenStreetMap importer for PostGIS")
844 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
845 files and imports the data into PostgreSQL/PostGIS databases. It is designed
846 to create databases that are optimized for rendering/tile/map-services.")
847 (license (list
848 license:asl2.0
849 ;; Some dependencies in vendor have different licenses
850 license:expat
851 license:bsd-2
852 license:bsd-3))))
853
854 (define-public libosmium
855 (package
856 (name "libosmium")
857 (version "2.15.4")
858 (source
859 (origin
860 (method git-fetch)
861 (uri (git-reference
862 (url "https://github.com/osmcode/libosmium.git")
863 (commit (string-append "v" version))))
864 (file-name (git-file-name name version))
865 (sha256
866 (base32 "0mlcvqrhp40bzj5r5j9nfc5vbis8hmzcq9xi8jylkciyydaynhz4"))))
867 (build-system cmake-build-system)
868 (propagated-inputs
869 `(("boost" ,boost)
870 ("bzip2" ,bzip2)
871 ("expat" ,expat)
872 ("gdal" ,gdal)
873 ("geos" ,geos)
874 ("proj" ,proj)
875 ("protozero" ,protozero)
876 ("sparsehash" ,sparsehash)
877 ("utfcpp" ,utfcpp)
878 ("zlib" ,zlib)))
879 (native-inputs
880 `(("doxygen" ,doxygen)))
881 (home-page "https://osmcode.org/libosmium/")
882 (synopsis "C++ library for working with OpenStreetMap data")
883 (description "Libosmium is a fast and flexible C++ library for working with
884 OpenStreetMap data.")
885 (license license:boost1.0)))
886
887 (define-public osm2pgsql
888 (package
889 (name "osm2pgsql")
890 (version "1.2.1")
891 (source
892 (origin
893 (method git-fetch)
894 (uri (git-reference
895 (url "https://github.com/openstreetmap/osm2pgsql.git")
896 (commit version)))
897 (file-name (git-file-name name version))
898 (sha256
899 (base32 "1ysan01lpqzjxlq3y2kdminfjs5d9zksicpf9vvzpdk3fzq51fc9"))
900 (modules '((guix build utils)))
901 (snippet
902 '(begin
903 (delete-file-recursively "contrib/protozero")
904 (delete-file-recursively "contrib/libosmium")
905 #t))))
906 (build-system cmake-build-system)
907 (arguments
908 `(#:tests? #f; tests fail because we need to setup a database
909 #:configure-flags
910 (list (string-append "-DOSMIUM_INCLUDE_DIR="
911 (assoc-ref %build-inputs "libosmium")
912 "/include")
913 (string-append "-DPROTOZERO_INCLUDE_DIR="
914 (assoc-ref %build-inputs "protozero")
915 "/include"))))
916 (inputs
917 `(("boost" ,boost)
918 ("bzip2" ,bzip2)
919 ("expat" ,expat)
920 ("libosmium" ,libosmium)
921 ("lua" ,lua)
922 ("postgresql" ,postgresql)
923 ("proj" ,proj)
924 ("protozero" ,protozero)
925 ("zlib" ,zlib)))
926 (native-inputs
927 `(("python" ,python)
928 ("python-psycopg2" ,python-psycopg2)))
929 (home-page "https://github.com/openstreetmap/osm2pgsql")
930 (synopsis "OSM data importer to postgresql")
931 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
932 PostgreSQL / PostGIS database suitable for applications like rendering into a
933 map, geocoding with Nominatim, or general analysis.")
934 (license license:gpl2+)))
935
936 (define-public tippecanoe
937 (package
938 (name "tippecanoe")
939 (version "1.31.5")
940 (source
941 (origin
942 (method git-fetch)
943 (uri (git-reference
944 (url "https://github.com/mapbox/tippecanoe.git")
945 (commit version)))
946 (file-name (git-file-name name version))
947 (sha256
948 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
949 (build-system gnu-build-system)
950 (arguments
951 `(#:phases
952 (modify-phases %standard-phases (delete 'configure))
953 #:test-target "test"
954 #:make-flags
955 (list "CC=gcc"
956 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
957 (inputs
958 `(("perl" ,perl)
959 ("sqlite" ,sqlite)
960 ("zlib" ,zlib)))
961 (home-page "https://github.com/mapbox/tippecanoe")
962 (synopsis "Vector tile server for maps")
963 (description "Tippecanoe creates scale-independent view of data, so that
964 the texture and density of features is visible at every zoom level, instead of
965 dropping features at lower levels.")
966 (license license:bsd-2)))
967
968 (define-public osmctools
969 (package
970 (name "osmctools")
971 (version "0.9")
972 (source
973 (origin
974 (method git-fetch)
975 (uri (git-reference
976 (url "https://gitlab.com/osm-c-tools/osmctools")
977 (commit version)))
978 (file-name (git-file-name name version))
979 (sha256
980 (base32
981 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
982 (build-system gnu-build-system)
983 (native-inputs
984 `(("autoconf" ,autoconf)
985 ("automake" ,automake)))
986 (inputs
987 `(("zlib" ,zlib)))
988 (home-page "https://gitlab.com/osm-c-tools/osmctools")
989 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
990 (description "This project contains a few tools which are used in the
991 OpenStreetMap project. They can be used to convert, filter and update
992 OpenStreetMap data files.")
993 (license license:agpl3)))
994
995 (define-public osm-gps-map
996 (package
997 (name "osm-gps-map")
998 (version "1.1.0")
999 (source
1000 (origin
1001 (method url-fetch)
1002 (uri (string-append
1003 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1004 version "/osm-gps-map-" version ".tar.gz"))
1005 (sha256
1006 (base32
1007 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1008 (build-system gnu-build-system)
1009 (native-inputs
1010 `(("gnome-common" ,gnome-common)
1011 ("gtk-doc" ,gtk-doc)
1012 ("pkg-config" ,pkg-config)))
1013 (inputs
1014 `(("cairo" ,cairo)
1015 ("glib" ,glib)
1016 ("gobject-introspection" ,gobject-introspection)
1017 ("gtk+" ,gtk+)
1018 ("libsoup" ,libsoup)))
1019 (home-page "https://nzjrs.github.io/osm-gps-map/")
1020 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1021 (description
1022 "This package provides a GTK+ widget (and Python bindings) that when
1023 given GPS coordinates,draws a GPS track, and points of interest on a moving
1024 map display. Downloads map data from a number of websites, including
1025 @url{https://www.openstreetmap.org}.")
1026 (license license:gpl2+)))
1027
1028 (define-public xygrib
1029 (package
1030 (name "xygrib")
1031 (version "1.2.6.1")
1032 (source (origin
1033 (method git-fetch)
1034 (uri (git-reference
1035 (url "https://github.com/opengribs/XyGrib.git")
1036 (commit (string-append "v" version))))
1037 (file-name (git-file-name name version))
1038 (sha256
1039 (base32
1040 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1041 (modules '((guix build utils)))
1042 (snippet
1043 '(begin (delete-file-recursively "data/fonts") #t))))
1044 (build-system cmake-build-system)
1045 (arguments
1046 `(#:phases
1047 (modify-phases %standard-phases
1048 (add-after 'unpack 'patch-directories
1049 (lambda* (#:key inputs #:allow-other-keys)
1050 (let ((jpeg (assoc-ref inputs "openjpeg"))
1051 (font (assoc-ref inputs "font-liberation")))
1052 (substitute* "CMakeLists.txt"
1053 ;; Find libjpeg.
1054 (("/usr") jpeg)
1055 ;; Fix install locations.
1056 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1057 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1058 ;; Skip looking for the static library.
1059 (("\"libnova.a\"") ""))
1060 ;; Don't use the bundled font-liberation.
1061 (substitute* "src/util/Font.cpp"
1062 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1063 (string-append "\"" font "/share/fonts/truetype/\"")))
1064 (substitute* "src/util/Util.h"
1065 (("pathData\\(\\)\\+\"data/fonts/\"")
1066 (string-append "\"" font "/share/fonts/\""))))
1067 #t)))
1068 #:tests? #f)) ; no tests
1069 (native-inputs
1070 `(("qttools" ,qttools)))
1071 (inputs
1072 `(("bzip2" ,bzip2)
1073 ("font-liberation" ,font-liberation)
1074 ("libnova" ,libnova)
1075 ("libpng" ,libpng)
1076 ("openjpeg" ,openjpeg)
1077 ("proj.4" ,proj.4)
1078 ("qtbase" ,qtbase)
1079 ("zlib" ,zlib)))
1080 (synopsis "Weather Forecast Visualization")
1081 (description
1082 "XyGrib is a Grib file reader and visualizes meteorological data providing
1083 an off-line capability to analyse weather forecasts or hindcasts. It is
1084 intended to be used as a capable weather work station for anyone with a serious
1085 interest in examining weather. This would include members of the sailing
1086 community, private and sport aviators, farmers, weather buffs and many more.
1087 XyGrib is the continuation of the zyGrib software package with a new team of
1088 volunteers.")
1089 (home-page "https://opengribs.org")
1090 (license license:gpl3+)))
1091
1092 (define-public libspatialindex
1093 (package
1094 (name "libspatialindex")
1095 (version "1.9.3")
1096 (source
1097 (origin
1098 (method url-fetch)
1099 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1100 "releases/download/" version "/spatialindex-src-"
1101 version ".tar.bz2"))
1102 (sha256
1103 (base32
1104 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1105 (build-system cmake-build-system)
1106 (home-page "https://libspatialindex.org")
1107 (synopsis "Spatial indexing library")
1108 (description "The purpose of this library is to provide:
1109
1110 @itemize
1111 @item An extensible framework that will support robust spatial indexing
1112 methods.
1113 @item Support for sophisticated spatial queries. Range, point location,
1114 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1115 by spatial constraints) should be easy to deploy and run.
1116 @item Easy to use interfaces for inserting, deleting and updating information.
1117 @item Wide variety of customization capabilities. Basic index and storage
1118 characteristics like the page size, node capacity, minimum fan-out, splitting
1119 algorithm, etc. should be easy to customize.
1120 @item Index persistence. Internal memory and external memory structures
1121 should be supported. Clustered and non-clustered indices should be easy to be
1122 persisted.
1123 @end itemize
1124 ")
1125 (license license:expat)))
1126
1127 (define-public java-jmapviewer
1128 (package
1129 (name "java-jmapviewer")
1130 (version "2.13")
1131 (source (origin
1132 (method url-fetch)
1133 (uri (string-append "https://svn.openstreetmap.org/applications/"
1134 "viewer/jmapviewer/releases/" version
1135 "/JMapViewer-" version "-Source.zip"))
1136 (sha256
1137 (base32
1138 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1139 (build-system ant-build-system)
1140 (native-inputs
1141 `(("unzip" ,unzip)))
1142 (arguments
1143 `(#:build-target "pack"
1144 #:tests? #f; No tests
1145 #:phases
1146 (modify-phases %standard-phases
1147 (add-before 'build 'clean
1148 (lambda* _
1149 (invoke "ant" "clean")))
1150 (replace 'install
1151 (lambda* (#:key outputs #:allow-other-keys)
1152 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1153 (mkdir-p dir)
1154 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1155 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1156 (synopsis "OSM map integration in Java")
1157 (description "JMapViewer is a Java component which easily
1158 integrates an OSM map view into your Java application. It is maintained as
1159 an independent project by the JOSM team.")
1160 (license license:gpl2)))
1161
1162 (define-public josm
1163 (package
1164 (name "josm")
1165 (version "15937")
1166 (source (origin
1167 (method svn-fetch)
1168 (uri (svn-reference
1169 (url "https://josm.openstreetmap.de/svn/trunk")
1170 (revision (string->number version))
1171 (recursive? #f)))
1172 (sha256
1173 (base32
1174 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
1175 (file-name (string-append name "-" version "-checkout"))
1176 (modules '((guix build utils)))
1177 (snippet
1178 '(begin
1179 (for-each delete-file (find-files "." ".*.jar$"))
1180 #t))))
1181 (build-system ant-build-system)
1182 (native-inputs
1183 `(("javacc" ,javacc)))
1184 (inputs
1185 `(("java-commons-jcs" ,java-commons-jcs)
1186 ("java-commons-compress" ,java-commons-compress)
1187 ("java-jmapviewer" ,java-jmapviewer)
1188 ("java-jsonp-api" ,java-jsonp-api)
1189 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1190 ("java-metadata-extractor" ,java-metadata-extractor)
1191 ("java-openjfx-media" ,java-openjfx-media)
1192 ("java-signpost-core" ,java-signpost-core)
1193 ("java-svg-salamander" ,java-svg-salamander)))
1194 (arguments
1195 `(#:tests? #f
1196 #:jar-name "josm.jar"
1197 #:phases
1198 (modify-phases %standard-phases
1199 (add-after 'unpack 'rm-build.xml
1200 (lambda* _
1201 (delete-file "build.xml")
1202 #t))
1203 (add-before 'build 'fix-revision
1204 (lambda* _
1205 (with-output-to-file "REVISION.XML"
1206 (lambda _
1207 (display
1208 (string-append "<info><entry><commit revision=\"" ,version "\">"
1209 "<date>1970-01-01 00:00:00 +0000</date>"
1210 "</commit></entry></info>"))))
1211 #t))
1212 (add-before 'build 'fix-classpath
1213 (lambda* (#:key inputs #:allow-other-keys)
1214 (setenv "CLASSPATH"
1215 (string-join
1216 (filter
1217 (lambda (s)
1218 (let ((source (assoc-ref inputs "source")))
1219 (not (equal? (substring s 0 (string-length source)) source))))
1220 (string-split (getenv "CLASSPATH") #\:))
1221 ":"))
1222 #t))
1223 (add-before 'build 'generate-parser
1224 (lambda* _
1225 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1226 (out (string-append dir "/parsergen"))
1227 (file (string-append dir "/MapCSSParser.jj")))
1228 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1229 (invoke "javacc" "-DEBUG_PARSER=false"
1230 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1231 "-GRAMMAR_ENCODING=UTF-8"
1232 (string-append "-OUTPUT_DIRECTORY=" out)
1233 file))
1234 #t))
1235 (add-after 'build 'generate-epsg
1236 (lambda _
1237 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1238 "-cp" "build/classes")
1239 (mkdir-p "data/projection")
1240 (with-output-to-file "data/projection/custom-epsg"
1241 (lambda _ (display "")))
1242 (invoke "java" "-cp" "build/classes:scripts:."
1243 "BuildProjectionDefinitions" ".")
1244 #t))
1245 (add-after 'generate-epsg 'copy-data
1246 (lambda _
1247 (mkdir-p "build/classes")
1248 (rename-file "data" "build/classes/data")
1249 #t))
1250 (add-before 'install 'regenerate-jar
1251 (lambda _
1252 ;; We need to regenerate the jar file to add data.
1253 (delete-file "build/jar/josm.jar")
1254 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1255 "build/classes" ".")
1256 #t))
1257 (add-before 'build 'copy-styles
1258 (lambda _
1259 (mkdir-p "build/classes")
1260 (rename-file "styles" "build/classes/styles")
1261 #t))
1262 (add-before 'build 'copy-images
1263 (lambda _
1264 (mkdir-p "build/classes")
1265 (rename-file "images" "build/classes/images")
1266 #t))
1267 (add-before 'build 'copy-revision
1268 (lambda _
1269 (mkdir-p "build/classes")
1270 (with-output-to-file "build/classes/REVISION"
1271 (lambda _
1272 (display
1273 (string-append "Revision: " ,version "\n"
1274 "Is-Local-Build: true\n"
1275 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1276 #t))
1277 (add-after 'install 'install-bin
1278 (lambda* (#:key outputs inputs #:allow-other-keys)
1279 (let* ((out (assoc-ref outputs "out"))
1280 (bin (string-append out "/bin")))
1281 (mkdir-p bin)
1282 (with-output-to-file (string-append bin "/josm")
1283 (lambda _
1284 (display
1285 (string-append "#!/bin/sh\n"
1286 (assoc-ref inputs "jdk") "/bin/java"
1287 " -cp " out "/share/java/josm.jar:"
1288 (getenv "CLASSPATH")
1289 " org.openstreetmap.josm.gui.MainApplication"))))
1290 (chmod (string-append bin "/josm") #o755))
1291 #t)))))
1292 (home-page "https://josm.openstreetmap.de")
1293 (synopsis "OSM editor")
1294 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1295 supports loading GPX tracks, background imagery and OSM data from local
1296 sources as well as from online sources and allows editing the OSM data (nodes,
1297 ways, and relations) and their metadata tags.")
1298 (license license:gpl2+)))
1299
1300 (define-public libmaxminddb
1301 (package
1302 (name "libmaxminddb")
1303 (version "1.4.2")
1304 (source
1305 (origin
1306 (method url-fetch)
1307 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1308 "/releases/download/" version "/"
1309 "/libmaxminddb-" version ".tar.gz"))
1310 (sha256
1311 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1312 (build-system gnu-build-system)
1313 (arguments
1314 `(#:phases
1315 (modify-phases %standard-phases
1316 (add-before 'configure 'set-cc-to-gcc
1317 (lambda _
1318 (setenv "CC" "gcc"))))))
1319 (native-inputs
1320 `(("perl" ,perl)))
1321 (home-page "https://maxmind.github.io/libmaxminddb/")
1322 (synopsis "C library for the MaxMind DB file format")
1323 (description "The libmaxminddb library provides a C library for reading
1324 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1325 format is a custom, but open, binary format designed to facilitate fast
1326 lookups of IP addresses while allowing flexibility in the type of data
1327 associated with an address.")
1328 (license license:asl2.0)))
1329
1330 (define-public python-maxminddb
1331 (package
1332 (name "python-maxminddb")
1333 (version "1.5.1")
1334 (source
1335 (origin
1336 (method url-fetch)
1337 (uri (pypi-uri "maxminddb" version))
1338 (sha256
1339 (base32
1340 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1341 (build-system python-build-system)
1342 (arguments
1343 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1344 (inputs
1345 `(("libmaxminddb" ,libmaxminddb)))
1346 (home-page "https://www.maxmind.com/")
1347 (synopsis "Reader for the MaxMind DB format")
1348 (description "MaxMind DB is a binary file format that stores data indexed
1349 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1350 MaxMind DB files.")
1351 (license license:asl2.0)))
1352
1353 (define-public python-geoip2
1354 (package
1355 (name "python-geoip2")
1356 (version "2.9.0")
1357 (source
1358 (origin
1359 (method url-fetch)
1360 (uri (pypi-uri "geoip2" version))
1361 (sha256
1362 (base32
1363 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1364 (build-system python-build-system)
1365 (arguments
1366 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1367 (inputs
1368 `(("python-maxminddb" ,python-maxminddb)
1369 ("python-requests" ,python-requests)))
1370 (home-page "https://www.maxmind.com/")
1371 (synopsis "MaxMind GeoIP2 API")
1372 (description "Provides an API for the GeoIP2 web services and databases.
1373 The API also works with MaxMind’s free GeoLite2 databases.")
1374 (license license:asl2.0)))
1375
1376 (define-public routino
1377 (package
1378 (name "routino")
1379 (version "3.3.2")
1380 (source
1381 (origin
1382 (method url-fetch)
1383 (uri (string-append "http://www.routino.org/download/routino-"
1384 version ".tgz"))
1385 (sha256
1386 (base32
1387 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1388 (build-system gnu-build-system)
1389 (native-inputs
1390 `(("perl" ,perl)))
1391 (inputs
1392 `(("bzip2" ,bzip2)
1393 ("xz" ,xz)
1394 ("zlib" ,zlib)))
1395 (arguments
1396 `(#:test-target "test"
1397 #:phases
1398 (modify-phases %standard-phases
1399 (replace 'configure
1400 (lambda* (#:key outputs #:allow-other-keys)
1401 (substitute* "Makefile.conf"
1402 (("prefix=/usr/local")
1403 (string-append "prefix=" (assoc-ref outputs "out")))
1404 (("LDFLAGS_LDSO=-Wl,-R\\.")
1405 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1406 (("#CFLAGS\\+=-DUSE_XZ")
1407 "CFLAGS+=-DUSE_XZ")
1408 (("#LDFLAGS\\+=-llzma")
1409 "LDFLAGS+=-llzma"))
1410 #t)))))
1411 (synopsis "Routing application for OpenStreetMap data")
1412 (description
1413 "Routino is an application for finding a route between two points
1414 using the dataset of topographical information collected by
1415 @url{https://www.OpenStreetMap.org}.")
1416 (home-page "https://www.routino.org/")
1417 (license license:agpl3+)))
1418
1419 (define-public qmapshack
1420 (package
1421 (name "qmapshack")
1422 (version "1.14.0")
1423 (source
1424 (origin
1425 (method git-fetch)
1426 (uri (git-reference
1427 (url "https://github.com/Maproom/qmapshack.git")
1428 (commit (string-append "V_" version))))
1429 (file-name (git-file-name name version))
1430 (sha256
1431 (base32
1432 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1433 (build-system qt-build-system)
1434 (native-inputs
1435 `(("pkg-config" ,pkg-config)
1436 ("qttools" ,qttools)))
1437 (inputs
1438 `(("gdal" ,gdal)
1439 ("libjpeg-turbo" ,libjpeg-turbo)
1440 ("proj" ,proj)
1441 ("qtbase" ,qtbase)
1442 ("qtdeclarative" ,qtdeclarative)
1443 ("qtlocation" ,qtlocation)
1444 ("qtwebchannel" ,qtwebchannel)
1445 ("qtwebengine" ,qtwebengine)
1446 ("quazip" ,quazip)
1447 ("routino" ,routino)
1448 ("sqlite" ,sqlite) ; See wrap phase
1449 ("zlib" ,zlib)))
1450 (arguments
1451 `(#:tests? #f
1452 #:phases
1453 (modify-phases %standard-phases
1454 (add-after 'unpack 'fix-cmake-modules
1455 (lambda* (#:key inputs #:allow-other-keys)
1456 (substitute* "CMakeLists.txt"
1457 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1458 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1459 (substitute* "cmake/Modules/FindROUTINO.cmake"
1460 (("/usr/local")
1461 (assoc-ref inputs "routino")))
1462 ;; The following fixes are included as patches in the sources
1463 ;; of QMapShack, but they are not applied by default, for
1464 ;; some reason...
1465 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1466 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1467 #t))
1468 (add-after 'install 'wrap
1469 ;; The program fails to find the QtWebEngineProcess program,
1470 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1471 (lambda* (#:key inputs outputs #:allow-other-keys)
1472 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1473 (qtwebengineprocess (string-append
1474 (assoc-ref inputs "qtwebengine")
1475 "/lib/qt5/libexec/QtWebEngineProcess")))
1476 (for-each (lambda (program)
1477 (wrap-program program
1478 `("QTWEBENGINEPROCESS_PATH" =
1479 (,qtwebengineprocess))))
1480 (find-files bin ".*")))
1481 #t)))))
1482 (synopsis "GPS mapping application")
1483 (description
1484 "QMapShack can be used to plan your next outdoor trip or to visualize and
1485 archive all the GPS recordings of your past trips. It is the successor of the
1486 QLandkarte GT application.")
1487 (home-page "https://github.com/Maproom/qmapshack/wiki")
1488 (license license:gpl3+)))
1489
1490 (define-public readosm
1491 (package
1492 (name "readosm")
1493 (version "1.1.0")
1494 (source
1495 (origin
1496 (method url-fetch)
1497 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1498 "readosm-" version ".tar.gz"))
1499 (sha256
1500 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1501 (build-system gnu-build-system)
1502 (inputs
1503 `(("expat" ,expat)
1504 ("zlib" ,zlib)))
1505 (synopsis "Data extractor for OpenStreetMap files")
1506 (description
1507 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1508 input file (in @code{.osm} or @code{.osm.pbf} format).")
1509 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1510 (license (list license:gpl2+
1511 license:lgpl2.1+
1512 license:mpl1.1))))
1513
1514 (define-public spatialite-tools
1515 (package
1516 (name "spatialite-tools")
1517 (version "4.3.0")
1518 (source
1519 (origin
1520 (method url-fetch)
1521 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1522 "spatialite-tools-" version ".tar.gz"))
1523 (sha256
1524 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1525 (build-system gnu-build-system)
1526 (native-inputs
1527 `(("pkg-config" ,pkg-config)))
1528 (inputs
1529 `(("expat" ,expat)
1530 ("freexl" ,freexl)
1531 ("geos" ,geos)
1532 ("libspatialite" ,libspatialite)
1533 ("libxml2" ,libxml2)
1534 ("proj.4" ,proj.4)
1535 ("readosm" ,readosm)
1536 ("sqlite" ,sqlite)
1537 ("zlib" ,zlib)))
1538 (synopsis "Collection of command line tools for SpatiaLite")
1539 (description
1540 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1541 tools supporting SpatiaLite.")
1542 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1543 (license license:gpl3+)))
1544
1545 (define-public virtualpg
1546 (package
1547 (name "virtualpg")
1548 (version "1.0.2")
1549 (source
1550 (origin
1551 (method url-fetch)
1552 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1553 "virtualpg-" version ".tar.gz"))
1554 (sha256
1555 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1556 (build-system gnu-build-system)
1557 (inputs
1558 `(("postgresql" ,postgresql)
1559 ("sqlite" ,sqlite)))
1560 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1561 (description
1562 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1563 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1564 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1565 exchanged form one Spatial DBMS and the other.")
1566 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1567 (license (list license:gpl2+
1568 license:lgpl2.1+
1569 license:mpl1.1))))
1570
1571 (define-public opencpn
1572 (package
1573 (name "opencpn")
1574 (version "5.0.0")
1575 (source
1576 (origin
1577 (method git-fetch)
1578 (uri (git-reference
1579 (url "https://github.com/OpenCPN/OpenCPN.git")
1580 (commit (string-append "v" version))))
1581 (file-name (git-file-name name version))
1582 (sha256
1583 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1584 (build-system cmake-build-system)
1585 (native-inputs
1586 `(("gettext" ,gettext-minimal)
1587 ("pkg-config" ,pkg-config)))
1588 (inputs
1589 `(("bzip2" ,bzip2)
1590 ("cairo" ,cairo)
1591 ("curl" ,curl)
1592 ("glu" ,glu)
1593 ("gtk+" ,gtk+)
1594 ("libarchive" ,libarchive)
1595 ("libelf" ,libelf)
1596 ("libexif" ,libexif)
1597 ("libsndfile" ,libsndfile)
1598 ("lz4" ,lz4)
1599 ("mesa" ,mesa)
1600 ("pango" ,pango)
1601 ("portaudio" ,portaudio)
1602 ("sqlite" ,sqlite)
1603 ("tinyxml" ,tinyxml)
1604 ("wxsvg" ,wxsvg)
1605 ("wxwidgets" ,wxwidgets)
1606 ("xz" ,xz)
1607 ("zlib" ,zlib)))
1608 (arguments
1609 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1610 "-DENABLE_SNDFILE=ON"
1611 "-DBUNDLE_TCDATA=ON"
1612 "-DBUNDLE_GSHHS=CRUDE")
1613 #:tests? #f ; No tests defined
1614 #:phases
1615 (modify-phases %standard-phases
1616 (add-after 'unpack 'fix-build
1617 (lambda _
1618 (substitute* "CMakeLists.txt"
1619 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1620 (string-append all " --libs all")))
1621 #t)))))
1622 (synopsis "Chart plotter and marine GPS navigation software")
1623 (description
1624 "OpenCPN is a chart plotter and marine navigation software designed to be
1625 used at the helm station of your boat while underway. Chart a course and
1626 track your position right from your laptop.")
1627 (home-page "https://opencpn.org/")
1628 (license (list license:asl2.0
1629 license:cc0
1630 license:bsd-2
1631 license:bsd-3
1632 license:expat
1633 license:gpl3+
1634 license:lgpl2.1+
1635 license:lgpl3+
1636 license:sgifreeb2.0
1637 license:zlib))))
1638
1639 (define-public grass
1640 (let* ((version "7.8.2")
1641 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1642 (grassxx (string-append "grass" majorminor)))
1643 (package
1644 (name "grass")
1645 (version version)
1646 (source
1647 (origin
1648 (method url-fetch)
1649 (uri (string-append "https://grass.osgeo.org/" grassxx
1650 "/source/grass-" version ".tar.gz"))
1651 (sha256
1652 (base32 "1fwsm99kz0bxvjk7442qq1h45ikrmhba8bqclafb61gqg1q6ymrk"))))
1653 (build-system gnu-build-system)
1654 (inputs
1655 `(("bzip2", bzip2)
1656 ("cairo" ,cairo)
1657 ("fftw" ,fftw)
1658 ("freetype" ,freetype)
1659 ("gdal" ,gdal)
1660 ("geos" ,geos)
1661 ("glu" ,glu)
1662 ("lapack" ,lapack)
1663 ("libpng" ,libpng)
1664 ("libtiff" ,libtiff)
1665 ("mesa" ,mesa)
1666 ("mariadb-dev" ,mariadb "dev")
1667 ("mariadb-lib" ,mariadb "lib")
1668 ("netcdf" ,netcdf)
1669 ("openblas" ,openblas)
1670 ("perl" ,perl)
1671 ("postgresql" ,postgresql)
1672 ("proj.4" ,proj.4)
1673 ("python" ,python)
1674 ("python-dateutil" ,python-dateutil)
1675 ("python-numpy" ,python-numpy)
1676 ("python-wxpython" ,python-wxpython)
1677 ("readline" ,readline)
1678 ("sqlite" ,sqlite)
1679 ("wxwidgets" ,wxwidgets)
1680 ("zlib" ,zlib)
1681 ("zstd" ,zstd "lib")))
1682 (native-inputs
1683 `(("bash" ,bash-minimal)
1684 ("bison" ,bison)
1685 ("flex" ,flex)
1686 ("pkg-config" ,pkg-config)))
1687 (arguments
1688 `(#:tests? #f ; No tests
1689 #:modules ((guix build gnu-build-system)
1690 ((guix build python-build-system) #:prefix python:)
1691 (guix build utils))
1692 #:imported-modules (,@%gnu-build-system-modules
1693 (guix build python-build-system))
1694 #:phases
1695 (modify-phases %standard-phases
1696 (replace 'configure
1697 (lambda* (#:key inputs outputs #:allow-other-keys)
1698 (let ((shell (string-append (assoc-ref inputs "bash")
1699 "/bin/bash")))
1700 (setenv "SHELL" shell)
1701 (setenv "CONFIG_SHELL" shell)
1702 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1703 (assoc-ref outputs "out")
1704 "/" ,grassxx "/lib")))
1705 (invoke "./configure"
1706 (string-append "--prefix="
1707 (assoc-ref outputs "out"))
1708 "--with-blas"
1709 "--with-bzlib"
1710 (string-append "--with-freetype-includes="
1711 (assoc-ref inputs "freetype")
1712 "/include/freetype2")
1713 (string-append "--with-freetype-libs="
1714 (assoc-ref inputs "freetype")
1715 "/lib")
1716 "--with-geos"
1717 "--with-lapack"
1718 "--with-mysql"
1719 (string-append "--with-mysql-includes="
1720 (assoc-ref inputs "mariadb-dev")
1721 "/include/mysql")
1722 (string-append "--with-mysql-libs="
1723 (assoc-ref inputs "mariadb-lib")
1724 "/lib")
1725 "--with-netcdf"
1726 "--with-postgres"
1727 (string-append "--with-proj-share="
1728 (assoc-ref inputs "proj.4")
1729 "/share/proj")
1730 "--with-pthread"
1731 "--with-readline"
1732 "--with-sqlite"
1733 "--with-wxwidgets")))
1734 (add-after 'install 'install-links
1735 (lambda* (#:key outputs #:allow-other-keys)
1736 ;; Put links for includes and libraries in the standard places.
1737 (let* ((out (assoc-ref outputs "out"))
1738 (dir (string-append out "/" ,grassxx)))
1739 (symlink (string-append dir "/include")
1740 (string-append out "/include"))
1741 (symlink (string-append dir "/lib")
1742 (string-append out "/lib")))
1743 #t))
1744 (add-after 'install-links 'wrap-python
1745 (assoc-ref python:%standard-phases 'wrap)))))
1746 (synopsis "GRASS Geographic Information System")
1747 (description
1748 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1749 Information System (GIS) software suite used for geospatial data management and
1750 analysis, image processing, graphics and maps production, spatial modeling, and
1751 visualization.")
1752 (home-page "https://grass.osgeo.org/")
1753 (license license:gpl2+))))
1754
1755 (define-public saga
1756 (package
1757 (name "saga")
1758 (version "7.6.2")
1759 (source
1760 (origin
1761 (method url-fetch)
1762 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1763 (version-major version) "/SAGA%20-%20" version
1764 "/saga-" version ".tar.gz"))
1765 (sha256
1766 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1767 (build-system gnu-build-system)
1768 (native-inputs
1769 `(("pkg-config" ,pkg-config)
1770 ("swig" ,swig)))
1771 (inputs
1772 `(("curl" ,curl)
1773 ("fftw" ,fftw)
1774 ("gdal" ,gdal)
1775 ("hdf5" ,hdf5)
1776 ("jasper" ,jasper)
1777 ("libharu" ,libharu)
1778 ("libtiff" ,libtiff)
1779 ("opencv" ,opencv)
1780 ("postgresql" ,postgresql)
1781 ("proj.4" ,proj.4)
1782 ("python" ,python)
1783 ("qhull" ,qhull)
1784 ("unixodbc" ,unixodbc)
1785 ("vigra" ,vigra)
1786 ("wxwidgets" ,wxwidgets)))
1787 (arguments
1788 '(#:configure-flags '("--enable-python")))
1789 (synopsis "System for Automated Geoscientific Analyses")
1790 (description
1791 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1792 Information System (GIS) software. It has been designed for an easy and
1793 effective implementation of spatial algorithms and it offers a comprehensive,
1794 growing set of geoscientific methods.")
1795 (home-page "http://www.saga-gis.org")
1796 (license (list license:gpl2+ license:lgpl2.1+))))
1797
1798 (define-public qgis
1799 (package
1800 (name "qgis")
1801 (version "3.12.1")
1802 (source
1803 (origin
1804 (method url-fetch)
1805 (uri (string-append "https://qgis.org/downloads/qgis-"
1806 version ".tar.bz2"))
1807 (sha256
1808 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1809 (build-system cmake-build-system)
1810 (arguments
1811 `(#:modules ((guix build cmake-build-system)
1812 ((guix build python-build-system) #:prefix python:)
1813 (guix build qt-utils)
1814 (guix build utils))
1815 #:imported-modules (,@%cmake-build-system-modules
1816 (guix build python-build-system)
1817 (guix build qt-utils))
1818 #:phases
1819 (modify-phases %standard-phases
1820 ;; Configure correct path to PyQt5 SIP directory
1821 (add-after 'unpack 'configure-pyqt5-sip-path
1822 (lambda* (#:key inputs #:allow-other-keys)
1823 (substitute* "cmake/FindPyQt5.cmake"
1824 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
1825 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
1826 "/share/sip\" PYQT5_SIP_DIR")))
1827 (substitute* (list "scripts/prepare-commit.sh"
1828 "scripts/runtests-local-travis-config.sh"
1829 "scripts/sip_include.sh"
1830 "scripts/sipdiff"
1831 "scripts/sipify_all.sh"
1832 "scripts/spell_check/check_spelling.sh"
1833 "scripts/spell_check/spell_test.sh"
1834 "scripts/verify-indentation.sh"
1835 "tests/code_layout/test_banned_keywords.sh"
1836 "tests/code_layout/test_licenses.sh"
1837 "tests/code_layout/test_shellcheck.sh"
1838 "tests/code_layout/test_sip_include.sh"
1839 "tests/code_layout/test_sipfiles_uptodate.sh"
1840 "tests/code_layout/test_sipify.sh")
1841 (("\\$\\(git rev-parse --show-toplevel\\)")
1842 (getcwd)))
1843 (substitute* "tests/code_layout/test_sip_include.sh"
1844 (("^REV=.*") "REV=currentrev\n"))
1845 #t))
1846 (replace 'check
1847 (lambda* (#:key inputs #:allow-other-keys)
1848 (setenv "HOME" "/tmp")
1849 (system (string-append (assoc-ref inputs "xorg-server")
1850 "/bin/Xvfb :1 &"))
1851 (setenv "DISPLAY" ":1")
1852 (setenv "TRAVIS" "true")
1853 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
1854 (invoke "ctest"
1855 "-E" (string-join
1856 '(;; Disable tests that require network access
1857 "qgis_filedownloader"
1858 ;; TODO: Find why the following tests fail
1859 "ProcessingQgisAlgorithmsTestPt1"
1860 "ProcessingQgisAlgorithmsTestPt3"
1861 "ProcessingQgisAlgorithmsTestPt4"
1862 "ProcessingGdalAlgorithmsRasterTest"
1863 "ProcessingGdalAlgorithmsVectorTest"
1864 "ProcessingGrass7AlgorithmsImageryTest"
1865 "ProcessingGrass7AlgorithmsRasterTest"
1866 "ProcessingGrass7AlgorithmsVectorTest"
1867 "ProcessingOtbAlgorithmsTest"
1868 "qgis_authmanagertest"
1869 "qgis_compositionconvertertest"
1870 "qgis_coordinatereferencesystemtest"
1871 "qgis_geometrytest"
1872 "qgis_layouthtmltest"
1873 "qgis_layoutmaptest"
1874 "qgis_painteffecttest"
1875 "qgis_pallabelingtest"
1876 "qgis_svgmarkertest"
1877 "qgis_taskmanagertest"
1878 "qgis_ziplayertest"
1879 "qgis_processingtest"
1880 "qgis_wcsprovidertest"
1881 "qgis_arcgisrestutilstest"
1882 "qgis_grassprovidertest7"
1883 "qgis_gpsinformationwidget"
1884 "PyCoreAdittions"
1885 "PyQgsPythonProvider"
1886 "PyQgsAnnotation"
1887 "PyQgsAuthenticationSystem"
1888 "PyQgsProject"
1889 "PyQgsFileUtils"
1890 "PyQgsGeometryTest"
1891 "PyQgsImageCache"
1892 "PyQgsLayoutExporter"
1893 "PyQgsLayoutLegend"
1894 "PyQgsMapLayer"
1895 "PyQgsOGRProviderGpkg"
1896 "PyQgsPalLabelingLayout"
1897 "PyQgsImportIntoPostGIS"
1898 "PyQgsProviderConnectionPostgres"
1899 "PyQgsProviderConnectionGpkg"
1900 "PyQgsShapefileProvider"
1901 "PyQgsSvgCache"
1902 "PyQgsTextRenderer"
1903 "PyQgsOGRProvider"
1904 "PyQgsSpatialiteProvider"
1905 "PyQgsVectorFileWriter"
1906 "PyQgsVectorLayer"
1907 "PyQgsVectorLayerUtils"
1908 "PyQgsVirtualLayerProvider"
1909 "PyQgsWFSProvider"
1910 "PyQgsOapifProvider"
1911 "PyQgsLayerDependencies"
1912 "PyQgsDBManagerGpkg"
1913 "PyQgsDBManagerSpatialite"
1914 "PyQgsSettings"
1915 "PyQgsAuxiliaryStorage"
1916 "PyQgsSelectiveMasking"
1917 "PyQgsAppStartup"
1918 "qgis_geometrycheckstest"
1919 "qgis_shellcheck"
1920 "qgis_sipify"
1921 "qgis_sip_include"
1922 "qgis_sip_uptodate")
1923 "|"))))
1924 (add-after 'install 'wrap-python
1925 (assoc-ref python:%standard-phases 'wrap))
1926 (add-after 'wrap-python 'wrap-qt
1927 (lambda* (#:key outputs #:allow-other-keys)
1928 (wrap-qt-program (assoc-ref outputs "out") "qgis")
1929 #t))
1930 (add-after 'wrap-qt 'wrap-gis
1931 (lambda* (#:key inputs outputs #:allow-other-keys)
1932 (let* ((out (assoc-ref outputs "out"))
1933 (saga (string-append (assoc-ref inputs "saga") "/bin"))
1934 (grass-version ,(package-version grass))
1935 (grass-majorminor (string-join
1936 (list-head
1937 (string-split grass-version #\.) 2)
1938 ""))
1939 (grass (string-append (assoc-ref inputs "grass")
1940 "/grass" grass-majorminor)))
1941 (wrap-program (string-append out "/bin/qgis")
1942 `("PATH" ":" prefix (,saga))
1943 `("QGIS_PREFIX_PATH" = (,out))
1944 `("GISBASE" = (,grass))))
1945 #t)))))
1946 (inputs
1947 `(("exiv2" ,exiv2)
1948 ("expat" ,expat)
1949 ("gdal" ,gdal)
1950 ("geos" ,geos)
1951 ("gpsbabel" ,gpsbabel)
1952 ("grass" ,grass)
1953 ("gsl" ,gsl)
1954 ("hdf5" ,hdf5)
1955 ("libspatialindex" ,libspatialindex)
1956 ("libspatialite" ,libspatialite)
1957 ("libxml2" ,libxml2)
1958 ("libzip" ,libzip)
1959 ("netcdf" ,netcdf)
1960 ("postgresql" ,postgresql)
1961 ("proj" ,proj)
1962 ("python" ,python)
1963 ("python-chardet" ,python-chardet)
1964 ("python-dateutil" ,python-dateutil)
1965 ("python-gdal" ,python-gdal)
1966 ("python-jinja2" ,python-jinja2)
1967 ("python-numpy" ,python-numpy)
1968 ("python-owslib" ,python-owslib)
1969 ("python-psycopg2" ,python-psycopg2)
1970 ("python-pygments" ,python-pygments)
1971 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
1972 ("python-pytz" ,python-pytz)
1973 ("python-pyyaml" ,python-pyyaml)
1974 ("python-requests" ,python-requests)
1975 ("python-sip" ,python-sip)
1976 ("python-six" ,python-six)
1977 ("python-urllib3" ,python-urllib3)
1978 ("qca" ,qca)
1979 ("qscintilla" ,qscintilla)
1980 ("qtbase" ,qtbase)
1981 ("qtdeclarative" ,qtdeclarative)
1982 ("qtkeychain" ,qtkeychain)
1983 ("qtlocation" ,qtlocation)
1984 ("qtserialport" ,qtserialport)
1985 ("qtsvg" ,qtsvg)
1986 ("qtwebkit" ,qtwebkit)
1987 ("qwt" ,qwt)
1988 ("saga" ,saga)
1989 ("sqlite" ,sqlite)))
1990 (native-inputs
1991 `(("bison" ,bison)
1992 ("flex" ,flex)
1993 ("perl" ,perl)
1994 ("perl-yaml-tiny" ,perl-yaml-tiny)
1995 ("pkg-config" ,pkg-config)
1996 ("python-mock" ,python-mock)
1997 ("python-nose2" ,python-nose2)
1998 ("qttools" ,qttools)
1999 ("shellcheck" ,shellcheck)
2000 ("xorg-server" ,xorg-server-for-tests)))
2001 (home-page "https://qgis.org")
2002 (synopsis "Geographical information system")
2003 (description "QGIS is an easy to use Geographical Information
2004 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2005 raster and vector data formats, with new support easily added using the plugin
2006 architecture.")
2007 (license
2008 (list
2009 license:asl1.1
2010 license:asl2.0
2011 license:bsd-2
2012 license:bsd-3
2013 license:boost1.0
2014 license:cc-by3.0
2015 license:cc-by4.0
2016 license:cc-by-sa3.0
2017 license:cc-by-sa4.0
2018 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2019 (license:fsf-free "file://debian/copyright" "Go Squared")
2020 license:expat
2021 license:fdl1.2+
2022 (license:fsf-free
2023 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2024 (license:fsf-free
2025 "file://debian/copyright"
2026 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2027 license:gpl2
2028 license:gpl2+
2029 license:gpl3
2030 license:gpl3+
2031 license:isc
2032 license:lgpl2.0+
2033 license:lgpl2.1
2034 license:lgpl2.1+
2035 license:lgpl3
2036 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2037 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2038 (license:non-copyleft
2039 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2040 "NCL Source Code License")
2041 license:ogl-psi1.0
2042 license:opl1.0+
2043 license:public-domain
2044 license:qwt1.0))))