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, 2020 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 'unpack 'patch-dbus-service
231 (lambda* (#:key outputs #:allow-other-keys)
232 (substitute* "data/org.gnome.Maps.service.in"
233 (("@pkgdatadir@/org.gnome.Maps")
234 (string-append (assoc-ref outputs "out") "/bin/gnome-maps")))
236 (add-after 'install 'wrap
237 (lambda* (#:key inputs outputs #:allow-other-keys)
238 (let ((out (assoc-ref outputs "out"))
239 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
240 (geocode-glib-path (string-append
241 (assoc-ref inputs "geocode-glib")
243 (goa-path (string-append
244 (assoc-ref inputs "gnome-online-accounts:lib")
246 (gdk-pixbuf-path (string-append
247 (assoc-ref inputs "gdk-pixbuf")
249 (webkitgtk-path (string-append
250 (assoc-ref inputs "webkitgtk")
252 (wrap-program (string-append out "/bin/gnome-maps")
253 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
255 ;; There seems to be no way to embed the path of
256 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
257 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
258 ;; libgeocode-glib.so.0
259 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
262 ,geocode-glib-path)))
265 `(("gettext" ,gettext-minimal)
266 ("gobject-introspection" ,gobject-introspection)
267 ("pkg-config" ,pkg-config)))
269 `(("evolution-data-server" ,evolution-data-server)
271 ("libchamplain" ,libchamplain)
273 ("libsecret" ,libsecret)
275 ("libgweather" ,libgweather)
277 ("gdk-pixbuf" ,gdk-pixbuf+svg)
278 ("glib-networking" ,glib-networking)
280 ("geocode-glib" ,geocode-glib)
281 ("gfbgraph" ,gfbgraph)
284 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
285 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
288 ("webkitgtk" ,webkitgtk)))
289 (synopsis "Graphical map viewer and wayfinding program")
290 (description "GNOME Maps is a graphical map viewer. It uses map data from
291 the OpenStreetMap project. It can provide directions for walking, bicycling,
293 (home-page "https://wiki.gnome.org/Apps/Maps")
294 (license license:gpl2+)))
296 (define-public libgaiagraphics
298 (name "libgaiagraphics")
303 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
307 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
308 (build-system gnu-build-system)
310 `(("pkg-config" ,pkg-config)))
314 ("libjpeg-turbo" ,libjpeg-turbo)
316 ("libgeotiff" ,libgeotiff)
320 (synopsis "Gaia common graphics support")
321 (description "libgaiagraphics is a library supporting
322 common-utility raster handling methods.")
323 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
324 (license license:lgpl3+)))
326 (define-public libgeotiff
333 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
335 (patches (search-patches
336 ;; See libgeotiff 1.5.1 issue
337 ;; https://github.com/OSGeo/libgeotiff/issues/22
338 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
340 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
341 (modules '((guix build utils)))
344 ;; Remove .csv files, distributed from EPSG under a restricted
345 ;; license. See LICENSE for full license text.
346 (for-each delete-file (find-files "." "\\.csv$"))
348 (build-system gnu-build-system)
350 `(("libjpeg-turbo" ,libjpeg-turbo)
354 `(;; libgeotiff headers include proj headers, so ensure those are available.
358 (list "--disable-static"
359 "--with-zlib" "--with-jpeg"
360 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
361 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
362 (description "libgeotiff is a library on top of libtiff for reading and
363 writing GeoTIFF information tags.")
364 (home-page "https://trac.osgeo.org/geotiff/")
365 ;; This is a mixture of various contributions under different licenses.
366 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
367 ;; states, as its commercial redistribution is restricted. Hence, we have
368 ;; removed it from the package.
369 (license (list license:public-domain
372 (license:non-copyleft "file://LICENSE"
373 "See LICENSE in the distribution.")))))
375 (define-public librttopo
383 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
384 (commit (string-append "librttopo-" version))))
385 (file-name (git-file-name name version))
387 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
388 (build-system gnu-build-system)
391 (modify-phases %standard-phases
392 (add-after 'unpack 'patch-autogen
394 (let ((autoconf (which "autoconf"))
395 (autoheader (which "autoheader"))
396 (aclocal (which "aclocal"))
397 (automake (which "automake"))
398 (libtoolize (which "libtoolize")))
399 (substitute* "autogen.sh"
400 (("`which autoconf 2>/dev/null`") autoconf)
401 (("`which autoheader 2>/dev/null`") autoheader)
403 (string-append "ACLOCAL=" aclocal "\n"))
405 (string-append "AUTOMAKE=" automake "\n"))
407 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
410 `(("autoconf" ,autoconf)
411 ("automake" ,automake)
413 ("pkg-config" ,pkg-config)))
416 (synopsis "Library to handle SQL/MM topologies")
418 "The RT Topology Library exposes an API to create and manage standard
419 (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
420 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
421 (license license:gpl2+)))
423 (define-public libspatialite
425 (name "libspatialite")
430 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
434 "1b3dmkgwbfi43hj3jzy2mh707khavrnw91vdd5sv387m8c1dfzvv"))))
435 (build-system gnu-build-system)
437 `(("pkg-config" ,pkg-config)))
441 ("librttopo" ,librttopo)
449 '("--enable-rttopo=yes")
451 (modify-phases %standard-phases
452 ;; 3 tests are failing, ignore them:
453 (add-after 'unpack 'ignore-broken-tests
455 (substitute* '("test/Makefile.in")
456 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
457 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
458 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
460 (synopsis "Extend SQLite to support Spatial SQL capabilities")
462 "SpatiaLite is a library intended to extend the SQLite core to support
463 fully fledged Spatial SQL capabilities.")
464 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
465 ;; For the genuine libspatialite-sources holds:
466 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
467 ;; Files under src/control_points are from GRASS
468 ;; and are licensed under GPL2+ only.
469 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
470 (license (list license:gpl2+
473 license:public-domain))))
482 (uri (string-append "http://download.osgeo.org/proj/proj-"
486 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
487 (build-system gnu-build-system)
489 `(("sqlite" ,sqlite)))
491 `(("pkg-config" ,pkg-config)))
492 (home-page "https://proj.org/")
493 (synopsis "Coordinate transformation software")
495 "Proj is a generic coordinate transformation software that transforms
496 geospatial coordinates from one coordinate reference system (CRS) to another.
497 This includes cartographic projections as well as geodetic transformations.
498 PROJ includes command line applications for easy conversion of coordinates
499 from text files or directly from user input. In addition, proj also exposes
500 an application programming interface that lets developers use the
501 functionality of proj in their own software.")
502 (license (list license:expat
503 ;; src/projections/patterson.cpp
505 ;; src/geodesic.*, src/tests/geodtest.cpp
508 (define-public proj.4
514 (uri (string-append "http://download.osgeo.org/proj/proj-"
518 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
519 (build-system gnu-build-system)
522 (modify-phases %standard-phases
523 (add-after 'unpack 'patch-test-paths
525 (substitute* '("nad/test27"
531 (("/bin/rm") (which "rm")))
533 ;; Precision problems on i686 and other platforms. See:
534 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
535 ;; Disable failing test.
536 (add-after 'patch-test-paths 'ignore-failing-tests
538 (substitute* '("nad/Makefile.in")
539 (("\tPROJ_LIB.*" all) (string-append "#" all)))
543 (home-page "https://proj.org/")
544 (synopsis "Cartographic Projections Library")
546 "Proj.4 is a library for converting coordinates between cartographic
548 (license (list license:expat
549 ;; src/PJ_patterson.c
553 ;; Embedded EPSG database.
554 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
558 (define-public mapnik
565 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
566 version "/mapnik-v" version ".tar.bz2"))
569 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
570 (build-system scons-build-system)
574 ("freetype" ,freetype)
575 ("harfbuzz" ,harfbuzz)
577 ("libjpeg-turbo" ,libjpeg-turbo)
586 `(("pkg-config" ,pkg-config)))
588 `(#:scons ,scons-python2
591 (string-append "PREFIX=" %output)
592 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
593 (home-page "https://mapnik.org/")
594 (synopsis "Toolkit for developing mapping applications")
595 (description "Mapnik is a toolkit for developing mapping applications. It
596 is basically a collection of geographic objects like maps, layers,
597 datasources, features, and geometries. At its core is a C++ shared library
598 providing algorithms and patterns for spatial data access and visualization.
599 The library does not rely on any specific windowing system and can be deployed
600 to any server environment. It is intended to play fair in a multi-threaded
601 environment and is aimed primarily, but not exclusively, at web-based
603 (license (list license:lgpl2.1+
604 ;; demo/viewer, demo/python/rundemo.py
606 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
608 ;; deps/mapnik/sparsehash
611 (license:non-copyleft "file://deps/agg/copying")))))
613 (define-public python2-mapnik
615 (name "python2-mapnik")
620 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
622 (file-name (string-append name "-" version ".tar.gz"))
625 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
626 (build-system python-build-system)
629 ("harfbuzz" ,harfbuzz)
631 ("libjpeg-turbo" ,libjpeg-turbo)
637 ("python2-pycairo" ,python2-pycairo)))
639 (let ((test-data-input
640 (lambda (repository version hash)
643 (uri (string-append "https://github.com/mapnik/" repository
644 "/archive/v" version ".tar.gz"))
645 (file-name (string-append "python-mapnik-" repository
646 "-" version ".tar.gz"))
647 (sha256 (base32 hash))))))
648 `(("python2-nose" ,python2-nose)
649 ;; Test data is released as separate tarballs
651 ,(test-data-input "test-data" "3.0.18"
652 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
654 ,(test-data-input "test-data-visual" "3.0.18"
655 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
657 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
659 (modify-phases %standard-phases
660 ;; Unpack test data into the source tree
661 (add-after 'unpack 'unpack-submodules
662 (lambda* (#:key inputs #:allow-other-keys)
663 (let ((unpack (lambda (source target)
664 (with-directory-excursion target
665 (invoke "tar" "xvf" (assoc-ref inputs source)
666 "--strip-components=1")))))
667 (unpack "test-data" "test/data")
668 (unpack "test-data-visual" "test/data-visual"))))
669 ;; Skip failing tests
670 (add-after 'unpack 'skip-tests
672 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
673 "test_unicode_regex_replace"
674 "test_proj_antimeridian_bbox"
675 "test_render_with_scale_factor")))
676 (substitute* "setup.cfg"
677 (("\\[nosetests\\]" all)
678 (string-append all "\nexclude=^("
679 (string-join skipped-tests "|") ")$")))))))))
680 (home-page "https://github.com/mapnik/python-mapnik")
681 (synopsis "Python bindings for Mapnik")
682 (description "This package provides Python bindings for Mapnik.")
683 (license license:lgpl2.1+)))
685 (define-public spatialite-gui
687 (name "spatialite-gui")
692 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
696 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
697 (build-system gnu-build-system)
699 `(("pkg-config" ,pkg-config)))
703 ("libgaiagraphics" ,libgaiagraphics)
704 ("libjpeg-turbo" ,libjpeg-turbo)
705 ("libspatialite" ,libspatialite)
709 ("wxwidgets" ,wxwidgets-2)
712 `(#:phases (modify-phases %standard-phases
713 (add-after 'unpack 'fix-gui
715 ;; Fix for the GUI not showing up.
716 (substitute* "Main.cpp"
717 (("Hide\\(\\);") ""))
719 (synopsis "Graphical user interface for SpatiaLite")
720 (description "Spatialite-gui provides a visual interface for viewing and
721 maintaining a spatialite database. You can easily see the structure of the
722 tables and data contents using point and click functions, many of which
723 construct common SQL queries, or craft your own SQL queries.")
724 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
725 (license license:gpl3+)))
734 "http://download.osgeo.org/gdal/" version "/gdal-"
738 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
739 (modules '((guix build utils)))
742 ;; TODO: frmts contains a lot more bundled code.
743 (for-each delete-file-recursively
748 "frmts/jpeg/libjpeg12"
749 "frmts/gtiff/libtiff"
750 "frmts/gtiff/libgeotiff"
752 "ogr/ogrsf_frmts/geojson/libjson"))))))
753 (build-system gnu-build-system)
757 (let-syntax ((with (syntax-rules ()
759 (string-append option "="
760 (assoc-ref %build-inputs input))))))
762 ;; TODO: --with-pcidsk, --with-pcraster
763 (with "--with-freexl" "freexl")
764 (with "--with-libjson-c" "json-c")
765 (with "--with-png" "libpng")
766 (with "--with-webp" "libwebp")
767 (with "--with-gif" "giflib")
768 (with "--with-jpeg" "libjpeg-turbo")
769 (with "--with-libtiff" "libtiff")
770 (with "--with-geotiff" "libgeotiff")
771 (with "--with-libz" "zlib")
772 (with "--with-expat" "expat")
773 (with "--with-sqlite3" "sqlite")
776 (modify-phases %standard-phases
777 (add-before 'build 'fix-path
779 (substitute* "frmts/mrf/mrf_band.cpp"
780 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
787 ("libgeotiff" ,libgeotiff)
788 ("libjpeg-turbo" ,libjpeg-turbo)
794 ("postgresql" ,postgresql) ; libpq
799 `(("pkg-config" ,pkg-config)))
800 (home-page "https://gdal.org/")
801 (synopsis "Raster and vector geospatial data format library")
802 (description "GDAL is a translator library for raster and vector geospatial
803 data formats. As a library, it presents a single raster abstract data model
804 and single vector abstract data model to the calling application for all
805 supported formats. It also comes with a variety of useful command line
806 utilities for data translation and processing.")
810 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
811 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
814 ;; frmts/hdf4/hdf-eos/*
815 ;; similar to the expat license, but without guarantee exclusion
816 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
817 ;; frmts/grib/degrib/
818 license:public-domain ; with guarantee exclusion
820 ;; Some bsd-inspired license
821 (license:non-copyleft "file://port/LICENCE_minizip")
822 ;; alg/internal_libqhull
823 ;; Some 5-clause license
824 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
828 (define-public python-gdal
829 (package (inherit gdal)
831 (build-system python-build-system)
833 '(#:tests? #f ; no tests
835 (modify-phases %standard-phases
836 (add-before 'build 'chdir
838 (chdir "swig/python")
842 `(("python-numpy" ,python-numpy)))
845 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
847 (define-public postgis
853 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
857 "05s8cx1rlysiq7dd44kf7cid0la61a4p895j9g95bvfb8v8dpzh7"))))
858 (build-system gnu-build-system)
862 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
863 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
864 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
865 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
867 (modify-phases %standard-phases
868 (add-before 'build 'fix-install-path
869 (lambda* (#:key outputs #:allow-other-keys)
870 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
871 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
872 (string-append (assoc-ref outputs "out") "/bin"))))))))
878 ("libjpeg" ,libjpeg-turbo)
881 ("postgresql" ,postgresql)
885 ("pkg-config" ,pkg-config)))
886 (home-page "https://postgis.net")
887 (synopsis "Spatial database extender for PostgreSQL")
888 (description "PostGIS is a spatial database extender for PostgreSQL
889 object-relational database. It adds support for geographic objects allowing
890 location queries to be run in SQL. This package provides a PostgreSQL
895 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
898 license:public-domain
900 license:bsd-3 ; files only say "BSD"
902 license:cc-by-sa3.0))))
904 (define-public tegola
911 "https://github.com/go-spatial/tegola/archive/v"
913 (file-name (string-append name "-" version ".tar.gz"))
916 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
917 (build-system go-build-system)
919 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
920 #:unpack-path "github.com/go-spatial/tegola"
922 (modify-phases %standard-phases
923 (add-before 'build 'set-version
925 (with-directory-excursion "src/github.com/go-spatial/tegola"
926 (substitute* '("cmd/tegola/cmd/root.go"
927 "cmd/tegola_lambda/main.go")
928 (("version not set") ,version)))
930 (home-page "https://tegola.io")
931 (synopsis "Vector tile server for maps")
932 (description "Tegola is a free vector tile server written in Go. Tegola
933 takes geospatial data and slices it into vector tiles that can be efficiently
934 delivered to any client.")
937 ;; Some packages in vendor have other licenses
943 (define-public imposm3
946 (version "0.6.0-alpha.4")
950 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
952 (file-name (string-append name "-" version ".tar.gz"))
955 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
956 (build-system go-build-system)
958 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
959 #:unpack-path "github.com/omniscale/imposm3"
961 (modify-phases %standard-phases
962 (add-before 'build 'set-version
964 (substitute* "src/github.com/omniscale/imposm3/version.go"
965 (("0.0.0-dev") ,version))
969 ("leveldb" ,leveldb)))
970 (home-page "https://imposm.org/")
971 (synopsis "OpenStreetMap importer for PostGIS")
972 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
973 files and imports the data into PostgreSQL/PostGIS databases. It is designed
974 to create databases that are optimized for rendering/tile/map-services.")
977 ;; Some dependencies in vendor have different licenses
982 (define-public libosmium
990 (url "https://github.com/osmcode/libosmium")
991 (commit (string-append "v" version))))
992 (file-name (git-file-name name version))
994 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
995 (build-system cmake-build-system)
1003 ("protozero" ,protozero)
1004 ("sparsehash" ,sparsehash)
1008 `(("doxygen" ,doxygen)))
1009 (home-page "https://osmcode.org/libosmium/")
1010 (synopsis "C++ library for working with OpenStreetMap data")
1011 (description "Libosmium is a fast and flexible C++ library for working with
1012 OpenStreetMap data.")
1013 (license license:boost1.0)))
1015 (define-public osm2pgsql
1023 (url "https://github.com/openstreetmap/osm2pgsql")
1025 (file-name (git-file-name name version))
1027 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
1028 (modules '((guix build utils)))
1031 (delete-file-recursively "contrib/protozero")
1032 (delete-file-recursively "contrib/libosmium")
1034 (build-system cmake-build-system)
1036 `(#:tests? #f; tests fail because we need to setup a database
1038 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1039 (assoc-ref %build-inputs "libosmium")
1041 (string-append "-DPROTOZERO_INCLUDE_DIR="
1042 (assoc-ref %build-inputs "protozero")
1048 ("libosmium" ,libosmium)
1050 ("postgresql" ,postgresql)
1052 ("protozero" ,protozero)
1055 `(("python" ,python)
1056 ("python-psycopg2" ,python-psycopg2)))
1057 (home-page "https://github.com/openstreetmap/osm2pgsql")
1058 (synopsis "OSM data importer to postgresql")
1059 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1060 PostgreSQL / PostGIS database suitable for applications like rendering into a
1061 map, geocoding with Nominatim, or general analysis.")
1062 (license license:gpl2+)))
1064 (define-public tippecanoe
1072 (url "https://github.com/mapbox/tippecanoe")
1074 (file-name (git-file-name name version))
1076 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
1077 (build-system gnu-build-system)
1080 (modify-phases %standard-phases (delete 'configure))
1081 #:test-target "test"
1084 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1089 (home-page "https://github.com/mapbox/tippecanoe")
1090 (synopsis "Vector tile server for maps")
1091 (description "Tippecanoe creates scale-independent view of data, so that
1092 the texture and density of features is visible at every zoom level, instead of
1093 dropping features at lower levels.")
1094 (license license:bsd-2)))
1096 (define-public osmctools
1104 (url "https://gitlab.com/osm-c-tools/osmctools")
1106 (file-name (git-file-name name version))
1109 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1110 (build-system gnu-build-system)
1112 `(("autoconf" ,autoconf)
1113 ("automake" ,automake)))
1116 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1117 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1118 (description "This project contains a few tools which are used in the
1119 OpenStreetMap project. They can be used to convert, filter and update
1120 OpenStreetMap data files.")
1121 (license license:agpl3)))
1123 (define-public osm-gps-map
1125 (name "osm-gps-map")
1131 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1132 version "/osm-gps-map-" version ".tar.gz"))
1135 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1136 (build-system gnu-build-system)
1138 `(("gnome-common" ,gnome-common)
1139 ("gtk-doc" ,gtk-doc)
1140 ("pkg-config" ,pkg-config)))
1144 ("gobject-introspection" ,gobject-introspection)
1146 ("libsoup" ,libsoup)))
1147 (home-page "https://nzjrs.github.io/osm-gps-map/")
1148 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1150 "This package provides a GTK+ widget (and Python bindings) that when
1151 given GPS coordinates,draws a GPS track, and points of interest on a moving
1152 map display. Downloads map data from a number of websites, including
1153 @url{https://www.openstreetmap.org}.")
1154 (license license:gpl2+)))
1156 (define-public xygrib
1163 (url "https://github.com/opengribs/XyGrib")
1164 (commit (string-append "v" version))))
1165 (file-name (git-file-name name version))
1168 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1169 (modules '((guix build utils)))
1171 '(begin (delete-file-recursively "data/fonts") #t))))
1172 (build-system cmake-build-system)
1175 (modify-phases %standard-phases
1176 (add-after 'unpack 'patch-directories
1177 (lambda* (#:key inputs #:allow-other-keys)
1178 (let ((jpeg (assoc-ref inputs "openjpeg"))
1179 (font (assoc-ref inputs "font-liberation")))
1180 (substitute* "CMakeLists.txt"
1183 ;; Fix install locations.
1184 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1185 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1186 ;; Skip looking for the static library.
1187 (("\"libnova.a\"") ""))
1188 ;; Don't use the bundled font-liberation.
1189 (substitute* "src/util/Font.cpp"
1190 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1191 (string-append "\"" font "/share/fonts/truetype/\"")))
1192 (substitute* "src/util/Util.h"
1193 (("pathData\\(\\)\\+\"data/fonts/\"")
1194 (string-append "\"" font "/share/fonts/\""))))
1196 #:tests? #f)) ; no tests
1198 `(("qttools" ,qttools)))
1201 ("font-liberation" ,font-liberation)
1202 ("libnova" ,libnova)
1204 ("openjpeg" ,openjpeg)
1208 (synopsis "Weather Forecast Visualization")
1210 "XyGrib is a Grib file reader and visualizes meteorological data providing
1211 an off-line capability to analyse weather forecasts or hindcasts. It is
1212 intended to be used as a capable weather work station for anyone with a serious
1213 interest in examining weather. This would include members of the sailing
1214 community, private and sport aviators, farmers, weather buffs and many more.
1215 XyGrib is the continuation of the zyGrib software package with a new team of
1217 (home-page "https://opengribs.org")
1218 (license license:gpl3+)))
1220 (define-public libspatialindex
1222 (name "libspatialindex")
1227 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1228 "releases/download/" version "/spatialindex-src-"
1229 version ".tar.bz2"))
1232 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1233 (build-system cmake-build-system)
1234 (home-page "https://libspatialindex.org")
1235 (synopsis "Spatial indexing library")
1236 (description "The purpose of this library is to provide:
1239 @item An extensible framework that will support robust spatial indexing
1241 @item Support for sophisticated spatial queries. Range, point location,
1242 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1243 by spatial constraints) should be easy to deploy and run.
1244 @item Easy to use interfaces for inserting, deleting and updating information.
1245 @item Wide variety of customization capabilities. Basic index and storage
1246 characteristics like the page size, node capacity, minimum fan-out, splitting
1247 algorithm, etc. should be easy to customize.
1248 @item Index persistence. Internal memory and external memory structures
1249 should be supported. Clustered and non-clustered indices should be easy to be
1253 (license license:expat)))
1255 (define-public java-jmapviewer
1257 (name "java-jmapviewer")
1261 (uri (string-append "https://svn.openstreetmap.org/applications/"
1262 "viewer/jmapviewer/releases/" version
1263 "/JMapViewer-" version "-Source.zip"))
1266 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1267 (build-system ant-build-system)
1269 `(("unzip" ,unzip)))
1271 `(#:build-target "pack"
1272 #:tests? #f; No tests
1274 (modify-phases %standard-phases
1275 (add-before 'build 'clean
1277 (invoke "ant" "clean")))
1279 (lambda* (#:key outputs #:allow-other-keys)
1280 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1282 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1284 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1285 (synopsis "OSM map integration in Java")
1286 (description "JMapViewer is a Java component which easily
1287 integrates an OSM map view into your Java application. It is maintained as
1288 an independent project by the JOSM team.")
1289 (license license:gpl2)))
1291 (define-public java-opening-hours-parser
1293 (name "java-opening-hours-parser")
1298 (url "https://github.com/simonpoole/OpeningHoursParser")
1300 (file-name (git-file-name name version))
1303 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1304 (build-system ant-build-system)
1306 `(#:jar-name "java-opening-hours-parser.jar"
1307 #:source-dir "src/main/java"
1309 (modify-phases %standard-phases
1310 (add-before 'build 'copy-resources
1312 (copy-recursively "src/main/resources" "build/classes")
1314 (add-before 'build 'generate-parser
1316 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1317 (file (string-append dir "/OpeningHoursParser.jj")))
1318 (invoke "javacc" "-DEBUG_PARSER=false"
1319 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1320 "-GRAMMAR_ENCODING=UTF-8"
1321 (string-append "-OUTPUT_DIRECTORY=" dir)
1325 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1327 `(("javacc" ,javacc)
1328 ("java-junit" ,java-junit)
1329 ("java-hamcrest-core" ,java-hamcrest-core)))
1330 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1331 (synopsis "Java parser for the OpenStreetMap opening hour format")
1332 (description "This is a very simplistic parser for string values according
1333 to the OSM opening hours specification.")
1334 (license license:expat)))
1343 (url "https://josm.openstreetmap.de/svn/trunk")
1344 (revision (string->number version))
1348 "0bq6mirdsi0kmhjfzfp3innxi5a4395d7mas7ikxaz0cziljrz1i"))
1349 (file-name (string-append name "-" version "-checkout"))
1350 (modules '((guix build utils)))
1353 (for-each delete-file (find-files "." ".*.jar$"))
1355 (build-system ant-build-system)
1357 `(("javacc" ,javacc)))
1359 `(("java-commons-jcs" ,java-commons-jcs)
1360 ("java-commons-compress" ,java-commons-compress)
1361 ("java-jmapviewer" ,java-jmapviewer)
1362 ("java-jsonp-api" ,java-jsonp-api)
1363 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1364 ("java-metadata-extractor" ,java-metadata-extractor)
1365 ("java-opening-hours-parser" ,java-opening-hours-parser)
1366 ("java-openjfx-media" ,java-openjfx-media)
1367 ("java-signpost-core" ,java-signpost-core)
1368 ("java-svg-salamander" ,java-svg-salamander)))
1371 #:jar-name "josm.jar"
1373 (modify-phases %standard-phases
1374 (add-after 'unpack 'rm-build.xml
1376 (delete-file "build.xml")
1378 (add-before 'build 'fix-revision
1380 (with-output-to-file "REVISION.XML"
1383 (string-append "<info><entry><commit revision=\"" ,version "\">"
1384 "<date>1970-01-01 00:00:00 +0000</date>"
1385 "</commit></entry></info>"))))
1387 (add-before 'build 'fix-jcs
1389 ;; This version of JOSM uses an unreleased version of commons-jcs,
1390 ;; which has renamed its classes to another namespace. Rename them
1391 ;; back so they can be used with our version of jcs.
1392 (substitute* (find-files "." ".*.java$")
1395 (add-before 'build 'fix-classpath
1396 (lambda* (#:key inputs #:allow-other-keys)
1401 (let ((source (assoc-ref inputs "source")))
1402 (not (equal? (substring s 0 (string-length source))
1404 (string-split (getenv "CLASSPATH") #\:))
1407 (add-before 'build 'generate-parser
1409 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1410 (out (string-append dir "/parsergen"))
1411 (file (string-append dir "/MapCSSParser.jj")))
1412 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1413 (invoke "javacc" "-DEBUG_PARSER=false"
1414 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1415 "-GRAMMAR_ENCODING=UTF-8"
1416 (string-append "-OUTPUT_DIRECTORY=" out)
1419 (add-after 'build 'generate-epsg
1421 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1422 "-cp" "build/classes")
1423 (mkdir-p "data/projection")
1424 (with-output-to-file "data/projection/custom-epsg"
1425 (lambda _ (display "")))
1426 (invoke "java" "-cp" "build/classes:scripts:."
1427 "BuildProjectionDefinitions" ".")
1429 (add-after 'generate-epsg 'copy-resources
1431 (copy-recursively "resources" "build/classes")
1433 (add-before 'install 'regenerate-jar
1435 ;; We need to regenerate the jar file to add data.
1436 (delete-file "build/jar/josm.jar")
1437 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1438 "build/classes" ".")
1440 (add-before 'build 'copy-revision
1442 (mkdir-p "build/classes")
1443 (with-output-to-file "build/classes/REVISION"
1446 (string-append "Revision: " ,version "\n"
1447 "Is-Local-Build: true\n"
1448 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1450 (add-after 'install 'install-share-directories
1451 (lambda* (#:key outputs #:allow-other-keys)
1452 (let ((out (assoc-ref outputs "out"))
1453 (share-directories '("applications" "icons" "man" "menu"
1454 "metainfo" "mime" "pixmaps")))
1455 (for-each (lambda (directory)
1456 (copy-recursively (string-append
1457 "native/linux/tested/usr/share/"
1460 out "/share/" directory)))
1463 (add-after 'install 'install-bin
1464 (lambda* (#:key outputs inputs #:allow-other-keys)
1465 (let* ((out (assoc-ref outputs "out"))
1466 (bin (string-append out "/bin")))
1468 (with-output-to-file (string-append bin "/josm")
1471 (string-append "#!/bin/sh\n"
1472 (assoc-ref inputs "jdk") "/bin/java"
1473 " -cp " out "/share/java/josm.jar:"
1474 (getenv "CLASSPATH")
1475 " org.openstreetmap.josm.gui.MainApplication"))))
1476 (chmod (string-append bin "/josm") #o755))
1478 (home-page "https://josm.openstreetmap.de")
1479 (synopsis "OSM editor")
1480 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1481 supports loading GPX tracks, background imagery and OSM data from local
1482 sources as well as from online sources and allows editing the OSM data (nodes,
1483 ways, and relations) and their metadata tags.")
1484 (license license:gpl2+)))
1486 (define-public libmaxminddb
1488 (name "libmaxminddb")
1493 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1494 "/releases/download/" version "/"
1495 "/libmaxminddb-" version ".tar.gz"))
1497 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1498 (build-system gnu-build-system)
1501 (list ,(string-append "CC=" (cc-for-target)))))
1504 (home-page "https://maxmind.github.io/libmaxminddb/")
1505 (synopsis "C library for the MaxMind DB file format")
1506 (description "The libmaxminddb library provides a C library for reading
1507 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1508 format is a custom, but open, binary format designed to facilitate fast
1509 lookups of IP addresses while allowing flexibility in the type of data
1510 associated with an address.")
1511 (license license:asl2.0)))
1513 (define-public python-maxminddb
1515 (name "python-maxminddb")
1520 (uri (pypi-uri "maxminddb" version))
1523 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1524 (build-system python-build-system)
1526 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1528 `(("libmaxminddb" ,libmaxminddb)))
1529 (home-page "https://www.maxmind.com/")
1530 (synopsis "Reader for the MaxMind DB format")
1531 (description "MaxMind DB is a binary file format that stores data indexed
1532 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1534 (license license:asl2.0)))
1536 (define-public python-geoip2
1538 (name "python-geoip2")
1543 (uri (pypi-uri "geoip2" version))
1546 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1547 (build-system python-build-system)
1549 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1551 `(("python-maxminddb" ,python-maxminddb)
1552 ("python-requests" ,python-requests)))
1553 (home-page "https://www.maxmind.com/")
1554 (synopsis "MaxMind GeoIP2 API")
1555 (description "Provides an API for the GeoIP2 web services and databases.
1556 The API also works with MaxMind’s free GeoLite2 databases.")
1557 (license license:asl2.0)))
1559 (define-public routino
1566 (uri (string-append "http://www.routino.org/download/routino-"
1569 (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
1570 (build-system gnu-build-system)
1578 `(#:test-target "test"
1580 (modify-phases %standard-phases
1582 (lambda* (#:key outputs #:allow-other-keys)
1583 (substitute* "Makefile.conf"
1584 (("prefix=/usr/local")
1585 (string-append "prefix=" (assoc-ref outputs "out")))
1586 (("LDFLAGS_LDSO=-Wl,-R\\.")
1587 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1588 (("#CFLAGS\\+=-DUSE_XZ")
1590 (("#LDFLAGS\\+=-llzma")
1593 (synopsis "Routing application for OpenStreetMap data")
1595 "Routino is an application for finding a route between two points
1596 using the dataset of topographical information collected by
1597 @url{https://www.OpenStreetMap.org}.")
1598 (home-page "https://www.routino.org/")
1599 (license license:agpl3+)))
1601 (define-public qmapshack
1609 (url "https://github.com/Maproom/qmapshack")
1610 (commit (string-append "V_" version))))
1611 (file-name (git-file-name name version))
1614 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1615 (build-system qt-build-system)
1617 `(("pkg-config" ,pkg-config)
1618 ("qttools" ,qttools)))
1621 ("libjpeg-turbo" ,libjpeg-turbo)
1624 ("qtdeclarative" ,qtdeclarative)
1625 ("qtlocation" ,qtlocation)
1626 ("qtwebchannel" ,qtwebchannel)
1627 ("qtwebengine" ,qtwebengine)
1629 ("routino" ,routino)
1630 ("sqlite" ,sqlite) ; See wrap phase
1635 (modify-phases %standard-phases
1636 (add-after 'unpack 'fix-cmake-modules
1637 (lambda* (#:key inputs #:allow-other-keys)
1638 (substitute* "CMakeLists.txt"
1639 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1640 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1641 (substitute* "cmake/Modules/FindROUTINO.cmake"
1643 (assoc-ref inputs "routino")))
1644 ;; The following fixes are included as patches in the sources
1645 ;; of QMapShack, but they are not applied by default, for
1647 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1648 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1650 (add-after 'install 'wrap
1651 ;; The program fails to find the QtWebEngineProcess program,
1652 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1653 (lambda* (#:key inputs outputs #:allow-other-keys)
1654 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1655 (qtwebengineprocess (string-append
1656 (assoc-ref inputs "qtwebengine")
1657 "/lib/qt5/libexec/QtWebEngineProcess")))
1658 (for-each (lambda (program)
1659 (wrap-program program
1660 `("QTWEBENGINEPROCESS_PATH" =
1661 (,qtwebengineprocess))))
1662 (find-files bin ".*")))
1664 (synopsis "GPS mapping application")
1666 "QMapShack can be used to plan your next outdoor trip or to visualize and
1667 archive all the GPS recordings of your past trips. It is the successor of the
1668 QLandkarte GT application.")
1669 (home-page "https://github.com/Maproom/qmapshack/wiki")
1670 (license license:gpl3+)))
1672 (define-public readosm
1679 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1680 "readosm-" version ".tar.gz"))
1682 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
1683 (build-system gnu-build-system)
1687 (synopsis "Data extractor for OpenStreetMap files")
1689 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1690 input file (in @code{.osm} or @code{.osm.pbf} format).")
1691 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1692 (license (list license:gpl2+
1696 (define-public spatialite-tools
1698 (name "spatialite-tools")
1703 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1704 "spatialite-tools-" version ".tar.gz"))
1706 (base32 "0ckddgdpxhy6vkpr9q2hnx5qmanrd8g4pqnifbrq1i5jrj82s2dd"))))
1707 (build-system gnu-build-system)
1709 `(("pkg-config" ,pkg-config)))
1714 ("librttopo" ,librttopo)
1715 ("libspatialite" ,libspatialite)
1716 ("libxml2" ,libxml2)
1717 ("minizip" ,minizip)
1719 ("readosm" ,readosm)
1722 (synopsis "Collection of command line tools for SpatiaLite")
1724 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1725 tools supporting SpatiaLite.")
1726 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1727 (license license:gpl3+)))
1729 (define-public virtualpg
1736 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1737 "virtualpg-" version ".tar.gz"))
1739 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1740 (build-system gnu-build-system)
1742 `(("postgresql" ,postgresql)
1743 ("sqlite" ,sqlite)))
1744 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1746 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1747 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1748 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1749 exchanged form one Spatial DBMS and the other.")
1750 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1751 (license (list license:gpl2+
1755 (define-public opencpn
1763 (url "https://github.com/OpenCPN/OpenCPN")
1764 (commit (string-append "v" version))))
1765 (file-name (git-file-name name version))
1767 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1768 (build-system cmake-build-system)
1770 `(("gettext" ,gettext-minimal)
1771 ("pkg-config" ,pkg-config)))
1778 ("libarchive" ,libarchive)
1780 ("libexif" ,libexif)
1781 ("libsndfile" ,libsndfile)
1785 ("portaudio" ,portaudio)
1787 ("tinyxml" ,tinyxml)
1789 ("wxwidgets" ,wxwidgets)
1793 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1794 "-DENABLE_SNDFILE=ON"
1795 "-DBUNDLE_TCDATA=ON"
1796 "-DBUNDLE_GSHHS=CRUDE")
1797 #:tests? #f ; No tests defined
1799 (modify-phases %standard-phases
1800 (add-after 'unpack 'fix-build
1802 (substitute* "CMakeLists.txt"
1803 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1804 (string-append all " --libs all")))
1806 (synopsis "Chart plotter and marine GPS navigation software")
1808 "OpenCPN is a chart plotter and marine navigation software designed to be
1809 used at the helm station of your boat while underway. Chart a course and
1810 track your position right from your laptop.")
1811 (home-page "https://opencpn.org/")
1812 (license (list license:asl2.0
1823 (define-public grass
1824 (let* ((version "7.8.5")
1825 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1826 (grassxx (string-append "grass" majorminor)))
1833 (uri (string-append "https://grass.osgeo.org/" grassxx
1834 "/source/grass-" version ".tar.gz"))
1836 (base32 "0dzzhgcsrszzinvjir50nvzq873b8gsp0p9k8fvcrv14amkbnnd3"))))
1837 (build-system gnu-build-system)
1842 ("freetype" ,freetype)
1848 ("libtiff" ,libtiff)
1850 ("mariadb-dev" ,mariadb "dev")
1851 ("mariadb-lib" ,mariadb "lib")
1853 ("openblas" ,openblas)
1855 ("postgresql" ,postgresql)
1858 ("python-dateutil" ,python-dateutil)
1859 ("python-numpy" ,python-numpy)
1860 ("python-wxpython" ,python-wxpython)
1861 ("readline" ,readline)
1863 ("wxwidgets" ,wxwidgets)
1865 ("zstd" ,zstd "lib")))
1867 `(("bash" ,bash-minimal)
1870 ("pkg-config" ,pkg-config)))
1872 `(#:tests? #f ; No tests
1873 #:modules ((guix build gnu-build-system)
1874 ((guix build python-build-system) #:prefix python:)
1876 #:imported-modules (,@%gnu-build-system-modules
1877 (guix build python-build-system))
1879 (modify-phases %standard-phases
1881 (lambda* (#:key inputs outputs #:allow-other-keys)
1882 (let ((shell (string-append (assoc-ref inputs "bash")
1884 (setenv "SHELL" shell)
1885 (setenv "CONFIG_SHELL" shell)
1886 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1887 (assoc-ref outputs "out")
1888 "/" ,grassxx "/lib")))
1889 (invoke "./configure"
1890 (string-append "--prefix="
1891 (assoc-ref outputs "out"))
1894 (string-append "--with-freetype-includes="
1895 (assoc-ref inputs "freetype")
1896 "/include/freetype2")
1897 (string-append "--with-freetype-libs="
1898 (assoc-ref inputs "freetype")
1903 (string-append "--with-mysql-includes="
1904 (assoc-ref inputs "mariadb-dev")
1906 (string-append "--with-mysql-libs="
1907 (assoc-ref inputs "mariadb-lib")
1911 (string-append "--with-proj-share="
1912 (assoc-ref inputs "proj.4")
1917 "--with-wxwidgets")))
1918 (add-after 'install 'install-links
1919 (lambda* (#:key outputs #:allow-other-keys)
1920 ;; Put links for includes and libraries in the standard places.
1921 (let* ((out (assoc-ref outputs "out"))
1922 (dir (string-append out "/" ,grassxx)))
1923 (symlink (string-append dir "/include")
1924 (string-append out "/include"))
1925 (symlink (string-append dir "/lib")
1926 (string-append out "/lib")))
1928 (add-after 'install-links 'python:wrap
1929 (assoc-ref python:%standard-phases 'wrap))
1930 (add-after 'python:wrap 'wrap-with-python-interpreter
1931 (lambda* (#:key outputs #:allow-other-keys)
1932 (let ((out (assoc-ref outputs "out")))
1933 (wrap-program (string-append out "/bin/" ,grassxx)
1934 `("GRASS_PYTHON" = (,(which "python3"))))
1936 (synopsis "GRASS Geographic Information System")
1938 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1939 Information System (GIS) software suite used for geospatial data management and
1940 analysis, image processing, graphics and maps production, spatial modeling, and
1942 (home-page "https://grass.osgeo.org/")
1943 (license license:gpl2+))))
1952 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1953 (version-major version) "/SAGA%20-%20" version
1954 "/saga-" version ".tar.gz"))
1956 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1957 (build-system gnu-build-system)
1959 `(("pkg-config" ,pkg-config)
1967 ("libharu" ,libharu)
1968 ("libtiff" ,libtiff)
1970 ("postgresql" ,postgresql)
1974 ("unixodbc" ,unixodbc)
1976 ("wxwidgets" ,wxwidgets)))
1978 '(#:configure-flags '("--enable-python")))
1979 (synopsis "System for Automated Geoscientific Analyses")
1981 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1982 Information System (GIS) software. It has been designed for an easy and
1983 effective implementation of spatial algorithms and it offers a comprehensive,
1984 growing set of geoscientific methods.")
1985 (home-page "http://www.saga-gis.org")
1986 (license (list license:gpl2+ license:lgpl2.1+))))
1995 (uri (string-append "https://qgis.org/downloads/qgis-"
1996 version ".tar.bz2"))
1998 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1999 (build-system cmake-build-system)
2001 `(#:modules ((guix build cmake-build-system)
2002 ((guix build python-build-system) #:prefix python:)
2003 (guix build qt-utils)
2005 #:imported-modules (,@%cmake-build-system-modules
2006 (guix build python-build-system)
2007 (guix build qt-utils))
2009 (modify-phases %standard-phases
2010 ;; Configure correct path to PyQt5 SIP directory
2011 (add-after 'unpack 'configure-pyqt5-sip-path
2012 (lambda* (#:key inputs #:allow-other-keys)
2013 (substitute* "cmake/FindPyQt5.cmake"
2014 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
2015 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
2016 "/share/sip\" PYQT5_SIP_DIR")))
2017 (substitute* (list "scripts/prepare-commit.sh"
2018 "scripts/runtests-local-travis-config.sh"
2019 "scripts/sip_include.sh"
2021 "scripts/sipify_all.sh"
2022 "scripts/spell_check/check_spelling.sh"
2023 "scripts/spell_check/spell_test.sh"
2024 "scripts/verify-indentation.sh"
2025 "tests/code_layout/test_banned_keywords.sh"
2026 "tests/code_layout/test_licenses.sh"
2027 "tests/code_layout/test_shellcheck.sh"
2028 "tests/code_layout/test_sip_include.sh"
2029 "tests/code_layout/test_sipfiles_uptodate.sh"
2030 "tests/code_layout/test_sipify.sh")
2031 (("\\$\\(git rev-parse --show-toplevel\\)")
2033 (substitute* "tests/code_layout/test_sip_include.sh"
2034 (("^REV=.*") "REV=currentrev\n"))
2037 (lambda* (#:key inputs #:allow-other-keys)
2038 (setenv "HOME" "/tmp")
2039 (system (string-append (assoc-ref inputs "xorg-server")
2041 (setenv "DISPLAY" ":1")
2042 (setenv "TRAVIS" "true")
2043 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2046 '(;; Disable tests that require network access
2047 "qgis_filedownloader"
2048 ;; TODO: Find why the following tests fail
2049 "ProcessingQgisAlgorithmsTestPt1"
2050 "ProcessingQgisAlgorithmsTestPt2"
2051 "ProcessingQgisAlgorithmsTestPt3"
2052 "ProcessingQgisAlgorithmsTestPt4"
2053 "ProcessingGdalAlgorithmsRasterTest"
2054 "ProcessingGdalAlgorithmsVectorTest"
2055 "ProcessingGrass7AlgorithmsImageryTest"
2056 "ProcessingGrass7AlgorithmsRasterTest"
2057 "ProcessingGrass7AlgorithmsVectorTest"
2058 "ProcessingOtbAlgorithmsTest"
2059 "qgis_authmanagertest"
2060 "qgis_compositionconvertertest"
2061 "qgis_coordinatereferencesystemtest"
2063 "qgis_layouthtmltest"
2064 "qgis_layoutmaptest"
2065 "qgis_layoutmapgridtest"
2066 "qgis_painteffecttest"
2067 "qgis_pallabelingtest"
2068 "qgis_svgmarkertest"
2069 "qgis_taskmanagertest"
2071 "qgis_processingtest"
2072 "qgis_wcsprovidertest"
2073 "qgis_arcgisrestutilstest"
2074 "qgis_grassprovidertest7"
2075 "qgis_gpsinformationwidget"
2077 "PyQgsPythonProvider"
2079 "PyQgsAuthenticationSystem"
2084 "PyQgsLayerMetadata"
2087 "PyQgsLayoutMapGrid"
2089 "PyQgsLayoutExporter"
2092 "PyQgsOGRProviderGpkg"
2093 "PyQgsPalLabelingLayout"
2094 "PyQgsImportIntoPostGIS"
2095 "PyQgsProviderConnectionPostgres"
2096 "PyQgsProviderConnectionGpkg"
2097 "PyQgsShapefileProvider"
2101 "PyQgsSpatialiteProvider"
2102 "PyQgsVectorFileWriter"
2104 "PyQgsVectorLayerUtils"
2105 "PyQgsVirtualLayerProvider"
2107 "PyQgsOapifProvider"
2108 "PyQgsLayerDependencies"
2109 "PyQgsDBManagerGpkg"
2110 "PyQgsDBManagerSpatialite"
2112 "PyQgsAuxiliaryStorage"
2113 "PyQgsSelectiveMasking"
2115 "qgis_geometrycheckstest"
2119 "qgis_sip_uptodate")
2121 (add-after 'install 'wrap-python
2122 (assoc-ref python:%standard-phases 'wrap))
2123 (add-after 'wrap-python 'wrap-qt
2124 (lambda* (#:key outputs inputs #:allow-other-keys)
2125 (let ((out (assoc-ref outputs "out")))
2126 (wrap-qt-program "qgis" #:output out #:inputs inputs))
2128 (add-after 'wrap-qt 'wrap-gis
2129 (lambda* (#:key inputs outputs #:allow-other-keys)
2130 (let* ((out (assoc-ref outputs "out"))
2131 (saga (string-append (assoc-ref inputs "saga") "/bin"))
2132 (grass-version ,(package-version grass))
2133 (grass-majorminor (string-join
2135 (string-split grass-version #\.) 2)
2137 (grass (string-append (assoc-ref inputs "grass")
2138 "/grass" grass-majorminor)))
2139 (wrap-program (string-append out "/bin/qgis")
2140 `("PATH" ":" prefix (,saga))
2141 `("QGIS_PREFIX_PATH" = (,out))
2142 `("GISBASE" = (,grass))))
2149 ("gpsbabel" ,gpsbabel)
2153 ("libspatialindex" ,libspatialindex)
2154 ("libspatialite" ,libspatialite)
2155 ("libxml2" ,libxml2)
2158 ("postgresql" ,postgresql)
2161 ("python-chardet" ,python-chardet)
2162 ("python-dateutil" ,python-dateutil)
2163 ("python-future" ,python-future)
2164 ("python-gdal" ,python-gdal)
2165 ("python-jinja2" ,python-jinja2)
2166 ("python-numpy" ,python-numpy)
2167 ("python-owslib" ,python-owslib)
2168 ("python-psycopg2" ,python-psycopg2)
2169 ("python-pygments" ,python-pygments)
2170 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2171 ("python-pytz" ,python-pytz)
2172 ("python-pyyaml" ,python-pyyaml)
2173 ("python-requests" ,python-requests)
2174 ("python-sip" ,python-sip)
2175 ("python-six" ,python-six)
2176 ("python-urllib3" ,python-urllib3)
2178 ("qscintilla" ,qscintilla)
2180 ("qtdeclarative" ,qtdeclarative)
2181 ("qtkeychain" ,qtkeychain)
2182 ("qtlocation" ,qtlocation)
2183 ("qtserialport" ,qtserialport)
2185 ("qtwebkit" ,qtwebkit)
2188 ("sqlite" ,sqlite)))
2193 ("perl-yaml-tiny" ,perl-yaml-tiny)
2194 ("pkg-config" ,pkg-config)
2195 ("python-mock" ,python-mock)
2196 ("python-nose2" ,python-nose2)
2197 ("qttools" ,qttools)
2198 ("shellcheck" ,shellcheck)
2199 ("xorg-server" ,xorg-server-for-tests)))
2200 (home-page "https://qgis.org")
2201 (synopsis "Geographical information system")
2202 (description "QGIS is an easy to use Geographical Information
2203 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2204 raster and vector data formats, with new support easily added using the plugin
2217 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2218 (license:fsf-free "file://debian/copyright" "Go Squared")
2222 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2224 "file://debian/copyright"
2225 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2235 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2236 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2237 (license:non-copyleft
2238 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2239 "NCL Source Code License")
2242 license:public-domain
2245 (define-public python-geographiclib
2247 (name "python-geographiclib")
2252 (uri (pypi-uri "geographiclib" version))
2255 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2256 (build-system python-build-system)
2257 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2258 (synopsis "Python geodesic routines from GeographicLib")
2260 "This is a python implementation of the geodesic routines in GeographicLib.")
2261 (license license:expat)))
2263 (define-public python-geopy
2265 (name "python-geopy")
2270 (uri (pypi-uri "geopy" version))
2273 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2274 (build-system python-build-system)
2276 `(("python-geographiclib" ,python-geographiclib)))
2278 `(("python-async-generator" ,python-async-generator)
2279 ("python-coverage" ,python-coverage)
2280 ("python-flake8" ,python-flake8)
2281 ("python-isort" ,python-isort)
2282 ("python-pytest" ,python-pytest)
2283 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2284 ("python-readme-renderer" ,python-readme-renderer)
2285 ("python-pytz" ,python-pytz)))
2286 (home-page "https://github.com/geopy/geopy")
2287 (synopsis "Geocoding library for Python")
2288 (description "@code{geopy} is a Python client for several popular geocoding
2289 web services. @code{geopy} makes it easy for Python developers to locate the
2290 coordinates of addresses, cities, countries, and landmarks across the globe
2291 using third-party geocoders and other data sources.")
2292 (license license:expat)))