1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019, 2020 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages geo)
32 #:use-module (guix build-system ant)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system glib-or-gtk)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system go)
37 #:use-module (guix build-system meson)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system qt)
40 #:use-module (guix build-system scons)
41 #:use-module (guix build-system r)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix svn-download)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix utils)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages astronomy)
51 #:use-module (gnu packages audio)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages boost)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages datastructures)
62 #:use-module (gnu packages docbook)
63 #:use-module (gnu packages documentation)
64 #:use-module (gnu packages elf)
65 #:use-module (gnu packages flex)
66 #:use-module (gnu packages fonts)
67 #:use-module (gnu packages fontutils)
68 #:use-module (gnu packages gettext)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gps)
73 #:use-module (gnu packages gtk)
74 #:use-module (gnu packages haskell-apps)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages image-processing)
77 #:use-module (gnu packages icu4c)
78 #:use-module (gnu packages java)
79 #:use-module (gnu packages kde)
80 #:use-module (gnu packages lua)
81 #:use-module (gnu packages maths)
82 #:use-module (gnu packages pcre)
83 #:use-module (gnu packages pdf)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages photo)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages protobuf)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages python-check)
91 #:use-module (gnu packages python-web)
92 #:use-module (gnu packages python-xyz)
93 #:use-module (gnu packages qt)
94 #:use-module (gnu packages readline)
95 #:use-module (gnu packages swig)
96 #:use-module (gnu packages sqlite)
97 #:use-module (gnu packages textutils)
98 #:use-module (gnu packages time)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages webkit)
101 #:use-module (gnu packages wxwidgets)
102 #:use-module (gnu packages xml)
103 #:use-module (gnu packages xorg))
105 (define-public memphis
114 (url "https://github.com/jiuka/memphis.git")
116 (file-name (git-file-name name version))
118 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
119 (build-system glib-or-gtk-build-system)
120 (outputs '("out" "doc"))
127 (string-append "--with-html-dir="
128 (assoc-ref %outputs "doc")
129 "/share/gtk-doc/html"))
131 (modify-phases %standard-phases
132 (add-after 'unpack 'patch-autogen
134 (substitute* "autogen.sh"
135 (("\\./configure \"\\$@\"")
138 (add-after 'patch-autogen 'patch-docbook-xml
139 (lambda* (#:key inputs #:allow-other-keys)
140 (with-directory-excursion "docs/reference"
141 (substitute* "libmemphis-docs.sgml"
142 (("http://www.oasis-open.org/docbook/xml/4.3/")
143 (string-append (assoc-ref inputs "docbook-xml")
144 "/xml/dtd/docbook/"))))
147 `(("autoconf" ,autoconf)
148 ("automake" ,automake)
149 ("docbook-xml" ,docbook-xml-4.3)
150 ("gobject-introspection" ,gobject-introspection)
153 ("pkg-config" ,pkg-config)
154 ("python" ,python-wrapper)
162 (synopsis "Map-rendering for OpenSteetMap")
163 (description "Memphis is a map-rendering application and a library for
164 OpenStreetMap written in C using eXpat, Cairo and GLib.")
165 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
166 (license license:lgpl2.1+)))
174 (uri (string-append "http://download.osgeo.org/geos/geos-"
179 "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
180 (build-system gnu-build-system)
181 (arguments `(#:phases
182 (modify-phases %standard-phases
184 'unpack 'patch-test-shebangs
186 (substitute* '("tests/xmltester/testrunner.sh"
187 "tests/geostest/testrunner.sh")
188 (("/bin/sh") (which "sh")))
192 (home-page "https://geos.osgeo.org/")
193 (synopsis "Geometry Engine for Geographic Information Systems")
195 "GEOS provides a spatial object model and fundamental geometric
196 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
197 it aims to contain the complete functionality of JTS in C++. This
198 includes all the OpenGIS Simple Features for SQL spatial predicate
199 functions and spatial operators, as well as specific JTS enhanced
200 topology functions.")
201 (license (list license:lgpl2.1+ ; Main distribution.
202 license:zlib ; tests/xmltester/tinyxml/*
203 license:public-domain)))) ; include/geos/timeval.h
205 (define-public gnome-maps
211 (uri (string-append "mirror://gnome/sources/" name "/"
212 (version-major+minor version) "/"
213 name "-" version ".tar.xz"))
216 "00xslcnhhwslqglgfv2im7vq3awa49y2jxzr8wsby7f713k28vf5"))))
217 (build-system meson-build-system)
221 (modify-phases %standard-phases
222 (add-after 'unpack 'skip-gtk-update-icon-cache
223 ;; Don't create 'icon-theme.cache'.
225 (substitute* "meson_post_install.py"
226 (("gtk-update-icon-cache") "true"))
228 (add-after 'install 'wrap
229 (lambda* (#:key inputs outputs #:allow-other-keys)
230 (let ((out (assoc-ref outputs "out"))
231 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
232 (geocode-glib-path (string-append
233 (assoc-ref inputs "geocode-glib")
235 (goa-path (string-append
236 (assoc-ref inputs "gnome-online-accounts:lib")
238 (gdk-pixbuf-path (string-append
239 (assoc-ref inputs "gdk-pixbuf")
241 (webkitgtk-path (string-append
242 (assoc-ref inputs "webkitgtk")
244 (wrap-program (string-append out "/bin/gnome-maps")
245 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
247 ;; There seems to be no way to embed the path of
248 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
249 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
250 ;; libgeocode-glib.so.0
251 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
254 ,geocode-glib-path)))
257 `(("gettext" ,gettext-minimal)
258 ("gobject-introspection" ,gobject-introspection)
259 ("pkg-config" ,pkg-config)))
261 `(("evolution-data-server" ,evolution-data-server)
263 ("libchamplain" ,libchamplain)
265 ("libsecret" ,libsecret)
267 ("libgweather" ,libgweather)
269 ("gdk-pixbuf" ,gdk-pixbuf+svg)
270 ("glib-networking" ,glib-networking)
272 ("geocode-glib" ,geocode-glib)
273 ("gfbgraph" ,gfbgraph)
276 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
277 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
280 ("webkitgtk" ,webkitgtk)))
281 (synopsis "Graphical map viewer and wayfinding program")
282 (description "GNOME Maps is a graphical map viewer. It uses map data from
283 the OpenStreetMap project. It can provide directions for walking, bicycling,
285 (home-page "https://wiki.gnome.org/Apps/Maps")
286 (license license:gpl2+)))
288 (define-public libgaiagraphics
290 (name "libgaiagraphics")
295 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
299 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
300 (build-system gnu-build-system)
302 `(("pkg-config" ,pkg-config)))
306 ("libjpeg-turbo" ,libjpeg-turbo)
308 ("libgeotiff" ,libgeotiff)
312 (synopsis "Gaia common graphics support")
313 (description "libgaiagraphics is a library supporting
314 common-utility raster handling methods.")
315 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
316 (license license:lgpl3+)))
318 (define-public libgeotiff
325 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
327 (patches (search-patches
328 ;; See libgeotiff 1.5.1 issue
329 ;; https://github.com/OSGeo/libgeotiff/issues/22
330 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
332 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
333 (modules '((guix build utils)))
336 ;; Remove .csv files, distributed from EPSG under a restricted
337 ;; license. See LICENSE for full license text.
338 (for-each delete-file (find-files "." "\\.csv$"))
340 (build-system gnu-build-system)
342 `(("libjpeg-turbo" ,libjpeg-turbo)
346 `(;; libgeotiff headers include proj headers, so ensure those are available.
350 (list "--disable-static"
351 "--with-zlib" "--with-jpeg"
352 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
353 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
354 (description "libgeotiff is a library on top of libtiff for reading and
355 writing GeoTIFF information tags.")
356 (home-page "https://trac.osgeo.org/geotiff/")
357 ;; This is a mixture of various contributions under different licenses.
358 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
359 ;; states, as its commercial redistribution is restricted. Hence, we have
360 ;; removed it from the package.
361 (license (list license:public-domain
364 (license:non-copyleft "file://LICENSE"
365 "See LICENSE in the distribution.")))))
367 (define-public libspatialite
369 (name "libspatialite")
374 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
378 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
379 (build-system gnu-build-system)
381 `(("pkg-config" ,pkg-config)))
391 (modify-phases %standard-phases
392 ;; 3 tests are failing, ignore them:
393 (add-after 'unpack 'ignore-broken-tests
395 (substitute* '("test/Makefile.in")
396 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
397 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
398 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
400 (synopsis "Extend SQLite to support Spatial SQL capabilities")
402 "SpatiaLite is a library intended to extend the SQLite core to support
403 fully fledged Spatial SQL capabilities.")
404 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
405 ;; For the genuine libspatialite-sources holds:
406 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
407 ;; Files under src/control_points are from GRASS
408 ;; and are licensed under GPL2+ only.
409 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
410 (license (list license:gpl2+
413 license:public-domain))))
422 (uri (string-append "http://download.osgeo.org/proj/proj-"
426 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
427 (build-system gnu-build-system)
429 `(("sqlite" ,sqlite)))
431 `(("pkg-config" ,pkg-config)))
432 (home-page "https://proj.org/")
433 (synopsis "Coordinate transformation software")
435 "Proj is a generic coordinate transformation software that transforms
436 geospatial coordinates from one coordinate reference system (CRS) to another.
437 This includes cartographic projections as well as geodetic transformations.
438 PROJ includes command line applications for easy conversion of coordinates
439 from text files or directly from user input. In addition, proj also exposes
440 an application programming interface that lets developers use the
441 functionality of proj in their own software.")
442 (license (list license:expat
443 ;; src/projections/patterson.cpp
445 ;; src/geodesic.*, src/tests/geodtest.cpp
448 (define-public proj.4
454 (uri (string-append "http://download.osgeo.org/proj/proj-"
458 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
459 (build-system gnu-build-system)
462 (modify-phases %standard-phases
463 (add-after 'unpack 'patch-test-paths
465 (substitute* '("nad/test27"
471 (("/bin/rm") (which "rm")))
473 ;; Precision problems on i686 and other platforms. See:
474 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
475 ;; Disable failing test.
476 (add-after 'patch-test-paths 'ignore-failing-tests
478 (substitute* '("nad/Makefile.in")
479 (("\tPROJ_LIB.*" all) (string-append "#" all)))
483 (home-page "https://proj.org/")
484 (synopsis "Cartographic Projections Library")
486 "Proj.4 is a library for converting coordinates between cartographic
488 (license (list license:expat
489 ;; src/PJ_patterson.c
493 ;; Embedded EPSG database.
494 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
498 (define-public mapnik
505 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
506 version "/mapnik-v" version ".tar.bz2"))
509 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
510 (build-system scons-build-system)
514 ("freetype" ,freetype)
515 ("harfbuzz" ,harfbuzz)
517 ("libjpeg-turbo" ,libjpeg-turbo)
526 `(("pkg-config" ,pkg-config)))
528 `(#:scons ,scons-python2
531 (string-append "PREFIX=" %output)
532 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
533 (home-page "https://mapnik.org/")
534 (synopsis "Toolkit for developing mapping applications")
535 (description "Mapnik is a toolkit for developing mapping applications. It
536 is basically a collection of geographic objects like maps, layers,
537 datasources, features, and geometries. At its core is a C++ shared library
538 providing algorithms and patterns for spatial data access and visualization.
539 The library does not rely on any specific windowing system and can be deployed
540 to any server environment. It is intended to play fair in a multi-threaded
541 environment and is aimed primarily, but not exclusively, at web-based
543 (license (list license:lgpl2.1+
544 ;; demo/viewer, demo/python/rundemo.py
546 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
548 ;; deps/mapnik/sparsehash
551 (license:non-copyleft "file://deps/agg/copying")))))
553 (define-public python2-mapnik
555 (name "python2-mapnik")
560 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
562 (file-name (string-append name "-" version ".tar.gz"))
565 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
566 (build-system python-build-system)
569 ("harfbuzz" ,harfbuzz)
571 ("libjpeg-turbo" ,libjpeg-turbo)
577 ("python2-pycairo" ,python2-pycairo)))
579 (let ((test-data-input
580 (lambda (repository version hash)
583 (uri (string-append "https://github.com/mapnik/" repository
584 "/archive/v" version ".tar.gz"))
585 (file-name (string-append "python-mapnik-" repository
586 "-" version ".tar.gz"))
587 (sha256 (base32 hash))))))
588 `(("python2-nose" ,python2-nose)
589 ;; Test data is released as separate tarballs
591 ,(test-data-input "test-data" "3.0.18"
592 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
594 ,(test-data-input "test-data-visual" "3.0.18"
595 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
597 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
599 (modify-phases %standard-phases
600 ;; Unpack test data into the source tree
601 (add-after 'unpack 'unpack-submodules
602 (lambda* (#:key inputs #:allow-other-keys)
603 (let ((unpack (lambda (source target)
604 (with-directory-excursion target
605 (invoke "tar" "xvf" (assoc-ref inputs source)
606 "--strip-components=1")))))
607 (unpack "test-data" "test/data")
608 (unpack "test-data-visual" "test/data-visual"))))
609 ;; Skip failing tests
610 (add-after 'unpack 'skip-tests
612 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
613 "test_unicode_regex_replace"
614 "test_proj_antimeridian_bbox"
615 "test_render_with_scale_factor")))
616 (substitute* "setup.cfg"
617 (("\\[nosetests\\]" all)
618 (string-append all "\nexclude=^("
619 (string-join skipped-tests "|") ")$")))))))))
620 (home-page "https://github.com/mapnik/python-mapnik")
621 (synopsis "Python bindings for Mapnik")
622 (description "This package provides Python bindings for Mapnik.")
623 (license license:lgpl2.1+)))
625 (define-public spatialite-gui
627 (name "spatialite-gui")
632 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
636 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
637 (build-system gnu-build-system)
639 `(("pkg-config" ,pkg-config)))
643 ("libgaiagraphics" ,libgaiagraphics)
644 ("libjpeg-turbo" ,libjpeg-turbo)
645 ("libspatialite" ,libspatialite)
649 ("wxwidgets" ,wxwidgets-2)
652 `(#:phases (modify-phases %standard-phases
653 (add-after 'unpack 'fix-gui
655 ;; Fix for the GUI not showing up.
656 (substitute* "Main.cpp"
657 (("Hide\\(\\);") ""))
659 (synopsis "Graphical user interface for SpatiaLite")
660 (description "Spatialite-gui provides a visual interface for viewing and
661 maintaining a spatialite database. You can easily see the structure of the
662 tables and data contents using point and click functions, many of which
663 construct common SQL queries, or craft your own SQL queries.")
664 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
665 (license license:gpl3+)))
674 "http://download.osgeo.org/gdal/" version "/gdal-"
678 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
679 (modules '((guix build utils)))
682 ;; TODO: frmts contains a lot more bundled code.
683 (for-each delete-file-recursively
688 "frmts/jpeg/libjpeg12"
689 "frmts/gtiff/libtiff"
690 "frmts/gtiff/libgeotiff"
692 "ogr/ogrsf_frmts/geojson/libjson"))))))
693 (build-system gnu-build-system)
697 (let-syntax ((with (syntax-rules ()
699 (string-append option "="
700 (assoc-ref %build-inputs input))))))
702 ;; TODO: --with-pcidsk, --with-pcraster
703 (with "--with-freexl" "freexl")
704 (with "--with-libjson-c" "json-c")
705 (with "--with-png" "libpng")
706 (with "--with-webp" "libwebp")
707 (with "--with-gif" "giflib")
708 (with "--with-jpeg" "libjpeg-turbo")
709 (with "--with-libtiff" "libtiff")
710 (with "--with-geotiff" "libgeotiff")
711 (with "--with-libz" "zlib")
712 (with "--with-expat" "expat")
713 (with "--with-sqlite3" "sqlite")
716 (modify-phases %standard-phases
717 (add-before 'build 'fix-path
719 (substitute* "frmts/mrf/mrf_band.cpp"
720 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
727 ("libgeotiff" ,libgeotiff)
728 ("libjpeg-turbo" ,libjpeg-turbo)
734 ("postgresql" ,postgresql) ; libpq
739 `(("pkg-config" ,pkg-config)))
740 (home-page "https://gdal.org/")
741 (synopsis "Raster and vector geospatial data format library")
742 (description "GDAL is a translator library for raster and vector geospatial
743 data formats. As a library, it presents a single raster abstract data model
744 and single vector abstract data model to the calling application for all
745 supported formats. It also comes with a variety of useful command line
746 utilities for data translation and processing.")
750 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
751 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
754 ;; frmts/hdf4/hdf-eos/*
755 ;; similar to the expat license, but without guarantee exclusion
756 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
757 ;; frmts/grib/degrib/
758 license:public-domain ; with guarantee exclusion
760 ;; Some bsd-inspired license
761 (license:non-copyleft "file://port/LICENCE_minizip")
762 ;; alg/internal_libqhull
763 ;; Some 5-clause license
764 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
768 (define-public python-gdal
769 (package (inherit gdal)
771 (build-system python-build-system)
773 '(#:tests? #f ; no tests
775 (modify-phases %standard-phases
776 (add-before 'build 'chdir
778 (chdir "swig/python")
782 `(("python-numpy" ,python-numpy)))
785 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
787 (define-public postgis
793 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
797 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
798 (build-system gnu-build-system)
802 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
803 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
804 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
805 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
807 (modify-phases %standard-phases
808 (add-before 'build 'fix-install-path
809 (lambda* (#:key outputs #:allow-other-keys)
810 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
811 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
812 (string-append (assoc-ref outputs "out") "/bin"))))))))
818 ("libjpeg" ,libjpeg-turbo)
821 ("postgresql" ,postgresql)
825 ("pkg-config" ,pkg-config)))
826 (home-page "https://postgis.net")
827 (synopsis "Spatial database extender for PostgreSQL")
828 (description "PostGIS is a spatial database extender for PostgreSQL
829 object-relational database. It adds support for geographic objects allowing
830 location queries to be run in SQL. This package provides a PostgreSQL
835 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
838 license:public-domain
840 license:bsd-3 ; files only say "BSD"
842 license:cc-by-sa3.0))))
844 (define-public tegola
851 "https://github.com/go-spatial/tegola/archive/v"
853 (file-name (string-append name "-" version ".tar.gz"))
856 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
857 (build-system go-build-system)
859 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
860 #:unpack-path "github.com/go-spatial/tegola"
862 (modify-phases %standard-phases
863 (add-before 'build 'set-version
865 (with-directory-excursion "src/github.com/go-spatial/tegola"
866 (substitute* '("cmd/tegola/cmd/root.go"
867 "cmd/tegola_lambda/main.go")
868 (("version not set") ,version)))
870 (home-page "https://tegola.io")
871 (synopsis "Vector tile server for maps")
872 (description "Tegola is a free vector tile server written in Go. Tegola
873 takes geospatial data and slices it into vector tiles that can be efficiently
874 delivered to any client.")
877 ;; Some packages in vendor have other licenses
883 (define-public imposm3
886 (version "0.6.0-alpha.4")
890 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
892 (file-name (string-append name "-" version ".tar.gz"))
895 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
896 (build-system go-build-system)
898 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
899 #:unpack-path "github.com/omniscale/imposm3"
901 (modify-phases %standard-phases
902 (add-before 'build 'set-version
904 (substitute* "src/github.com/omniscale/imposm3/version.go"
905 (("0.0.0-dev") ,version))
909 ("leveldb" ,leveldb)))
910 (home-page "https://imposm.org/")
911 (synopsis "OpenStreetMap importer for PostGIS")
912 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
913 files and imports the data into PostgreSQL/PostGIS databases. It is designed
914 to create databases that are optimized for rendering/tile/map-services.")
917 ;; Some dependencies in vendor have different licenses
922 (define-public libosmium
930 (url "https://github.com/osmcode/libosmium")
931 (commit (string-append "v" version))))
932 (file-name (git-file-name name version))
934 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
935 (build-system cmake-build-system)
943 ("protozero" ,protozero)
944 ("sparsehash" ,sparsehash)
948 `(("doxygen" ,doxygen)))
949 (home-page "https://osmcode.org/libosmium/")
950 (synopsis "C++ library for working with OpenStreetMap data")
951 (description "Libosmium is a fast and flexible C++ library for working with
952 OpenStreetMap data.")
953 (license license:boost1.0)))
955 (define-public osm2pgsql
963 (url "https://github.com/openstreetmap/osm2pgsql")
965 (file-name (git-file-name name version))
967 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
968 (modules '((guix build utils)))
971 (delete-file-recursively "contrib/protozero")
972 (delete-file-recursively "contrib/libosmium")
974 (build-system cmake-build-system)
976 `(#:tests? #f; tests fail because we need to setup a database
978 (list (string-append "-DOSMIUM_INCLUDE_DIR="
979 (assoc-ref %build-inputs "libosmium")
981 (string-append "-DPROTOZERO_INCLUDE_DIR="
982 (assoc-ref %build-inputs "protozero")
988 ("libosmium" ,libosmium)
990 ("postgresql" ,postgresql)
992 ("protozero" ,protozero)
996 ("python-psycopg2" ,python-psycopg2)))
997 (home-page "https://github.com/openstreetmap/osm2pgsql")
998 (synopsis "OSM data importer to postgresql")
999 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1000 PostgreSQL / PostGIS database suitable for applications like rendering into a
1001 map, geocoding with Nominatim, or general analysis.")
1002 (license license:gpl2+)))
1004 (define-public tippecanoe
1012 (url "https://github.com/mapbox/tippecanoe")
1014 (file-name (git-file-name name version))
1016 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
1017 (build-system gnu-build-system)
1020 (modify-phases %standard-phases (delete 'configure))
1021 #:test-target "test"
1024 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1029 (home-page "https://github.com/mapbox/tippecanoe")
1030 (synopsis "Vector tile server for maps")
1031 (description "Tippecanoe creates scale-independent view of data, so that
1032 the texture and density of features is visible at every zoom level, instead of
1033 dropping features at lower levels.")
1034 (license license:bsd-2)))
1036 (define-public osmctools
1044 (url "https://gitlab.com/osm-c-tools/osmctools")
1046 (file-name (git-file-name name version))
1049 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1050 (build-system gnu-build-system)
1052 `(("autoconf" ,autoconf)
1053 ("automake" ,automake)))
1056 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1057 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1058 (description "This project contains a few tools which are used in the
1059 OpenStreetMap project. They can be used to convert, filter and update
1060 OpenStreetMap data files.")
1061 (license license:agpl3)))
1063 (define-public osm-gps-map
1065 (name "osm-gps-map")
1071 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1072 version "/osm-gps-map-" version ".tar.gz"))
1075 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1076 (build-system gnu-build-system)
1078 `(("gnome-common" ,gnome-common)
1079 ("gtk-doc" ,gtk-doc)
1080 ("pkg-config" ,pkg-config)))
1084 ("gobject-introspection" ,gobject-introspection)
1086 ("libsoup" ,libsoup)))
1087 (home-page "https://nzjrs.github.io/osm-gps-map/")
1088 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1090 "This package provides a GTK+ widget (and Python bindings) that when
1091 given GPS coordinates,draws a GPS track, and points of interest on a moving
1092 map display. Downloads map data from a number of websites, including
1093 @url{https://www.openstreetmap.org}.")
1094 (license license:gpl2+)))
1096 (define-public xygrib
1103 (url "https://github.com/opengribs/XyGrib")
1104 (commit (string-append "v" version))))
1105 (file-name (git-file-name name version))
1108 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1109 (modules '((guix build utils)))
1111 '(begin (delete-file-recursively "data/fonts") #t))))
1112 (build-system cmake-build-system)
1115 (modify-phases %standard-phases
1116 (add-after 'unpack 'patch-directories
1117 (lambda* (#:key inputs #:allow-other-keys)
1118 (let ((jpeg (assoc-ref inputs "openjpeg"))
1119 (font (assoc-ref inputs "font-liberation")))
1120 (substitute* "CMakeLists.txt"
1123 ;; Fix install locations.
1124 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1125 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1126 ;; Skip looking for the static library.
1127 (("\"libnova.a\"") ""))
1128 ;; Don't use the bundled font-liberation.
1129 (substitute* "src/util/Font.cpp"
1130 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1131 (string-append "\"" font "/share/fonts/truetype/\"")))
1132 (substitute* "src/util/Util.h"
1133 (("pathData\\(\\)\\+\"data/fonts/\"")
1134 (string-append "\"" font "/share/fonts/\""))))
1136 #:tests? #f)) ; no tests
1138 `(("qttools" ,qttools)))
1141 ("font-liberation" ,font-liberation)
1142 ("libnova" ,libnova)
1144 ("openjpeg" ,openjpeg)
1148 (synopsis "Weather Forecast Visualization")
1150 "XyGrib is a Grib file reader and visualizes meteorological data providing
1151 an off-line capability to analyse weather forecasts or hindcasts. It is
1152 intended to be used as a capable weather work station for anyone with a serious
1153 interest in examining weather. This would include members of the sailing
1154 community, private and sport aviators, farmers, weather buffs and many more.
1155 XyGrib is the continuation of the zyGrib software package with a new team of
1157 (home-page "https://opengribs.org")
1158 (license license:gpl3+)))
1160 (define-public libspatialindex
1162 (name "libspatialindex")
1167 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1168 "releases/download/" version "/spatialindex-src-"
1169 version ".tar.bz2"))
1172 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1173 (build-system cmake-build-system)
1174 (home-page "https://libspatialindex.org")
1175 (synopsis "Spatial indexing library")
1176 (description "The purpose of this library is to provide:
1179 @item An extensible framework that will support robust spatial indexing
1181 @item Support for sophisticated spatial queries. Range, point location,
1182 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1183 by spatial constraints) should be easy to deploy and run.
1184 @item Easy to use interfaces for inserting, deleting and updating information.
1185 @item Wide variety of customization capabilities. Basic index and storage
1186 characteristics like the page size, node capacity, minimum fan-out, splitting
1187 algorithm, etc. should be easy to customize.
1188 @item Index persistence. Internal memory and external memory structures
1189 should be supported. Clustered and non-clustered indices should be easy to be
1193 (license license:expat)))
1195 (define-public java-jmapviewer
1197 (name "java-jmapviewer")
1201 (uri (string-append "https://svn.openstreetmap.org/applications/"
1202 "viewer/jmapviewer/releases/" version
1203 "/JMapViewer-" version "-Source.zip"))
1206 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1207 (build-system ant-build-system)
1209 `(("unzip" ,unzip)))
1211 `(#:build-target "pack"
1212 #:tests? #f; No tests
1214 (modify-phases %standard-phases
1215 (add-before 'build 'clean
1217 (invoke "ant" "clean")))
1219 (lambda* (#:key outputs #:allow-other-keys)
1220 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1222 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1224 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1225 (synopsis "OSM map integration in Java")
1226 (description "JMapViewer is a Java component which easily
1227 integrates an OSM map view into your Java application. It is maintained as
1228 an independent project by the JOSM team.")
1229 (license license:gpl2)))
1231 (define-public java-opening-hours-parser
1233 (name "java-opening-hours-parser")
1238 (url "https://github.com/simonpoole/OpeningHoursParser")
1240 (file-name (git-file-name name version))
1243 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1244 (build-system ant-build-system)
1246 `(#:jar-name "java-opening-hours-parser.jar"
1247 #:source-dir "src/main/java"
1249 (modify-phases %standard-phases
1250 (add-before 'build 'copy-resources
1252 (copy-recursively "src/main/resources" "build/classes")
1254 (add-before 'build 'generate-parser
1256 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1257 (file (string-append dir "/OpeningHoursParser.jj")))
1258 (invoke "javacc" "-DEBUG_PARSER=false"
1259 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1260 "-GRAMMAR_ENCODING=UTF-8"
1261 (string-append "-OUTPUT_DIRECTORY=" dir)
1265 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1267 `(("javacc" ,javacc)
1268 ("java-junit" ,java-junit)
1269 ("java-hamcrest-core" ,java-hamcrest-core)))
1270 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1271 (synopsis "Java parser for the OpenStreetMap opening hour format")
1272 (description "This is a very simplistic parser for string values according
1273 to the OSM opening hours specification.")
1274 (license license:expat)))
1283 (url "https://josm.openstreetmap.de/svn/trunk")
1284 (revision (string->number version))
1288 "131ly6ah9ygrah1wq1h2199v4hyzgflnh62ychs4jqvy9wz0dal6"))
1289 (file-name (string-append name "-" version "-checkout"))
1290 (modules '((guix build utils)))
1293 (for-each delete-file (find-files "." ".*.jar$"))
1295 (build-system ant-build-system)
1297 `(("javacc" ,javacc)))
1299 `(("java-commons-jcs" ,java-commons-jcs)
1300 ("java-commons-compress" ,java-commons-compress)
1301 ("java-jmapviewer" ,java-jmapviewer)
1302 ("java-jsonp-api" ,java-jsonp-api)
1303 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1304 ("java-metadata-extractor" ,java-metadata-extractor)
1305 ("java-opening-hours-parser" ,java-opening-hours-parser)
1306 ("java-openjfx-media" ,java-openjfx-media)
1307 ("java-signpost-core" ,java-signpost-core)
1308 ("java-svg-salamander" ,java-svg-salamander)))
1311 #:jar-name "josm.jar"
1313 (modify-phases %standard-phases
1314 (add-after 'unpack 'rm-build.xml
1316 (delete-file "build.xml")
1318 (add-before 'build 'fix-revision
1320 (with-output-to-file "REVISION.XML"
1323 (string-append "<info><entry><commit revision=\"" ,version "\">"
1324 "<date>1970-01-01 00:00:00 +0000</date>"
1325 "</commit></entry></info>"))))
1327 (add-before 'build 'fix-jcs
1329 ;; This version of JOSM uses an unreleased version of commons-jcs,
1330 ;; which has renamed its classes to another namespace. Rename them
1331 ;; back so they can be used with our version of jcs.
1332 (substitute* (find-files "." ".*.java$")
1335 (add-before 'build 'fix-classpath
1336 (lambda* (#:key inputs #:allow-other-keys)
1341 (let ((source (assoc-ref inputs "source")))
1342 (not (equal? (substring s 0 (string-length source)) source))))
1343 (string-split (getenv "CLASSPATH") #\:))
1346 (add-before 'build 'generate-parser
1348 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1349 (out (string-append dir "/parsergen"))
1350 (file (string-append dir "/MapCSSParser.jj")))
1351 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1352 (invoke "javacc" "-DEBUG_PARSER=false"
1353 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1354 "-GRAMMAR_ENCODING=UTF-8"
1355 (string-append "-OUTPUT_DIRECTORY=" out)
1358 (add-after 'build 'generate-epsg
1360 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1361 "-cp" "build/classes")
1362 (mkdir-p "data/projection")
1363 (with-output-to-file "data/projection/custom-epsg"
1364 (lambda _ (display "")))
1365 (invoke "java" "-cp" "build/classes:scripts:."
1366 "BuildProjectionDefinitions" ".")
1368 (add-after 'generate-epsg 'copy-resources
1370 (copy-recursively "resources" "build/classes")
1372 (add-before 'install 'regenerate-jar
1374 ;; We need to regenerate the jar file to add data.
1375 (delete-file "build/jar/josm.jar")
1376 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1377 "build/classes" ".")
1379 (add-before 'build 'copy-revision
1381 (mkdir-p "build/classes")
1382 (with-output-to-file "build/classes/REVISION"
1385 (string-append "Revision: " ,version "\n"
1386 "Is-Local-Build: true\n"
1387 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1389 (add-after 'install 'install-bin
1390 (lambda* (#:key outputs inputs #:allow-other-keys)
1391 (let* ((out (assoc-ref outputs "out"))
1392 (bin (string-append out "/bin")))
1394 (with-output-to-file (string-append bin "/josm")
1397 (string-append "#!/bin/sh\n"
1398 (assoc-ref inputs "jdk") "/bin/java"
1399 " -cp " out "/share/java/josm.jar:"
1400 (getenv "CLASSPATH")
1401 " org.openstreetmap.josm.gui.MainApplication"))))
1402 (chmod (string-append bin "/josm") #o755))
1404 (home-page "https://josm.openstreetmap.de")
1405 (synopsis "OSM editor")
1406 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1407 supports loading GPX tracks, background imagery and OSM data from local
1408 sources as well as from online sources and allows editing the OSM data (nodes,
1409 ways, and relations) and their metadata tags.")
1410 (license license:gpl2+)))
1412 (define-public libmaxminddb
1414 (name "libmaxminddb")
1419 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1420 "/releases/download/" version "/"
1421 "/libmaxminddb-" version ".tar.gz"))
1423 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1424 (build-system gnu-build-system)
1427 (list ,(string-append "CC=" (cc-for-target)))))
1430 (home-page "https://maxmind.github.io/libmaxminddb/")
1431 (synopsis "C library for the MaxMind DB file format")
1432 (description "The libmaxminddb library provides a C library for reading
1433 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1434 format is a custom, but open, binary format designed to facilitate fast
1435 lookups of IP addresses while allowing flexibility in the type of data
1436 associated with an address.")
1437 (license license:asl2.0)))
1439 (define-public python-maxminddb
1441 (name "python-maxminddb")
1446 (uri (pypi-uri "maxminddb" version))
1449 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1450 (build-system python-build-system)
1452 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1454 `(("libmaxminddb" ,libmaxminddb)))
1455 (home-page "https://www.maxmind.com/")
1456 (synopsis "Reader for the MaxMind DB format")
1457 (description "MaxMind DB is a binary file format that stores data indexed
1458 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1460 (license license:asl2.0)))
1462 (define-public python-geoip2
1464 (name "python-geoip2")
1469 (uri (pypi-uri "geoip2" version))
1472 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1473 (build-system python-build-system)
1475 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1477 `(("python-maxminddb" ,python-maxminddb)
1478 ("python-requests" ,python-requests)))
1479 (home-page "https://www.maxmind.com/")
1480 (synopsis "MaxMind GeoIP2 API")
1481 (description "Provides an API for the GeoIP2 web services and databases.
1482 The API also works with MaxMind’s free GeoLite2 databases.")
1483 (license license:asl2.0)))
1485 (define-public routino
1492 (uri (string-append "http://www.routino.org/download/routino-"
1496 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1497 (build-system gnu-build-system)
1505 `(#:test-target "test"
1507 (modify-phases %standard-phases
1509 (lambda* (#:key outputs #:allow-other-keys)
1510 (substitute* "Makefile.conf"
1511 (("prefix=/usr/local")
1512 (string-append "prefix=" (assoc-ref outputs "out")))
1513 (("LDFLAGS_LDSO=-Wl,-R\\.")
1514 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1515 (("#CFLAGS\\+=-DUSE_XZ")
1517 (("#LDFLAGS\\+=-llzma")
1520 (synopsis "Routing application for OpenStreetMap data")
1522 "Routino is an application for finding a route between two points
1523 using the dataset of topographical information collected by
1524 @url{https://www.OpenStreetMap.org}.")
1525 (home-page "https://www.routino.org/")
1526 (license license:agpl3+)))
1528 (define-public qmapshack
1536 (url "https://github.com/Maproom/qmapshack")
1537 (commit (string-append "V_" version))))
1538 (file-name (git-file-name name version))
1541 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1542 (build-system qt-build-system)
1544 `(("pkg-config" ,pkg-config)
1545 ("qttools" ,qttools)))
1548 ("libjpeg-turbo" ,libjpeg-turbo)
1551 ("qtdeclarative" ,qtdeclarative)
1552 ("qtlocation" ,qtlocation)
1553 ("qtwebchannel" ,qtwebchannel)
1554 ("qtwebengine" ,qtwebengine)
1556 ("routino" ,routino)
1557 ("sqlite" ,sqlite) ; See wrap phase
1562 (modify-phases %standard-phases
1563 (add-after 'unpack 'fix-cmake-modules
1564 (lambda* (#:key inputs #:allow-other-keys)
1565 (substitute* "CMakeLists.txt"
1566 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1567 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1568 (substitute* "cmake/Modules/FindROUTINO.cmake"
1570 (assoc-ref inputs "routino")))
1571 ;; The following fixes are included as patches in the sources
1572 ;; of QMapShack, but they are not applied by default, for
1574 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1575 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1577 (add-after 'install 'wrap
1578 ;; The program fails to find the QtWebEngineProcess program,
1579 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1580 (lambda* (#:key inputs outputs #:allow-other-keys)
1581 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1582 (qtwebengineprocess (string-append
1583 (assoc-ref inputs "qtwebengine")
1584 "/lib/qt5/libexec/QtWebEngineProcess")))
1585 (for-each (lambda (program)
1586 (wrap-program program
1587 `("QTWEBENGINEPROCESS_PATH" =
1588 (,qtwebengineprocess))))
1589 (find-files bin ".*")))
1591 (synopsis "GPS mapping application")
1593 "QMapShack can be used to plan your next outdoor trip or to visualize and
1594 archive all the GPS recordings of your past trips. It is the successor of the
1595 QLandkarte GT application.")
1596 (home-page "https://github.com/Maproom/qmapshack/wiki")
1597 (license license:gpl3+)))
1599 (define-public readosm
1606 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1607 "readosm-" version ".tar.gz"))
1609 (base32 "0zv6p352pqjcv70nvcaf2x3011z35jqa24dcdm27a4ns1wha3cjc"))))
1610 (build-system gnu-build-system)
1614 (synopsis "Data extractor for OpenStreetMap files")
1616 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1617 input file (in @code{.osm} or @code{.osm.pbf} format).")
1618 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1619 (license (list license:gpl2+
1623 (define-public spatialite-tools
1625 (name "spatialite-tools")
1630 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1631 "spatialite-tools-" version ".tar.gz"))
1633 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1634 (build-system gnu-build-system)
1636 `(("pkg-config" ,pkg-config)))
1641 ("libspatialite" ,libspatialite)
1642 ("libxml2" ,libxml2)
1644 ("readosm" ,readosm)
1647 (synopsis "Collection of command line tools for SpatiaLite")
1649 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1650 tools supporting SpatiaLite.")
1651 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1652 (license license:gpl3+)))
1654 (define-public virtualpg
1661 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1662 "virtualpg-" version ".tar.gz"))
1664 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1665 (build-system gnu-build-system)
1667 `(("postgresql" ,postgresql)
1668 ("sqlite" ,sqlite)))
1669 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1671 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1672 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1673 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1674 exchanged form one Spatial DBMS and the other.")
1675 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1676 (license (list license:gpl2+
1680 (define-public opencpn
1688 (url "https://github.com/OpenCPN/OpenCPN")
1689 (commit (string-append "v" version))))
1690 (file-name (git-file-name name version))
1692 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1693 (build-system cmake-build-system)
1695 `(("gettext" ,gettext-minimal)
1696 ("pkg-config" ,pkg-config)))
1703 ("libarchive" ,libarchive)
1705 ("libexif" ,libexif)
1706 ("libsndfile" ,libsndfile)
1710 ("portaudio" ,portaudio)
1712 ("tinyxml" ,tinyxml)
1714 ("wxwidgets" ,wxwidgets)
1718 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1719 "-DENABLE_SNDFILE=ON"
1720 "-DBUNDLE_TCDATA=ON"
1721 "-DBUNDLE_GSHHS=CRUDE")
1722 #:tests? #f ; No tests defined
1724 (modify-phases %standard-phases
1725 (add-after 'unpack 'fix-build
1727 (substitute* "CMakeLists.txt"
1728 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1729 (string-append all " --libs all")))
1731 (synopsis "Chart plotter and marine GPS navigation software")
1733 "OpenCPN is a chart plotter and marine navigation software designed to be
1734 used at the helm station of your boat while underway. Chart a course and
1735 track your position right from your laptop.")
1736 (home-page "https://opencpn.org/")
1737 (license (list license:asl2.0
1748 (define-public grass
1749 (let* ((version "7.8.2")
1750 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1751 (grassxx (string-append "grass" majorminor)))
1758 (uri (string-append "https://grass.osgeo.org/" grassxx
1759 "/source/grass-" version ".tar.gz"))
1761 (base32 "1fwsm99kz0bxvjk7442qq1h45ikrmhba8bqclafb61gqg1q6ymrk"))))
1762 (build-system gnu-build-system)
1767 ("freetype" ,freetype)
1773 ("libtiff" ,libtiff)
1775 ("mariadb-dev" ,mariadb "dev")
1776 ("mariadb-lib" ,mariadb "lib")
1778 ("openblas" ,openblas)
1780 ("postgresql" ,postgresql)
1783 ("python-dateutil" ,python-dateutil)
1784 ("python-numpy" ,python-numpy)
1785 ("python-wxpython" ,python-wxpython)
1786 ("readline" ,readline)
1788 ("wxwidgets" ,wxwidgets)
1790 ("zstd" ,zstd "lib")))
1792 `(("bash" ,bash-minimal)
1795 ("pkg-config" ,pkg-config)))
1797 `(#:tests? #f ; No tests
1798 #:modules ((guix build gnu-build-system)
1799 ((guix build python-build-system) #:prefix python:)
1801 #:imported-modules (,@%gnu-build-system-modules
1802 (guix build python-build-system))
1804 (modify-phases %standard-phases
1806 (lambda* (#:key inputs outputs #:allow-other-keys)
1807 (let ((shell (string-append (assoc-ref inputs "bash")
1809 (setenv "SHELL" shell)
1810 (setenv "CONFIG_SHELL" shell)
1811 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1812 (assoc-ref outputs "out")
1813 "/" ,grassxx "/lib")))
1814 (invoke "./configure"
1815 (string-append "--prefix="
1816 (assoc-ref outputs "out"))
1819 (string-append "--with-freetype-includes="
1820 (assoc-ref inputs "freetype")
1821 "/include/freetype2")
1822 (string-append "--with-freetype-libs="
1823 (assoc-ref inputs "freetype")
1828 (string-append "--with-mysql-includes="
1829 (assoc-ref inputs "mariadb-dev")
1831 (string-append "--with-mysql-libs="
1832 (assoc-ref inputs "mariadb-lib")
1836 (string-append "--with-proj-share="
1837 (assoc-ref inputs "proj.4")
1842 "--with-wxwidgets")))
1843 (add-after 'install 'install-links
1844 (lambda* (#:key outputs #:allow-other-keys)
1845 ;; Put links for includes and libraries in the standard places.
1846 (let* ((out (assoc-ref outputs "out"))
1847 (dir (string-append out "/" ,grassxx)))
1848 (symlink (string-append dir "/include")
1849 (string-append out "/include"))
1850 (symlink (string-append dir "/lib")
1851 (string-append out "/lib")))
1853 (add-after 'install-links 'wrap-python
1854 (assoc-ref python:%standard-phases 'wrap)))))
1855 (synopsis "GRASS Geographic Information System")
1857 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1858 Information System (GIS) software suite used for geospatial data management and
1859 analysis, image processing, graphics and maps production, spatial modeling, and
1861 (home-page "https://grass.osgeo.org/")
1862 (license license:gpl2+))))
1871 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1872 (version-major version) "/SAGA%20-%20" version
1873 "/saga-" version ".tar.gz"))
1875 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1876 (build-system gnu-build-system)
1878 `(("pkg-config" ,pkg-config)
1886 ("libharu" ,libharu)
1887 ("libtiff" ,libtiff)
1889 ("postgresql" ,postgresql)
1893 ("unixodbc" ,unixodbc)
1895 ("wxwidgets" ,wxwidgets)))
1897 '(#:configure-flags '("--enable-python")))
1898 (synopsis "System for Automated Geoscientific Analyses")
1900 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1901 Information System (GIS) software. It has been designed for an easy and
1902 effective implementation of spatial algorithms and it offers a comprehensive,
1903 growing set of geoscientific methods.")
1904 (home-page "http://www.saga-gis.org")
1905 (license (list license:gpl2+ license:lgpl2.1+))))
1914 (uri (string-append "https://qgis.org/downloads/qgis-"
1915 version ".tar.bz2"))
1917 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1918 (build-system cmake-build-system)
1920 `(#:modules ((guix build cmake-build-system)
1921 ((guix build python-build-system) #:prefix python:)
1922 (guix build qt-utils)
1924 #:imported-modules (,@%cmake-build-system-modules
1925 (guix build python-build-system)
1926 (guix build qt-utils))
1928 (modify-phases %standard-phases
1929 ;; Configure correct path to PyQt5 SIP directory
1930 (add-after 'unpack 'configure-pyqt5-sip-path
1931 (lambda* (#:key inputs #:allow-other-keys)
1932 (substitute* "cmake/FindPyQt5.cmake"
1933 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
1934 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
1935 "/share/sip\" PYQT5_SIP_DIR")))
1936 (substitute* (list "scripts/prepare-commit.sh"
1937 "scripts/runtests-local-travis-config.sh"
1938 "scripts/sip_include.sh"
1940 "scripts/sipify_all.sh"
1941 "scripts/spell_check/check_spelling.sh"
1942 "scripts/spell_check/spell_test.sh"
1943 "scripts/verify-indentation.sh"
1944 "tests/code_layout/test_banned_keywords.sh"
1945 "tests/code_layout/test_licenses.sh"
1946 "tests/code_layout/test_shellcheck.sh"
1947 "tests/code_layout/test_sip_include.sh"
1948 "tests/code_layout/test_sipfiles_uptodate.sh"
1949 "tests/code_layout/test_sipify.sh")
1950 (("\\$\\(git rev-parse --show-toplevel\\)")
1952 (substitute* "tests/code_layout/test_sip_include.sh"
1953 (("^REV=.*") "REV=currentrev\n"))
1956 (lambda* (#:key inputs #:allow-other-keys)
1957 (setenv "HOME" "/tmp")
1958 (system (string-append (assoc-ref inputs "xorg-server")
1960 (setenv "DISPLAY" ":1")
1961 (setenv "TRAVIS" "true")
1962 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
1965 '(;; Disable tests that require network access
1966 "qgis_filedownloader"
1967 ;; TODO: Find why the following tests fail
1968 "ProcessingQgisAlgorithmsTestPt1"
1969 "ProcessingQgisAlgorithmsTestPt2"
1970 "ProcessingQgisAlgorithmsTestPt3"
1971 "ProcessingQgisAlgorithmsTestPt4"
1972 "ProcessingGdalAlgorithmsRasterTest"
1973 "ProcessingGdalAlgorithmsVectorTest"
1974 "ProcessingGrass7AlgorithmsImageryTest"
1975 "ProcessingGrass7AlgorithmsRasterTest"
1976 "ProcessingGrass7AlgorithmsVectorTest"
1977 "ProcessingOtbAlgorithmsTest"
1978 "qgis_authmanagertest"
1979 "qgis_compositionconvertertest"
1980 "qgis_coordinatereferencesystemtest"
1982 "qgis_layouthtmltest"
1983 "qgis_layoutmaptest"
1984 "qgis_layoutmapgridtest"
1985 "qgis_painteffecttest"
1986 "qgis_pallabelingtest"
1987 "qgis_svgmarkertest"
1988 "qgis_taskmanagertest"
1990 "qgis_processingtest"
1991 "qgis_wcsprovidertest"
1992 "qgis_arcgisrestutilstest"
1993 "qgis_grassprovidertest7"
1994 "qgis_gpsinformationwidget"
1996 "PyQgsPythonProvider"
1998 "PyQgsAuthenticationSystem"
2003 "PyQgsLayerMetadata"
2006 "PyQgsLayoutMapGrid"
2008 "PyQgsLayoutExporter"
2011 "PyQgsOGRProviderGpkg"
2012 "PyQgsPalLabelingLayout"
2013 "PyQgsImportIntoPostGIS"
2014 "PyQgsProviderConnectionPostgres"
2015 "PyQgsProviderConnectionGpkg"
2016 "PyQgsShapefileProvider"
2020 "PyQgsSpatialiteProvider"
2021 "PyQgsVectorFileWriter"
2023 "PyQgsVectorLayerUtils"
2024 "PyQgsVirtualLayerProvider"
2026 "PyQgsOapifProvider"
2027 "PyQgsLayerDependencies"
2028 "PyQgsDBManagerGpkg"
2029 "PyQgsDBManagerSpatialite"
2031 "PyQgsAuxiliaryStorage"
2032 "PyQgsSelectiveMasking"
2034 "qgis_geometrycheckstest"
2038 "qgis_sip_uptodate")
2040 (add-after 'install 'wrap-python
2041 (assoc-ref python:%standard-phases 'wrap))
2042 (add-after 'wrap-python 'wrap-qt
2043 (lambda* (#:key outputs #:allow-other-keys)
2044 (wrap-qt-program (assoc-ref outputs "out") "qgis")
2046 (add-after 'wrap-qt 'wrap-gis
2047 (lambda* (#:key inputs outputs #:allow-other-keys)
2048 (let* ((out (assoc-ref outputs "out"))
2049 (saga (string-append (assoc-ref inputs "saga") "/bin"))
2050 (grass-version ,(package-version grass))
2051 (grass-majorminor (string-join
2053 (string-split grass-version #\.) 2)
2055 (grass (string-append (assoc-ref inputs "grass")
2056 "/grass" grass-majorminor)))
2057 (wrap-program (string-append out "/bin/qgis")
2058 `("PATH" ":" prefix (,saga))
2059 `("QGIS_PREFIX_PATH" = (,out))
2060 `("GISBASE" = (,grass))))
2067 ("gpsbabel" ,gpsbabel)
2071 ("libspatialindex" ,libspatialindex)
2072 ("libspatialite" ,libspatialite)
2073 ("libxml2" ,libxml2)
2076 ("postgresql" ,postgresql)
2079 ("python-chardet" ,python-chardet)
2080 ("python-dateutil" ,python-dateutil)
2081 ("python-gdal" ,python-gdal)
2082 ("python-jinja2" ,python-jinja2)
2083 ("python-numpy" ,python-numpy)
2084 ("python-owslib" ,python-owslib)
2085 ("python-psycopg2" ,python-psycopg2)
2086 ("python-pygments" ,python-pygments)
2087 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2088 ("python-pytz" ,python-pytz)
2089 ("python-pyyaml" ,python-pyyaml)
2090 ("python-requests" ,python-requests)
2091 ("python-sip" ,python-sip)
2092 ("python-six" ,python-six)
2093 ("python-urllib3" ,python-urllib3)
2095 ("qscintilla" ,qscintilla)
2097 ("qtdeclarative" ,qtdeclarative)
2098 ("qtkeychain" ,qtkeychain)
2099 ("qtlocation" ,qtlocation)
2100 ("qtserialport" ,qtserialport)
2102 ("qtwebkit" ,qtwebkit)
2105 ("sqlite" ,sqlite)))
2110 ("perl-yaml-tiny" ,perl-yaml-tiny)
2111 ("pkg-config" ,pkg-config)
2112 ("python-mock" ,python-mock)
2113 ("python-nose2" ,python-nose2)
2114 ("qttools" ,qttools)
2115 ("shellcheck" ,shellcheck)
2116 ("xorg-server" ,xorg-server-for-tests)))
2117 (home-page "https://qgis.org")
2118 (synopsis "Geographical information system")
2119 (description "QGIS is an easy to use Geographical Information
2120 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2121 raster and vector data formats, with new support easily added using the plugin
2134 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2135 (license:fsf-free "file://debian/copyright" "Go Squared")
2139 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2141 "file://debian/copyright"
2142 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2152 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2153 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2154 (license:non-copyleft
2155 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2156 "NCL Source Code License")
2159 license:public-domain
2162 (define-public python-geographiclib
2164 (name "python-geographiclib")
2169 (uri (pypi-uri "geographiclib" version))
2172 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2173 (build-system python-build-system)
2174 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2175 (synopsis "Python geodesic routines from GeographicLib")
2177 "This is a python implementation of the geodesic routines in GeographicLib.")
2178 (license license:expat)))
2180 (define-public python-geopy
2182 (name "python-geopy")
2187 (uri (pypi-uri "geopy" version))
2190 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2191 (build-system python-build-system)
2193 `(("python-geographiclib" ,python-geographiclib)))
2195 `(("python-async-generator" ,python-async-generator)
2196 ("python-coverage" ,python-coverage)
2197 ("python-flake8" ,python-flake8)
2198 ("python-isort" ,python-isort)
2199 ("python-pytest" ,python-pytest)
2200 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2201 ("python-readme-renderer" ,python-readme-renderer)
2202 ("python-pytz" ,python-pytz)))
2203 (home-page "https://github.com/geopy/geopy")
2204 (synopsis "Geocoding library for Python")
2205 (description "@code{geopy} is a Python client for several popular geocoding
2206 web services. @code{geopy} makes it easy for Python developers to locate the
2207 coordinates of addresses, cities, countries, and landmarks across the globe
2208 using third-party geocoders and other data sources.")
2209 (license license:expat)))