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