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–2021 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>
17 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages geo)
35 #:use-module (guix build-system ant)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system glib-or-gtk)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system go)
40 #:use-module (guix build-system meson)
41 #:use-module (guix build-system python)
42 #:use-module (guix build-system qt)
43 #:use-module (guix build-system scons)
44 #:use-module (guix build-system r)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix svn-download)
48 #:use-module ((guix licenses) #:prefix license:)
49 #:use-module (guix packages)
50 #:use-module (guix utils)
51 #:use-module (gnu packages)
52 #:use-module (gnu packages algebra)
53 #:use-module (gnu packages astronomy)
54 #:use-module (gnu packages audio)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages backup)
57 #:use-module (gnu packages bash)
58 #:use-module (gnu packages bison)
59 #:use-module (gnu packages boost)
60 #:use-module (gnu packages check)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages curl)
63 #:use-module (gnu packages databases)
64 #:use-module (gnu packages datastructures)
65 #:use-module (gnu packages docbook)
66 #:use-module (gnu packages documentation)
67 #:use-module (gnu packages elf)
68 #:use-module (gnu packages flex)
69 #:use-module (gnu packages fonts)
70 #:use-module (gnu packages fontutils)
71 #:use-module (gnu packages gettext)
72 #:use-module (gnu packages gl)
73 #:use-module (gnu packages glib)
74 #:use-module (gnu packages gnome)
75 #:use-module (gnu packages gps)
76 #:use-module (gnu packages gtk)
77 #:use-module (gnu packages haskell-apps)
78 #:use-module (gnu packages image)
79 #:use-module (gnu packages image-processing)
80 #:use-module (gnu packages icu4c)
81 #:use-module (gnu packages java)
82 #:use-module (gnu packages kde)
83 #:use-module (gnu packages lua)
84 #:use-module (gnu packages maths)
85 #:use-module (gnu packages pcre)
86 #:use-module (gnu packages pdf)
87 #:use-module (gnu packages perl)
88 #:use-module (gnu packages photo)
89 #:use-module (gnu packages pkg-config)
90 #:use-module (gnu packages protobuf)
91 #:use-module (gnu packages pulseaudio)
92 #:use-module (gnu packages python)
93 #:use-module (gnu packages python-check)
94 #:use-module (gnu packages python-web)
95 #:use-module (gnu packages python-xyz)
96 #:use-module (gnu packages qt)
97 #:use-module (gnu packages readline)
98 #:use-module (gnu packages swig)
99 #:use-module (gnu packages sqlite)
100 #:use-module (gnu packages textutils)
101 #:use-module (gnu packages time)
102 #:use-module (gnu packages web)
103 #:use-module (gnu packages webkit)
104 #:use-module (gnu packages wxwidgets)
105 #:use-module (gnu packages xml)
106 #:use-module (gnu packages xorg))
108 (define-public memphis
117 (url "https://github.com/jiuka/memphis")
119 (file-name (git-file-name name version))
121 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
122 (build-system glib-or-gtk-build-system)
123 (outputs '("out" "doc"))
130 (string-append "--with-html-dir="
131 (assoc-ref %outputs "doc")
132 "/share/gtk-doc/html"))
134 (modify-phases %standard-phases
135 (add-after 'unpack 'patch-autogen
137 (substitute* "autogen.sh"
138 (("\\./configure \"\\$@\"")
141 (add-after 'patch-autogen 'patch-docbook-xml
142 (lambda* (#:key inputs #:allow-other-keys)
143 (with-directory-excursion "docs/reference"
144 (substitute* "libmemphis-docs.sgml"
145 (("http://www.oasis-open.org/docbook/xml/4.3/")
146 (string-append (assoc-ref inputs "docbook-xml")
147 "/xml/dtd/docbook/"))))
150 `(("autoconf" ,autoconf)
151 ("automake" ,automake)
152 ("docbook-xml" ,docbook-xml-4.3)
153 ("gobject-introspection" ,gobject-introspection)
156 ("pkg-config" ,pkg-config)
157 ("python" ,python-wrapper)
165 (synopsis "Map-rendering for OpenSteetMap")
166 (description "Memphis is a map-rendering application and a library for
167 OpenStreetMap written in C using eXpat, Cairo and GLib.")
168 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
169 (license license:lgpl2.1+)))
177 (uri (string-append "http://download.osgeo.org/geos/geos-"
182 "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
183 (build-system gnu-build-system)
184 (arguments `(#:phases
185 (modify-phases %standard-phases
187 'unpack 'patch-test-shebangs
189 (substitute* '("tests/xmltester/testrunner.sh"
190 "tests/geostest/testrunner.sh")
191 (("/bin/sh") (which "sh")))
195 (home-page "https://geos.osgeo.org/")
196 (synopsis "Geometry Engine for Geographic Information Systems")
198 "GEOS provides a spatial object model and fundamental geometric
199 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
200 it aims to contain the complete functionality of JTS in C++. This
201 includes all the OpenGIS Simple Features for SQL spatial predicate
202 functions and spatial operators, as well as specific JTS enhanced
203 topology functions.")
204 (license (list license:lgpl2.1+ ; Main distribution.
205 license:zlib ; tests/xmltester/tinyxml/*
206 license:public-domain)))) ; include/geos/timeval.h
208 (define-public gnome-maps
214 (uri (string-append "mirror://gnome/sources/" name "/"
215 (version-major+minor version) "/"
216 name "-" version ".tar.xz"))
219 "00xslcnhhwslqglgfv2im7vq3awa49y2jxzr8wsby7f713k28vf5"))))
220 (build-system meson-build-system)
224 (modify-phases %standard-phases
225 (add-after 'unpack 'skip-gtk-update-icon-cache
226 ;; Don't create 'icon-theme.cache'.
228 (substitute* "meson_post_install.py"
229 (("gtk-update-icon-cache") "true"))
231 (add-after 'unpack 'patch-dbus-service
232 (lambda* (#:key outputs #:allow-other-keys)
233 (substitute* "data/org.gnome.Maps.service.in"
234 (("@pkgdatadir@/org.gnome.Maps")
235 (string-append (assoc-ref outputs "out") "/bin/gnome-maps")))
237 (add-after 'install 'wrap
238 (lambda* (#:key inputs outputs #:allow-other-keys)
239 (let ((out (assoc-ref outputs "out"))
240 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
241 (geocode-glib-path (string-append
242 (assoc-ref inputs "geocode-glib")
244 (goa-path (string-append
245 (assoc-ref inputs "gnome-online-accounts:lib")
247 (gdk-pixbuf-path (string-append
248 (assoc-ref inputs "gdk-pixbuf")
250 (webkitgtk-path (string-append
251 (assoc-ref inputs "webkitgtk")
253 (wrap-program (string-append out "/bin/gnome-maps")
254 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
256 ;; There seems to be no way to embed the path of
257 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
258 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
259 ;; libgeocode-glib.so.0
260 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
263 ,geocode-glib-path)))
266 `(("gettext" ,gettext-minimal)
267 ("gobject-introspection" ,gobject-introspection)
268 ("pkg-config" ,pkg-config)))
270 `(("evolution-data-server" ,evolution-data-server)
272 ("libchamplain" ,libchamplain)
274 ("libsecret" ,libsecret)
276 ("libgweather" ,libgweather)
278 ("gdk-pixbuf" ,gdk-pixbuf+svg)
279 ("glib-networking" ,glib-networking)
281 ("geocode-glib" ,geocode-glib)
282 ("gfbgraph" ,gfbgraph)
285 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
286 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
289 ("webkitgtk" ,webkitgtk)))
290 (synopsis "Graphical map viewer and wayfinding program")
291 (description "GNOME Maps is a graphical map viewer. It uses map data from
292 the OpenStreetMap project. It can provide directions for walking, bicycling,
294 (home-page "https://wiki.gnome.org/Apps/Maps")
295 (license license:gpl2+)))
297 (define-public libgaiagraphics
299 (name "libgaiagraphics")
304 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
308 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
309 (build-system gnu-build-system)
311 `(("pkg-config" ,pkg-config)))
315 ("libjpeg-turbo" ,libjpeg-turbo)
317 ("libgeotiff" ,libgeotiff)
321 (synopsis "Gaia common graphics support")
322 (description "libgaiagraphics is a library supporting
323 common-utility raster handling methods.")
324 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
325 (license license:lgpl3+)))
327 (define-public libgeotiff
334 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
336 (patches (search-patches
337 ;; See libgeotiff 1.5.1 issue
338 ;; https://github.com/OSGeo/libgeotiff/issues/22
339 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
341 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
342 (modules '((guix build utils)))
345 ;; Remove .csv files, distributed from EPSG under a restricted
346 ;; license. See LICENSE for full license text.
347 (for-each delete-file (find-files "." "\\.csv$"))
349 (build-system gnu-build-system)
351 `(("libjpeg-turbo" ,libjpeg-turbo)
355 `(;; libgeotiff headers include proj headers, so ensure those are available.
359 (list "--disable-static"
360 "--with-zlib" "--with-jpeg"
361 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
362 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
363 (description "libgeotiff is a library on top of libtiff for reading and
364 writing GeoTIFF information tags.")
365 (home-page "https://trac.osgeo.org/geotiff/")
366 ;; This is a mixture of various contributions under different licenses.
367 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
368 ;; states, as its commercial redistribution is restricted. Hence, we have
369 ;; removed it from the package.
370 (license (list license:public-domain
373 (license:non-copyleft "file://LICENSE"
374 "See LICENSE in the distribution.")))))
376 (define-public librttopo
384 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
385 (commit (string-append "librttopo-" version))))
386 (file-name (git-file-name name version))
388 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
389 (build-system gnu-build-system)
392 (modify-phases %standard-phases
393 (add-after 'unpack 'patch-autogen
395 (let ((autoconf (which "autoconf"))
396 (autoheader (which "autoheader"))
397 (aclocal (which "aclocal"))
398 (automake (which "automake"))
399 (libtoolize (which "libtoolize")))
400 (substitute* "autogen.sh"
401 (("`which autoconf 2>/dev/null`") autoconf)
402 (("`which autoheader 2>/dev/null`") autoheader)
404 (string-append "ACLOCAL=" aclocal "\n"))
406 (string-append "AUTOMAKE=" automake "\n"))
408 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
411 `(("autoconf" ,autoconf)
412 ("automake" ,automake)
414 ("pkg-config" ,pkg-config)))
417 (synopsis "Library to handle SQL/MM topologies")
419 "The RT Topology Library exposes an API to create and manage standard
420 (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
421 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
422 (license license:gpl2+)))
424 (define-public libspatialite
426 (name "libspatialite")
431 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
435 "1b3dmkgwbfi43hj3jzy2mh707khavrnw91vdd5sv387m8c1dfzvv"))))
436 (build-system gnu-build-system)
438 `(("pkg-config" ,pkg-config)))
442 ("librttopo" ,librttopo)
450 '("--enable-rttopo=yes")
452 (modify-phases %standard-phases
453 ;; 3 tests are failing, ignore them:
454 (add-after 'unpack 'ignore-broken-tests
456 (substitute* '("test/Makefile.in")
457 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
458 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
459 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
461 (synopsis "Extend SQLite to support Spatial SQL capabilities")
463 "SpatiaLite is a library intended to extend the SQLite core to support
464 fully fledged Spatial SQL capabilities.")
465 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
466 ;; For the genuine libspatialite-sources holds:
467 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
468 ;; Files under src/control_points are from GRASS
469 ;; and are licensed under GPL2+ only.
470 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
471 (license (list license:gpl2+
474 license:public-domain))))
483 (uri (string-append "http://download.osgeo.org/proj/proj-"
487 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
488 (build-system gnu-build-system)
490 `(("sqlite" ,sqlite)))
492 `(("pkg-config" ,pkg-config)))
493 (home-page "https://proj.org/")
494 (synopsis "Coordinate transformation software")
496 "Proj is a generic coordinate transformation software that transforms
497 geospatial coordinates from one coordinate reference system (CRS) to another.
498 This includes cartographic projections as well as geodetic transformations.
499 PROJ includes command line applications for easy conversion of coordinates
500 from text files or directly from user input. In addition, proj also exposes
501 an application programming interface that lets developers use the
502 functionality of proj in their own software.")
503 (license (list license:expat
504 ;; src/projections/patterson.cpp
506 ;; src/geodesic.*, src/tests/geodtest.cpp
509 (define-public proj.4
515 (uri (string-append "http://download.osgeo.org/proj/proj-"
519 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
520 (build-system gnu-build-system)
523 (modify-phases %standard-phases
524 (add-after 'unpack 'patch-test-paths
526 (substitute* '("nad/test27"
532 (("/bin/rm") (which "rm")))
534 ;; Precision problems on i686 and other platforms. See:
535 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
536 ;; Disable failing test.
537 (add-after 'patch-test-paths 'ignore-failing-tests
539 (substitute* '("nad/Makefile.in")
540 (("\tPROJ_LIB.*" all) (string-append "#" all)))
544 (home-page "https://proj.org/")
545 (synopsis "Cartographic Projections Library")
547 "Proj.4 is a library for converting coordinates between cartographic
549 (license (list license:expat
550 ;; src/PJ_patterson.c
554 ;; Embedded EPSG database.
555 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
559 (define-public mapnik
566 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
567 version "/mapnik-v" version ".tar.bz2"))
570 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
571 (build-system scons-build-system)
575 ("freetype" ,freetype)
576 ("harfbuzz" ,harfbuzz)
578 ("libjpeg-turbo" ,libjpeg-turbo)
587 `(("pkg-config" ,pkg-config)))
589 `(#:scons ,scons-python2
592 (string-append "PREFIX=" %output)
593 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
594 (home-page "https://mapnik.org/")
595 (synopsis "Toolkit for developing mapping applications")
596 (description "Mapnik is a toolkit for developing mapping applications. It
597 is basically a collection of geographic objects like maps, layers,
598 datasources, features, and geometries. At its core is a C++ shared library
599 providing algorithms and patterns for spatial data access and visualization.
600 The library does not rely on any specific windowing system and can be deployed
601 to any server environment. It is intended to play fair in a multi-threaded
602 environment and is aimed primarily, but not exclusively, at web-based
604 (license (list license:lgpl2.1+
605 ;; demo/viewer, demo/python/rundemo.py
607 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
609 ;; deps/mapnik/sparsehash
612 (license:non-copyleft "file://deps/agg/copying")))))
614 (define-public python2-mapnik
616 (name "python2-mapnik")
621 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
623 (file-name (string-append name "-" version ".tar.gz"))
626 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
627 (build-system python-build-system)
630 ("harfbuzz" ,harfbuzz)
632 ("libjpeg-turbo" ,libjpeg-turbo)
638 ("python2-pycairo" ,python2-pycairo)))
640 (let ((test-data-input
641 (lambda (repository version hash)
644 (uri (string-append "https://github.com/mapnik/" repository
645 "/archive/v" version ".tar.gz"))
646 (file-name (string-append "python-mapnik-" repository
647 "-" version ".tar.gz"))
648 (sha256 (base32 hash))))))
649 `(("python2-nose" ,python2-nose)
650 ;; Test data is released as separate tarballs
652 ,(test-data-input "test-data" "3.0.18"
653 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
655 ,(test-data-input "test-data-visual" "3.0.18"
656 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
658 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
660 (modify-phases %standard-phases
661 ;; Unpack test data into the source tree
662 (add-after 'unpack 'unpack-submodules
663 (lambda* (#:key inputs #:allow-other-keys)
664 (let ((unpack (lambda (source target)
665 (with-directory-excursion target
666 (invoke "tar" "xvf" (assoc-ref inputs source)
667 "--strip-components=1")))))
668 (unpack "test-data" "test/data")
669 (unpack "test-data-visual" "test/data-visual"))))
670 ;; Skip failing tests
671 (add-after 'unpack 'skip-tests
673 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
674 "test_unicode_regex_replace"
675 "test_proj_antimeridian_bbox"
676 "test_render_with_scale_factor")))
677 (substitute* "setup.cfg"
678 (("\\[nosetests\\]" all)
679 (string-append all "\nexclude=^("
680 (string-join skipped-tests "|") ")$")))))))))
681 (home-page "https://github.com/mapnik/python-mapnik")
682 (synopsis "Python bindings for Mapnik")
683 (description "This package provides Python bindings for Mapnik.")
684 (license license:lgpl2.1+)))
686 (define-public spatialite-gui
688 (name "spatialite-gui")
693 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
697 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
698 (build-system gnu-build-system)
700 `(("pkg-config" ,pkg-config)))
704 ("libgaiagraphics" ,libgaiagraphics)
705 ("libjpeg-turbo" ,libjpeg-turbo)
706 ("libspatialite" ,libspatialite)
710 ("wxwidgets" ,wxwidgets-2)
713 `(#:phases (modify-phases %standard-phases
714 (add-after 'unpack 'fix-gui
716 ;; Fix for the GUI not showing up.
717 (substitute* "Main.cpp"
718 (("Hide\\(\\);") ""))
720 (synopsis "Graphical user interface for SpatiaLite")
721 (description "Spatialite-gui provides a visual interface for viewing and
722 maintaining a spatialite database. You can easily see the structure of the
723 tables and data contents using point and click functions, many of which
724 construct common SQL queries, or craft your own SQL queries.")
725 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
726 (license license:gpl3+)))
735 "http://download.osgeo.org/gdal/" version "/gdal-"
739 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
740 (modules '((guix build utils)))
743 ;; TODO: frmts contains a lot more bundled code.
744 (for-each delete-file-recursively
749 "frmts/jpeg/libjpeg12"
750 "frmts/gtiff/libtiff"
751 "frmts/gtiff/libgeotiff"
753 "ogr/ogrsf_frmts/geojson/libjson"))))))
754 (build-system gnu-build-system)
758 (let-syntax ((with (syntax-rules ()
760 (string-append option "="
761 (assoc-ref %build-inputs input))))))
763 ;; TODO: --with-pcidsk, --with-pcraster
764 (with "--with-freexl" "freexl")
765 (with "--with-libjson-c" "json-c")
766 (with "--with-png" "libpng")
767 (with "--with-webp" "libwebp")
768 (with "--with-gif" "giflib")
769 (with "--with-jpeg" "libjpeg-turbo")
770 (with "--with-libtiff" "libtiff")
771 (with "--with-geotiff" "libgeotiff")
772 (with "--with-libz" "zlib")
773 (with "--with-expat" "expat")
774 (with "--with-sqlite3" "sqlite")
777 (modify-phases %standard-phases
778 (add-before 'build 'fix-path
780 (substitute* "frmts/mrf/mrf_band.cpp"
781 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
788 ("libgeotiff" ,libgeotiff)
789 ("libjpeg-turbo" ,libjpeg-turbo)
795 ("postgresql" ,postgresql) ; libpq
800 `(("pkg-config" ,pkg-config)))
801 (home-page "https://gdal.org/")
802 (synopsis "Raster and vector geospatial data format library")
803 (description "GDAL is a translator library for raster and vector geospatial
804 data formats. As a library, it presents a single raster abstract data model
805 and single vector abstract data model to the calling application for all
806 supported formats. It also comes with a variety of useful command line
807 utilities for data translation and processing.")
811 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
812 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
815 ;; frmts/hdf4/hdf-eos/*
816 ;; similar to the expat license, but without guarantee exclusion
817 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
818 ;; frmts/grib/degrib/
819 license:public-domain ; with guarantee exclusion
821 ;; Some bsd-inspired license
822 (license:non-copyleft "file://port/LICENCE_minizip")
823 ;; alg/internal_libqhull
824 ;; Some 5-clause license
825 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
829 (define-public python-gdal
830 (package (inherit gdal)
832 (build-system python-build-system)
834 '(#:tests? #f ; no tests
836 (modify-phases %standard-phases
837 (add-before 'build 'chdir
839 (chdir "swig/python")
843 `(("python-numpy" ,python-numpy)))
846 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
848 (define-public postgis
854 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
858 "05s8cx1rlysiq7dd44kf7cid0la61a4p895j9g95bvfb8v8dpzh7"))))
859 (build-system gnu-build-system)
863 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
864 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
865 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
866 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
868 (modify-phases %standard-phases
869 (add-before 'build 'fix-install-path
870 (lambda* (#:key outputs #:allow-other-keys)
871 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
872 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
873 (string-append (assoc-ref outputs "out") "/bin"))))))))
879 ("libjpeg" ,libjpeg-turbo)
882 ("postgresql" ,postgresql)
886 ("pkg-config" ,pkg-config)))
887 (home-page "https://postgis.net")
888 (synopsis "Spatial database extender for PostgreSQL")
889 (description "PostGIS is a spatial database extender for PostgreSQL
890 object-relational database. It adds support for geographic objects allowing
891 location queries to be run in SQL. This package provides a PostgreSQL
896 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
899 license:public-domain
901 license:bsd-3 ; files only say "BSD"
903 license:cc-by-sa3.0))))
905 (define-public tegola
912 "https://github.com/go-spatial/tegola/archive/v"
914 (file-name (string-append name "-" version ".tar.gz"))
917 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
918 (build-system go-build-system)
920 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
921 #:unpack-path "github.com/go-spatial/tegola"
923 (modify-phases %standard-phases
924 (add-before 'build 'set-version
926 (with-directory-excursion "src/github.com/go-spatial/tegola"
927 (substitute* '("cmd/tegola/cmd/root.go"
928 "cmd/tegola_lambda/main.go")
929 (("version not set") ,version)))
931 (home-page "https://tegola.io")
932 (synopsis "Vector tile server for maps")
933 (description "Tegola is a free vector tile server written in Go. Tegola
934 takes geospatial data and slices it into vector tiles that can be efficiently
935 delivered to any client.")
938 ;; Some packages in vendor have other licenses
944 (define-public imposm3
947 (version "0.6.0-alpha.4")
951 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
953 (file-name (string-append name "-" version ".tar.gz"))
956 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
957 (build-system go-build-system)
959 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
960 #:unpack-path "github.com/omniscale/imposm3"
962 (modify-phases %standard-phases
963 (add-before 'build 'set-version
965 (substitute* "src/github.com/omniscale/imposm3/version.go"
966 (("0.0.0-dev") ,version))
970 ("leveldb" ,leveldb)))
971 (home-page "https://imposm.org/")
972 (synopsis "OpenStreetMap importer for PostGIS")
973 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
974 files and imports the data into PostgreSQL/PostGIS databases. It is designed
975 to create databases that are optimized for rendering/tile/map-services.")
978 ;; Some dependencies in vendor have different licenses
983 (define-public libosmium
991 (url "https://github.com/osmcode/libosmium")
992 (commit (string-append "v" version))))
993 (file-name (git-file-name name version))
995 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
996 (build-system cmake-build-system)
1004 ("protozero" ,protozero)
1005 ("sparsehash" ,sparsehash)
1009 `(("doxygen" ,doxygen)))
1010 (home-page "https://osmcode.org/libosmium/")
1011 (synopsis "C++ library for working with OpenStreetMap data")
1012 (description "Libosmium is a fast and flexible C++ library for working with
1013 OpenStreetMap data.")
1014 (license license:boost1.0)))
1016 (define-public osm2pgsql
1024 (url "https://github.com/openstreetmap/osm2pgsql")
1026 (file-name (git-file-name name version))
1028 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
1029 (modules '((guix build utils)))
1032 (delete-file-recursively "contrib/protozero")
1033 (delete-file-recursively "contrib/libosmium")
1035 (build-system cmake-build-system)
1037 `(#:tests? #f; tests fail because we need to setup a database
1039 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1040 (assoc-ref %build-inputs "libosmium")
1042 (string-append "-DPROTOZERO_INCLUDE_DIR="
1043 (assoc-ref %build-inputs "protozero")
1049 ("libosmium" ,libosmium)
1051 ("postgresql" ,postgresql)
1053 ("protozero" ,protozero)
1056 `(("python" ,python)
1057 ("python-psycopg2" ,python-psycopg2)))
1058 (home-page "https://github.com/openstreetmap/osm2pgsql")
1059 (synopsis "OSM data importer to postgresql")
1060 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1061 PostgreSQL / PostGIS database suitable for applications like rendering into a
1062 map, geocoding with Nominatim, or general analysis.")
1063 (license license:gpl2+)))
1065 (define-public tippecanoe
1073 (url "https://github.com/mapbox/tippecanoe")
1075 (file-name (git-file-name name version))
1077 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
1078 (build-system gnu-build-system)
1081 (modify-phases %standard-phases (delete 'configure))
1082 #:test-target "test"
1085 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1090 (home-page "https://github.com/mapbox/tippecanoe")
1091 (synopsis "Vector tile server for maps")
1092 (description "Tippecanoe creates scale-independent view of data, so that
1093 the texture and density of features is visible at every zoom level, instead of
1094 dropping features at lower levels.")
1095 (license license:bsd-2)))
1097 (define-public osmctools
1105 (url "https://gitlab.com/osm-c-tools/osmctools")
1107 (file-name (git-file-name name version))
1110 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1111 (build-system gnu-build-system)
1113 `(("autoconf" ,autoconf)
1114 ("automake" ,automake)))
1117 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1118 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1119 (description "This project contains a few tools which are used in the
1120 OpenStreetMap project. They can be used to convert, filter and update
1121 OpenStreetMap data files.")
1122 (license license:agpl3)))
1124 (define-public osm-gps-map
1126 (name "osm-gps-map")
1132 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1133 version "/osm-gps-map-" version ".tar.gz"))
1136 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1137 (build-system gnu-build-system)
1139 `(("gnome-common" ,gnome-common)
1140 ("gtk-doc" ,gtk-doc)
1141 ("pkg-config" ,pkg-config)))
1145 ("gobject-introspection" ,gobject-introspection)
1147 ("libsoup" ,libsoup)))
1148 (home-page "https://nzjrs.github.io/osm-gps-map/")
1149 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1151 "This package provides a GTK+ widget (and Python bindings) that when
1152 given GPS coordinates,draws a GPS track, and points of interest on a moving
1153 map display. Downloads map data from a number of websites, including
1154 @url{https://www.openstreetmap.org}.")
1155 (license license:gpl2+)))
1157 (define-public xygrib
1164 (url "https://github.com/opengribs/XyGrib")
1165 (commit (string-append "v" version))))
1166 (file-name (git-file-name name version))
1169 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1170 (modules '((guix build utils)))
1172 '(begin (delete-file-recursively "data/fonts") #t))))
1173 (build-system cmake-build-system)
1176 (modify-phases %standard-phases
1177 (add-after 'unpack 'patch-directories
1178 (lambda* (#:key inputs #:allow-other-keys)
1179 (let ((jpeg (assoc-ref inputs "openjpeg"))
1180 (font (assoc-ref inputs "font-liberation")))
1181 (substitute* "CMakeLists.txt"
1184 ;; Fix install locations.
1185 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1186 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1187 ;; Skip looking for the static library.
1188 (("\"libnova.a\"") ""))
1189 ;; Don't use the bundled font-liberation.
1190 (substitute* "src/util/Font.cpp"
1191 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1192 (string-append "\"" font "/share/fonts/truetype/\"")))
1193 (substitute* "src/util/Util.h"
1194 (("pathData\\(\\)\\+\"data/fonts/\"")
1195 (string-append "\"" font "/share/fonts/\""))))
1197 #:tests? #f)) ; no tests
1199 `(("qttools" ,qttools)))
1202 ("font-liberation" ,font-liberation)
1203 ("libnova" ,libnova)
1205 ("openjpeg" ,openjpeg)
1209 (synopsis "Weather Forecast Visualization")
1211 "XyGrib is a Grib file reader and visualizes meteorological data providing
1212 an off-line capability to analyse weather forecasts or hindcasts. It is
1213 intended to be used as a capable weather work station for anyone with a serious
1214 interest in examining weather. This would include members of the sailing
1215 community, private and sport aviators, farmers, weather buffs and many more.
1216 XyGrib is the continuation of the zyGrib software package with a new team of
1218 (home-page "https://opengribs.org")
1219 (license license:gpl3+)))
1221 (define-public libspatialindex
1223 (name "libspatialindex")
1228 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1229 "releases/download/" version "/spatialindex-src-"
1230 version ".tar.bz2"))
1233 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1234 (build-system cmake-build-system)
1235 (home-page "https://libspatialindex.org")
1236 (synopsis "Spatial indexing library")
1237 (description "The purpose of this library is to provide:
1240 @item An extensible framework that will support robust spatial indexing
1242 @item Support for sophisticated spatial queries. Range, point location,
1243 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1244 by spatial constraints) should be easy to deploy and run.
1245 @item Easy to use interfaces for inserting, deleting and updating information.
1246 @item Wide variety of customization capabilities. Basic index and storage
1247 characteristics like the page size, node capacity, minimum fan-out, splitting
1248 algorithm, etc. should be easy to customize.
1249 @item Index persistence. Internal memory and external memory structures
1250 should be supported. Clustered and non-clustered indices should be easy to be
1254 (license license:expat)))
1256 (define-public java-jmapviewer
1258 (name "java-jmapviewer")
1262 (uri (string-append "https://svn.openstreetmap.org/applications/"
1263 "viewer/jmapviewer/releases/" version
1264 "/JMapViewer-" version "-Source.zip"))
1267 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1268 (build-system ant-build-system)
1270 `(("unzip" ,unzip)))
1272 `(#:build-target "pack"
1273 #:tests? #f; No tests
1275 (modify-phases %standard-phases
1276 (add-before 'build 'clean
1278 (invoke "ant" "clean")))
1280 (lambda* (#:key outputs #:allow-other-keys)
1281 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1283 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1285 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1286 (synopsis "OSM map integration in Java")
1287 (description "JMapViewer is a Java component which easily
1288 integrates an OSM map view into your Java application. It is maintained as
1289 an independent project by the JOSM team.")
1290 (license license:gpl2)))
1292 (define-public java-opening-hours-parser
1294 (name "java-opening-hours-parser")
1299 (url "https://github.com/simonpoole/OpeningHoursParser")
1301 (file-name (git-file-name name version))
1304 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1305 (build-system ant-build-system)
1307 `(#:jar-name "java-opening-hours-parser.jar"
1308 #:source-dir "src/main/java"
1310 (modify-phases %standard-phases
1311 (add-before 'build 'copy-resources
1313 (copy-recursively "src/main/resources" "build/classes")
1315 (add-before 'build 'generate-parser
1317 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1318 (file (string-append dir "/OpeningHoursParser.jj")))
1319 (invoke "javacc" "-DEBUG_PARSER=false"
1320 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1321 "-GRAMMAR_ENCODING=UTF-8"
1322 (string-append "-OUTPUT_DIRECTORY=" dir)
1326 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1328 `(("javacc" ,javacc)
1329 ("java-junit" ,java-junit)
1330 ("java-hamcrest-core" ,java-hamcrest-core)))
1331 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1332 (synopsis "Java parser for the OpenStreetMap opening hour format")
1333 (description "This is a very simplistic parser for string values according
1334 to the OSM opening hours specification.")
1335 (license license:expat)))
1344 (url "https://josm.openstreetmap.de/svn/trunk")
1345 (revision (string->number version))
1349 "0bq6mirdsi0kmhjfzfp3innxi5a4395d7mas7ikxaz0cziljrz1i"))
1350 (file-name (string-append name "-" version "-checkout"))
1351 (modules '((guix build utils)))
1354 (for-each delete-file (find-files "." ".*.jar$"))
1356 (build-system ant-build-system)
1358 `(("javacc" ,javacc)))
1360 `(("java-commons-jcs" ,java-commons-jcs)
1361 ("java-commons-compress" ,java-commons-compress)
1362 ("java-jmapviewer" ,java-jmapviewer)
1363 ("java-jsonp-api" ,java-jsonp-api)
1364 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1365 ("java-metadata-extractor" ,java-metadata-extractor)
1366 ("java-opening-hours-parser" ,java-opening-hours-parser)
1367 ("java-openjfx-media" ,java-openjfx-media)
1368 ("java-signpost-core" ,java-signpost-core)
1369 ("java-svg-salamander" ,java-svg-salamander)))
1372 #:jar-name "josm.jar"
1374 (modify-phases %standard-phases
1375 (add-after 'unpack 'rm-build.xml
1377 (delete-file "build.xml")
1379 (add-before 'build 'fix-revision
1381 (with-output-to-file "REVISION.XML"
1384 (string-append "<info><entry><commit revision=\"" ,version "\">"
1385 "<date>1970-01-01 00:00:00 +0000</date>"
1386 "</commit></entry></info>"))))
1388 (add-before 'build 'fix-jcs
1390 ;; This version of JOSM uses an unreleased version of commons-jcs,
1391 ;; which has renamed its classes to another namespace. Rename them
1392 ;; back so they can be used with our version of jcs.
1393 (substitute* (find-files "." ".*.java$")
1396 (add-before 'build 'fix-classpath
1397 (lambda* (#:key inputs #:allow-other-keys)
1402 (let ((source (assoc-ref inputs "source")))
1403 (not (equal? (substring s 0 (string-length source))
1405 (string-split (getenv "CLASSPATH") #\:))
1408 (add-before 'build 'generate-parser
1410 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1411 (out (string-append dir "/parsergen"))
1412 (file (string-append dir "/MapCSSParser.jj")))
1413 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1414 (invoke "javacc" "-DEBUG_PARSER=false"
1415 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1416 "-GRAMMAR_ENCODING=UTF-8"
1417 (string-append "-OUTPUT_DIRECTORY=" out)
1420 (add-after 'build 'generate-epsg
1422 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1423 "-cp" "build/classes")
1424 (mkdir-p "data/projection")
1425 (with-output-to-file "data/projection/custom-epsg"
1426 (lambda _ (display "")))
1427 (invoke "java" "-cp" "build/classes:scripts:."
1428 "BuildProjectionDefinitions" ".")
1430 (add-after 'generate-epsg 'copy-resources
1432 (copy-recursively "resources" "build/classes")
1434 (add-before 'install 'regenerate-jar
1436 ;; We need to regenerate the jar file to add data.
1437 (delete-file "build/jar/josm.jar")
1438 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1439 "build/classes" ".")
1441 (add-before 'build 'copy-revision
1443 (mkdir-p "build/classes")
1444 (with-output-to-file "build/classes/REVISION"
1447 (string-append "Revision: " ,version "\n"
1448 "Is-Local-Build: true\n"
1449 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1451 (add-after 'install 'install-share-directories
1452 (lambda* (#:key outputs #:allow-other-keys)
1453 (let ((out (assoc-ref outputs "out"))
1454 (share-directories '("applications" "icons" "man" "menu"
1455 "metainfo" "mime" "pixmaps")))
1456 (for-each (lambda (directory)
1457 (copy-recursively (string-append
1458 "native/linux/tested/usr/share/"
1461 out "/share/" directory)))
1464 (add-after 'install 'install-bin
1465 (lambda* (#:key outputs inputs #:allow-other-keys)
1466 (let* ((out (assoc-ref outputs "out"))
1467 (bin (string-append out "/bin")))
1469 (with-output-to-file (string-append bin "/josm")
1472 (string-append "#!/bin/sh\n"
1473 (assoc-ref inputs "jdk") "/bin/java"
1474 " -cp " out "/share/java/josm.jar:"
1475 (getenv "CLASSPATH")
1476 " org.openstreetmap.josm.gui.MainApplication"))))
1477 (chmod (string-append bin "/josm") #o755))
1479 (home-page "https://josm.openstreetmap.de")
1480 (synopsis "OSM editor")
1481 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1482 supports loading GPX tracks, background imagery and OSM data from local
1483 sources as well as from online sources and allows editing the OSM data (nodes,
1484 ways, and relations) and their metadata tags.")
1485 (license license:gpl2+)))
1487 (define-public libmaxminddb
1489 (name "libmaxminddb")
1494 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1495 "/releases/download/" version "/"
1496 "/libmaxminddb-" version ".tar.gz"))
1498 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1499 (build-system gnu-build-system)
1502 (list ,(string-append "CC=" (cc-for-target)))))
1505 (home-page "https://maxmind.github.io/libmaxminddb/")
1506 (synopsis "C library for the MaxMind DB file format")
1507 (description "The libmaxminddb library provides a C library for reading
1508 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1509 format is a custom, but open, binary format designed to facilitate fast
1510 lookups of IP addresses while allowing flexibility in the type of data
1511 associated with an address.")
1512 (license license:asl2.0)))
1514 (define-public python-maxminddb
1516 (name "python-maxminddb")
1521 (uri (pypi-uri "maxminddb" version))
1524 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1525 (build-system python-build-system)
1527 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1529 `(("libmaxminddb" ,libmaxminddb)))
1530 (home-page "https://www.maxmind.com/")
1531 (synopsis "Reader for the MaxMind DB format")
1532 (description "MaxMind DB is a binary file format that stores data indexed
1533 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1535 (license license:asl2.0)))
1537 (define-public python-geoip2
1539 (name "python-geoip2")
1544 (uri (pypi-uri "geoip2" version))
1547 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1548 (build-system python-build-system)
1550 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1552 `(("python-maxminddb" ,python-maxminddb)
1553 ("python-requests" ,python-requests)))
1554 (home-page "https://www.maxmind.com/")
1555 (synopsis "MaxMind GeoIP2 API")
1556 (description "Provides an API for the GeoIP2 web services and databases.
1557 The API also works with MaxMind’s free GeoLite2 databases.")
1558 (license license:asl2.0)))
1560 (define-public routino
1567 (uri (string-append "http://www.routino.org/download/routino-"
1570 (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
1571 (build-system gnu-build-system)
1579 `(#:test-target "test"
1581 (modify-phases %standard-phases
1583 (lambda* (#:key outputs #:allow-other-keys)
1584 (substitute* "Makefile.conf"
1585 (("prefix=/usr/local")
1586 (string-append "prefix=" (assoc-ref outputs "out")))
1587 (("LDFLAGS_LDSO=-Wl,-R\\.")
1588 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1589 (("#CFLAGS\\+=-DUSE_XZ")
1591 (("#LDFLAGS\\+=-llzma")
1594 (synopsis "Routing application for OpenStreetMap data")
1596 "Routino is an application for finding a route between two points
1597 using the dataset of topographical information collected by
1598 @url{https://www.OpenStreetMap.org}.")
1599 (home-page "https://www.routino.org/")
1600 (license license:agpl3+)))
1602 (define-public qmapshack
1610 (url "https://github.com/Maproom/qmapshack")
1611 (commit (string-append "V_" version))))
1612 (file-name (git-file-name name version))
1615 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1616 (build-system qt-build-system)
1618 `(("pkg-config" ,pkg-config)
1619 ("qttools" ,qttools)))
1622 ("libjpeg-turbo" ,libjpeg-turbo)
1625 ("qtdeclarative" ,qtdeclarative)
1626 ("qtlocation" ,qtlocation)
1627 ("qtwebchannel" ,qtwebchannel)
1628 ("qtwebengine" ,qtwebengine)
1630 ("routino" ,routino)
1631 ("sqlite" ,sqlite) ; See wrap phase
1636 (modify-phases %standard-phases
1637 (add-after 'unpack 'fix-cmake-modules
1638 (lambda* (#:key inputs #:allow-other-keys)
1639 (substitute* "CMakeLists.txt"
1640 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1641 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1642 (substitute* "cmake/Modules/FindROUTINO.cmake"
1644 (assoc-ref inputs "routino")))
1645 ;; The following fixes are included as patches in the sources
1646 ;; of QMapShack, but they are not applied by default, for
1648 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1649 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1651 (add-after 'install 'wrap
1652 ;; The program fails to find the QtWebEngineProcess program,
1653 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1654 (lambda* (#:key inputs outputs #:allow-other-keys)
1655 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1656 (qtwebengineprocess (string-append
1657 (assoc-ref inputs "qtwebengine")
1658 "/lib/qt5/libexec/QtWebEngineProcess")))
1659 (for-each (lambda (program)
1660 (wrap-program program
1661 `("QTWEBENGINEPROCESS_PATH" =
1662 (,qtwebengineprocess))))
1663 (find-files bin ".*")))
1665 (synopsis "GPS mapping application")
1667 "QMapShack can be used to plan your next outdoor trip or to visualize and
1668 archive all the GPS recordings of your past trips. It is the successor of the
1669 QLandkarte GT application.")
1670 (home-page "https://github.com/Maproom/qmapshack/wiki")
1671 (license license:gpl3+)))
1673 (define-public readosm
1680 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1681 "readosm-" version ".tar.gz"))
1683 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
1684 (build-system gnu-build-system)
1688 (synopsis "Data extractor for OpenStreetMap files")
1690 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1691 input file (in @code{.osm} or @code{.osm.pbf} format).")
1692 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1693 (license (list license:gpl2+
1697 (define-public shapelib
1705 (url "https://github.com/OSGeo/shapelib")
1706 (commit (string-append "v" version))))
1707 (file-name (git-file-name name version))
1709 (base32 "1lzch0jf6yqhw391phhafzw4ghmiz98zkf698h4fmq109fa2vhqd"))))
1710 (build-system gnu-build-system)
1712 `(("autoconf" ,autoconf)
1713 ("automake" ,automake)
1714 ("libtool" ,libtool)))
1715 (home-page "http://shapelib.maptools.org/")
1716 (synopsis "Provides C library to write and update ESRI Shapefiles")
1718 "The Shapefile C Library provides the ability to write simple C programs
1719 for reading, writing and updating (to a limited extent) ESRI Shapefiles, and the
1720 associated attribute file (@file{.dbf}).")
1721 (license license:gpl2+)))
1723 (define-public spatialite-tools
1725 (name "spatialite-tools")
1730 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1731 "spatialite-tools-" version ".tar.gz"))
1733 (base32 "0ckddgdpxhy6vkpr9q2hnx5qmanrd8g4pqnifbrq1i5jrj82s2dd"))))
1734 (build-system gnu-build-system)
1736 `(("pkg-config" ,pkg-config)))
1741 ("librttopo" ,librttopo)
1742 ("libspatialite" ,libspatialite)
1743 ("libxml2" ,libxml2)
1744 ("minizip" ,minizip)
1746 ("readosm" ,readosm)
1749 (synopsis "Collection of command line tools for SpatiaLite")
1751 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1752 tools supporting SpatiaLite.")
1753 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1754 (license license:gpl3+)))
1756 (define-public virtualpg
1763 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1764 "virtualpg-" version ".tar.gz"))
1766 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1767 (build-system gnu-build-system)
1769 `(("postgresql" ,postgresql)
1770 ("sqlite" ,sqlite)))
1771 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1773 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1774 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1775 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1776 exchanged form one Spatial DBMS and the other.")
1777 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1778 (license (list license:gpl2+
1782 (define-public opencpn
1790 (url "https://github.com/OpenCPN/OpenCPN")
1791 (commit (string-append "v" version))))
1792 (file-name (git-file-name name version))
1794 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1795 (build-system cmake-build-system)
1797 `(("gettext" ,gettext-minimal)
1798 ("pkg-config" ,pkg-config)))
1805 ("libarchive" ,libarchive)
1807 ("libexif" ,libexif)
1808 ("libsndfile" ,libsndfile)
1812 ("portaudio" ,portaudio)
1814 ("tinyxml" ,tinyxml)
1816 ("wxwidgets" ,wxwidgets)
1820 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1821 "-DENABLE_SNDFILE=ON"
1822 "-DBUNDLE_TCDATA=ON"
1823 "-DBUNDLE_GSHHS=CRUDE")
1824 #:tests? #f ; No tests defined
1826 (modify-phases %standard-phases
1827 (add-after 'unpack 'fix-build
1829 (substitute* "CMakeLists.txt"
1830 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1831 (string-append all " --libs all")))
1833 (synopsis "Chart plotter and marine GPS navigation software")
1835 "OpenCPN is a chart plotter and marine navigation software designed to be
1836 used at the helm station of your boat while underway. Chart a course and
1837 track your position right from your laptop.")
1838 (home-page "https://opencpn.org/")
1839 (license (list license:asl2.0
1850 (define-public grass
1851 (let* ((version "7.8.5")
1852 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1853 (grassxx (string-append "grass" majorminor)))
1860 (uri (string-append "https://grass.osgeo.org/" grassxx
1861 "/source/grass-" version ".tar.gz"))
1863 (base32 "0dzzhgcsrszzinvjir50nvzq873b8gsp0p9k8fvcrv14amkbnnd3"))))
1864 (build-system gnu-build-system)
1869 ("freetype" ,freetype)
1875 ("libtiff" ,libtiff)
1877 ("mariadb-dev" ,mariadb "dev")
1878 ("mariadb-lib" ,mariadb "lib")
1880 ("openblas" ,openblas)
1882 ("postgresql" ,postgresql)
1885 ("python-dateutil" ,python-dateutil)
1886 ("python-numpy" ,python-numpy)
1887 ("python-wxpython" ,python-wxpython)
1888 ("readline" ,readline)
1890 ("wxwidgets" ,wxwidgets)
1892 ("zstd" ,zstd "lib")))
1894 `(("bash" ,bash-minimal)
1897 ("pkg-config" ,pkg-config)))
1899 `(#:tests? #f ; No tests
1900 #:modules ((guix build gnu-build-system)
1901 ((guix build python-build-system) #:prefix python:)
1903 #:imported-modules (,@%gnu-build-system-modules
1904 (guix build python-build-system))
1906 (modify-phases %standard-phases
1908 (lambda* (#:key inputs outputs #:allow-other-keys)
1909 (let ((shell (string-append (assoc-ref inputs "bash")
1911 (setenv "SHELL" shell)
1912 (setenv "CONFIG_SHELL" shell)
1913 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1914 (assoc-ref outputs "out")
1915 "/" ,grassxx "/lib")))
1916 (invoke "./configure"
1917 (string-append "--prefix="
1918 (assoc-ref outputs "out"))
1921 (string-append "--with-freetype-includes="
1922 (assoc-ref inputs "freetype")
1923 "/include/freetype2")
1924 (string-append "--with-freetype-libs="
1925 (assoc-ref inputs "freetype")
1930 (string-append "--with-mysql-includes="
1931 (assoc-ref inputs "mariadb-dev")
1933 (string-append "--with-mysql-libs="
1934 (assoc-ref inputs "mariadb-lib")
1938 (string-append "--with-proj-share="
1939 (assoc-ref inputs "proj.4")
1944 "--with-wxwidgets")))
1945 (add-after 'install 'install-links
1946 (lambda* (#:key outputs #:allow-other-keys)
1947 ;; Put links for includes and libraries in the standard places.
1948 (let* ((out (assoc-ref outputs "out"))
1949 (dir (string-append out "/" ,grassxx)))
1950 (symlink (string-append dir "/include")
1951 (string-append out "/include"))
1952 (symlink (string-append dir "/lib")
1953 (string-append out "/lib")))
1955 (add-after 'install-links 'python:wrap
1956 (assoc-ref python:%standard-phases 'wrap))
1957 (add-after 'python:wrap 'wrap-with-python-interpreter
1958 (lambda* (#:key outputs #:allow-other-keys)
1959 (let ((out (assoc-ref outputs "out")))
1960 (wrap-program (string-append out "/bin/" ,grassxx)
1961 `("GRASS_PYTHON" = (,(which "python3"))))
1963 (synopsis "GRASS Geographic Information System")
1965 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1966 Information System (GIS) software suite used for geospatial data management and
1967 analysis, image processing, graphics and maps production, spatial modeling, and
1969 (home-page "https://grass.osgeo.org/")
1970 (license license:gpl2+))))
1979 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1980 (version-major version) "/SAGA%20-%20" version
1981 "/saga-" version ".tar.gz"))
1983 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1984 (build-system gnu-build-system)
1986 `(("pkg-config" ,pkg-config)
1994 ("libharu" ,libharu)
1995 ("libtiff" ,libtiff)
1997 ("postgresql" ,postgresql)
2001 ("unixodbc" ,unixodbc)
2003 ("wxwidgets" ,wxwidgets)))
2005 '(#:configure-flags '("--enable-python")))
2006 (synopsis "System for Automated Geoscientific Analyses")
2008 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
2009 Information System (GIS) software. It has been designed for an easy and
2010 effective implementation of spatial algorithms and it offers a comprehensive,
2011 growing set of geoscientific methods.")
2012 (home-page "http://www.saga-gis.org")
2013 (license (list license:gpl2+ license:lgpl2.1+))))
2022 (uri (string-append "https://qgis.org/downloads/qgis-"
2023 version ".tar.bz2"))
2025 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
2026 (build-system cmake-build-system)
2028 `(#:modules ((guix build cmake-build-system)
2029 ((guix build python-build-system) #:prefix python:)
2030 (guix build qt-utils)
2032 #:imported-modules (,@%cmake-build-system-modules
2033 (guix build python-build-system)
2034 (guix build qt-utils))
2036 (modify-phases %standard-phases
2037 ;; Configure correct path to PyQt5 SIP directory
2038 (add-after 'unpack 'configure-pyqt5-sip-path
2039 (lambda* (#:key inputs #:allow-other-keys)
2040 (substitute* "cmake/FindPyQt5.cmake"
2041 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
2042 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
2043 "/share/sip\" PYQT5_SIP_DIR")))
2044 (substitute* (list "scripts/prepare-commit.sh"
2045 "scripts/runtests-local-travis-config.sh"
2046 "scripts/sip_include.sh"
2048 "scripts/sipify_all.sh"
2049 "scripts/spell_check/check_spelling.sh"
2050 "scripts/spell_check/spell_test.sh"
2051 "scripts/verify-indentation.sh"
2052 "tests/code_layout/test_banned_keywords.sh"
2053 "tests/code_layout/test_licenses.sh"
2054 "tests/code_layout/test_shellcheck.sh"
2055 "tests/code_layout/test_sip_include.sh"
2056 "tests/code_layout/test_sipfiles_uptodate.sh"
2057 "tests/code_layout/test_sipify.sh")
2058 (("\\$\\(git rev-parse --show-toplevel\\)")
2060 (substitute* "tests/code_layout/test_sip_include.sh"
2061 (("^REV=.*") "REV=currentrev\n"))
2064 (lambda* (#:key inputs #:allow-other-keys)
2065 (setenv "HOME" "/tmp")
2066 (system (string-append (assoc-ref inputs "xorg-server")
2068 (setenv "DISPLAY" ":1")
2069 (setenv "TRAVIS" "true")
2070 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2073 '(;; Disable tests that require network access
2074 "qgis_filedownloader"
2075 ;; TODO: Find why the following tests fail
2076 "ProcessingQgisAlgorithmsTestPt1"
2077 "ProcessingQgisAlgorithmsTestPt2"
2078 "ProcessingQgisAlgorithmsTestPt3"
2079 "ProcessingQgisAlgorithmsTestPt4"
2080 "ProcessingGdalAlgorithmsRasterTest"
2081 "ProcessingGdalAlgorithmsVectorTest"
2082 "ProcessingGrass7AlgorithmsImageryTest"
2083 "ProcessingGrass7AlgorithmsRasterTest"
2084 "ProcessingGrass7AlgorithmsVectorTest"
2085 "ProcessingOtbAlgorithmsTest"
2086 "qgis_authmanagertest"
2087 "qgis_compositionconvertertest"
2088 "qgis_coordinatereferencesystemtest"
2090 "qgis_layouthtmltest"
2091 "qgis_layoutmaptest"
2092 "qgis_layoutmapgridtest"
2093 "qgis_painteffecttest"
2094 "qgis_pallabelingtest"
2095 "qgis_svgmarkertest"
2096 "qgis_taskmanagertest"
2098 "qgis_processingtest"
2099 "qgis_wcsprovidertest"
2100 "qgis_arcgisrestutilstest"
2101 "qgis_grassprovidertest7"
2102 "qgis_gpsinformationwidget"
2104 "PyQgsPythonProvider"
2106 "PyQgsAuthenticationSystem"
2111 "PyQgsLayerMetadata"
2114 "PyQgsLayoutMapGrid"
2116 "PyQgsLayoutExporter"
2119 "PyQgsOGRProviderGpkg"
2120 "PyQgsPalLabelingLayout"
2121 "PyQgsImportIntoPostGIS"
2122 "PyQgsProviderConnectionPostgres"
2123 "PyQgsProviderConnectionGpkg"
2124 "PyQgsShapefileProvider"
2128 "PyQgsSpatialiteProvider"
2129 "PyQgsVectorFileWriter"
2131 "PyQgsVectorLayerUtils"
2132 "PyQgsVirtualLayerProvider"
2134 "PyQgsOapifProvider"
2135 "PyQgsLayerDependencies"
2136 "PyQgsDBManagerGpkg"
2137 "PyQgsDBManagerSpatialite"
2139 "PyQgsAuxiliaryStorage"
2140 "PyQgsSelectiveMasking"
2142 "qgis_geometrycheckstest"
2146 "qgis_sip_uptodate")
2148 (add-after 'install 'wrap-python
2149 (assoc-ref python:%standard-phases 'wrap))
2150 (add-after 'wrap-python 'wrap-qt
2151 (lambda* (#:key outputs #:allow-other-keys)
2152 (wrap-qt-program (assoc-ref outputs "out") "qgis")
2154 (add-after 'wrap-qt 'wrap-gis
2155 (lambda* (#:key inputs outputs #:allow-other-keys)
2156 (let* ((out (assoc-ref outputs "out"))
2157 (saga (string-append (assoc-ref inputs "saga") "/bin"))
2158 (grass-version ,(package-version grass))
2159 (grass-majorminor (string-join
2161 (string-split grass-version #\.) 2)
2163 (grass (string-append (assoc-ref inputs "grass")
2164 "/grass" grass-majorminor)))
2165 (wrap-program (string-append out "/bin/qgis")
2166 `("PATH" ":" prefix (,saga))
2167 `("QGIS_PREFIX_PATH" = (,out))
2168 `("GISBASE" = (,grass))))
2175 ("gpsbabel" ,gpsbabel)
2179 ("libspatialindex" ,libspatialindex)
2180 ("libspatialite" ,libspatialite)
2181 ("libxml2" ,libxml2)
2184 ("postgresql" ,postgresql)
2187 ("python-chardet" ,python-chardet)
2188 ("python-dateutil" ,python-dateutil)
2189 ("python-future" ,python-future)
2190 ("python-gdal" ,python-gdal)
2191 ("python-jinja2" ,python-jinja2)
2192 ("python-numpy" ,python-numpy)
2193 ("python-owslib" ,python-owslib)
2194 ("python-psycopg2" ,python-psycopg2)
2195 ("python-pygments" ,python-pygments)
2196 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2197 ("python-pytz" ,python-pytz)
2198 ("python-pyyaml" ,python-pyyaml)
2199 ("python-requests" ,python-requests)
2200 ("python-sip" ,python-sip)
2201 ("python-six" ,python-six)
2202 ("python-urllib3" ,python-urllib3)
2204 ("qscintilla" ,qscintilla)
2206 ("qtdeclarative" ,qtdeclarative)
2207 ("qtkeychain" ,qtkeychain)
2208 ("qtlocation" ,qtlocation)
2209 ("qtserialport" ,qtserialport)
2211 ("qtwebkit" ,qtwebkit)
2214 ("sqlite" ,sqlite)))
2219 ("perl-yaml-tiny" ,perl-yaml-tiny)
2220 ("pkg-config" ,pkg-config)
2221 ("python-mock" ,python-mock)
2222 ("python-nose2" ,python-nose2)
2223 ("qttools" ,qttools)
2224 ("shellcheck" ,shellcheck)
2225 ("xorg-server" ,xorg-server-for-tests)))
2226 (home-page "https://qgis.org")
2227 (synopsis "Geographical information system")
2228 (description "QGIS is an easy to use Geographical Information
2229 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2230 raster and vector data formats, with new support easily added using the plugin
2243 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2244 (license:fsf-free "file://debian/copyright" "Go Squared")
2248 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2250 "file://debian/copyright"
2251 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2261 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2262 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2263 (license:non-copyleft
2264 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2265 "NCL Source Code License")
2268 license:public-domain
2271 (define-public python-geographiclib
2273 (name "python-geographiclib")
2278 (uri (pypi-uri "geographiclib" version))
2281 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2282 (build-system python-build-system)
2283 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2284 (synopsis "Python geodesic routines from GeographicLib")
2286 "This is a python implementation of the geodesic routines in GeographicLib.")
2287 (license license:expat)))
2289 (define-public python-geopy
2291 (name "python-geopy")
2296 (uri (pypi-uri "geopy" version))
2299 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2300 (build-system python-build-system)
2302 `(("python-geographiclib" ,python-geographiclib)))
2304 `(("python-async-generator" ,python-async-generator)
2305 ("python-coverage" ,python-coverage)
2306 ("python-flake8" ,python-flake8)
2307 ("python-isort" ,python-isort)
2308 ("python-pytest" ,python-pytest)
2309 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2310 ("python-readme-renderer" ,python-readme-renderer)
2311 ("python-pytz" ,python-pytz)))
2312 (home-page "https://github.com/geopy/geopy")
2313 (synopsis "Geocoding library for Python")
2314 (description "@code{geopy} is a Python client for several popular geocoding
2315 web services. @code{geopy} makes it easy for Python developers to locate the
2316 coordinates of addresses, cities, countries, and landmarks across the globe
2317 using third-party geocoders and other data sources.")
2318 (license license:expat)))