gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts.
[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 `(("gettext" ,gettext-minimal)
193 ("gobject-introspection" ,gobject-introspection)
194 ("pkg-config" ,pkg-config)))
195 (inputs
196 `(("evolution-data-server" ,evolution-data-server)
197 ("folks" ,folks)
198 ("libchamplain" ,libchamplain)
199 ("libgee" ,libgee)
200 ("libsecret" ,libsecret)
201 ("libsoup" ,libsoup)
202 ("libgweather" ,libgweather)
203 ("libxml2" ,libxml2)
204 ("gdk-pixbuf" ,gdk-pixbuf+svg)
205 ("glib-networking" ,glib-networking)
206 ("geoclue" ,geoclue)
207 ("geocode-glib" ,geocode-glib)
208 ("gfbgraph" ,gfbgraph)
209 ("gjs" ,gjs)
210 ("glib" ,glib)
211 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
212 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
213 ("gtk+" ,gtk+)
214 ("rest" ,rest)
215 ("webkitgtk" ,webkitgtk)))
216 (synopsis "Graphical map viewer and wayfinding program")
217 (description "GNOME Maps is a graphical map viewer. It uses map data from
218 the OpenStreetMap project. It can provide directions for walking, bicycling,
219 and driving.")
220 (home-page "https://wiki.gnome.org/Apps/Maps")
221 (license license:gpl2+)))
222
223 (define-public libgaiagraphics
224 (package
225 (name "libgaiagraphics")
226 (version "0.5")
227 (source
228 (origin
229 (method url-fetch)
230 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
231 version ".tar.gz"))
232 (sha256
233 (base32
234 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
235 (build-system gnu-build-system)
236 (native-inputs
237 `(("pkg-config" ,pkg-config)))
238 (inputs
239 `(("cairo" ,cairo)
240 ("libpng" ,libpng)
241 ("libjpeg-turbo" ,libjpeg-turbo)
242 ("libtiff" ,libtiff)
243 ("libgeotiff" ,libgeotiff)
244 ("proj.4" ,proj.4)
245 ("libxml2" ,libxml2)
246 ("zlib" ,zlib)))
247 (synopsis "Gaia common graphics support")
248 (description "libgaiagraphics is a library supporting
249 common-utility raster handling methods.")
250 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
251 (license license:lgpl3+)))
252
253 (define-public libgeotiff
254 (package
255 (name "libgeotiff")
256 (version "1.5.1")
257 (source
258 (origin
259 (method url-fetch)
260 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
261 version ".tar.gz"))
262 (patches (search-patches
263 ;; See libgeotiff 1.5.1 issue
264 ;; https://github.com/OSGeo/libgeotiff/issues/22
265 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
266 (sha256
267 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
268 (modules '((guix build utils)))
269 (snippet
270 '(begin
271 ;; Remove .csv files, distributed from EPSG under a restricted
272 ;; license. See LICENSE for full license text.
273 (for-each delete-file (find-files "." "\\.csv$"))
274 #t))))
275 (build-system gnu-build-system)
276 (inputs
277 `(("libjpeg-turbo" ,libjpeg-turbo)
278 ("libtiff" ,libtiff)
279 ("zlib" ,zlib)))
280 (propagated-inputs
281 `(;; libgeotiff headers include proj headers, so ensure those are available.
282 ("proj" ,proj)))
283 (arguments
284 `(#:configure-flags
285 (list "--disable-static"
286 "--with-zlib" "--with-jpeg"
287 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
288 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
289 (description "libgeotiff is a library on top of libtiff for reading and
290 writing GeoTIFF information tags.")
291 (home-page "https://trac.osgeo.org/geotiff/")
292 ;; This is a mixture of various contributions under different licenses.
293 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
294 ;; states, as its commercial redistribution is restricted. Hence, we have
295 ;; removed it from the package.
296 (license (list license:public-domain
297 license:x11
298 license:bsd-3
299 (license:non-copyleft "file://LICENSE"
300 "See LICENSE in the distribution.")))))
301
302 (define-public libspatialite
303 (package
304 (name "libspatialite")
305 (version "4.3.0a")
306 (source
307 (origin
308 (method url-fetch)
309 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
310 version ".tar.gz"))
311 (sha256
312 (base32
313 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
314 (build-system gnu-build-system)
315 (native-inputs
316 `(("pkg-config" ,pkg-config)))
317 (inputs
318 `(("freexl" ,freexl)
319 ("geos" ,geos)
320 ("libxml2" ,libxml2)
321 ("proj.4" ,proj.4)
322 ("sqlite" ,sqlite)
323 ("zlib" ,zlib)))
324 (arguments
325 `(#:phases
326 (modify-phases %standard-phases
327 ;; 3 tests are failing, ignore them:
328 (add-after 'unpack 'ignore-broken-tests
329 (lambda _
330 (substitute* '("test/Makefile.in")
331 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
332 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
333 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
334 #t)))))
335 (synopsis "Extend SQLite to support Spatial SQL capabilities")
336 (description
337 "SpatiaLite is a library intended to extend the SQLite core to support
338 fully fledged Spatial SQL capabilities.")
339 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
340 ;; For the genuine libspatialite-sources holds:
341 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
342 ;; Files under src/control_points are from GRASS
343 ;; and are licensed under GPL2+ only.
344 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
345 (license (list license:gpl2+
346 license:lgpl2.1+
347 license:mpl1.1
348 license:public-domain))))
349
350 (define-public proj
351 (package
352 (name "proj")
353 (version "6.3.1")
354 (source
355 (origin
356 (method url-fetch)
357 (uri (string-append "http://download.osgeo.org/proj/proj-"
358 version ".tar.gz"))
359 (sha256
360 (base32
361 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
362 (build-system gnu-build-system)
363 (inputs
364 `(("sqlite" ,sqlite)))
365 (native-inputs
366 `(("pkg-config" ,pkg-config)))
367 (home-page "https://proj.org/")
368 (synopsis "Coordinate transformation software")
369 (description
370 "Proj is a generic coordinate transformation software that transforms
371 geospatial coordinates from one coordinate reference system (CRS) to another.
372 This includes cartographic projections as well as geodetic transformations.
373 PROJ includes command line applications for easy conversion of coordinates
374 from text files or directly from user input. In addition, proj also exposes
375 an application programming interface that lets developers use the
376 functionality of proj in their own software.")
377 (license (list license:expat
378 ;; src/projections/patterson.cpp
379 license:asl2.0
380 ;; src/geodesic.*, src/tests/geodtest.cpp
381 license:x11))))
382
383 (define-public proj.4
384 (package
385 (name "proj.4")
386 (version "4.9.3")
387 (source (origin
388 (method url-fetch)
389 (uri (string-append "http://download.osgeo.org/proj/proj-"
390 version ".tar.gz"))
391 (sha256
392 (base32
393 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
394 (build-system gnu-build-system)
395 (arguments
396 `(#:phases
397 (modify-phases %standard-phases
398 (add-after 'unpack 'patch-test-paths
399 (lambda _
400 (substitute* '("nad/test27"
401 "nad/test83"
402 "nad/testvarious"
403 "nad/testdatumfile"
404 "nad/testflaky"
405 "nad/testIGNF")
406 (("/bin/rm") (which "rm")))
407 #t))
408 ;; Precision problems on i686 and other platforms. See:
409 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
410 ;; Disable failing test.
411 (add-after 'patch-test-paths 'ignore-failing-tests
412 (lambda _
413 (substitute* '("nad/Makefile.in")
414 (("\tPROJ_LIB.*" all) (string-append "#" all)))
415 #t)))))
416 (inputs
417 `(("glib" ,glib)))
418 (home-page "https://proj.org/")
419 (synopsis "Cartographic Projections Library")
420 (description
421 "Proj.4 is a library for converting coordinates between cartographic
422 projections.")
423 (license (list license:expat
424 ;; src/PJ_patterson.c
425 license:asl2.0
426 ;; src/geodesic.c/h
427 license:x11
428 ;; Embedded EPSG database.
429 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
430 ;; cmake/*
431 license:boost1.0))))
432
433 (define-public mapnik
434 (package
435 (name "mapnik")
436 (version "3.0.18")
437 (source
438 (origin
439 (method url-fetch)
440 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
441 version "/mapnik-v" version ".tar.bz2"))
442 (sha256
443 (base32
444 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
445 (build-system scons-build-system)
446 (inputs
447 `(("boost" ,boost)
448 ("cairo" ,cairo)
449 ("freetype" ,freetype)
450 ("harfbuzz" ,harfbuzz)
451 ("icu4c" ,icu4c)
452 ("libjpeg-turbo" ,libjpeg-turbo)
453 ("libpng" ,libpng)
454 ("libtiff" ,libtiff)
455 ("libwebp" ,libwebp)
456 ("libxml2" ,libxml2)
457 ("proj.4" ,proj.4)
458 ("sqlite" ,sqlite)
459 ("zlib" ,zlib)))
460 (native-inputs
461 `(("pkg-config" ,pkg-config)))
462 (arguments
463 `(#:scons ,scons-python2
464 #:scons-flags
465 (list "CC=gcc"
466 (string-append "PREFIX=" %output)
467 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
468 (home-page "https://mapnik.org/")
469 (synopsis "Toolkit for developing mapping applications")
470 (description "Mapnik is a toolkit for developing mapping applications. It
471 is basically a collection of geographic objects like maps, layers,
472 datasources, features, and geometries. At its core is a C++ shared library
473 providing algorithms and patterns for spatial data access and visualization.
474 The library does not rely on any specific windowing system and can be deployed
475 to any server environment. It is intended to play fair in a multi-threaded
476 environment and is aimed primarily, but not exclusively, at web-based
477 development.")
478 (license (list license:lgpl2.1+
479 ;; demo/viewer, demo/python/rundemo.py
480 license:gpl2+
481 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
482 license:boost1.0
483 ;; deps/mapnik/sparsehash
484 license:bsd-3
485 ;; deps/agg
486 (license:non-copyleft "file://deps/agg/copying")))))
487
488 (define-public python2-mapnik
489 (package
490 (name "python2-mapnik")
491 (version "3.0.16")
492 (source
493 (origin
494 (method url-fetch)
495 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
496 version ".tar.gz"))
497 (file-name (string-append name "-" version ".tar.gz"))
498 (sha256
499 (base32
500 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
501 (build-system python-build-system)
502 (inputs
503 `(("boost" ,boost)
504 ("harfbuzz" ,harfbuzz)
505 ("icu4c" ,icu4c)
506 ("libjpeg-turbo" ,libjpeg-turbo)
507 ("libpng" ,libpng)
508 ("libtiff" ,libtiff)
509 ("libwebp" ,libwebp)
510 ("mapnik" ,mapnik)
511 ("proj.4" ,proj.4)
512 ("python2-pycairo" ,python2-pycairo)))
513 (native-inputs
514 (let ((test-data-input
515 (lambda (repository version hash)
516 (origin
517 (method url-fetch)
518 (uri (string-append "https://github.com/mapnik/" repository
519 "/archive/v" version ".tar.gz"))
520 (file-name (string-append "python-mapnik-" repository
521 "-" version ".tar.gz"))
522 (sha256 (base32 hash))))))
523 `(("python2-nose" ,python2-nose)
524 ;; Test data is released as separate tarballs
525 ("test-data"
526 ,(test-data-input "test-data" "3.0.18"
527 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
528 ("test-data-visual"
529 ,(test-data-input "test-data-visual" "3.0.18"
530 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
531 (arguments
532 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
533 #:phases
534 (modify-phases %standard-phases
535 ;; Unpack test data into the source tree
536 (add-after 'unpack 'unpack-submodules
537 (lambda* (#:key inputs #:allow-other-keys)
538 (let ((unpack (lambda (source target)
539 (with-directory-excursion target
540 (invoke "tar" "xvf" (assoc-ref inputs source)
541 "--strip-components=1")))))
542 (unpack "test-data" "test/data")
543 (unpack "test-data-visual" "test/data-visual"))))
544 ;; Skip failing tests
545 (add-after 'unpack 'skip-tests
546 (lambda _
547 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
548 "test_unicode_regex_replace"
549 "test_proj_antimeridian_bbox"
550 "test_render_with_scale_factor")))
551 (substitute* "setup.cfg"
552 (("\\[nosetests\\]" all)
553 (string-append all "\nexclude=^("
554 (string-join skipped-tests "|") ")$")))))))))
555 (home-page "https://github.com/mapnik/python-mapnik")
556 (synopsis "Python bindings for Mapnik")
557 (description "This package provides Python bindings for Mapnik.")
558 (license license:lgpl2.1+)))
559
560 (define-public spatialite-gui
561 (package
562 (name "spatialite-gui")
563 (version "1.7.1")
564 (source
565 (origin
566 (method url-fetch)
567 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
568 version ".tar.gz"))
569 (sha256
570 (base32
571 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
572 (build-system gnu-build-system)
573 (native-inputs
574 `(("pkg-config" ,pkg-config)))
575 (inputs
576 `(("freexl" ,freexl)
577 ("geos" ,geos)
578 ("libgaiagraphics" ,libgaiagraphics)
579 ("libjpeg-turbo" ,libjpeg-turbo)
580 ("libspatialite" ,libspatialite)
581 ("libxml2" ,libxml2)
582 ("proj.4" ,proj.4)
583 ("sqlite" ,sqlite)
584 ("wxwidgets" ,wxwidgets-2)
585 ("zlib" ,zlib)))
586 (arguments
587 `(#:phases (modify-phases %standard-phases
588 (add-after 'unpack 'fix-gui
589 (lambda _
590 ;; Fix for the GUI not showing up.
591 (substitute* "Main.cpp"
592 (("Hide\\(\\);") ""))
593 #t)))))
594 (synopsis "Graphical user interface for SpatiaLite")
595 (description "Spatialite-gui provides a visual interface for viewing and
596 maintaining a spatialite database. You can easily see the structure of the
597 tables and data contents using point and click functions, many of which
598 construct common SQL queries, or craft your own SQL queries.")
599 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
600 (license license:gpl3+)))
601
602 (define-public gdal
603 (package
604 (name "gdal")
605 (version "3.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 ("giflib" ,giflib)
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 #t))))))
1156 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1157 (synopsis "OSM map integration in Java")
1158 (description "JMapViewer is a Java component which easily
1159 integrates an OSM map view into your Java application. It is maintained as
1160 an independent project by the JOSM team.")
1161 (license license:gpl2)))
1162
1163 (define-public josm
1164 (package
1165 (name "josm")
1166 (version "15937")
1167 (source (origin
1168 (method svn-fetch)
1169 (uri (svn-reference
1170 (url "https://josm.openstreetmap.de/svn/trunk")
1171 (revision (string->number version))
1172 (recursive? #f)))
1173 (sha256
1174 (base32
1175 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
1176 (file-name (string-append name "-" version "-checkout"))
1177 (modules '((guix build utils)))
1178 (snippet
1179 '(begin
1180 (for-each delete-file (find-files "." ".*.jar$"))
1181 #t))))
1182 (build-system ant-build-system)
1183 (native-inputs
1184 `(("javacc" ,javacc)))
1185 (inputs
1186 `(("java-commons-jcs" ,java-commons-jcs)
1187 ("java-commons-compress" ,java-commons-compress)
1188 ("java-jmapviewer" ,java-jmapviewer)
1189 ("java-jsonp-api" ,java-jsonp-api)
1190 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1191 ("java-metadata-extractor" ,java-metadata-extractor)
1192 ("java-openjfx-media" ,java-openjfx-media)
1193 ("java-signpost-core" ,java-signpost-core)
1194 ("java-svg-salamander" ,java-svg-salamander)))
1195 (arguments
1196 `(#:tests? #f
1197 #:jar-name "josm.jar"
1198 #:phases
1199 (modify-phases %standard-phases
1200 (add-after 'unpack 'rm-build.xml
1201 (lambda* _
1202 (delete-file "build.xml")
1203 #t))
1204 (add-before 'build 'fix-revision
1205 (lambda* _
1206 (with-output-to-file "REVISION.XML"
1207 (lambda _
1208 (display
1209 (string-append "<info><entry><commit revision=\"" ,version "\">"
1210 "<date>1970-01-01 00:00:00 +0000</date>"
1211 "</commit></entry></info>"))))
1212 #t))
1213 (add-before 'build 'fix-classpath
1214 (lambda* (#:key inputs #:allow-other-keys)
1215 (setenv "CLASSPATH"
1216 (string-join
1217 (filter
1218 (lambda (s)
1219 (let ((source (assoc-ref inputs "source")))
1220 (not (equal? (substring s 0 (string-length source)) source))))
1221 (string-split (getenv "CLASSPATH") #\:))
1222 ":"))
1223 #t))
1224 (add-before 'build 'generate-parser
1225 (lambda* _
1226 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1227 (out (string-append dir "/parsergen"))
1228 (file (string-append dir "/MapCSSParser.jj")))
1229 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1230 (invoke "javacc" "-DEBUG_PARSER=false"
1231 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1232 "-GRAMMAR_ENCODING=UTF-8"
1233 (string-append "-OUTPUT_DIRECTORY=" out)
1234 file))
1235 #t))
1236 (add-after 'build 'generate-epsg
1237 (lambda _
1238 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1239 "-cp" "build/classes")
1240 (mkdir-p "data/projection")
1241 (with-output-to-file "data/projection/custom-epsg"
1242 (lambda _ (display "")))
1243 (invoke "java" "-cp" "build/classes:scripts:."
1244 "BuildProjectionDefinitions" ".")
1245 #t))
1246 (add-after 'generate-epsg 'copy-data
1247 (lambda _
1248 (mkdir-p "build/classes")
1249 (rename-file "data" "build/classes/data")
1250 #t))
1251 (add-before 'install 'regenerate-jar
1252 (lambda _
1253 ;; We need to regenerate the jar file to add data.
1254 (delete-file "build/jar/josm.jar")
1255 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1256 "build/classes" ".")
1257 #t))
1258 (add-before 'build 'copy-styles
1259 (lambda _
1260 (mkdir-p "build/classes")
1261 (rename-file "styles" "build/classes/styles")
1262 #t))
1263 (add-before 'build 'copy-images
1264 (lambda _
1265 (mkdir-p "build/classes")
1266 (rename-file "images" "build/classes/images")
1267 #t))
1268 (add-before 'build 'copy-revision
1269 (lambda _
1270 (mkdir-p "build/classes")
1271 (with-output-to-file "build/classes/REVISION"
1272 (lambda _
1273 (display
1274 (string-append "Revision: " ,version "\n"
1275 "Is-Local-Build: true\n"
1276 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1277 #t))
1278 (add-after 'install 'install-bin
1279 (lambda* (#:key outputs inputs #:allow-other-keys)
1280 (let* ((out (assoc-ref outputs "out"))
1281 (bin (string-append out "/bin")))
1282 (mkdir-p bin)
1283 (with-output-to-file (string-append bin "/josm")
1284 (lambda _
1285 (display
1286 (string-append "#!/bin/sh\n"
1287 (assoc-ref inputs "jdk") "/bin/java"
1288 " -cp " out "/share/java/josm.jar:"
1289 (getenv "CLASSPATH")
1290 " org.openstreetmap.josm.gui.MainApplication"))))
1291 (chmod (string-append bin "/josm") #o755))
1292 #t)))))
1293 (home-page "https://josm.openstreetmap.de")
1294 (synopsis "OSM editor")
1295 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1296 supports loading GPX tracks, background imagery and OSM data from local
1297 sources as well as from online sources and allows editing the OSM data (nodes,
1298 ways, and relations) and their metadata tags.")
1299 (license license:gpl2+)))
1300
1301 (define-public libmaxminddb
1302 (package
1303 (name "libmaxminddb")
1304 (version "1.4.2")
1305 (source
1306 (origin
1307 (method url-fetch)
1308 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1309 "/releases/download/" version "/"
1310 "/libmaxminddb-" version ".tar.gz"))
1311 (sha256
1312 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1313 (build-system gnu-build-system)
1314 (arguments
1315 `(#:phases
1316 (modify-phases %standard-phases
1317 (add-before 'configure 'set-cc-to-gcc
1318 (lambda _
1319 (setenv "CC" "gcc"))))))
1320 (native-inputs
1321 `(("perl" ,perl)))
1322 (home-page "https://maxmind.github.io/libmaxminddb/")
1323 (synopsis "C library for the MaxMind DB file format")
1324 (description "The libmaxminddb library provides a C library for reading
1325 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1326 format is a custom, but open, binary format designed to facilitate fast
1327 lookups of IP addresses while allowing flexibility in the type of data
1328 associated with an address.")
1329 (license license:asl2.0)))
1330
1331 (define-public python-maxminddb
1332 (package
1333 (name "python-maxminddb")
1334 (version "1.5.1")
1335 (source
1336 (origin
1337 (method url-fetch)
1338 (uri (pypi-uri "maxminddb" version))
1339 (sha256
1340 (base32
1341 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1342 (build-system python-build-system)
1343 (arguments
1344 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1345 (inputs
1346 `(("libmaxminddb" ,libmaxminddb)))
1347 (home-page "https://www.maxmind.com/")
1348 (synopsis "Reader for the MaxMind DB format")
1349 (description "MaxMind DB is a binary file format that stores data indexed
1350 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1351 MaxMind DB files.")
1352 (license license:asl2.0)))
1353
1354 (define-public python-geoip2
1355 (package
1356 (name "python-geoip2")
1357 (version "2.9.0")
1358 (source
1359 (origin
1360 (method url-fetch)
1361 (uri (pypi-uri "geoip2" version))
1362 (sha256
1363 (base32
1364 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1365 (build-system python-build-system)
1366 (arguments
1367 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1368 (inputs
1369 `(("python-maxminddb" ,python-maxminddb)
1370 ("python-requests" ,python-requests)))
1371 (home-page "https://www.maxmind.com/")
1372 (synopsis "MaxMind GeoIP2 API")
1373 (description "Provides an API for the GeoIP2 web services and databases.
1374 The API also works with MaxMind’s free GeoLite2 databases.")
1375 (license license:asl2.0)))
1376
1377 (define-public routino
1378 (package
1379 (name "routino")
1380 (version "3.3.2")
1381 (source
1382 (origin
1383 (method url-fetch)
1384 (uri (string-append "http://www.routino.org/download/routino-"
1385 version ".tgz"))
1386 (sha256
1387 (base32
1388 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1389 (build-system gnu-build-system)
1390 (native-inputs
1391 `(("perl" ,perl)))
1392 (inputs
1393 `(("bzip2" ,bzip2)
1394 ("xz" ,xz)
1395 ("zlib" ,zlib)))
1396 (arguments
1397 `(#:test-target "test"
1398 #:phases
1399 (modify-phases %standard-phases
1400 (replace 'configure
1401 (lambda* (#:key outputs #:allow-other-keys)
1402 (substitute* "Makefile.conf"
1403 (("prefix=/usr/local")
1404 (string-append "prefix=" (assoc-ref outputs "out")))
1405 (("LDFLAGS_LDSO=-Wl,-R\\.")
1406 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1407 (("#CFLAGS\\+=-DUSE_XZ")
1408 "CFLAGS+=-DUSE_XZ")
1409 (("#LDFLAGS\\+=-llzma")
1410 "LDFLAGS+=-llzma"))
1411 #t)))))
1412 (synopsis "Routing application for OpenStreetMap data")
1413 (description
1414 "Routino is an application for finding a route between two points
1415 using the dataset of topographical information collected by
1416 @url{https://www.OpenStreetMap.org}.")
1417 (home-page "https://www.routino.org/")
1418 (license license:agpl3+)))
1419
1420 (define-public qmapshack
1421 (package
1422 (name "qmapshack")
1423 (version "1.14.0")
1424 (source
1425 (origin
1426 (method git-fetch)
1427 (uri (git-reference
1428 (url "https://github.com/Maproom/qmapshack.git")
1429 (commit (string-append "V_" version))))
1430 (file-name (git-file-name name version))
1431 (sha256
1432 (base32
1433 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1434 (build-system qt-build-system)
1435 (native-inputs
1436 `(("pkg-config" ,pkg-config)
1437 ("qttools" ,qttools)))
1438 (inputs
1439 `(("gdal" ,gdal)
1440 ("libjpeg-turbo" ,libjpeg-turbo)
1441 ("proj" ,proj)
1442 ("qtbase" ,qtbase)
1443 ("qtdeclarative" ,qtdeclarative)
1444 ("qtlocation" ,qtlocation)
1445 ("qtwebchannel" ,qtwebchannel)
1446 ("qtwebengine" ,qtwebengine)
1447 ("quazip" ,quazip)
1448 ("routino" ,routino)
1449 ("sqlite" ,sqlite) ; See wrap phase
1450 ("zlib" ,zlib)))
1451 (arguments
1452 `(#:tests? #f
1453 #:phases
1454 (modify-phases %standard-phases
1455 (add-after 'unpack 'fix-cmake-modules
1456 (lambda* (#:key inputs #:allow-other-keys)
1457 (substitute* "CMakeLists.txt"
1458 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1459 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1460 (substitute* "cmake/Modules/FindROUTINO.cmake"
1461 (("/usr/local")
1462 (assoc-ref inputs "routino")))
1463 ;; The following fixes are included as patches in the sources
1464 ;; of QMapShack, but they are not applied by default, for
1465 ;; some reason...
1466 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1467 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1468 #t))
1469 (add-after 'install 'wrap
1470 ;; The program fails to find the QtWebEngineProcess program,
1471 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1472 (lambda* (#:key inputs outputs #:allow-other-keys)
1473 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1474 (qtwebengineprocess (string-append
1475 (assoc-ref inputs "qtwebengine")
1476 "/lib/qt5/libexec/QtWebEngineProcess")))
1477 (for-each (lambda (program)
1478 (wrap-program program
1479 `("QTWEBENGINEPROCESS_PATH" =
1480 (,qtwebengineprocess))))
1481 (find-files bin ".*")))
1482 #t)))))
1483 (synopsis "GPS mapping application")
1484 (description
1485 "QMapShack can be used to plan your next outdoor trip or to visualize and
1486 archive all the GPS recordings of your past trips. It is the successor of the
1487 QLandkarte GT application.")
1488 (home-page "https://github.com/Maproom/qmapshack/wiki")
1489 (license license:gpl3+)))
1490
1491 (define-public readosm
1492 (package
1493 (name "readosm")
1494 (version "1.1.0")
1495 (source
1496 (origin
1497 (method url-fetch)
1498 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1499 "readosm-" version ".tar.gz"))
1500 (sha256
1501 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1502 (build-system gnu-build-system)
1503 (inputs
1504 `(("expat" ,expat)
1505 ("zlib" ,zlib)))
1506 (synopsis "Data extractor for OpenStreetMap files")
1507 (description
1508 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1509 input file (in @code{.osm} or @code{.osm.pbf} format).")
1510 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1511 (license (list license:gpl2+
1512 license:lgpl2.1+
1513 license:mpl1.1))))
1514
1515 (define-public spatialite-tools
1516 (package
1517 (name "spatialite-tools")
1518 (version "4.3.0")
1519 (source
1520 (origin
1521 (method url-fetch)
1522 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1523 "spatialite-tools-" version ".tar.gz"))
1524 (sha256
1525 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1526 (build-system gnu-build-system)
1527 (native-inputs
1528 `(("pkg-config" ,pkg-config)))
1529 (inputs
1530 `(("expat" ,expat)
1531 ("freexl" ,freexl)
1532 ("geos" ,geos)
1533 ("libspatialite" ,libspatialite)
1534 ("libxml2" ,libxml2)
1535 ("proj.4" ,proj.4)
1536 ("readosm" ,readosm)
1537 ("sqlite" ,sqlite)
1538 ("zlib" ,zlib)))
1539 (synopsis "Collection of command line tools for SpatiaLite")
1540 (description
1541 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1542 tools supporting SpatiaLite.")
1543 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1544 (license license:gpl3+)))
1545
1546 (define-public virtualpg
1547 (package
1548 (name "virtualpg")
1549 (version "1.0.2")
1550 (source
1551 (origin
1552 (method url-fetch)
1553 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1554 "virtualpg-" version ".tar.gz"))
1555 (sha256
1556 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1557 (build-system gnu-build-system)
1558 (inputs
1559 `(("postgresql" ,postgresql)
1560 ("sqlite" ,sqlite)))
1561 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1562 (description
1563 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1564 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1565 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1566 exchanged form one Spatial DBMS and the other.")
1567 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1568 (license (list license:gpl2+
1569 license:lgpl2.1+
1570 license:mpl1.1))))
1571
1572 (define-public opencpn
1573 (package
1574 (name "opencpn")
1575 (version "5.0.0")
1576 (source
1577 (origin
1578 (method git-fetch)
1579 (uri (git-reference
1580 (url "https://github.com/OpenCPN/OpenCPN.git")
1581 (commit (string-append "v" version))))
1582 (file-name (git-file-name name version))
1583 (sha256
1584 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1585 (build-system cmake-build-system)
1586 (native-inputs
1587 `(("gettext" ,gettext-minimal)
1588 ("pkg-config" ,pkg-config)))
1589 (inputs
1590 `(("bzip2" ,bzip2)
1591 ("cairo" ,cairo)
1592 ("curl" ,curl)
1593 ("glu" ,glu)
1594 ("gtk+" ,gtk+)
1595 ("libarchive" ,libarchive)
1596 ("libelf" ,libelf)
1597 ("libexif" ,libexif)
1598 ("libsndfile" ,libsndfile)
1599 ("lz4" ,lz4)
1600 ("mesa" ,mesa)
1601 ("pango" ,pango)
1602 ("portaudio" ,portaudio)
1603 ("sqlite" ,sqlite)
1604 ("tinyxml" ,tinyxml)
1605 ("wxsvg" ,wxsvg)
1606 ("wxwidgets" ,wxwidgets)
1607 ("xz" ,xz)
1608 ("zlib" ,zlib)))
1609 (arguments
1610 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1611 "-DENABLE_SNDFILE=ON"
1612 "-DBUNDLE_TCDATA=ON"
1613 "-DBUNDLE_GSHHS=CRUDE")
1614 #:tests? #f ; No tests defined
1615 #:phases
1616 (modify-phases %standard-phases
1617 (add-after 'unpack 'fix-build
1618 (lambda _
1619 (substitute* "CMakeLists.txt"
1620 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1621 (string-append all " --libs all")))
1622 #t)))))
1623 (synopsis "Chart plotter and marine GPS navigation software")
1624 (description
1625 "OpenCPN is a chart plotter and marine navigation software designed to be
1626 used at the helm station of your boat while underway. Chart a course and
1627 track your position right from your laptop.")
1628 (home-page "https://opencpn.org/")
1629 (license (list license:asl2.0
1630 license:cc0
1631 license:bsd-2
1632 license:bsd-3
1633 license:expat
1634 license:gpl3+
1635 license:lgpl2.1+
1636 license:lgpl3+
1637 license:sgifreeb2.0
1638 license:zlib))))
1639
1640 (define-public grass
1641 (let* ((version "7.8.2")
1642 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1643 (grassxx (string-append "grass" majorminor)))
1644 (package
1645 (name "grass")
1646 (version version)
1647 (source
1648 (origin
1649 (method url-fetch)
1650 (uri (string-append "https://grass.osgeo.org/" grassxx
1651 "/source/grass-" version ".tar.gz"))
1652 (sha256
1653 (base32 "1fwsm99kz0bxvjk7442qq1h45ikrmhba8bqclafb61gqg1q6ymrk"))))
1654 (build-system gnu-build-system)
1655 (inputs
1656 `(("bzip2", bzip2)
1657 ("cairo" ,cairo)
1658 ("fftw" ,fftw)
1659 ("freetype" ,freetype)
1660 ("gdal" ,gdal)
1661 ("geos" ,geos)
1662 ("glu" ,glu)
1663 ("lapack" ,lapack)
1664 ("libpng" ,libpng)
1665 ("libtiff" ,libtiff)
1666 ("mesa" ,mesa)
1667 ("mariadb-dev" ,mariadb "dev")
1668 ("mariadb-lib" ,mariadb "lib")
1669 ("netcdf" ,netcdf)
1670 ("openblas" ,openblas)
1671 ("perl" ,perl)
1672 ("postgresql" ,postgresql)
1673 ("proj.4" ,proj.4)
1674 ("python" ,python)
1675 ("python-dateutil" ,python-dateutil)
1676 ("python-numpy" ,python-numpy)
1677 ("python-wxpython" ,python-wxpython)
1678 ("readline" ,readline)
1679 ("sqlite" ,sqlite)
1680 ("wxwidgets" ,wxwidgets)
1681 ("zlib" ,zlib)
1682 ("zstd" ,zstd "lib")))
1683 (native-inputs
1684 `(("bash" ,bash-minimal)
1685 ("bison" ,bison)
1686 ("flex" ,flex)
1687 ("pkg-config" ,pkg-config)))
1688 (arguments
1689 `(#:tests? #f ; No tests
1690 #:modules ((guix build gnu-build-system)
1691 ((guix build python-build-system) #:prefix python:)
1692 (guix build utils))
1693 #:imported-modules (,@%gnu-build-system-modules
1694 (guix build python-build-system))
1695 #:phases
1696 (modify-phases %standard-phases
1697 (replace 'configure
1698 (lambda* (#:key inputs outputs #:allow-other-keys)
1699 (let ((shell (string-append (assoc-ref inputs "bash")
1700 "/bin/bash")))
1701 (setenv "SHELL" shell)
1702 (setenv "CONFIG_SHELL" shell)
1703 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1704 (assoc-ref outputs "out")
1705 "/" ,grassxx "/lib")))
1706 (invoke "./configure"
1707 (string-append "--prefix="
1708 (assoc-ref outputs "out"))
1709 "--with-blas"
1710 "--with-bzlib"
1711 (string-append "--with-freetype-includes="
1712 (assoc-ref inputs "freetype")
1713 "/include/freetype2")
1714 (string-append "--with-freetype-libs="
1715 (assoc-ref inputs "freetype")
1716 "/lib")
1717 "--with-geos"
1718 "--with-lapack"
1719 "--with-mysql"
1720 (string-append "--with-mysql-includes="
1721 (assoc-ref inputs "mariadb-dev")
1722 "/include/mysql")
1723 (string-append "--with-mysql-libs="
1724 (assoc-ref inputs "mariadb-lib")
1725 "/lib")
1726 "--with-netcdf"
1727 "--with-postgres"
1728 (string-append "--with-proj-share="
1729 (assoc-ref inputs "proj.4")
1730 "/share/proj")
1731 "--with-pthread"
1732 "--with-readline"
1733 "--with-sqlite"
1734 "--with-wxwidgets")))
1735 (add-after 'install 'install-links
1736 (lambda* (#:key outputs #:allow-other-keys)
1737 ;; Put links for includes and libraries in the standard places.
1738 (let* ((out (assoc-ref outputs "out"))
1739 (dir (string-append out "/" ,grassxx)))
1740 (symlink (string-append dir "/include")
1741 (string-append out "/include"))
1742 (symlink (string-append dir "/lib")
1743 (string-append out "/lib")))
1744 #t))
1745 (add-after 'install-links 'wrap-python
1746 (assoc-ref python:%standard-phases 'wrap)))))
1747 (synopsis "GRASS Geographic Information System")
1748 (description
1749 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1750 Information System (GIS) software suite used for geospatial data management and
1751 analysis, image processing, graphics and maps production, spatial modeling, and
1752 visualization.")
1753 (home-page "https://grass.osgeo.org/")
1754 (license license:gpl2+))))
1755
1756 (define-public saga
1757 (package
1758 (name "saga")
1759 (version "7.6.2")
1760 (source
1761 (origin
1762 (method url-fetch)
1763 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1764 (version-major version) "/SAGA%20-%20" version
1765 "/saga-" version ".tar.gz"))
1766 (sha256
1767 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1768 (build-system gnu-build-system)
1769 (native-inputs
1770 `(("pkg-config" ,pkg-config)
1771 ("swig" ,swig)))
1772 (inputs
1773 `(("curl" ,curl)
1774 ("fftw" ,fftw)
1775 ("gdal" ,gdal)
1776 ("hdf5" ,hdf5)
1777 ("jasper" ,jasper)
1778 ("libharu" ,libharu)
1779 ("libtiff" ,libtiff)
1780 ("opencv" ,opencv)
1781 ("postgresql" ,postgresql)
1782 ("proj.4" ,proj.4)
1783 ("python" ,python)
1784 ("qhull" ,qhull)
1785 ("unixodbc" ,unixodbc)
1786 ("vigra" ,vigra)
1787 ("wxwidgets" ,wxwidgets)))
1788 (arguments
1789 '(#:configure-flags '("--enable-python")))
1790 (synopsis "System for Automated Geoscientific Analyses")
1791 (description
1792 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1793 Information System (GIS) software. It has been designed for an easy and
1794 effective implementation of spatial algorithms and it offers a comprehensive,
1795 growing set of geoscientific methods.")
1796 (home-page "http://www.saga-gis.org")
1797 (license (list license:gpl2+ license:lgpl2.1+))))
1798
1799 (define-public qgis
1800 (package
1801 (name "qgis")
1802 (version "3.12.1")
1803 (source
1804 (origin
1805 (method url-fetch)
1806 (uri (string-append "https://qgis.org/downloads/qgis-"
1807 version ".tar.bz2"))
1808 (sha256
1809 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1810 (build-system cmake-build-system)
1811 (arguments
1812 `(#:modules ((guix build cmake-build-system)
1813 ((guix build python-build-system) #:prefix python:)
1814 (guix build qt-utils)
1815 (guix build utils))
1816 #:imported-modules (,@%cmake-build-system-modules
1817 (guix build python-build-system)
1818 (guix build qt-utils))
1819 #:phases
1820 (modify-phases %standard-phases
1821 ;; Configure correct path to PyQt5 SIP directory
1822 (add-after 'unpack 'configure-pyqt5-sip-path
1823 (lambda* (#:key inputs #:allow-other-keys)
1824 (substitute* "cmake/FindPyQt5.cmake"
1825 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
1826 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
1827 "/share/sip\" PYQT5_SIP_DIR")))
1828 (substitute* (list "scripts/prepare-commit.sh"
1829 "scripts/runtests-local-travis-config.sh"
1830 "scripts/sip_include.sh"
1831 "scripts/sipdiff"
1832 "scripts/sipify_all.sh"
1833 "scripts/spell_check/check_spelling.sh"
1834 "scripts/spell_check/spell_test.sh"
1835 "scripts/verify-indentation.sh"
1836 "tests/code_layout/test_banned_keywords.sh"
1837 "tests/code_layout/test_licenses.sh"
1838 "tests/code_layout/test_shellcheck.sh"
1839 "tests/code_layout/test_sip_include.sh"
1840 "tests/code_layout/test_sipfiles_uptodate.sh"
1841 "tests/code_layout/test_sipify.sh")
1842 (("\\$\\(git rev-parse --show-toplevel\\)")
1843 (getcwd)))
1844 (substitute* "tests/code_layout/test_sip_include.sh"
1845 (("^REV=.*") "REV=currentrev\n"))
1846 #t))
1847 (replace 'check
1848 (lambda* (#:key inputs #:allow-other-keys)
1849 (setenv "HOME" "/tmp")
1850 (system (string-append (assoc-ref inputs "xorg-server")
1851 "/bin/Xvfb :1 &"))
1852 (setenv "DISPLAY" ":1")
1853 (setenv "TRAVIS" "true")
1854 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
1855 (invoke "ctest"
1856 "-E" (string-join
1857 '(;; Disable tests that require network access
1858 "qgis_filedownloader"
1859 ;; TODO: Find why the following tests fail
1860 "ProcessingQgisAlgorithmsTestPt1"
1861 "ProcessingQgisAlgorithmsTestPt3"
1862 "ProcessingQgisAlgorithmsTestPt4"
1863 "ProcessingGdalAlgorithmsRasterTest"
1864 "ProcessingGdalAlgorithmsVectorTest"
1865 "ProcessingGrass7AlgorithmsImageryTest"
1866 "ProcessingGrass7AlgorithmsRasterTest"
1867 "ProcessingGrass7AlgorithmsVectorTest"
1868 "ProcessingOtbAlgorithmsTest"
1869 "qgis_authmanagertest"
1870 "qgis_compositionconvertertest"
1871 "qgis_coordinatereferencesystemtest"
1872 "qgis_geometrytest"
1873 "qgis_layouthtmltest"
1874 "qgis_layoutmaptest"
1875 "qgis_painteffecttest"
1876 "qgis_pallabelingtest"
1877 "qgis_svgmarkertest"
1878 "qgis_taskmanagertest"
1879 "qgis_ziplayertest"
1880 "qgis_processingtest"
1881 "qgis_wcsprovidertest"
1882 "qgis_arcgisrestutilstest"
1883 "qgis_grassprovidertest7"
1884 "qgis_gpsinformationwidget"
1885 "PyCoreAdittions"
1886 "PyQgsPythonProvider"
1887 "PyQgsAnnotation"
1888 "PyQgsAuthenticationSystem"
1889 "PyQgsProject"
1890 "PyQgsFileUtils"
1891 "PyQgsGeometryTest"
1892 "PyQgsImageCache"
1893 "PyQgsLayoutExporter"
1894 "PyQgsLayoutLegend"
1895 "PyQgsMapLayer"
1896 "PyQgsOGRProviderGpkg"
1897 "PyQgsPalLabelingLayout"
1898 "PyQgsImportIntoPostGIS"
1899 "PyQgsProviderConnectionPostgres"
1900 "PyQgsProviderConnectionGpkg"
1901 "PyQgsShapefileProvider"
1902 "PyQgsSvgCache"
1903 "PyQgsTextRenderer"
1904 "PyQgsOGRProvider"
1905 "PyQgsSpatialiteProvider"
1906 "PyQgsVectorFileWriter"
1907 "PyQgsVectorLayer"
1908 "PyQgsVectorLayerUtils"
1909 "PyQgsVirtualLayerProvider"
1910 "PyQgsWFSProvider"
1911 "PyQgsOapifProvider"
1912 "PyQgsLayerDependencies"
1913 "PyQgsDBManagerGpkg"
1914 "PyQgsDBManagerSpatialite"
1915 "PyQgsSettings"
1916 "PyQgsAuxiliaryStorage"
1917 "PyQgsSelectiveMasking"
1918 "PyQgsAppStartup"
1919 "qgis_geometrycheckstest"
1920 "qgis_shellcheck"
1921 "qgis_sipify"
1922 "qgis_sip_include"
1923 "qgis_sip_uptodate")
1924 "|"))))
1925 (add-after 'install 'wrap-python
1926 (assoc-ref python:%standard-phases 'wrap))
1927 (add-after 'wrap-python 'wrap-qt
1928 (lambda* (#:key outputs #:allow-other-keys)
1929 (wrap-qt-program (assoc-ref outputs "out") "qgis")
1930 #t))
1931 (add-after 'wrap-qt 'wrap-gis
1932 (lambda* (#:key inputs outputs #:allow-other-keys)
1933 (let* ((out (assoc-ref outputs "out"))
1934 (saga (string-append (assoc-ref inputs "saga") "/bin"))
1935 (grass-version ,(package-version grass))
1936 (grass-majorminor (string-join
1937 (list-head
1938 (string-split grass-version #\.) 2)
1939 ""))
1940 (grass (string-append (assoc-ref inputs "grass")
1941 "/grass" grass-majorminor)))
1942 (wrap-program (string-append out "/bin/qgis")
1943 `("PATH" ":" prefix (,saga))
1944 `("QGIS_PREFIX_PATH" = (,out))
1945 `("GISBASE" = (,grass))))
1946 #t)))))
1947 (inputs
1948 `(("exiv2" ,exiv2)
1949 ("expat" ,expat)
1950 ("gdal" ,gdal)
1951 ("geos" ,geos)
1952 ("gpsbabel" ,gpsbabel)
1953 ("grass" ,grass)
1954 ("gsl" ,gsl)
1955 ("hdf5" ,hdf5)
1956 ("libspatialindex" ,libspatialindex)
1957 ("libspatialite" ,libspatialite)
1958 ("libxml2" ,libxml2)
1959 ("libzip" ,libzip)
1960 ("netcdf" ,netcdf)
1961 ("postgresql" ,postgresql)
1962 ("proj" ,proj)
1963 ("python" ,python)
1964 ("python-chardet" ,python-chardet)
1965 ("python-dateutil" ,python-dateutil)
1966 ("python-gdal" ,python-gdal)
1967 ("python-jinja2" ,python-jinja2)
1968 ("python-numpy" ,python-numpy)
1969 ("python-owslib" ,python-owslib)
1970 ("python-psycopg2" ,python-psycopg2)
1971 ("python-pygments" ,python-pygments)
1972 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
1973 ("python-pytz" ,python-pytz)
1974 ("python-pyyaml" ,python-pyyaml)
1975 ("python-requests" ,python-requests)
1976 ("python-sip" ,python-sip)
1977 ("python-six" ,python-six)
1978 ("python-urllib3" ,python-urllib3)
1979 ("qca" ,qca)
1980 ("qscintilla" ,qscintilla)
1981 ("qtbase" ,qtbase)
1982 ("qtdeclarative" ,qtdeclarative)
1983 ("qtkeychain" ,qtkeychain)
1984 ("qtlocation" ,qtlocation)
1985 ("qtserialport" ,qtserialport)
1986 ("qtsvg" ,qtsvg)
1987 ("qtwebkit" ,qtwebkit)
1988 ("qwt" ,qwt)
1989 ("saga" ,saga)
1990 ("sqlite" ,sqlite)))
1991 (native-inputs
1992 `(("bison" ,bison)
1993 ("flex" ,flex)
1994 ("perl" ,perl)
1995 ("perl-yaml-tiny" ,perl-yaml-tiny)
1996 ("pkg-config" ,pkg-config)
1997 ("python-mock" ,python-mock)
1998 ("python-nose2" ,python-nose2)
1999 ("qttools" ,qttools)
2000 ("shellcheck" ,shellcheck)
2001 ("xorg-server" ,xorg-server-for-tests)))
2002 (home-page "https://qgis.org")
2003 (synopsis "Geographical information system")
2004 (description "QGIS is an easy to use Geographical Information
2005 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2006 raster and vector data formats, with new support easily added using the plugin
2007 architecture.")
2008 (license
2009 (list
2010 license:asl1.1
2011 license:asl2.0
2012 license:bsd-2
2013 license:bsd-3
2014 license:boost1.0
2015 license:cc-by3.0
2016 license:cc-by4.0
2017 license:cc-by-sa3.0
2018 license:cc-by-sa4.0
2019 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2020 (license:fsf-free "file://debian/copyright" "Go Squared")
2021 license:expat
2022 license:fdl1.2+
2023 (license:fsf-free
2024 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2025 (license:fsf-free
2026 "file://debian/copyright"
2027 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2028 license:gpl2
2029 license:gpl2+
2030 license:gpl3
2031 license:gpl3+
2032 license:isc
2033 license:lgpl2.0+
2034 license:lgpl2.1
2035 license:lgpl2.1+
2036 license:lgpl3
2037 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2038 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2039 (license:non-copyleft
2040 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2041 "NCL Source Code License")
2042 license:ogl-psi1.0
2043 license:opl1.0+
2044 license:public-domain
2045 license:qwt1.0))))