1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
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 documentation)
63 #:use-module (gnu packages elf)
64 #:use-module (gnu packages flex)
65 #:use-module (gnu packages fonts)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages gl)
69 #:use-module (gnu packages glib)
70 #:use-module (gnu packages gnome)
71 #:use-module (gnu packages gps)
72 #:use-module (gnu packages gtk)
73 #:use-module (gnu packages haskell-apps)
74 #:use-module (gnu packages image)
75 #:use-module (gnu packages image-processing)
76 #:use-module (gnu packages icu4c)
77 #:use-module (gnu packages java)
78 #:use-module (gnu packages kde)
79 #:use-module (gnu packages lua)
80 #:use-module (gnu packages maths)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages pdf)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages photo)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages protobuf)
87 #:use-module (gnu packages pulseaudio)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages python-web)
90 #:use-module (gnu packages python-xyz)
91 #:use-module (gnu packages qt)
92 #:use-module (gnu packages readline)
93 #:use-module (gnu packages swig)
94 #:use-module (gnu packages sqlite)
95 #:use-module (gnu packages textutils)
96 #:use-module (gnu packages time)
97 #:use-module (gnu packages web)
98 #:use-module (gnu packages webkit)
99 #:use-module (gnu packages wxwidgets)
100 #:use-module (gnu packages xml)
101 #:use-module (gnu packages xorg))
109 (uri (string-append "http://download.osgeo.org/geos/geos-"
114 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
115 (build-system gnu-build-system)
116 (arguments `(#:phases
117 (modify-phases %standard-phases
119 'unpack 'patch-test-shebangs
121 (substitute* '("tests/xmltester/testrunner.sh"
122 "tests/geostest/testrunner.sh")
123 (("/bin/sh") (which "sh")))
127 (home-page "https://geos.osgeo.org/")
128 (synopsis "Geometry Engine for Geographic Information Systems")
130 "GEOS provides a spatial object model and fundamental geometric
131 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
132 it aims to contain the complete functionality of JTS in C++. This
133 includes all the OpenGIS Simple Features for SQL spatial predicate
134 functions and spatial operators, as well as specific JTS enhanced
135 topology functions.")
136 (license (list license:lgpl2.1+ ; Main distribution.
137 license:zlib ; tests/xmltester/tinyxml/*
138 license:public-domain)))) ; include/geos/timeval.h
140 (define-public gnome-maps
146 (uri (string-append "mirror://gnome/sources/" name "/"
147 (version-major+minor version) "/"
148 name "-" version ".tar.xz"))
151 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
152 (build-system meson-build-system)
156 (modify-phases %standard-phases
157 (add-after 'unpack 'skip-gtk-update-icon-cache
158 ;; Don't create 'icon-theme.cache'.
160 (substitute* "meson_post_install.py"
161 (("gtk-update-icon-cache") "true"))
163 (add-after 'install 'wrap
164 (lambda* (#:key inputs outputs #:allow-other-keys)
165 (let ((out (assoc-ref outputs "out"))
166 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
167 (geocode-glib-path (string-append
168 (assoc-ref inputs "geocode-glib")
170 (goa-path (string-append
171 (assoc-ref inputs "gnome-online-accounts:lib")
173 (gdk-pixbuf-path (string-append
174 (assoc-ref inputs "gdk-pixbuf")
176 (webkitgtk-path (string-append
177 (assoc-ref inputs "webkitgtk")
179 (wrap-program (string-append out "/bin/gnome-maps")
180 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
182 ;; There seems to be no way to embed the path of
183 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
184 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
185 ;; libgeocode-glib.so.0
186 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
189 ,geocode-glib-path)))
192 `(("gobject-introspection" ,gobject-introspection)
193 ("intltool" ,intltool)
194 ("pkg-config" ,pkg-config)))
197 ("libchamplain" ,libchamplain)
199 ("libsecret" ,libsecret)
201 ("libgweather" ,libgweather)
203 ("gdk-pixbuf" ,gdk-pixbuf+svg)
204 ("glib-networking" ,glib-networking)
206 ("geocode-glib" ,geocode-glib)
207 ("gfbgraph" ,gfbgraph)
210 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
211 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
213 ("webkitgtk" ,webkitgtk)))
216 (synopsis "Graphical map viewer and wayfinding program")
217 (description "GNOME Maps is a graphical map viewer. It uses map data from
218 the OpenStreetMap project. It can provide directions for walking, bicycling,
220 (home-page "https://wiki.gnome.org/Apps/Maps")
221 (license license:gpl2+)))
223 (define-public libgaiagraphics
225 (name "libgaiagraphics")
230 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
234 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
235 (build-system gnu-build-system)
237 `(("pkg-config" ,pkg-config)))
241 ("libjpeg-turbo" ,libjpeg-turbo)
243 ("libgeotiff" ,libgeotiff)
247 (synopsis "Gaia common graphics support")
248 (description "libgaiagraphics is a library supporting
249 common-utility raster handling methods.")
250 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
251 (license license:lgpl3+)))
253 (define-public libgeotiff
260 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
262 (patches (search-patches
263 ;; See libgeotiff 1.5.1 issue
264 ;; https://github.com/OSGeo/libgeotiff/issues/22
265 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
267 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
268 (modules '((guix build utils)))
271 ;; Remove .csv files, distributed from EPSG under a restricted
272 ;; license. See LICENSE for full license text.
273 (for-each delete-file (find-files "." "\\.csv$"))
275 (build-system gnu-build-system)
277 `(("libjpeg-turbo" ,libjpeg-turbo)
281 `(;; libgeotiff headers include proj headers, so ensure those are available.
285 (list "--disable-static"
286 "--with-zlib" "--with-jpeg"
287 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
288 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
289 (description "libgeotiff is a library on top of libtiff for reading and
290 writing GeoTIFF information tags.")
291 (home-page "https://trac.osgeo.org/geotiff/")
292 ;; This is a mixture of various contributions under different licenses.
293 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
294 ;; states, as its commercial redistribution is restricted. Hence, we have
295 ;; removed it from the package.
296 (license (list license:public-domain
299 (license:non-copyleft "file://LICENSE"
300 "See LICENSE in the distribution.")))))
302 (define-public libspatialite
304 (name "libspatialite")
309 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
313 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
314 (build-system gnu-build-system)
316 `(("pkg-config" ,pkg-config)))
326 (modify-phases %standard-phases
327 ;; 3 tests are failing, ignore them:
328 (add-after 'unpack 'ignore-broken-tests
330 (substitute* '("test/Makefile.in")
331 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
332 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
333 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
335 (synopsis "Extend SQLite to support Spatial SQL capabilities")
337 "SpatiaLite is a library intended to extend the SQLite core to support
338 fully fledged Spatial SQL capabilities.")
339 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
340 ;; For the genuine libspatialite-sources holds:
341 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
342 ;; Files under src/control_points are from GRASS
343 ;; and are licensed under GPL2+ only.
344 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
345 (license (list license:gpl2+
348 license:public-domain))))
357 (uri (string-append "http://download.osgeo.org/proj/proj-"
361 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
362 (build-system gnu-build-system)
364 `(("sqlite" ,sqlite)))
366 `(("pkg-config" ,pkg-config)))
367 (home-page "https://proj.org/")
368 (synopsis "Coordinate transformation software")
370 "Proj is a generic coordinate transformation software that transforms
371 geospatial coordinates from one coordinate reference system (CRS) to another.
372 This includes cartographic projections as well as geodetic transformations.
373 PROJ includes command line applications for easy conversion of coordinates
374 from text files or directly from user input. In addition, proj also exposes
375 an application programming interface that lets developers use the
376 functionality of proj in their own software.")
377 (license (list license:expat
378 ;; src/projections/patterson.cpp
380 ;; src/geodesic.*, src/tests/geodtest.cpp
383 (define-public proj.4
389 (uri (string-append "http://download.osgeo.org/proj/proj-"
393 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
394 (build-system gnu-build-system)
397 (modify-phases %standard-phases
398 (add-after 'unpack 'patch-test-paths
400 (substitute* '("nad/test27"
406 (("/bin/rm") (which "rm")))
408 ;; Precision problems on i686 and other platforms. See:
409 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
410 ;; Disable failing test.
411 (add-after 'patch-test-paths 'ignore-failing-tests
413 (substitute* '("nad/Makefile.in")
414 (("\tPROJ_LIB.*" all) (string-append "#" all)))
418 (home-page "https://proj.org/")
419 (synopsis "Cartographic Projections Library")
421 "Proj.4 is a library for converting coordinates between cartographic
423 (license (list license:expat
424 ;; src/PJ_patterson.c
428 ;; Embedded EPSG database.
429 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
433 (define-public mapnik
440 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
441 version "/mapnik-v" version ".tar.bz2"))
444 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
445 (build-system scons-build-system)
449 ("freetype" ,freetype)
450 ("harfbuzz" ,harfbuzz)
452 ("libjpeg-turbo" ,libjpeg-turbo)
461 `(("pkg-config" ,pkg-config)))
463 `(#:scons ,scons-python2
466 (string-append "PREFIX=" %output)
467 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
468 (home-page "https://mapnik.org/")
469 (synopsis "Toolkit for developing mapping applications")
470 (description "Mapnik is a toolkit for developing mapping applications. It
471 is basically a collection of geographic objects like maps, layers,
472 datasources, features, and geometries. At its core is a C++ shared library
473 providing algorithms and patterns for spatial data access and visualization.
474 The library does not rely on any specific windowing system and can be deployed
475 to any server environment. It is intended to play fair in a multi-threaded
476 environment and is aimed primarily, but not exclusively, at web-based
478 (license (list license:lgpl2.1+
479 ;; demo/viewer, demo/python/rundemo.py
481 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
483 ;; deps/mapnik/sparsehash
486 (license:non-copyleft "file://deps/agg/copying")))))
488 (define-public python2-mapnik
490 (name "python2-mapnik")
495 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
497 (file-name (string-append name "-" version ".tar.gz"))
500 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
501 (build-system python-build-system)
504 ("harfbuzz" ,harfbuzz)
506 ("libjpeg-turbo" ,libjpeg-turbo)
512 ("python2-pycairo" ,python2-pycairo)))
514 (let ((test-data-input
515 (lambda (repository version hash)
518 (uri (string-append "https://github.com/mapnik/" repository
519 "/archive/v" version ".tar.gz"))
520 (file-name (string-append "python-mapnik-" repository
521 "-" version ".tar.gz"))
522 (sha256 (base32 hash))))))
523 `(("python2-nose" ,python2-nose)
524 ;; Test data is released as separate tarballs
526 ,(test-data-input "test-data" "3.0.18"
527 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
529 ,(test-data-input "test-data-visual" "3.0.18"
530 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
532 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
534 (modify-phases %standard-phases
535 ;; Unpack test data into the source tree
536 (add-after 'unpack 'unpack-submodules
537 (lambda* (#:key inputs #:allow-other-keys)
538 (let ((unpack (lambda (source target)
539 (with-directory-excursion target
540 (invoke "tar" "xvf" (assoc-ref inputs source)
541 "--strip-components=1")))))
542 (unpack "test-data" "test/data")
543 (unpack "test-data-visual" "test/data-visual"))))
544 ;; Skip failing tests
545 (add-after 'unpack 'skip-tests
547 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
548 "test_unicode_regex_replace"
549 "test_proj_antimeridian_bbox"
550 "test_render_with_scale_factor")))
551 (substitute* "setup.cfg"
552 (("\\[nosetests\\]" all)
553 (string-append all "\nexclude=^("
554 (string-join skipped-tests "|") ")$")))))))))
555 (home-page "https://github.com/mapnik/python-mapnik")
556 (synopsis "Python bindings for Mapnik")
557 (description "This package provides Python bindings for Mapnik.")
558 (license license:lgpl2.1+)))
560 (define-public spatialite-gui
562 (name "spatialite-gui")
567 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
571 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
572 (build-system gnu-build-system)
574 `(("pkg-config" ,pkg-config)))
578 ("libgaiagraphics" ,libgaiagraphics)
579 ("libjpeg-turbo" ,libjpeg-turbo)
580 ("libspatialite" ,libspatialite)
584 ("wxwidgets" ,wxwidgets-2)
587 `(#:phases (modify-phases %standard-phases
588 (add-after 'unpack 'fix-gui
590 ;; Fix for the GUI not showing up.
591 (substitute* "Main.cpp"
592 (("Hide\\(\\);") ""))
594 (synopsis "Graphical user interface for SpatiaLite")
595 (description "Spatialite-gui provides a visual interface for viewing and
596 maintaining a spatialite database. You can easily see the structure of the
597 tables and data contents using point and click functions, many of which
598 construct common SQL queries, or craft your own SQL queries.")
599 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
600 (license license:gpl3+)))
609 "http://download.osgeo.org/gdal/" version "/gdal-"
613 "10symyajj1b7j98f889lqxxbmhcyvlhq9gg0l42h69bv22wx45gw"))
614 (modules '((guix build utils)))
617 ;; TODO: frmts contains a lot more bundled code.
618 (for-each delete-file-recursively
623 "frmts/jpeg/libjpeg12"
624 "frmts/gtiff/libtiff"
625 "frmts/gtiff/libgeotiff"
627 "ogr/ogrsf_frmts/geojson/libjson"))))))
628 (build-system gnu-build-system)
632 (let-syntax ((with (syntax-rules ()
634 (string-append option "="
635 (assoc-ref %build-inputs input))))))
637 ;; TODO: --with-pcidsk, --with-pcraster
638 (with "--with-freexl" "freexl")
639 (with "--with-libjson-c" "json-c")
640 (with "--with-png" "libpng")
641 (with "--with-webp" "libwebp")
642 (with "--with-gif" "giflib")
643 (with "--with-jpeg" "libjpeg-turbo")
644 (with "--with-libtiff" "libtiff")
645 (with "--with-geotiff" "libgeotiff")
646 (with "--with-libz" "zlib")
647 (with "--with-expat" "expat")
648 (with "--with-sqlite3" "sqlite")
651 (modify-phases %standard-phases
652 (add-before 'build 'fix-path
654 (substitute* "frmts/mrf/mrf_band.cpp"
655 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
662 ("libgeotiff" ,libgeotiff)
663 ("libjpeg-turbo" ,libjpeg-turbo)
672 (home-page "https://gdal.org/")
673 (synopsis "Raster and vector geospatial data format library")
674 (description "GDAL is a translator library for raster and vector geospatial
675 data formats. As a library, it presents a single raster abstract data model
676 and single vector abstract data model to the calling application for all
677 supported formats. It also comes with a variety of useful command line
678 utilities for data translation and processing.")
682 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
683 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
686 ;; frmts/hdf4/hdf-eos/*
687 ;; similar to the expat license, but without guarantee exclusion
688 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
689 ;; frmts/grib/degrib/
690 license:public-domain ; with guarantee exclusion
692 ;; Some bsd-inspired license
693 (license:non-copyleft "file://port/LICENCE_minizip")
694 ;; alg/internal_libqhull
695 ;; Some 5-clause license
696 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
700 (define-public python-gdal
701 (package (inherit gdal)
703 (build-system python-build-system)
705 '(#:tests? #f ; no tests
707 (modify-phases %standard-phases
708 (add-before 'build 'chdir
710 (chdir "swig/python")
714 `(("python-numpy" ,python-numpy)))
717 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
719 (define-public postgis
725 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
729 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
730 (build-system gnu-build-system)
734 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
735 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
736 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
737 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
739 (modify-phases %standard-phases
740 (add-before 'build 'fix-install-path
741 (lambda* (#:key outputs #:allow-other-keys)
742 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
743 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
744 (string-append (assoc-ref outputs "out") "/bin"))))))))
749 ("libjpeg" ,libjpeg-turbo)
752 ("postgresql" ,postgresql)
756 ("pkg-config" ,pkg-config)))
757 (home-page "https://postgis.net")
758 (synopsis "Spatial database extender for PostgreSQL")
759 (description "PostGIS is a spatial database extender for PostgreSQL
760 object-relational database. It adds support for geographic objects allowing
761 location queries to be run in SQL. This package provides a PostgreSQL
766 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
769 license:public-domain
771 license:bsd-3 ; files only say "BSD"
773 license:cc-by-sa3.0))))
775 (define-public tegola
782 "https://github.com/go-spatial/tegola/archive/v"
784 (file-name (string-append name "-" version ".tar.gz"))
787 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
788 (build-system go-build-system)
790 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
791 #:unpack-path "github.com/go-spatial/tegola"
793 (modify-phases %standard-phases
794 (add-before 'build 'set-version
796 (with-directory-excursion "src/github.com/go-spatial/tegola"
797 (substitute* '("cmd/tegola/cmd/root.go"
798 "cmd/tegola_lambda/main.go")
799 (("version not set") ,version)))
801 (home-page "https://tegola.io")
802 (synopsis "Vector tile server for maps")
803 (description "Tegola is a free vector tile server written in Go. Tegola
804 takes geospatial data and slices it into vector tiles that can be efficiently
805 delivered to any client.")
808 ;; Some packages in vendor have other licenses
814 (define-public imposm3
817 (version "0.6.0-alpha.4")
821 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
823 (file-name (string-append name "-" version ".tar.gz"))
826 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
827 (build-system go-build-system)
829 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
830 #:unpack-path "github.com/omniscale/imposm3"
832 (modify-phases %standard-phases
833 (add-before 'build 'set-version
835 (substitute* "src/github.com/omniscale/imposm3/version.go"
836 (("0.0.0-dev") ,version))
840 ("leveldb" ,leveldb)))
841 (home-page "https://imposm.org/")
842 (synopsis "OpenStreetMap importer for PostGIS")
843 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
844 files and imports the data into PostgreSQL/PostGIS databases. It is designed
845 to create databases that are optimized for rendering/tile/map-services.")
848 ;; Some dependencies in vendor have different licenses
853 (define-public libosmium
861 (url "https://github.com/osmcode/libosmium.git")
862 (commit (string-append "v" version))))
863 (file-name (git-file-name name version))
865 (base32 "0mlcvqrhp40bzj5r5j9nfc5vbis8hmzcq9xi8jylkciyydaynhz4"))))
866 (build-system cmake-build-system)
874 ("protozero" ,protozero)
875 ("sparsehash" ,sparsehash)
879 `(("doxygen" ,doxygen)))
880 (home-page "https://osmcode.org/libosmium/")
881 (synopsis "C++ library for working with OpenStreetMap data")
882 (description "Libosmium is a fast and flexible C++ library for working with
883 OpenStreetMap data.")
884 (license license:boost1.0)))
886 (define-public osm2pgsql
894 (url "https://github.com/openstreetmap/osm2pgsql.git")
896 (file-name (git-file-name name version))
898 (base32 "1ysan01lpqzjxlq3y2kdminfjs5d9zksicpf9vvzpdk3fzq51fc9"))
899 (modules '((guix build utils)))
902 (delete-file-recursively "contrib/protozero")
903 (delete-file-recursively "contrib/libosmium")
905 (build-system cmake-build-system)
907 `(#:tests? #f; tests fail because we need to setup a database
909 (list (string-append "-DOSMIUM_INCLUDE_DIR="
910 (assoc-ref %build-inputs "libosmium")
912 (string-append "-DPROTOZERO_INCLUDE_DIR="
913 (assoc-ref %build-inputs "protozero")
919 ("libosmium" ,libosmium)
921 ("postgresql" ,postgresql)
923 ("protozero" ,protozero)
927 ("python-psycopg2" ,python-psycopg2)))
928 (home-page "https://github.com/openstreetmap/osm2pgsql")
929 (synopsis "OSM data importer to postgresql")
930 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
931 PostgreSQL / PostGIS database suitable for applications like rendering into a
932 map, geocoding with Nominatim, or general analysis.")
933 (license license:gpl2+)))
935 (define-public tippecanoe
943 (url "https://github.com/mapbox/tippecanoe.git")
945 (file-name (git-file-name name version))
947 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
948 (build-system gnu-build-system)
951 (modify-phases %standard-phases (delete 'configure))
955 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
960 (home-page "https://github.com/mapbox/tippecanoe")
961 (synopsis "Vector tile server for maps")
962 (description "Tippecanoe creates scale-independent view of data, so that
963 the texture and density of features is visible at every zoom level, instead of
964 dropping features at lower levels.")
965 (license license:bsd-2)))
967 (define-public osmctools
975 (url "https://gitlab.com/osm-c-tools/osmctools")
977 (file-name (git-file-name name version))
980 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
981 (build-system gnu-build-system)
983 `(("autoconf" ,autoconf)
984 ("automake" ,automake)))
987 (home-page "https://gitlab.com/osm-c-tools/osmctools")
988 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
989 (description "This project contains a few tools which are used in the
990 OpenStreetMap project. They can be used to convert, filter and update
991 OpenStreetMap data files.")
992 (license license:agpl3)))
994 (define-public osm-gps-map
1002 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1003 version "/osm-gps-map-" version ".tar.gz"))
1006 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1007 (build-system gnu-build-system)
1009 `(("gnome-common" ,gnome-common)
1010 ("gtk-doc" ,gtk-doc)
1011 ("pkg-config" ,pkg-config)))
1015 ("gobject-introspection" ,gobject-introspection)
1017 ("libsoup" ,libsoup)))
1018 (home-page "https://nzjrs.github.io/osm-gps-map/")
1019 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1021 "This package provides a GTK+ widget (and Python bindings) that when
1022 given GPS coordinates,draws a GPS track, and points of interest on a moving
1023 map display. Downloads map data from a number of websites, including
1024 @url{https://www.openstreetmap.org}.")
1025 (license license:gpl2+)))
1027 (define-public xygrib
1034 (url "https://github.com/opengribs/XyGrib.git")
1035 (commit (string-append "v" version))))
1036 (file-name (git-file-name name version))
1039 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1040 (modules '((guix build utils)))
1042 '(begin (delete-file-recursively "data/fonts") #t))))
1043 (build-system cmake-build-system)
1046 (modify-phases %standard-phases
1047 (add-after 'unpack 'patch-directories
1048 (lambda* (#:key inputs #:allow-other-keys)
1049 (let ((jpeg (assoc-ref inputs "openjpeg"))
1050 (font (assoc-ref inputs "font-liberation")))
1051 (substitute* "CMakeLists.txt"
1054 ;; Fix install locations.
1055 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1056 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1057 ;; Skip looking for the static library.
1058 (("\"libnova.a\"") ""))
1059 ;; Don't use the bundled font-liberation.
1060 (substitute* "src/util/Font.cpp"
1061 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1062 (string-append "\"" font "/share/fonts/truetype/\"")))
1063 (substitute* "src/util/Util.h"
1064 (("pathData\\(\\)\\+\"data/fonts/\"")
1065 (string-append "\"" font "/share/fonts/\""))))
1067 #:tests? #f)) ; no tests
1069 `(("qttools" ,qttools)))
1072 ("font-liberation" ,font-liberation)
1073 ("libnova" ,libnova)
1075 ("openjpeg" ,openjpeg)
1079 (synopsis "Weather Forecast Visualization")
1081 "XyGrib is a Grib file reader and visualizes meteorological data providing
1082 an off-line capability to analyse weather forecasts or hindcasts. It is
1083 intended to be used as a capable weather work station for anyone with a serious
1084 interest in examining weather. This would include members of the sailing
1085 community, private and sport aviators, farmers, weather buffs and many more.
1086 XyGrib is the continuation of the zyGrib software package with a new team of
1088 (home-page "https://opengribs.org")
1089 (license license:gpl3+)))
1091 (define-public libspatialindex
1093 (name "libspatialindex")
1098 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1099 "releases/download/" version "/spatialindex-src-"
1100 version ".tar.bz2"))
1103 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1104 (build-system cmake-build-system)
1105 (home-page "https://libspatialindex.org")
1106 (synopsis "Spatial indexing library")
1107 (description "The purpose of this library is to provide:
1110 @item An extensible framework that will support robust spatial indexing
1112 @item Support for sophisticated spatial queries. Range, point location,
1113 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1114 by spatial constraints) should be easy to deploy and run.
1115 @item Easy to use interfaces for inserting, deleting and updating information.
1116 @item Wide variety of customization capabilities. Basic index and storage
1117 characteristics like the page size, node capacity, minimum fan-out, splitting
1118 algorithm, etc. should be easy to customize.
1119 @item Index persistence. Internal memory and external memory structures
1120 should be supported. Clustered and non-clustered indices should be easy to be
1124 (license license:expat)))
1126 (define-public java-jmapviewer
1128 (name "java-jmapviewer")
1132 (uri (string-append "https://svn.openstreetmap.org/applications/"
1133 "viewer/jmapviewer/releases/" version
1134 "/JMapViewer-" version "-Source.zip"))
1137 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1138 (build-system ant-build-system)
1140 `(("unzip" ,unzip)))
1142 `(#:build-target "pack"
1143 #:tests? #f; No tests
1145 (modify-phases %standard-phases
1146 (add-before 'build 'clean
1148 (invoke "ant" "clean")))
1150 (lambda* (#:key outputs #:allow-other-keys)
1151 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1153 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1154 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1155 (synopsis "OSM map integration in Java")
1156 (description "JMapViewer is a Java component which easily
1157 integrates an OSM map view into your Java application. It is maintained as
1158 an independent project by the JOSM team.")
1159 (license license:gpl2)))
1168 (url "https://josm.openstreetmap.de/svn/trunk")
1169 (revision (string->number version))
1173 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
1174 (file-name (string-append name "-" version "-checkout"))
1175 (modules '((guix build utils)))
1178 (for-each delete-file (find-files "." ".*.jar$"))
1180 (build-system ant-build-system)
1182 `(("javacc" ,javacc)))
1184 `(("java-commons-jcs" ,java-commons-jcs)
1185 ("java-commons-compress" ,java-commons-compress)
1186 ("java-jmapviewer" ,java-jmapviewer)
1187 ("java-jsonp-api" ,java-jsonp-api)
1188 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1189 ("java-metadata-extractor" ,java-metadata-extractor)
1190 ("java-openjfx-media" ,java-openjfx-media)
1191 ("java-signpost-core" ,java-signpost-core)
1192 ("java-svg-salamander" ,java-svg-salamander)))
1195 #:jar-name "josm.jar"
1197 (modify-phases %standard-phases
1198 (add-after 'unpack 'rm-build.xml
1200 (delete-file "build.xml")
1202 (add-before 'build 'fix-revision
1204 (with-output-to-file "REVISION.XML"
1207 (string-append "<info><entry><commit revision=\"" ,version "\">"
1208 "<date>1970-01-01 00:00:00 +0000</date>"
1209 "</commit></entry></info>"))))
1211 (add-before 'build 'fix-classpath
1212 (lambda* (#:key inputs #:allow-other-keys)
1217 (let ((source (assoc-ref inputs "source")))
1218 (not (equal? (substring s 0 (string-length source)) source))))
1219 (string-split (getenv "CLASSPATH") #\:))
1222 (add-before 'build 'generate-parser
1224 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1225 (out (string-append dir "/parsergen"))
1226 (file (string-append dir "/MapCSSParser.jj")))
1227 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1228 (invoke "javacc" "-DEBUG_PARSER=false"
1229 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1230 "-GRAMMAR_ENCODING=UTF-8"
1231 (string-append "-OUTPUT_DIRECTORY=" out)
1234 (add-after 'build 'generate-epsg
1236 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1237 "-cp" "build/classes")
1238 (mkdir-p "data/projection")
1239 (with-output-to-file "data/projection/custom-epsg"
1240 (lambda _ (display "")))
1241 (invoke "java" "-cp" "build/classes:scripts:."
1242 "BuildProjectionDefinitions" ".")
1244 (add-after 'generate-epsg 'copy-data
1246 (mkdir-p "build/classes")
1247 (rename-file "data" "build/classes/data")
1249 (add-before 'install 'regenerate-jar
1251 ;; We need to regenerate the jar file to add data.
1252 (delete-file "build/jar/josm.jar")
1253 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1254 "build/classes" ".")
1256 (add-before 'build 'copy-styles
1258 (mkdir-p "build/classes")
1259 (rename-file "styles" "build/classes/styles")
1261 (add-before 'build 'copy-images
1263 (mkdir-p "build/classes")
1264 (rename-file "images" "build/classes/images")
1266 (add-before 'build 'copy-revision
1268 (mkdir-p "build/classes")
1269 (with-output-to-file "build/classes/REVISION"
1272 (string-append "Revision: " ,version "\n"
1273 "Is-Local-Build: true\n"
1274 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1276 (add-after 'install 'install-bin
1277 (lambda* (#:key outputs inputs #:allow-other-keys)
1278 (let* ((out (assoc-ref outputs "out"))
1279 (bin (string-append out "/bin")))
1281 (with-output-to-file (string-append bin "/josm")
1284 (string-append "#!/bin/sh\n"
1285 (assoc-ref inputs "jdk") "/bin/java"
1286 " -cp " out "/share/java/josm.jar:"
1287 (getenv "CLASSPATH")
1288 " org.openstreetmap.josm.gui.MainApplication"))))
1289 (chmod (string-append bin "/josm") #o755))
1291 (home-page "https://josm.openstreetmap.de")
1292 (synopsis "OSM editor")
1293 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1294 supports loading GPX tracks, background imagery and OSM data from local
1295 sources as well as from online sources and allows editing the OSM data (nodes,
1296 ways, and relations) and their metadata tags.")
1297 (license license:gpl2+)))
1299 (define-public libmaxminddb
1301 (name "libmaxminddb")
1306 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1307 "/releases/download/" version "/"
1308 "/libmaxminddb-" version ".tar.gz"))
1310 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1311 (build-system gnu-build-system)
1314 (modify-phases %standard-phases
1315 (add-before 'configure 'set-cc-to-gcc
1317 (setenv "CC" "gcc"))))))
1320 (home-page "https://maxmind.github.io/libmaxminddb/")
1321 (synopsis "C library for the MaxMind DB file format")
1322 (description "The libmaxminddb library provides a C library for reading
1323 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1324 format is a custom, but open, binary format designed to facilitate fast
1325 lookups of IP addresses while allowing flexibility in the type of data
1326 associated with an address.")
1327 (license license:asl2.0)))
1329 (define-public python-maxminddb
1331 (name "python-maxminddb")
1336 (uri (pypi-uri "maxminddb" version))
1339 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1340 (build-system python-build-system)
1342 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1344 `(("libmaxminddb" ,libmaxminddb)))
1345 (home-page "https://www.maxmind.com/")
1346 (synopsis "Reader for the MaxMind DB format")
1347 (description "MaxMind DB is a binary file format that stores data indexed
1348 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1350 (license license:asl2.0)))
1352 (define-public python-geoip2
1354 (name "python-geoip2")
1359 (uri (pypi-uri "geoip2" version))
1362 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1363 (build-system python-build-system)
1365 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1367 `(("python-maxminddb" ,python-maxminddb)
1368 ("python-requests" ,python-requests)))
1369 (home-page "https://www.maxmind.com/")
1370 (synopsis "MaxMind GeoIP2 API")
1371 (description "Provides an API for the GeoIP2 web services and databases.
1372 The API also works with MaxMind’s free GeoLite2 databases.")
1373 (license license:asl2.0)))
1375 (define-public routino
1382 (uri (string-append "http://www.routino.org/download/routino-"
1386 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1387 (build-system gnu-build-system)
1395 `(#:test-target "test"
1397 (modify-phases %standard-phases
1399 (lambda* (#:key outputs #:allow-other-keys)
1400 (substitute* "Makefile.conf"
1401 (("prefix=/usr/local")
1402 (string-append "prefix=" (assoc-ref outputs "out")))
1403 (("LDFLAGS_LDSO=-Wl,-R\\.")
1404 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1405 (("#CFLAGS\\+=-DUSE_XZ")
1407 (("#LDFLAGS\\+=-llzma")
1410 (synopsis "Routing application for OpenStreetMap data")
1412 "Routino is an application for finding a route between two points
1413 using the dataset of topographical information collected by
1414 @url{https://www.OpenStreetMap.org}.")
1415 (home-page "https://www.routino.org/")
1416 (license license:agpl3+)))
1418 (define-public qmapshack
1426 (url "https://github.com/Maproom/qmapshack.git")
1427 (commit (string-append "V_" version))))
1428 (file-name (git-file-name name version))
1431 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1432 (build-system qt-build-system)
1434 `(("pkg-config" ,pkg-config)
1435 ("qttools" ,qttools)))
1438 ("libjpeg-turbo" ,libjpeg-turbo)
1441 ("qtdeclarative" ,qtdeclarative)
1442 ("qtlocation" ,qtlocation)
1443 ("qtwebchannel" ,qtwebchannel)
1444 ("qtwebengine" ,qtwebengine)
1446 ("routino" ,routino)
1447 ("sqlite" ,sqlite-with-column-metadata) ; See wrap phase
1452 (modify-phases %standard-phases
1453 (add-after 'unpack 'fix-cmake-modules
1454 (lambda* (#:key inputs #:allow-other-keys)
1455 (substitute* "CMakeLists.txt"
1456 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1457 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1458 (substitute* "cmake/Modules/FindROUTINO.cmake"
1460 (assoc-ref inputs "routino")))
1461 ;; The following fixes are included as patches in the sources
1462 ;; of QMapShack, but they are not applied by default, for
1464 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1465 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1467 (add-after 'install 'wrap
1468 ;; The program fails to run with the error:
1469 ;; undefined symbol: sqlite3_column_table_name16
1470 ;; Forcing the program to use sqlite-with-column-metadata instead
1471 ;; of sqlite using LD_LIBRARY_PATH solves the problem.
1473 ;; The program also fails to find the QtWebEngineProcess program,
1474 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1475 (lambda* (#:key inputs outputs #:allow-other-keys)
1476 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1477 (qtwebengineprocess (string-append
1478 (assoc-ref inputs "qtwebengine")
1479 "/lib/qt5/libexec/QtWebEngineProcess"))
1480 (sqlite-lib (string-append (assoc-ref inputs "sqlite")
1482 (for-each (lambda (program)
1483 (wrap-program program
1484 `("LD_LIBRARY_PATH" ":" prefix (,sqlite-lib))
1485 `("QTWEBENGINEPROCESS_PATH" =
1486 (,qtwebengineprocess))))
1487 (find-files bin ".*")))
1489 (synopsis "GPS mapping application")
1491 "QMapShack can be used to plan your next outdoor trip or to visualize and
1492 archive all the GPS recordings of your past trips. It is the successor of the
1493 QLandkarte GT application.")
1494 (home-page "https://github.com/Maproom/qmapshack/wiki")
1495 (license license:gpl3+)))
1497 (define-public readosm
1504 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1505 "readosm-" version ".tar.gz"))
1507 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1508 (build-system gnu-build-system)
1512 (synopsis "Data extractor for OpenStreetMap files")
1514 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1515 input file (in @code{.osm} or @code{.osm.pbf} format).")
1516 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1517 (license (list license:gpl2+
1521 (define-public spatialite-tools
1523 (name "spatialite-tools")
1528 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1529 "spatialite-tools-" version ".tar.gz"))
1531 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1532 (build-system gnu-build-system)
1534 `(("pkg-config" ,pkg-config)))
1539 ("libspatialite" ,libspatialite)
1540 ("libxml2" ,libxml2)
1542 ("readosm" ,readosm)
1545 (synopsis "Collection of command line tools for SpatiaLite")
1547 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1548 tools supporting SpatiaLite.")
1549 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1550 (license license:gpl3+)))
1552 (define-public virtualpg
1559 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1560 "virtualpg-" version ".tar.gz"))
1562 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1563 (build-system gnu-build-system)
1565 `(("postgresql" ,postgresql)
1566 ("sqlite" ,sqlite)))
1567 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1569 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1570 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1571 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1572 exchanged form one Spatial DBMS and the other.")
1573 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1574 (license (list license:gpl2+
1578 (define-public opencpn
1586 (url "https://github.com/OpenCPN/OpenCPN.git")
1587 (commit (string-append "v" version))))
1588 (file-name (git-file-name name version))
1590 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1591 (build-system cmake-build-system)
1593 `(("gettext" ,gettext-minimal)
1594 ("pkg-config" ,pkg-config)))
1601 ("libarchive" ,libarchive)
1603 ("libexif" ,libexif)
1604 ("libsndfile" ,libsndfile)
1608 ("portaudio" ,portaudio)
1610 ("tinyxml" ,tinyxml)
1612 ("wxwidgets" ,wxwidgets)
1616 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1617 "-DENABLE_SNDFILE=ON"
1618 "-DBUNDLE_TCDATA=ON"
1619 "-DBUNDLE_GSHHS=CRUDE")
1620 #:tests? #f ; No tests defined
1622 (modify-phases %standard-phases
1623 (add-after 'unpack 'fix-build
1625 (substitute* "CMakeLists.txt"
1626 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1627 (string-append all " --libs all")))
1629 (synopsis "Chart plotter and marine GPS navigation software")
1631 "OpenCPN is a chart plotter and marine navigation software designed to be
1632 used at the helm station of your boat while underway. Chart a course and
1633 track your position right from your laptop.")
1634 (home-page "https://opencpn.org/")
1635 (license (list license:asl2.0
1646 (define-public grass
1647 (let* ((version "7.8.2")
1648 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1649 (grassxx (string-append "grass" majorminor)))
1656 (uri (string-append "https://grass.osgeo.org/" grassxx
1657 "/source/grass-" version ".tar.gz"))
1659 (base32 "1fwsm99kz0bxvjk7442qq1h45ikrmhba8bqclafb61gqg1q6ymrk"))))
1660 (build-system gnu-build-system)
1665 ("freetype" ,freetype)
1671 ("libtiff" ,libtiff)
1673 ("mariadb-dev" ,mariadb "dev")
1674 ("mariadb-lib" ,mariadb "lib")
1676 ("openblas" ,openblas)
1678 ("postgresql" ,postgresql)
1681 ("python-dateutil" ,python-dateutil)
1682 ("python-numpy" ,python-numpy)
1683 ("python-wxpython" ,python-wxpython)
1684 ("readline" ,readline)
1686 ("wxwidgets" ,wxwidgets)
1688 ("zstd" ,zstd "lib")))
1690 `(("bash" ,bash-minimal)
1693 ("pkg-config" ,pkg-config)))
1695 `(#:tests? #f ; No tests
1696 #:modules ((guix build gnu-build-system)
1697 ((guix build python-build-system) #:prefix python:)
1699 #:imported-modules (,@%gnu-build-system-modules
1700 (guix build python-build-system))
1702 (modify-phases %standard-phases
1704 (lambda* (#:key inputs outputs #:allow-other-keys)
1705 (let ((shell (string-append (assoc-ref inputs "bash")
1707 (setenv "SHELL" shell)
1708 (setenv "CONFIG_SHELL" shell)
1709 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1710 (assoc-ref outputs "out")
1711 "/" ,grassxx "/lib")))
1712 (invoke "./configure"
1713 (string-append "--prefix="
1714 (assoc-ref outputs "out"))
1717 (string-append "--with-freetype-includes="
1718 (assoc-ref inputs "freetype")
1719 "/include/freetype2")
1720 (string-append "--with-freetype-libs="
1721 (assoc-ref inputs "freetype")
1726 (string-append "--with-mysql-includes="
1727 (assoc-ref inputs "mariadb-dev")
1729 (string-append "--with-mysql-libs="
1730 (assoc-ref inputs "mariadb-lib")
1734 (string-append "--with-proj-share="
1735 (assoc-ref inputs "proj.4")
1740 "--with-wxwidgets")))
1741 (add-after 'install 'install-links
1742 (lambda* (#:key outputs #:allow-other-keys)
1743 ;; Put links for includes and libraries in the standard places.
1744 (let* ((out (assoc-ref outputs "out"))
1745 (dir (string-append out "/" ,grassxx)))
1746 (symlink (string-append dir "/include")
1747 (string-append out "/include"))
1748 (symlink (string-append dir "/lib")
1749 (string-append out "/lib")))
1751 (add-after 'install-links 'wrap-python
1752 (assoc-ref python:%standard-phases 'wrap)))))
1753 (synopsis "GRASS Geographic Information System")
1755 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1756 Information System (GIS) software suite used for geospatial data management and
1757 analysis, image processing, graphics and maps production, spatial modeling, and
1759 (home-page "https://grass.osgeo.org/")
1760 (license license:gpl2+))))
1769 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1770 (version-major version) "/SAGA%20-%20" version
1771 "/saga-" version ".tar.gz"))
1773 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1774 (build-system gnu-build-system)
1776 `(("pkg-config" ,pkg-config)
1784 ("libharu" ,libharu)
1785 ("libtiff" ,libtiff)
1787 ("postgresql" ,postgresql)
1791 ("unixodbc" ,unixodbc)
1793 ("wxwidgets" ,wxwidgets)))
1795 '(#:configure-flags '("--enable-python")))
1796 (synopsis "System for Automated Geoscientific Analyses")
1798 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1799 Information System (GIS) software. It has been designed for an easy and
1800 effective implementation of spatial algorithms and it offers a comprehensive,
1801 growing set of geoscientific methods.")
1802 (home-page "http://www.saga-gis.org")
1803 (license (list license:gpl2+ license:lgpl2.1+))))
1812 (uri (string-append "https://qgis.org/downloads/qgis-"
1813 version ".tar.bz2"))
1815 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1816 (build-system cmake-build-system)
1818 `(#:modules ((guix build cmake-build-system)
1819 ((guix build python-build-system) #:prefix python:)
1820 (guix build qt-utils)
1822 #:imported-modules (,@%cmake-build-system-modules
1823 (guix build python-build-system)
1824 (guix build qt-utils))
1826 (modify-phases %standard-phases
1827 ;; Configure correct path to PyQt5 SIP directory
1828 (add-after 'unpack 'configure-pyqt5-sip-path
1829 (lambda* (#:key inputs #:allow-other-keys)
1830 (substitute* "cmake/FindPyQt5.cmake"
1831 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
1832 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
1833 "/share/sip\" PYQT5_SIP_DIR")))
1834 (substitute* (list "scripts/prepare-commit.sh"
1835 "scripts/runtests-local-travis-config.sh"
1836 "scripts/sip_include.sh"
1838 "scripts/sipify_all.sh"
1839 "scripts/spell_check/check_spelling.sh"
1840 "scripts/spell_check/spell_test.sh"
1841 "scripts/verify-indentation.sh"
1842 "tests/code_layout/test_banned_keywords.sh"
1843 "tests/code_layout/test_licenses.sh"
1844 "tests/code_layout/test_shellcheck.sh"
1845 "tests/code_layout/test_sip_include.sh"
1846 "tests/code_layout/test_sipfiles_uptodate.sh"
1847 "tests/code_layout/test_sipify.sh")
1848 (("\\$\\(git rev-parse --show-toplevel\\)")
1850 (substitute* "tests/code_layout/test_sip_include.sh"
1851 (("^REV=.*") "REV=currentrev\n"))
1854 (lambda* (#:key inputs #:allow-other-keys)
1855 (setenv "HOME" "/tmp")
1856 (system (string-append (assoc-ref inputs "xorg-server")
1858 (setenv "DISPLAY" ":1")
1859 (setenv "TRAVIS" "true")
1860 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
1863 '(;; Disable tests that require network access
1864 "qgis_filedownloader"
1865 ;; TODO: Find why the following tests fail
1866 "ProcessingQgisAlgorithmsTestPt1"
1867 "ProcessingQgisAlgorithmsTestPt3"
1868 "ProcessingQgisAlgorithmsTestPt4"
1869 "ProcessingGdalAlgorithmsRasterTest"
1870 "ProcessingGdalAlgorithmsVectorTest"
1871 "ProcessingGrass7AlgorithmsImageryTest"
1872 "ProcessingGrass7AlgorithmsRasterTest"
1873 "ProcessingGrass7AlgorithmsVectorTest"
1874 "ProcessingOtbAlgorithmsTest"
1875 "qgis_authmanagertest"
1876 "qgis_compositionconvertertest"
1877 "qgis_coordinatereferencesystemtest"
1879 "qgis_layouthtmltest"
1880 "qgis_layoutmaptest"
1881 "qgis_painteffecttest"
1882 "qgis_pallabelingtest"
1883 "qgis_svgmarkertest"
1884 "qgis_taskmanagertest"
1886 "qgis_processingtest"
1887 "qgis_wcsprovidertest"
1888 "qgis_arcgisrestutilstest"
1889 "qgis_grassprovidertest7"
1890 "qgis_gpsinformationwidget"
1892 "PyQgsPythonProvider"
1894 "PyQgsAuthenticationSystem"
1899 "PyQgsLayoutExporter"
1902 "PyQgsOGRProviderGpkg"
1903 "PyQgsPalLabelingLayout"
1904 "PyQgsImportIntoPostGIS"
1905 "PyQgsProviderConnectionPostgres"
1906 "PyQgsProviderConnectionGpkg"
1907 "PyQgsShapefileProvider"
1911 "PyQgsSpatialiteProvider"
1912 "PyQgsVectorFileWriter"
1914 "PyQgsVectorLayerUtils"
1915 "PyQgsVirtualLayerProvider"
1917 "PyQgsOapifProvider"
1918 "PyQgsLayerDependencies"
1919 "PyQgsDBManagerGpkg"
1920 "PyQgsDBManagerSpatialite"
1922 "PyQgsAuxiliaryStorage"
1923 "PyQgsSelectiveMasking"
1925 "qgis_geometrycheckstest"
1929 "qgis_sip_uptodate")
1931 (add-after 'install 'wrap-python
1932 (assoc-ref python:%standard-phases 'wrap))
1933 (add-after 'wrap-python 'wrap-qt
1934 (lambda* (#:key outputs #:allow-other-keys)
1935 (wrap-qt-program (assoc-ref outputs "out") "qgis")
1937 (add-after 'wrap-qt 'wrap-gis
1938 (lambda* (#:key inputs outputs #:allow-other-keys)
1939 (let* ((out (assoc-ref outputs "out"))
1940 (saga (string-append (assoc-ref inputs "saga") "/bin"))
1941 (grass-version ,(package-version grass))
1942 (grass-majorminor (string-join
1944 (string-split grass-version #\.) 2)
1946 (grass (string-append (assoc-ref inputs "grass")
1947 "/grass" grass-majorminor)))
1948 (wrap-program (string-append out "/bin/qgis")
1949 `("PATH" ":" prefix (,saga))
1950 `("QGIS_PREFIX_PATH" = (,out))
1951 `("GISBASE" = (,grass))))
1958 ("gpsbabel" ,gpsbabel)
1962 ("libspatialindex" ,libspatialindex)
1963 ("libspatialite" ,libspatialite)
1964 ("libxml2" ,libxml2)
1967 ("postgresql" ,postgresql)
1970 ("python-chardet" ,python-chardet)
1971 ("python-dateutil" ,python-dateutil)
1972 ("python-gdal" ,python-gdal)
1973 ("python-jinja2" ,python-jinja2)
1974 ("python-numpy" ,python-numpy)
1975 ("python-owslib" ,python-owslib)
1976 ("python-psycopg2" ,python-psycopg2)
1977 ("python-pygments" ,python-pygments)
1978 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
1979 ("python-pytz" ,python-pytz)
1980 ("python-pyyaml" ,python-pyyaml)
1981 ("python-requests" ,python-requests)
1982 ("python-sip" ,python-sip)
1983 ("python-six" ,python-six)
1984 ("python-urllib3" ,python-urllib3)
1986 ("qscintilla" ,qscintilla)
1988 ("qtdeclarative" ,qtdeclarative)
1989 ("qtkeychain" ,qtkeychain)
1990 ("qtlocation" ,qtlocation)
1991 ("qtserialport" ,qtserialport)
1993 ("qtwebkit" ,qtwebkit)
1996 ("sqlite" ,sqlite-with-column-metadata)))
2001 ("perl-yaml-tiny" ,perl-yaml-tiny)
2002 ("pkg-config" ,pkg-config)
2003 ("python-mock" ,python-mock)
2004 ("python-nose2" ,python-nose2)
2005 ("qttools" ,qttools)
2006 ("shellcheck" ,shellcheck)
2007 ("xorg-server" ,xorg-server-for-tests)))
2008 (home-page "https://qgis.org")
2009 (synopsis "Geographical information system")
2010 (description "QGIS is an easy to use Geographical Information
2011 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2012 raster and vector data formats, with new support easily added using the plugin
2025 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2026 (license:fsf-free "file://debian/copyright" "Go Squared")
2030 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2032 "file://debian/copyright"
2033 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2043 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2044 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2045 (license:non-copyleft
2046 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2047 "NCL Source Code License")
2050 license:public-domain