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, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019, 2020 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
16 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages geo)
34 #:use-module (guix build-system ant)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system glib-or-gtk)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system go)
39 #:use-module (guix build-system meson)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system qt)
42 #:use-module (guix build-system scons)
43 #:use-module (guix build-system r)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix svn-download)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (guix packages)
49 #:use-module (guix utils)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages algebra)
52 #:use-module (gnu packages astronomy)
53 #:use-module (gnu packages audio)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages backup)
56 #:use-module (gnu packages bash)
57 #:use-module (gnu packages bison)
58 #:use-module (gnu packages boost)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages curl)
62 #:use-module (gnu packages databases)
63 #:use-module (gnu packages datastructures)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages documentation)
66 #:use-module (gnu packages elf)
67 #:use-module (gnu packages flex)
68 #:use-module (gnu packages fonts)
69 #:use-module (gnu packages fontutils)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages gl)
72 #:use-module (gnu packages glib)
73 #:use-module (gnu packages gnome)
74 #:use-module (gnu packages gps)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages haskell-apps)
77 #:use-module (gnu packages image)
78 #:use-module (gnu packages image-processing)
79 #:use-module (gnu packages icu4c)
80 #:use-module (gnu packages java)
81 #:use-module (gnu packages kde)
82 #:use-module (gnu packages lua)
83 #:use-module (gnu packages maths)
84 #:use-module (gnu packages pcre)
85 #:use-module (gnu packages pdf)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages photo)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages protobuf)
90 #:use-module (gnu packages pulseaudio)
91 #:use-module (gnu packages python)
92 #:use-module (gnu packages python-check)
93 #:use-module (gnu packages python-web)
94 #:use-module (gnu packages python-xyz)
95 #:use-module (gnu packages qt)
96 #:use-module (gnu packages readline)
97 #:use-module (gnu packages swig)
98 #:use-module (gnu packages sqlite)
99 #:use-module (gnu packages textutils)
100 #:use-module (gnu packages time)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages webkit)
103 #:use-module (gnu packages wxwidgets)
104 #:use-module (gnu packages xml)
105 #:use-module (gnu packages xorg))
107 (define-public memphis
116 (url "https://github.com/jiuka/memphis")
118 (file-name (git-file-name name version))
120 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
121 (build-system glib-or-gtk-build-system)
122 (outputs '("out" "doc"))
129 (string-append "--with-html-dir="
130 (assoc-ref %outputs "doc")
131 "/share/gtk-doc/html"))
133 (modify-phases %standard-phases
134 (add-after 'unpack 'patch-autogen
136 (substitute* "autogen.sh"
137 (("\\./configure \"\\$@\"")
140 (add-after 'patch-autogen 'patch-docbook-xml
141 (lambda* (#:key inputs #:allow-other-keys)
142 (with-directory-excursion "docs/reference"
143 (substitute* "libmemphis-docs.sgml"
144 (("http://www.oasis-open.org/docbook/xml/4.3/")
145 (string-append (assoc-ref inputs "docbook-xml")
146 "/xml/dtd/docbook/"))))
149 `(("autoconf" ,autoconf)
150 ("automake" ,automake)
151 ("docbook-xml" ,docbook-xml-4.3)
152 ("gobject-introspection" ,gobject-introspection)
155 ("pkg-config" ,pkg-config)
156 ("python" ,python-wrapper)
164 (synopsis "Map-rendering for OpenSteetMap")
165 (description "Memphis is a map-rendering application and a library for
166 OpenStreetMap written in C using eXpat, Cairo and GLib.")
167 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
168 (license license:lgpl2.1+)))
176 (uri (string-append "http://download.osgeo.org/geos/geos-"
181 "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
182 (build-system gnu-build-system)
183 (arguments `(#:phases
184 (modify-phases %standard-phases
186 'unpack 'patch-test-shebangs
188 (substitute* '("tests/xmltester/testrunner.sh"
189 "tests/geostest/testrunner.sh")
190 (("/bin/sh") (which "sh")))
194 (home-page "https://geos.osgeo.org/")
195 (synopsis "Geometry Engine for Geographic Information Systems")
197 "GEOS provides a spatial object model and fundamental geometric
198 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
199 it aims to contain the complete functionality of JTS in C++. This
200 includes all the OpenGIS Simple Features for SQL spatial predicate
201 functions and spatial operators, as well as specific JTS enhanced
202 topology functions.")
203 (license (list license:lgpl2.1+ ; Main distribution.
204 license:zlib ; tests/xmltester/tinyxml/*
205 license:public-domain)))) ; include/geos/timeval.h
207 (define-public gnome-maps
213 (uri (string-append "mirror://gnome/sources/" name "/"
214 (version-major+minor version) "/"
215 name "-" version ".tar.xz"))
218 "00xslcnhhwslqglgfv2im7vq3awa49y2jxzr8wsby7f713k28vf5"))))
219 (build-system meson-build-system)
223 (modify-phases %standard-phases
224 (add-after 'unpack 'skip-gtk-update-icon-cache
225 ;; Don't create 'icon-theme.cache'.
227 (substitute* "meson_post_install.py"
228 (("gtk-update-icon-cache") "true"))
230 (add-after 'install 'wrap
231 (lambda* (#:key inputs outputs #:allow-other-keys)
232 (let ((out (assoc-ref outputs "out"))
233 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
234 (geocode-glib-path (string-append
235 (assoc-ref inputs "geocode-glib")
237 (goa-path (string-append
238 (assoc-ref inputs "gnome-online-accounts:lib")
240 (gdk-pixbuf-path (string-append
241 (assoc-ref inputs "gdk-pixbuf")
243 (webkitgtk-path (string-append
244 (assoc-ref inputs "webkitgtk")
246 (wrap-program (string-append out "/bin/gnome-maps")
247 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
249 ;; There seems to be no way to embed the path of
250 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
251 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
252 ;; libgeocode-glib.so.0
253 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
256 ,geocode-glib-path)))
259 `(("gettext" ,gettext-minimal)
260 ("gobject-introspection" ,gobject-introspection)
261 ("pkg-config" ,pkg-config)))
263 `(("evolution-data-server" ,evolution-data-server)
265 ("libchamplain" ,libchamplain)
267 ("libsecret" ,libsecret)
269 ("libgweather" ,libgweather)
271 ("gdk-pixbuf" ,gdk-pixbuf+svg)
272 ("glib-networking" ,glib-networking)
274 ("geocode-glib" ,geocode-glib)
275 ("gfbgraph" ,gfbgraph)
278 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
279 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
282 ("webkitgtk" ,webkitgtk)))
283 (synopsis "Graphical map viewer and wayfinding program")
284 (description "GNOME Maps is a graphical map viewer. It uses map data from
285 the OpenStreetMap project. It can provide directions for walking, bicycling,
287 (home-page "https://wiki.gnome.org/Apps/Maps")
288 (license license:gpl2+)))
290 (define-public libgaiagraphics
292 (name "libgaiagraphics")
297 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
301 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
302 (build-system gnu-build-system)
304 `(("pkg-config" ,pkg-config)))
308 ("libjpeg-turbo" ,libjpeg-turbo)
310 ("libgeotiff" ,libgeotiff)
314 (synopsis "Gaia common graphics support")
315 (description "libgaiagraphics is a library supporting
316 common-utility raster handling methods.")
317 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
318 (license license:lgpl3+)))
320 (define-public libgeotiff
327 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
329 (patches (search-patches
330 ;; See libgeotiff 1.5.1 issue
331 ;; https://github.com/OSGeo/libgeotiff/issues/22
332 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
334 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
335 (modules '((guix build utils)))
338 ;; Remove .csv files, distributed from EPSG under a restricted
339 ;; license. See LICENSE for full license text.
340 (for-each delete-file (find-files "." "\\.csv$"))
342 (build-system gnu-build-system)
344 `(("libjpeg-turbo" ,libjpeg-turbo)
348 `(;; libgeotiff headers include proj headers, so ensure those are available.
352 (list "--disable-static"
353 "--with-zlib" "--with-jpeg"
354 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
355 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
356 (description "libgeotiff is a library on top of libtiff for reading and
357 writing GeoTIFF information tags.")
358 (home-page "https://trac.osgeo.org/geotiff/")
359 ;; This is a mixture of various contributions under different licenses.
360 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
361 ;; states, as its commercial redistribution is restricted. Hence, we have
362 ;; removed it from the package.
363 (license (list license:public-domain
366 (license:non-copyleft "file://LICENSE"
367 "See LICENSE in the distribution.")))))
369 (define-public librttopo
377 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
378 (commit (string-append "librttopo-" version))))
379 (file-name (git-file-name name version))
381 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
382 (build-system gnu-build-system)
385 (modify-phases %standard-phases
386 (add-after 'unpack 'patch-autogen
388 (let ((autoconf (which "autoconf"))
389 (autoheader (which "autoheader"))
390 (aclocal (which "aclocal"))
391 (automake (which "automake"))
392 (libtoolize (which "libtoolize")))
393 (substitute* "autogen.sh"
394 (("`which autoconf 2>/dev/null`") autoconf)
395 (("`which autoheader 2>/dev/null`") autoheader)
397 (string-append "ACLOCAL=" aclocal "\n"))
399 (string-append "AUTOMAKE=" automake "\n"))
401 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
404 `(("autoconf" ,autoconf)
405 ("automake" ,automake)
407 ("pkg-config" ,pkg-config)))
410 (synopsis "Library to handle SQL/MM topologies")
412 "The RT Topology Library exposes an API to create and manage standard
413 (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
414 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
415 (license license:gpl2+)))
417 (define-public libspatialite
419 (name "libspatialite")
424 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
428 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
429 (build-system gnu-build-system)
431 `(("pkg-config" ,pkg-config)))
441 (modify-phases %standard-phases
442 ;; 3 tests are failing, ignore them:
443 (add-after 'unpack 'ignore-broken-tests
445 (substitute* '("test/Makefile.in")
446 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
447 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
448 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
450 (synopsis "Extend SQLite to support Spatial SQL capabilities")
452 "SpatiaLite is a library intended to extend the SQLite core to support
453 fully fledged Spatial SQL capabilities.")
454 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
455 ;; For the genuine libspatialite-sources holds:
456 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
457 ;; Files under src/control_points are from GRASS
458 ;; and are licensed under GPL2+ only.
459 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
460 (license (list license:gpl2+
463 license:public-domain))))
472 (uri (string-append "http://download.osgeo.org/proj/proj-"
476 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
477 (build-system gnu-build-system)
479 `(("sqlite" ,sqlite)))
481 `(("pkg-config" ,pkg-config)))
482 (home-page "https://proj.org/")
483 (synopsis "Coordinate transformation software")
485 "Proj is a generic coordinate transformation software that transforms
486 geospatial coordinates from one coordinate reference system (CRS) to another.
487 This includes cartographic projections as well as geodetic transformations.
488 PROJ includes command line applications for easy conversion of coordinates
489 from text files or directly from user input. In addition, proj also exposes
490 an application programming interface that lets developers use the
491 functionality of proj in their own software.")
492 (license (list license:expat
493 ;; src/projections/patterson.cpp
495 ;; src/geodesic.*, src/tests/geodtest.cpp
498 (define-public proj.4
504 (uri (string-append "http://download.osgeo.org/proj/proj-"
508 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
509 (build-system gnu-build-system)
512 (modify-phases %standard-phases
513 (add-after 'unpack 'patch-test-paths
515 (substitute* '("nad/test27"
521 (("/bin/rm") (which "rm")))
523 ;; Precision problems on i686 and other platforms. See:
524 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
525 ;; Disable failing test.
526 (add-after 'patch-test-paths 'ignore-failing-tests
528 (substitute* '("nad/Makefile.in")
529 (("\tPROJ_LIB.*" all) (string-append "#" all)))
533 (home-page "https://proj.org/")
534 (synopsis "Cartographic Projections Library")
536 "Proj.4 is a library for converting coordinates between cartographic
538 (license (list license:expat
539 ;; src/PJ_patterson.c
543 ;; Embedded EPSG database.
544 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
548 (define-public mapnik
555 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
556 version "/mapnik-v" version ".tar.bz2"))
559 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
560 (build-system scons-build-system)
564 ("freetype" ,freetype)
565 ("harfbuzz" ,harfbuzz)
567 ("libjpeg-turbo" ,libjpeg-turbo)
576 `(("pkg-config" ,pkg-config)))
578 `(#:scons ,scons-python2
581 (string-append "PREFIX=" %output)
582 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
583 (home-page "https://mapnik.org/")
584 (synopsis "Toolkit for developing mapping applications")
585 (description "Mapnik is a toolkit for developing mapping applications. It
586 is basically a collection of geographic objects like maps, layers,
587 datasources, features, and geometries. At its core is a C++ shared library
588 providing algorithms and patterns for spatial data access and visualization.
589 The library does not rely on any specific windowing system and can be deployed
590 to any server environment. It is intended to play fair in a multi-threaded
591 environment and is aimed primarily, but not exclusively, at web-based
593 (license (list license:lgpl2.1+
594 ;; demo/viewer, demo/python/rundemo.py
596 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
598 ;; deps/mapnik/sparsehash
601 (license:non-copyleft "file://deps/agg/copying")))))
603 (define-public python2-mapnik
605 (name "python2-mapnik")
610 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
612 (file-name (string-append name "-" version ".tar.gz"))
615 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
616 (build-system python-build-system)
619 ("harfbuzz" ,harfbuzz)
621 ("libjpeg-turbo" ,libjpeg-turbo)
627 ("python2-pycairo" ,python2-pycairo)))
629 (let ((test-data-input
630 (lambda (repository version hash)
633 (uri (string-append "https://github.com/mapnik/" repository
634 "/archive/v" version ".tar.gz"))
635 (file-name (string-append "python-mapnik-" repository
636 "-" version ".tar.gz"))
637 (sha256 (base32 hash))))))
638 `(("python2-nose" ,python2-nose)
639 ;; Test data is released as separate tarballs
641 ,(test-data-input "test-data" "3.0.18"
642 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
644 ,(test-data-input "test-data-visual" "3.0.18"
645 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
647 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
649 (modify-phases %standard-phases
650 ;; Unpack test data into the source tree
651 (add-after 'unpack 'unpack-submodules
652 (lambda* (#:key inputs #:allow-other-keys)
653 (let ((unpack (lambda (source target)
654 (with-directory-excursion target
655 (invoke "tar" "xvf" (assoc-ref inputs source)
656 "--strip-components=1")))))
657 (unpack "test-data" "test/data")
658 (unpack "test-data-visual" "test/data-visual"))))
659 ;; Skip failing tests
660 (add-after 'unpack 'skip-tests
662 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
663 "test_unicode_regex_replace"
664 "test_proj_antimeridian_bbox"
665 "test_render_with_scale_factor")))
666 (substitute* "setup.cfg"
667 (("\\[nosetests\\]" all)
668 (string-append all "\nexclude=^("
669 (string-join skipped-tests "|") ")$")))))))))
670 (home-page "https://github.com/mapnik/python-mapnik")
671 (synopsis "Python bindings for Mapnik")
672 (description "This package provides Python bindings for Mapnik.")
673 (license license:lgpl2.1+)))
675 (define-public spatialite-gui
677 (name "spatialite-gui")
682 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
686 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
687 (build-system gnu-build-system)
689 `(("pkg-config" ,pkg-config)))
693 ("libgaiagraphics" ,libgaiagraphics)
694 ("libjpeg-turbo" ,libjpeg-turbo)
695 ("libspatialite" ,libspatialite)
699 ("wxwidgets" ,wxwidgets-2)
702 `(#:phases (modify-phases %standard-phases
703 (add-after 'unpack 'fix-gui
705 ;; Fix for the GUI not showing up.
706 (substitute* "Main.cpp"
707 (("Hide\\(\\);") ""))
709 (synopsis "Graphical user interface for SpatiaLite")
710 (description "Spatialite-gui provides a visual interface for viewing and
711 maintaining a spatialite database. You can easily see the structure of the
712 tables and data contents using point and click functions, many of which
713 construct common SQL queries, or craft your own SQL queries.")
714 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
715 (license license:gpl3+)))
724 "http://download.osgeo.org/gdal/" version "/gdal-"
728 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
729 (modules '((guix build utils)))
732 ;; TODO: frmts contains a lot more bundled code.
733 (for-each delete-file-recursively
738 "frmts/jpeg/libjpeg12"
739 "frmts/gtiff/libtiff"
740 "frmts/gtiff/libgeotiff"
742 "ogr/ogrsf_frmts/geojson/libjson"))))))
743 (build-system gnu-build-system)
747 (let-syntax ((with (syntax-rules ()
749 (string-append option "="
750 (assoc-ref %build-inputs input))))))
752 ;; TODO: --with-pcidsk, --with-pcraster
753 (with "--with-freexl" "freexl")
754 (with "--with-libjson-c" "json-c")
755 (with "--with-png" "libpng")
756 (with "--with-webp" "libwebp")
757 (with "--with-gif" "giflib")
758 (with "--with-jpeg" "libjpeg-turbo")
759 (with "--with-libtiff" "libtiff")
760 (with "--with-geotiff" "libgeotiff")
761 (with "--with-libz" "zlib")
762 (with "--with-expat" "expat")
763 (with "--with-sqlite3" "sqlite")
766 (modify-phases %standard-phases
767 (add-before 'build 'fix-path
769 (substitute* "frmts/mrf/mrf_band.cpp"
770 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
777 ("libgeotiff" ,libgeotiff)
778 ("libjpeg-turbo" ,libjpeg-turbo)
784 ("postgresql" ,postgresql) ; libpq
789 `(("pkg-config" ,pkg-config)))
790 (home-page "https://gdal.org/")
791 (synopsis "Raster and vector geospatial data format library")
792 (description "GDAL is a translator library for raster and vector geospatial
793 data formats. As a library, it presents a single raster abstract data model
794 and single vector abstract data model to the calling application for all
795 supported formats. It also comes with a variety of useful command line
796 utilities for data translation and processing.")
800 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
801 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
804 ;; frmts/hdf4/hdf-eos/*
805 ;; similar to the expat license, but without guarantee exclusion
806 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
807 ;; frmts/grib/degrib/
808 license:public-domain ; with guarantee exclusion
810 ;; Some bsd-inspired license
811 (license:non-copyleft "file://port/LICENCE_minizip")
812 ;; alg/internal_libqhull
813 ;; Some 5-clause license
814 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
818 (define-public python-gdal
819 (package (inherit gdal)
821 (build-system python-build-system)
823 '(#:tests? #f ; no tests
825 (modify-phases %standard-phases
826 (add-before 'build 'chdir
828 (chdir "swig/python")
832 `(("python-numpy" ,python-numpy)))
835 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
837 (define-public postgis
843 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
847 "05s8cx1rlysiq7dd44kf7cid0la61a4p895j9g95bvfb8v8dpzh7"))))
848 (build-system gnu-build-system)
852 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
853 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
854 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
855 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
857 (modify-phases %standard-phases
858 (add-before 'build 'fix-install-path
859 (lambda* (#:key outputs #:allow-other-keys)
860 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
861 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
862 (string-append (assoc-ref outputs "out") "/bin"))))))))
868 ("libjpeg" ,libjpeg-turbo)
871 ("postgresql" ,postgresql)
875 ("pkg-config" ,pkg-config)))
876 (home-page "https://postgis.net")
877 (synopsis "Spatial database extender for PostgreSQL")
878 (description "PostGIS is a spatial database extender for PostgreSQL
879 object-relational database. It adds support for geographic objects allowing
880 location queries to be run in SQL. This package provides a PostgreSQL
885 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
888 license:public-domain
890 license:bsd-3 ; files only say "BSD"
892 license:cc-by-sa3.0))))
894 (define-public tegola
901 "https://github.com/go-spatial/tegola/archive/v"
903 (file-name (string-append name "-" version ".tar.gz"))
906 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
907 (build-system go-build-system)
909 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
910 #:unpack-path "github.com/go-spatial/tegola"
912 (modify-phases %standard-phases
913 (add-before 'build 'set-version
915 (with-directory-excursion "src/github.com/go-spatial/tegola"
916 (substitute* '("cmd/tegola/cmd/root.go"
917 "cmd/tegola_lambda/main.go")
918 (("version not set") ,version)))
920 (home-page "https://tegola.io")
921 (synopsis "Vector tile server for maps")
922 (description "Tegola is a free vector tile server written in Go. Tegola
923 takes geospatial data and slices it into vector tiles that can be efficiently
924 delivered to any client.")
927 ;; Some packages in vendor have other licenses
933 (define-public imposm3
936 (version "0.6.0-alpha.4")
940 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
942 (file-name (string-append name "-" version ".tar.gz"))
945 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
946 (build-system go-build-system)
948 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
949 #:unpack-path "github.com/omniscale/imposm3"
951 (modify-phases %standard-phases
952 (add-before 'build 'set-version
954 (substitute* "src/github.com/omniscale/imposm3/version.go"
955 (("0.0.0-dev") ,version))
959 ("leveldb" ,leveldb)))
960 (home-page "https://imposm.org/")
961 (synopsis "OpenStreetMap importer for PostGIS")
962 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
963 files and imports the data into PostgreSQL/PostGIS databases. It is designed
964 to create databases that are optimized for rendering/tile/map-services.")
967 ;; Some dependencies in vendor have different licenses
972 (define-public libosmium
980 (url "https://github.com/osmcode/libosmium")
981 (commit (string-append "v" version))))
982 (file-name (git-file-name name version))
984 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
985 (build-system cmake-build-system)
993 ("protozero" ,protozero)
994 ("sparsehash" ,sparsehash)
998 `(("doxygen" ,doxygen)))
999 (home-page "https://osmcode.org/libosmium/")
1000 (synopsis "C++ library for working with OpenStreetMap data")
1001 (description "Libosmium is a fast and flexible C++ library for working with
1002 OpenStreetMap data.")
1003 (license license:boost1.0)))
1005 (define-public osm2pgsql
1013 (url "https://github.com/openstreetmap/osm2pgsql")
1015 (file-name (git-file-name name version))
1017 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
1018 (modules '((guix build utils)))
1021 (delete-file-recursively "contrib/protozero")
1022 (delete-file-recursively "contrib/libosmium")
1024 (build-system cmake-build-system)
1026 `(#:tests? #f; tests fail because we need to setup a database
1028 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1029 (assoc-ref %build-inputs "libosmium")
1031 (string-append "-DPROTOZERO_INCLUDE_DIR="
1032 (assoc-ref %build-inputs "protozero")
1038 ("libosmium" ,libosmium)
1040 ("postgresql" ,postgresql)
1042 ("protozero" ,protozero)
1045 `(("python" ,python)
1046 ("python-psycopg2" ,python-psycopg2)))
1047 (home-page "https://github.com/openstreetmap/osm2pgsql")
1048 (synopsis "OSM data importer to postgresql")
1049 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1050 PostgreSQL / PostGIS database suitable for applications like rendering into a
1051 map, geocoding with Nominatim, or general analysis.")
1052 (license license:gpl2+)))
1054 (define-public tippecanoe
1062 (url "https://github.com/mapbox/tippecanoe")
1064 (file-name (git-file-name name version))
1066 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
1067 (build-system gnu-build-system)
1070 (modify-phases %standard-phases (delete 'configure))
1071 #:test-target "test"
1074 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1079 (home-page "https://github.com/mapbox/tippecanoe")
1080 (synopsis "Vector tile server for maps")
1081 (description "Tippecanoe creates scale-independent view of data, so that
1082 the texture and density of features is visible at every zoom level, instead of
1083 dropping features at lower levels.")
1084 (license license:bsd-2)))
1086 (define-public osmctools
1094 (url "https://gitlab.com/osm-c-tools/osmctools")
1096 (file-name (git-file-name name version))
1099 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1100 (build-system gnu-build-system)
1102 `(("autoconf" ,autoconf)
1103 ("automake" ,automake)))
1106 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1107 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1108 (description "This project contains a few tools which are used in the
1109 OpenStreetMap project. They can be used to convert, filter and update
1110 OpenStreetMap data files.")
1111 (license license:agpl3)))
1113 (define-public osm-gps-map
1115 (name "osm-gps-map")
1121 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1122 version "/osm-gps-map-" version ".tar.gz"))
1125 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1126 (build-system gnu-build-system)
1128 `(("gnome-common" ,gnome-common)
1129 ("gtk-doc" ,gtk-doc)
1130 ("pkg-config" ,pkg-config)))
1134 ("gobject-introspection" ,gobject-introspection)
1136 ("libsoup" ,libsoup)))
1137 (home-page "https://nzjrs.github.io/osm-gps-map/")
1138 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1140 "This package provides a GTK+ widget (and Python bindings) that when
1141 given GPS coordinates,draws a GPS track, and points of interest on a moving
1142 map display. Downloads map data from a number of websites, including
1143 @url{https://www.openstreetmap.org}.")
1144 (license license:gpl2+)))
1146 (define-public xygrib
1153 (url "https://github.com/opengribs/XyGrib")
1154 (commit (string-append "v" version))))
1155 (file-name (git-file-name name version))
1158 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1159 (modules '((guix build utils)))
1161 '(begin (delete-file-recursively "data/fonts") #t))))
1162 (build-system cmake-build-system)
1165 (modify-phases %standard-phases
1166 (add-after 'unpack 'patch-directories
1167 (lambda* (#:key inputs #:allow-other-keys)
1168 (let ((jpeg (assoc-ref inputs "openjpeg"))
1169 (font (assoc-ref inputs "font-liberation")))
1170 (substitute* "CMakeLists.txt"
1173 ;; Fix install locations.
1174 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1175 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1176 ;; Skip looking for the static library.
1177 (("\"libnova.a\"") ""))
1178 ;; Don't use the bundled font-liberation.
1179 (substitute* "src/util/Font.cpp"
1180 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1181 (string-append "\"" font "/share/fonts/truetype/\"")))
1182 (substitute* "src/util/Util.h"
1183 (("pathData\\(\\)\\+\"data/fonts/\"")
1184 (string-append "\"" font "/share/fonts/\""))))
1186 #:tests? #f)) ; no tests
1188 `(("qttools" ,qttools)))
1191 ("font-liberation" ,font-liberation)
1192 ("libnova" ,libnova)
1194 ("openjpeg" ,openjpeg)
1198 (synopsis "Weather Forecast Visualization")
1200 "XyGrib is a Grib file reader and visualizes meteorological data providing
1201 an off-line capability to analyse weather forecasts or hindcasts. It is
1202 intended to be used as a capable weather work station for anyone with a serious
1203 interest in examining weather. This would include members of the sailing
1204 community, private and sport aviators, farmers, weather buffs and many more.
1205 XyGrib is the continuation of the zyGrib software package with a new team of
1207 (home-page "https://opengribs.org")
1208 (license license:gpl3+)))
1210 (define-public libspatialindex
1212 (name "libspatialindex")
1217 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1218 "releases/download/" version "/spatialindex-src-"
1219 version ".tar.bz2"))
1222 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1223 (build-system cmake-build-system)
1224 (home-page "https://libspatialindex.org")
1225 (synopsis "Spatial indexing library")
1226 (description "The purpose of this library is to provide:
1229 @item An extensible framework that will support robust spatial indexing
1231 @item Support for sophisticated spatial queries. Range, point location,
1232 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1233 by spatial constraints) should be easy to deploy and run.
1234 @item Easy to use interfaces for inserting, deleting and updating information.
1235 @item Wide variety of customization capabilities. Basic index and storage
1236 characteristics like the page size, node capacity, minimum fan-out, splitting
1237 algorithm, etc. should be easy to customize.
1238 @item Index persistence. Internal memory and external memory structures
1239 should be supported. Clustered and non-clustered indices should be easy to be
1243 (license license:expat)))
1245 (define-public java-jmapviewer
1247 (name "java-jmapviewer")
1251 (uri (string-append "https://svn.openstreetmap.org/applications/"
1252 "viewer/jmapviewer/releases/" version
1253 "/JMapViewer-" version "-Source.zip"))
1256 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1257 (build-system ant-build-system)
1259 `(("unzip" ,unzip)))
1261 `(#:build-target "pack"
1262 #:tests? #f; No tests
1264 (modify-phases %standard-phases
1265 (add-before 'build 'clean
1267 (invoke "ant" "clean")))
1269 (lambda* (#:key outputs #:allow-other-keys)
1270 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1272 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1274 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1275 (synopsis "OSM map integration in Java")
1276 (description "JMapViewer is a Java component which easily
1277 integrates an OSM map view into your Java application. It is maintained as
1278 an independent project by the JOSM team.")
1279 (license license:gpl2)))
1281 (define-public java-opening-hours-parser
1283 (name "java-opening-hours-parser")
1288 (url "https://github.com/simonpoole/OpeningHoursParser")
1290 (file-name (git-file-name name version))
1293 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1294 (build-system ant-build-system)
1296 `(#:jar-name "java-opening-hours-parser.jar"
1297 #:source-dir "src/main/java"
1299 (modify-phases %standard-phases
1300 (add-before 'build 'copy-resources
1302 (copy-recursively "src/main/resources" "build/classes")
1304 (add-before 'build 'generate-parser
1306 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1307 (file (string-append dir "/OpeningHoursParser.jj")))
1308 (invoke "javacc" "-DEBUG_PARSER=false"
1309 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1310 "-GRAMMAR_ENCODING=UTF-8"
1311 (string-append "-OUTPUT_DIRECTORY=" dir)
1315 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1317 `(("javacc" ,javacc)
1318 ("java-junit" ,java-junit)
1319 ("java-hamcrest-core" ,java-hamcrest-core)))
1320 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1321 (synopsis "Java parser for the OpenStreetMap opening hour format")
1322 (description "This is a very simplistic parser for string values according
1323 to the OSM opening hours specification.")
1324 (license license:expat)))
1333 (url "https://josm.openstreetmap.de/svn/trunk")
1334 (revision (string->number version))
1338 "0pl1v0lj6lslnaxlr5isivg97xgnydsp0f491idvf93fi2g5grn5"))
1339 (file-name (string-append name "-" version "-checkout"))
1340 (modules '((guix build utils)))
1343 (for-each delete-file (find-files "." ".*.jar$"))
1345 (build-system ant-build-system)
1347 `(("javacc" ,javacc)))
1349 `(("java-commons-jcs" ,java-commons-jcs)
1350 ("java-commons-compress" ,java-commons-compress)
1351 ("java-jmapviewer" ,java-jmapviewer)
1352 ("java-jsonp-api" ,java-jsonp-api)
1353 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1354 ("java-metadata-extractor" ,java-metadata-extractor)
1355 ("java-opening-hours-parser" ,java-opening-hours-parser)
1356 ("java-openjfx-media" ,java-openjfx-media)
1357 ("java-signpost-core" ,java-signpost-core)
1358 ("java-svg-salamander" ,java-svg-salamander)))
1361 #:jar-name "josm.jar"
1363 (modify-phases %standard-phases
1364 (add-after 'unpack 'rm-build.xml
1366 (delete-file "build.xml")
1368 (add-before 'build 'fix-revision
1370 (with-output-to-file "REVISION.XML"
1373 (string-append "<info><entry><commit revision=\"" ,version "\">"
1374 "<date>1970-01-01 00:00:00 +0000</date>"
1375 "</commit></entry></info>"))))
1377 (add-before 'build 'fix-jcs
1379 ;; This version of JOSM uses an unreleased version of commons-jcs,
1380 ;; which has renamed its classes to another namespace. Rename them
1381 ;; back so they can be used with our version of jcs.
1382 (substitute* (find-files "." ".*.java$")
1385 (add-before 'build 'fix-classpath
1386 (lambda* (#:key inputs #:allow-other-keys)
1391 (let ((source (assoc-ref inputs "source")))
1392 (not (equal? (substring s 0 (string-length source))
1394 (string-split (getenv "CLASSPATH") #\:))
1397 (add-before 'build 'generate-parser
1399 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1400 (out (string-append dir "/parsergen"))
1401 (file (string-append dir "/MapCSSParser.jj")))
1402 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1403 (invoke "javacc" "-DEBUG_PARSER=false"
1404 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1405 "-GRAMMAR_ENCODING=UTF-8"
1406 (string-append "-OUTPUT_DIRECTORY=" out)
1409 (add-after 'build 'generate-epsg
1411 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1412 "-cp" "build/classes")
1413 (mkdir-p "data/projection")
1414 (with-output-to-file "data/projection/custom-epsg"
1415 (lambda _ (display "")))
1416 (invoke "java" "-cp" "build/classes:scripts:."
1417 "BuildProjectionDefinitions" ".")
1419 (add-after 'generate-epsg 'copy-resources
1421 (copy-recursively "resources" "build/classes")
1423 (add-before 'install 'regenerate-jar
1425 ;; We need to regenerate the jar file to add data.
1426 (delete-file "build/jar/josm.jar")
1427 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1428 "build/classes" ".")
1430 (add-before 'build 'copy-revision
1432 (mkdir-p "build/classes")
1433 (with-output-to-file "build/classes/REVISION"
1436 (string-append "Revision: " ,version "\n"
1437 "Is-Local-Build: true\n"
1438 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1440 (add-after 'install 'install-share-directories
1441 (lambda* (#:key outputs #:allow-other-keys)
1442 (let ((out (assoc-ref outputs "out"))
1443 (share-directories '("applications" "icons" "man" "menu"
1444 "metainfo" "mime" "pixmaps")))
1445 (for-each (lambda (directory)
1446 (copy-recursively (string-append
1447 "native/linux/tested/usr/share/"
1450 out "/share/" directory)))
1453 (add-after 'install 'install-bin
1454 (lambda* (#:key outputs inputs #:allow-other-keys)
1455 (let* ((out (assoc-ref outputs "out"))
1456 (bin (string-append out "/bin")))
1458 (with-output-to-file (string-append bin "/josm")
1461 (string-append "#!/bin/sh\n"
1462 (assoc-ref inputs "jdk") "/bin/java"
1463 " -cp " out "/share/java/josm.jar:"
1464 (getenv "CLASSPATH")
1465 " org.openstreetmap.josm.gui.MainApplication"))))
1466 (chmod (string-append bin "/josm") #o755))
1468 (home-page "https://josm.openstreetmap.de")
1469 (synopsis "OSM editor")
1470 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1471 supports loading GPX tracks, background imagery and OSM data from local
1472 sources as well as from online sources and allows editing the OSM data (nodes,
1473 ways, and relations) and their metadata tags.")
1474 (license license:gpl2+)))
1476 (define-public libmaxminddb
1478 (name "libmaxminddb")
1483 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1484 "/releases/download/" version "/"
1485 "/libmaxminddb-" version ".tar.gz"))
1487 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1488 (build-system gnu-build-system)
1491 (list ,(string-append "CC=" (cc-for-target)))))
1494 (home-page "https://maxmind.github.io/libmaxminddb/")
1495 (synopsis "C library for the MaxMind DB file format")
1496 (description "The libmaxminddb library provides a C library for reading
1497 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1498 format is a custom, but open, binary format designed to facilitate fast
1499 lookups of IP addresses while allowing flexibility in the type of data
1500 associated with an address.")
1501 (license license:asl2.0)))
1503 (define-public python-maxminddb
1505 (name "python-maxminddb")
1510 (uri (pypi-uri "maxminddb" version))
1513 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1514 (build-system python-build-system)
1516 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1518 `(("libmaxminddb" ,libmaxminddb)))
1519 (home-page "https://www.maxmind.com/")
1520 (synopsis "Reader for the MaxMind DB format")
1521 (description "MaxMind DB is a binary file format that stores data indexed
1522 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1524 (license license:asl2.0)))
1526 (define-public python-geoip2
1528 (name "python-geoip2")
1533 (uri (pypi-uri "geoip2" version))
1536 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1537 (build-system python-build-system)
1539 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1541 `(("python-maxminddb" ,python-maxminddb)
1542 ("python-requests" ,python-requests)))
1543 (home-page "https://www.maxmind.com/")
1544 (synopsis "MaxMind GeoIP2 API")
1545 (description "Provides an API for the GeoIP2 web services and databases.
1546 The API also works with MaxMind’s free GeoLite2 databases.")
1547 (license license:asl2.0)))
1549 (define-public routino
1556 (uri (string-append "http://www.routino.org/download/routino-"
1560 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1561 (build-system gnu-build-system)
1569 `(#:test-target "test"
1571 (modify-phases %standard-phases
1573 (lambda* (#:key outputs #:allow-other-keys)
1574 (substitute* "Makefile.conf"
1575 (("prefix=/usr/local")
1576 (string-append "prefix=" (assoc-ref outputs "out")))
1577 (("LDFLAGS_LDSO=-Wl,-R\\.")
1578 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1579 (("#CFLAGS\\+=-DUSE_XZ")
1581 (("#LDFLAGS\\+=-llzma")
1584 (synopsis "Routing application for OpenStreetMap data")
1586 "Routino is an application for finding a route between two points
1587 using the dataset of topographical information collected by
1588 @url{https://www.OpenStreetMap.org}.")
1589 (home-page "https://www.routino.org/")
1590 (license license:agpl3+)))
1592 (define-public qmapshack
1600 (url "https://github.com/Maproom/qmapshack")
1601 (commit (string-append "V_" version))))
1602 (file-name (git-file-name name version))
1605 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1606 (build-system qt-build-system)
1608 `(("pkg-config" ,pkg-config)
1609 ("qttools" ,qttools)))
1612 ("libjpeg-turbo" ,libjpeg-turbo)
1615 ("qtdeclarative" ,qtdeclarative)
1616 ("qtlocation" ,qtlocation)
1617 ("qtwebchannel" ,qtwebchannel)
1618 ("qtwebengine" ,qtwebengine)
1620 ("routino" ,routino)
1621 ("sqlite" ,sqlite) ; See wrap phase
1626 (modify-phases %standard-phases
1627 (add-after 'unpack 'fix-cmake-modules
1628 (lambda* (#:key inputs #:allow-other-keys)
1629 (substitute* "CMakeLists.txt"
1630 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1631 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1632 (substitute* "cmake/Modules/FindROUTINO.cmake"
1634 (assoc-ref inputs "routino")))
1635 ;; The following fixes are included as patches in the sources
1636 ;; of QMapShack, but they are not applied by default, for
1638 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1639 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1641 (add-after 'install 'wrap
1642 ;; The program fails to find the QtWebEngineProcess program,
1643 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1644 (lambda* (#:key inputs outputs #:allow-other-keys)
1645 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1646 (qtwebengineprocess (string-append
1647 (assoc-ref inputs "qtwebengine")
1648 "/lib/qt5/libexec/QtWebEngineProcess")))
1649 (for-each (lambda (program)
1650 (wrap-program program
1651 `("QTWEBENGINEPROCESS_PATH" =
1652 (,qtwebengineprocess))))
1653 (find-files bin ".*")))
1655 (synopsis "GPS mapping application")
1657 "QMapShack can be used to plan your next outdoor trip or to visualize and
1658 archive all the GPS recordings of your past trips. It is the successor of the
1659 QLandkarte GT application.")
1660 (home-page "https://github.com/Maproom/qmapshack/wiki")
1661 (license license:gpl3+)))
1663 (define-public readosm
1670 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1671 "readosm-" version ".tar.gz"))
1673 (base32 "0zv6p352pqjcv70nvcaf2x3011z35jqa24dcdm27a4ns1wha3cjc"))))
1674 (build-system gnu-build-system)
1678 (synopsis "Data extractor for OpenStreetMap files")
1680 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1681 input file (in @code{.osm} or @code{.osm.pbf} format).")
1682 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1683 (license (list license:gpl2+
1687 (define-public spatialite-tools
1689 (name "spatialite-tools")
1694 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1695 "spatialite-tools-" version ".tar.gz"))
1697 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1698 (build-system gnu-build-system)
1700 `(("pkg-config" ,pkg-config)))
1705 ("libspatialite" ,libspatialite)
1706 ("libxml2" ,libxml2)
1708 ("readosm" ,readosm)
1711 (synopsis "Collection of command line tools for SpatiaLite")
1713 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1714 tools supporting SpatiaLite.")
1715 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1716 (license license:gpl3+)))
1718 (define-public virtualpg
1725 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1726 "virtualpg-" version ".tar.gz"))
1728 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1729 (build-system gnu-build-system)
1731 `(("postgresql" ,postgresql)
1732 ("sqlite" ,sqlite)))
1733 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1735 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1736 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1737 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1738 exchanged form one Spatial DBMS and the other.")
1739 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1740 (license (list license:gpl2+
1744 (define-public opencpn
1752 (url "https://github.com/OpenCPN/OpenCPN")
1753 (commit (string-append "v" version))))
1754 (file-name (git-file-name name version))
1756 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1757 (build-system cmake-build-system)
1759 `(("gettext" ,gettext-minimal)
1760 ("pkg-config" ,pkg-config)))
1767 ("libarchive" ,libarchive)
1769 ("libexif" ,libexif)
1770 ("libsndfile" ,libsndfile)
1774 ("portaudio" ,portaudio)
1776 ("tinyxml" ,tinyxml)
1778 ("wxwidgets" ,wxwidgets)
1782 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1783 "-DENABLE_SNDFILE=ON"
1784 "-DBUNDLE_TCDATA=ON"
1785 "-DBUNDLE_GSHHS=CRUDE")
1786 #:tests? #f ; No tests defined
1788 (modify-phases %standard-phases
1789 (add-after 'unpack 'fix-build
1791 (substitute* "CMakeLists.txt"
1792 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1793 (string-append all " --libs all")))
1795 (synopsis "Chart plotter and marine GPS navigation software")
1797 "OpenCPN is a chart plotter and marine navigation software designed to be
1798 used at the helm station of your boat while underway. Chart a course and
1799 track your position right from your laptop.")
1800 (home-page "https://opencpn.org/")
1801 (license (list license:asl2.0
1812 (define-public grass
1813 (let* ((version "7.8.4")
1814 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1815 (grassxx (string-append "grass" majorminor)))
1822 (uri (string-append "https://grass.osgeo.org/" grassxx
1823 "/source/grass-" version ".tar.gz"))
1825 (base32 "1yfghvp522ijww3n3l5xarjbc21rm0gmlgr3lvwxrv23bvxmllyr"))))
1826 (build-system gnu-build-system)
1831 ("freetype" ,freetype)
1837 ("libtiff" ,libtiff)
1839 ("mariadb-dev" ,mariadb "dev")
1840 ("mariadb-lib" ,mariadb "lib")
1842 ("openblas" ,openblas)
1844 ("postgresql" ,postgresql)
1847 ("python-dateutil" ,python-dateutil)
1848 ("python-numpy" ,python-numpy)
1849 ("python-wxpython" ,python-wxpython)
1850 ("readline" ,readline)
1852 ("wxwidgets" ,wxwidgets)
1854 ("zstd" ,zstd "lib")))
1856 `(("bash" ,bash-minimal)
1859 ("pkg-config" ,pkg-config)))
1861 `(#:tests? #f ; No tests
1862 #:modules ((guix build gnu-build-system)
1863 ((guix build python-build-system) #:prefix python:)
1865 #:imported-modules (,@%gnu-build-system-modules
1866 (guix build python-build-system))
1868 (modify-phases %standard-phases
1870 (lambda* (#:key inputs outputs #:allow-other-keys)
1871 (let ((shell (string-append (assoc-ref inputs "bash")
1873 (setenv "SHELL" shell)
1874 (setenv "CONFIG_SHELL" shell)
1875 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1876 (assoc-ref outputs "out")
1877 "/" ,grassxx "/lib")))
1878 (invoke "./configure"
1879 (string-append "--prefix="
1880 (assoc-ref outputs "out"))
1883 (string-append "--with-freetype-includes="
1884 (assoc-ref inputs "freetype")
1885 "/include/freetype2")
1886 (string-append "--with-freetype-libs="
1887 (assoc-ref inputs "freetype")
1892 (string-append "--with-mysql-includes="
1893 (assoc-ref inputs "mariadb-dev")
1895 (string-append "--with-mysql-libs="
1896 (assoc-ref inputs "mariadb-lib")
1900 (string-append "--with-proj-share="
1901 (assoc-ref inputs "proj.4")
1906 "--with-wxwidgets")))
1907 (add-after 'install 'install-links
1908 (lambda* (#:key outputs #:allow-other-keys)
1909 ;; Put links for includes and libraries in the standard places.
1910 (let* ((out (assoc-ref outputs "out"))
1911 (dir (string-append out "/" ,grassxx)))
1912 (symlink (string-append dir "/include")
1913 (string-append out "/include"))
1914 (symlink (string-append dir "/lib")
1915 (string-append out "/lib")))
1917 (add-after 'install-links 'python:wrap
1918 (assoc-ref python:%standard-phases 'wrap))
1919 (add-after 'python:wrap 'wrap-with-python-interpreter
1920 (lambda* (#:key outputs #:allow-other-keys)
1921 (let ((out (assoc-ref outputs "out")))
1922 (wrap-program (string-append out "/bin/" ,grassxx)
1923 `("GRASS_PYTHON" = (,(which "python3"))))
1925 (synopsis "GRASS Geographic Information System")
1927 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1928 Information System (GIS) software suite used for geospatial data management and
1929 analysis, image processing, graphics and maps production, spatial modeling, and
1931 (home-page "https://grass.osgeo.org/")
1932 (license license:gpl2+))))
1941 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1942 (version-major version) "/SAGA%20-%20" version
1943 "/saga-" version ".tar.gz"))
1945 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1946 (build-system gnu-build-system)
1948 `(("pkg-config" ,pkg-config)
1956 ("libharu" ,libharu)
1957 ("libtiff" ,libtiff)
1959 ("postgresql" ,postgresql)
1963 ("unixodbc" ,unixodbc)
1965 ("wxwidgets" ,wxwidgets)))
1967 '(#:configure-flags '("--enable-python")))
1968 (synopsis "System for Automated Geoscientific Analyses")
1970 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1971 Information System (GIS) software. It has been designed for an easy and
1972 effective implementation of spatial algorithms and it offers a comprehensive,
1973 growing set of geoscientific methods.")
1974 (home-page "http://www.saga-gis.org")
1975 (license (list license:gpl2+ license:lgpl2.1+))))
1984 (uri (string-append "https://qgis.org/downloads/qgis-"
1985 version ".tar.bz2"))
1987 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1988 (build-system cmake-build-system)
1990 `(#:modules ((guix build cmake-build-system)
1991 ((guix build python-build-system) #:prefix python:)
1992 (guix build qt-utils)
1994 #:imported-modules (,@%cmake-build-system-modules
1995 (guix build python-build-system)
1996 (guix build qt-utils))
1998 (modify-phases %standard-phases
1999 ;; Configure correct path to PyQt5 SIP directory
2000 (add-after 'unpack 'configure-pyqt5-sip-path
2001 (lambda* (#:key inputs #:allow-other-keys)
2002 (substitute* "cmake/FindPyQt5.cmake"
2003 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
2004 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
2005 "/share/sip\" PYQT5_SIP_DIR")))
2006 (substitute* (list "scripts/prepare-commit.sh"
2007 "scripts/runtests-local-travis-config.sh"
2008 "scripts/sip_include.sh"
2010 "scripts/sipify_all.sh"
2011 "scripts/spell_check/check_spelling.sh"
2012 "scripts/spell_check/spell_test.sh"
2013 "scripts/verify-indentation.sh"
2014 "tests/code_layout/test_banned_keywords.sh"
2015 "tests/code_layout/test_licenses.sh"
2016 "tests/code_layout/test_shellcheck.sh"
2017 "tests/code_layout/test_sip_include.sh"
2018 "tests/code_layout/test_sipfiles_uptodate.sh"
2019 "tests/code_layout/test_sipify.sh")
2020 (("\\$\\(git rev-parse --show-toplevel\\)")
2022 (substitute* "tests/code_layout/test_sip_include.sh"
2023 (("^REV=.*") "REV=currentrev\n"))
2026 (lambda* (#:key inputs #:allow-other-keys)
2027 (setenv "HOME" "/tmp")
2028 (system (string-append (assoc-ref inputs "xorg-server")
2030 (setenv "DISPLAY" ":1")
2031 (setenv "TRAVIS" "true")
2032 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2035 '(;; Disable tests that require network access
2036 "qgis_filedownloader"
2037 ;; TODO: Find why the following tests fail
2038 "ProcessingQgisAlgorithmsTestPt1"
2039 "ProcessingQgisAlgorithmsTestPt2"
2040 "ProcessingQgisAlgorithmsTestPt3"
2041 "ProcessingQgisAlgorithmsTestPt4"
2042 "ProcessingGdalAlgorithmsRasterTest"
2043 "ProcessingGdalAlgorithmsVectorTest"
2044 "ProcessingGrass7AlgorithmsImageryTest"
2045 "ProcessingGrass7AlgorithmsRasterTest"
2046 "ProcessingGrass7AlgorithmsVectorTest"
2047 "ProcessingOtbAlgorithmsTest"
2048 "qgis_authmanagertest"
2049 "qgis_compositionconvertertest"
2050 "qgis_coordinatereferencesystemtest"
2052 "qgis_layouthtmltest"
2053 "qgis_layoutmaptest"
2054 "qgis_layoutmapgridtest"
2055 "qgis_painteffecttest"
2056 "qgis_pallabelingtest"
2057 "qgis_svgmarkertest"
2058 "qgis_taskmanagertest"
2060 "qgis_processingtest"
2061 "qgis_wcsprovidertest"
2062 "qgis_arcgisrestutilstest"
2063 "qgis_grassprovidertest7"
2064 "qgis_gpsinformationwidget"
2066 "PyQgsPythonProvider"
2068 "PyQgsAuthenticationSystem"
2073 "PyQgsLayerMetadata"
2076 "PyQgsLayoutMapGrid"
2078 "PyQgsLayoutExporter"
2081 "PyQgsOGRProviderGpkg"
2082 "PyQgsPalLabelingLayout"
2083 "PyQgsImportIntoPostGIS"
2084 "PyQgsProviderConnectionPostgres"
2085 "PyQgsProviderConnectionGpkg"
2086 "PyQgsShapefileProvider"
2090 "PyQgsSpatialiteProvider"
2091 "PyQgsVectorFileWriter"
2093 "PyQgsVectorLayerUtils"
2094 "PyQgsVirtualLayerProvider"
2096 "PyQgsOapifProvider"
2097 "PyQgsLayerDependencies"
2098 "PyQgsDBManagerGpkg"
2099 "PyQgsDBManagerSpatialite"
2101 "PyQgsAuxiliaryStorage"
2102 "PyQgsSelectiveMasking"
2104 "qgis_geometrycheckstest"
2108 "qgis_sip_uptodate")
2110 (add-after 'install 'wrap-python
2111 (assoc-ref python:%standard-phases 'wrap))
2112 (add-after 'wrap-python 'wrap-qt
2113 (lambda* (#:key outputs #:allow-other-keys)
2114 (wrap-qt-program (assoc-ref outputs "out") "qgis")
2116 (add-after 'wrap-qt 'wrap-gis
2117 (lambda* (#:key inputs outputs #:allow-other-keys)
2118 (let* ((out (assoc-ref outputs "out"))
2119 (saga (string-append (assoc-ref inputs "saga") "/bin"))
2120 (grass-version ,(package-version grass))
2121 (grass-majorminor (string-join
2123 (string-split grass-version #\.) 2)
2125 (grass (string-append (assoc-ref inputs "grass")
2126 "/grass" grass-majorminor)))
2127 (wrap-program (string-append out "/bin/qgis")
2128 `("PATH" ":" prefix (,saga))
2129 `("QGIS_PREFIX_PATH" = (,out))
2130 `("GISBASE" = (,grass))))
2137 ("gpsbabel" ,gpsbabel)
2141 ("libspatialindex" ,libspatialindex)
2142 ("libspatialite" ,libspatialite)
2143 ("libxml2" ,libxml2)
2146 ("postgresql" ,postgresql)
2149 ("python-chardet" ,python-chardet)
2150 ("python-dateutil" ,python-dateutil)
2151 ("python-future" ,python-future)
2152 ("python-gdal" ,python-gdal)
2153 ("python-jinja2" ,python-jinja2)
2154 ("python-numpy" ,python-numpy)
2155 ("python-owslib" ,python-owslib)
2156 ("python-psycopg2" ,python-psycopg2)
2157 ("python-pygments" ,python-pygments)
2158 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2159 ("python-pytz" ,python-pytz)
2160 ("python-pyyaml" ,python-pyyaml)
2161 ("python-requests" ,python-requests)
2162 ("python-sip" ,python-sip)
2163 ("python-six" ,python-six)
2164 ("python-urllib3" ,python-urllib3)
2166 ("qscintilla" ,qscintilla)
2168 ("qtdeclarative" ,qtdeclarative)
2169 ("qtkeychain" ,qtkeychain)
2170 ("qtlocation" ,qtlocation)
2171 ("qtserialport" ,qtserialport)
2173 ("qtwebkit" ,qtwebkit)
2176 ("sqlite" ,sqlite)))
2181 ("perl-yaml-tiny" ,perl-yaml-tiny)
2182 ("pkg-config" ,pkg-config)
2183 ("python-mock" ,python-mock)
2184 ("python-nose2" ,python-nose2)
2185 ("qttools" ,qttools)
2186 ("shellcheck" ,shellcheck)
2187 ("xorg-server" ,xorg-server-for-tests)))
2188 (home-page "https://qgis.org")
2189 (synopsis "Geographical information system")
2190 (description "QGIS is an easy to use Geographical Information
2191 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2192 raster and vector data formats, with new support easily added using the plugin
2205 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2206 (license:fsf-free "file://debian/copyright" "Go Squared")
2210 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2212 "file://debian/copyright"
2213 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2223 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2224 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2225 (license:non-copyleft
2226 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2227 "NCL Source Code License")
2230 license:public-domain
2233 (define-public python-geographiclib
2235 (name "python-geographiclib")
2240 (uri (pypi-uri "geographiclib" version))
2243 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2244 (build-system python-build-system)
2245 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2246 (synopsis "Python geodesic routines from GeographicLib")
2248 "This is a python implementation of the geodesic routines in GeographicLib.")
2249 (license license:expat)))
2251 (define-public python-geopy
2253 (name "python-geopy")
2258 (uri (pypi-uri "geopy" version))
2261 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2262 (build-system python-build-system)
2264 `(("python-geographiclib" ,python-geographiclib)))
2266 `(("python-async-generator" ,python-async-generator)
2267 ("python-coverage" ,python-coverage)
2268 ("python-flake8" ,python-flake8)
2269 ("python-isort" ,python-isort)
2270 ("python-pytest" ,python-pytest)
2271 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2272 ("python-readme-renderer" ,python-readme-renderer)
2273 ("python-pytz" ,python-pytz)))
2274 (home-page "https://github.com/geopy/geopy")
2275 (synopsis "Geocoding library for Python")
2276 (description "@code{geopy} is a Python client for several popular geocoding
2277 web services. @code{geopy} makes it easy for Python developers to locate the
2278 coordinates of addresses, cities, countries, and landmarks across the globe
2279 using third-party geocoders and other data sources.")
2280 (license license:expat)))