gnu: emacs-helm: Update to 3.8.7.
[jackhill/guix/guix.git] / gnu / packages / geo.scm
CommitLineData
03c1662e
LF
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
ad1ff78d 3;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
f6c507e1 4;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
e2492f58 5;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
8d26f48e 6;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
d33afa26 7;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
3d60f426 8;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
08326f3d 9;;; Copyright © 2018, 2019, 2020, 2021 Julien Lepiller <julien@lepiller.eu>
b30caf19 10;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
40b3e9da 11;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
769326cf 12;;; Copyright © 2019, 2021 Wiktor Żelazny <wzelazny@vurv.cz>
7e24e1e5 13;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
9f1713f2 14;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
1192ae94 15;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
87238a0b 16;;; Copyright © 2020, 2021, 2022 Felix Gruber <felgru@posteo.net>
6be69452 17;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
ac8fb4b9 18;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
c9f6fe2c 19;;; Copyright © 2021 Clément Lassieur <clement@lassieur.org>
02c9a069 20;;; Copyright © 2021 Nikolay Korotkiy <sikmir@disroot.org>
8a697e5c 21;;; Copyright © 2022 Roman Scherer <roman.scherer@burningswell.com>
03c1662e
LF
22;;;
23;;; This file is part of GNU Guix.
24;;;
25;;; GNU Guix is free software; you can redistribute it and/or modify it
26;;; under the terms of the GNU General Public License as published by
27;;; the Free Software Foundation; either version 3 of the License, or (at
28;;; your option) any later version.
29;;;
30;;; GNU Guix is distributed in the hope that it will be useful, but
31;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33;;; GNU General Public License for more details.
34;;;
35;;; You should have received a copy of the GNU General Public License
36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38(define-module (gnu packages geo)
6dd0e41d 39 #:use-module (guix build-system ant)
8fa3451c 40 #:use-module (guix build-system cmake)
03c1662e 41 #:use-module (guix build-system glib-or-gtk)
065d0125 42 #:use-module (guix build-system gnu)
be7c64ba 43 #:use-module (guix build-system go)
5339d2bb 44 #:use-module (guix build-system meson)
f25e1e24 45 #:use-module (guix build-system python)
bccbeece 46 #:use-module (guix build-system qt)
f2b005f6 47 #:use-module (guix build-system scons)
3d60f426 48 #:use-module (guix build-system r)
b4815e57 49 #:use-module (guix gexp)
03c1662e 50 #:use-module (guix download)
d56af1ff 51 #:use-module (guix git-download)
f041db86 52 #:use-module (guix svn-download)
065d0125 53 #:use-module ((guix licenses) #:prefix license:)
03c1662e
LF
54 #:use-module (guix packages)
55 #:use-module (guix utils)
f9d32883 56 #:use-module (gnu packages)
9fce5914 57 #:use-module (gnu packages algebra)
0f7b8a7f 58 #:use-module (gnu packages astronomy)
7b1fb40d 59 #:use-module (gnu packages audio)
ed72a133 60 #:use-module (gnu packages autotools)
7b1fb40d 61 #:use-module (gnu packages backup)
9fce5914
GLV
62 #:use-module (gnu packages bash)
63 #:use-module (gnu packages bison)
f2b005f6 64 #:use-module (gnu packages boost)
e13b18b2 65 #:use-module (gnu packages build-tools)
f25e1e24 66 #:use-module (gnu packages check)
1a39141d 67 #:use-module (gnu packages compression)
02c9a069
NK
68 #:use-module (gnu packages cpp)
69 #:use-module (gnu packages cups)
7b1fb40d 70 #:use-module (gnu packages curl)
f2b005f6 71 #:use-module (gnu packages databases)
889e94e3 72 #:use-module (gnu packages datastructures)
7295171e 73 #:use-module (gnu packages docbook)
889e94e3 74 #:use-module (gnu packages documentation)
7b1fb40d 75 #:use-module (gnu packages elf)
9fce5914 76 #:use-module (gnu packages flex)
0f7b8a7f 77 #:use-module (gnu packages fonts)
f2b005f6 78 #:use-module (gnu packages fontutils)
7b1fb40d
GLV
79 #:use-module (gnu packages gettext)
80 #:use-module (gnu packages gl)
03c1662e
LF
81 #:use-module (gnu packages glib)
82 #:use-module (gnu packages gnome)
151f3d41 83 #:use-module (gnu packages gps)
08326f3d 84 #:use-module (gnu packages graphics)
03c1662e 85 #:use-module (gnu packages gtk)
151f3d41 86 #:use-module (gnu packages haskell-apps)
eeac33a3 87 #:use-module (gnu packages haskell-xyz)
1a39141d 88 #:use-module (gnu packages image)
f7ac2fe1 89 #:use-module (gnu packages image-processing)
f2b005f6 90 #:use-module (gnu packages icu4c)
f041db86 91 #:use-module (gnu packages java)
151f3d41 92 #:use-module (gnu packages kde)
2da3c84a
GLV
93 #:use-module (gnu packages libusb)
94 #:use-module (gnu packages linux)
b0e2299a 95 #:use-module (gnu packages lua)
6cde0737 96 #:use-module (gnu packages maths)
08326f3d 97 #:use-module (gnu packages multiprecision)
996e45cb 98 #:use-module (gnu packages pcre)
f7ac2fe1 99 #:use-module (gnu packages pdf)
2b9be1a6 100 #:use-module (gnu packages perl)
7b1fb40d 101 #:use-module (gnu packages photo)
03c1662e 102 #:use-module (gnu packages pkg-config)
dc8621a2 103 #:use-module (gnu packages protobuf)
7b1fb40d 104 #:use-module (gnu packages pulseaudio)
f2b005f6 105 #:use-module (gnu packages python)
3288d6bf 106 #:use-module (gnu packages python-build)
481b0923 107 #:use-module (gnu packages python-check)
1c27038a 108 #:use-module (gnu packages python-crypto)
5ab7fbad 109 #:use-module (gnu packages python-science)
0a71e34e 110 #:use-module (gnu packages python-web)
44d10b1f 111 #:use-module (gnu packages python-xyz)
0f7b8a7f 112 #:use-module (gnu packages qt)
9fce5914 113 #:use-module (gnu packages readline)
f7ac2fe1 114 #:use-module (gnu packages swig)
cd0322a3 115 #:use-module (gnu packages sqlite)
7ba300ee 116 #:use-module (gnu packages textutils)
9fce5914 117 #:use-module (gnu packages time)
d4c8e8b6 118 #:use-module (gnu packages tls)
5b19776e 119 #:use-module (gnu packages web)
03c1662e 120 #:use-module (gnu packages webkit)
a2a53274 121 #:use-module (gnu packages wxwidgets)
151f3d41
GLV
122 #:use-module (gnu packages xml)
123 #:use-module (gnu packages xorg))
03c1662e 124
b4815e57 125(define-public cdo
126 (package
127 (name "cdo")
128 (version "2.0.5")
129 (source (origin
130 (method url-fetch)
131 (uri (string-append
132 "https://code.mpimet.mpg.de/attachments/download/26823/cdo-"
133 version ".tar.gz"))
134 (sha256
135 (base32
136 "1khdbd5cmnn7qm6hcqg4md5wbq14fs6brrns8b3g18diqgqvpvpd"))))
137 (build-system gnu-build-system)
138 (arguments
139 (list #:configure-flags
140 #~(list (string-append "--with-netcdf="
141 #$(this-package-input "netcdf")))))
142 (inputs
143 (list netcdf))
144 (native-inputs
145 (list pkg-config))
146 (home-page "https://code.mpimet.mpg.de/projects/cdo")
147 (synopsis "Climate data operators")
148 (description "@acronym{CDO, Climate Data Operators} is a collection of command-line
149operators to manipulate and analyse climate and NWP model data. Supported
150data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG. There are more
151than 600 operators available.")
152 (license license:bsd-3)))
153
7295171e
RG
154(define-public memphis
155 (package
156 (name "memphis")
157 (version "0.2.3")
158 (source
159 (origin
160 (method git-fetch)
161 (uri
162 (git-reference
8ed4c468 163 (url "https://github.com/jiuka/memphis")
7295171e
RG
164 (commit version)))
165 (file-name (git-file-name name version))
166 (sha256
167 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
168 (build-system glib-or-gtk-build-system)
169 (outputs '("out" "doc"))
170 (arguments
171 `(#:configure-flags
172 (list
173 "--disable-static"
174 "--enable-gtk-doc"
175 "--enable-vala"
176 (string-append "--with-html-dir="
177 (assoc-ref %outputs "doc")
178 "/share/gtk-doc/html"))
179 #:phases
180 (modify-phases %standard-phases
181 (add-after 'unpack 'patch-autogen
182 (lambda _
183 (substitute* "autogen.sh"
184 (("\\./configure \"\\$@\"")
185 ""))
186 #t))
187 (add-after 'patch-autogen 'patch-docbook-xml
188 (lambda* (#:key inputs #:allow-other-keys)
189 (with-directory-excursion "docs/reference"
190 (substitute* "libmemphis-docs.sgml"
191 (("http://www.oasis-open.org/docbook/xml/4.3/")
192 (string-append (assoc-ref inputs "docbook-xml")
193 "/xml/dtd/docbook/"))))
194 #t)))))
195 (native-inputs
196 `(("autoconf" ,autoconf)
197 ("automake" ,automake)
198 ("docbook-xml" ,docbook-xml-4.3)
199 ("gobject-introspection" ,gobject-introspection)
9dea1618 200 ("gtk-doc" ,gtk-doc/stable)
7295171e
RG
201 ("libtool" ,libtool)
202 ("pkg-config" ,pkg-config)
203 ("python" ,python-wrapper)
204 ("seed" ,seed)
205 ("vala" ,vala)))
206 (inputs
8394619b 207 (list expat glib))
7295171e 208 (propagated-inputs
8394619b 209 (list cairo))
7295171e
RG
210 (synopsis "Map-rendering for OpenSteetMap")
211 (description "Memphis is a map-rendering application and a library for
212OpenStreetMap written in C using eXpat, Cairo and GLib.")
213 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
214 (license license:lgpl2.1+)))
215
a7607572
BH
216(define-public geos
217 (package
218 (name "geos")
c493ecfa 219 (version "3.10.2")
a7607572
BH
220 (source (origin
221 (method url-fetch)
222 (uri (string-append "http://download.osgeo.org/geos/geos-"
223 version
224 ".tar.bz2"))
225 (sha256
226 (base32
c493ecfa
FG
227 "05apyh6dvv15fax4xvxa0kr622h4y08w9p3274mlqsrqmjcwbfsh"))))
228 (build-system cmake-build-system)
a7607572
BH
229 (arguments `(#:phases
230 (modify-phases %standard-phases
231 (add-after
232 'unpack 'patch-test-shebangs
233 (lambda _
234 (substitute* '("tests/xmltester/testrunner.sh"
235 "tests/geostest/testrunner.sh")
c493ecfa 236 (("/bin/sh") (which "sh"))))))))
a7607572 237 (inputs
8394619b 238 (list glib))
c493ecfa 239 (home-page "https://libgeos.org/")
a7607572
BH
240 (synopsis "Geometry Engine for Geographic Information Systems")
241 (description
242 "GEOS provides a spatial object model and fundamental geometric
243functions. It is a C++ port of the Java Topology Suite (JTS). As such,
244it aims to contain the complete functionality of JTS in C++. This
245includes all the OpenGIS Simple Features for SQL spatial predicate
246functions and spatial operators, as well as specific JTS enhanced
247topology functions.")
248 (license (list license:lgpl2.1+ ; Main distribution.
249 license:zlib ; tests/xmltester/tinyxml/*
250 license:public-domain)))) ; include/geos/timeval.h
251
03c1662e
LF
252(define-public gnome-maps
253 (package
254 (name "gnome-maps")
6104071e 255 (version "41.2")
03c1662e
LF
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "mirror://gnome/sources/" name "/"
d0b09122 259 (version-major version) "/"
03c1662e
LF
260 name "-" version ".tar.xz"))
261 (sha256
262 (base32
6104071e 263 "037xmkmcmcw87vb1c1s3y225m8757k331cvk1m8cshf6mx61p0l1"))))
5339d2bb 264 (build-system meson-build-system)
03c1662e 265 (arguments
41ec0573 266 `(#:glib-or-gtk? #t
03c1662e
LF
267 #:phases
268 (modify-phases %standard-phases
b0a7c0c3
EF
269 (add-after 'unpack 'skip-gtk-update-icon-cache
270 ;; Don't create 'icon-theme.cache'.
271 (lambda _
272 (substitute* "meson_post_install.py"
d0b09122 273 (("gtk-update-icon-cache") "true"))))
a2d5f9f6
LP
274 (add-after 'unpack 'patch-dbus-service
275 (lambda* (#:key outputs #:allow-other-keys)
276 (substitute* "data/org.gnome.Maps.service.in"
277 (("@pkgdatadir@/org.gnome.Maps")
d0b09122
MO
278 (string-append (assoc-ref outputs "out")
279 "/bin/gnome-maps")))))
67bd376b
KK
280 (add-after 'install 'wrap
281 (lambda* (#:key inputs outputs #:allow-other-keys)
282 (let ((out (assoc-ref outputs "out"))
283 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
5339d2bb
RW
284 (geocode-glib-path (string-append
285 (assoc-ref inputs "geocode-glib")
286 "/lib"))
67bd376b 287 (goa-path (string-append
2cf1e37c 288 (assoc-ref inputs "gnome-online-accounts:lib")
67bd376b 289 "/lib"))
2cf1e37c
KK
290 (gdk-pixbuf-path (string-append
291 (assoc-ref inputs "gdk-pixbuf")
292 "/lib"))
67bd376b
KK
293 (webkitgtk-path (string-append
294 (assoc-ref inputs "webkitgtk")
295 "/lib")))
296 (wrap-program (string-append out "/bin/gnome-maps")
297 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
03c1662e 298
67bd376b 299 ;; There seems to be no way to embed the path of
5339d2bb 300 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
2cf1e37c
KK
301 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
302 ;; libgeocode-glib.so.0
5339d2bb
RW
303 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
304 ,webkitgtk-path
2cf1e37c 305 ,gdk-pixbuf-path
5339d2bb 306 ,geocode-glib-path)))
67bd376b 307 #t))))))
03c1662e 308 (native-inputs
f7d34fcd
MB
309 `(("gettext" ,gettext-minimal)
310 ("gobject-introspection" ,gobject-introspection)
03c1662e
LF
311 ("pkg-config" ,pkg-config)))
312 (inputs
7d7fedf6
MB
313 `(("evolution-data-server" ,evolution-data-server)
314 ("folks" ,folks)
03c1662e
LF
315 ("libchamplain" ,libchamplain)
316 ("libgee" ,libgee)
d0b09122 317 ("libhandy" ,libhandy)
8d26f48e 318 ("libsecret" ,libsecret)
502d4b5d 319 ("libsoup" ,libsoup-minimal-2)
8d26f48e 320 ("libgweather" ,libgweather)
03c1662e 321 ("libxml2" ,libxml2)
feab09f7 322 ("librsvg" ,librsvg)
8d26f48e 323 ("glib-networking" ,glib-networking)
03c1662e
LF
324 ("geoclue" ,geoclue)
325 ("geocode-glib" ,geocode-glib)
326 ("gfbgraph" ,gfbgraph)
327 ("gjs" ,gjs)
328 ("glib" ,glib)
2cf1e37c 329 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
8d26f48e 330 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
be7e82f0 331 ("gtk+" ,gtk+)
03c1662e 332 ("rest" ,rest)
502d4b5d 333 ("webkitgtk" ,webkitgtk-with-libsoup2)))
03c1662e
LF
334 (synopsis "Graphical map viewer and wayfinding program")
335 (description "GNOME Maps is a graphical map viewer. It uses map data from
336the OpenStreetMap project. It can provide directions for walking, bicycling,
337and driving.")
338 (home-page "https://wiki.gnome.org/Apps/Maps")
065d0125
BH
339 (license license:gpl2+)))
340
1a39141d
BH
341(define-public libgeotiff
342 (package
343 (name "libgeotiff")
17a8a097 344 (version "1.7.1")
1a39141d
BH
345 (source
346 (origin
347 (method url-fetch)
348 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
349 version ".tar.gz"))
350 (sha256
17a8a097 351 (base32 "1mjmgv48x51ppax5dnb6lq7z600czxll53bx6jbzqwd4m93i7aq5"))
1a39141d
BH
352 (modules '((guix build utils)))
353 (snippet
354 '(begin
355 ;; Remove .csv files, distributed from EPSG under a restricted
356 ;; license. See LICENSE for full license text.
357 (for-each delete-file (find-files "." "\\.csv$"))
6cbee49d 358 #t))))
1a39141d
BH
359 (build-system gnu-build-system)
360 (inputs
8394619b 361 (list libjpeg-turbo libtiff zlib))
517c5538 362 (propagated-inputs
8394619b
LC
363 (list ;; libgeotiff headers include proj headers, so ensure those are available.
364 proj))
1a39141d
BH
365 (arguments
366 `(#:configure-flags
1ecadbfe
MB
367 (list "--disable-static"
368 "--with-zlib" "--with-jpeg"
1a39141d
BH
369 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
370 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
371 (description "libgeotiff is a library on top of libtiff for reading and
372writing GeoTIFF information tags.")
373 (home-page "https://trac.osgeo.org/geotiff/")
374 ;; This is a mixture of various contributions under different licenses.
375 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
376 ;; states, as its commercial redistribution is restricted. Hence, we have
377 ;; removed it from the package.
378 (license (list license:public-domain
379 license:x11
380 license:bsd-3
381 (license:non-copyleft "file://LICENSE"
382 "See LICENSE in the distribution.")))))
383
3eb14c28
FG
384(define-public librasterlite2
385 (package
386 (name "librasterlite2")
387 (version "1.1.0-beta1")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (string-append
392 "https://www.gaia-gis.it/gaia-sins/librasterlite2-sources/"
393 "librasterlite2-" version ".tar.gz"))
394 (sha256
395 (base32
396 "1x24gqp4hsq97c31ncwxblab0x0863q8v1z42jil7lvsq3glqa7p"))))
397 (build-system gnu-build-system)
398 (native-inputs
8394619b 399 (list pkg-config))
3eb14c28 400 (inputs
8394619b
LC
401 (list cairo
402 curl
403 freetype
404 freexl
405 giflib
406 libgeotiff
407 libjpeg-turbo
408 libpng
409 librttopo
410 libspatialite
411 libtiff
412 libwebp
413 libxml2
414 lz4
415 minizip
416 openjpeg
417 proj
418 sqlite
419 `(,zstd "lib")))
3eb14c28
FG
420 (synopsis "Library to work with huge raster coverages using a SpatiaLite")
421 (description
422 "librasterlite2 is a library that stores and retrieves huge raster
423coverages using a SpatiaLite DBMS.")
424 (home-page "https://www.gaia-gis.it/fossil/librasterlite2/index")
425 ;; For the genuine librasterlite-sources holds:
426 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
427 ;; Files under src/control_points are from GRASS
428 ;; and are licensed under GPL2+ only.
429 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
430 ;; The tools supporting the library (both rl2tool and wmslite) are
431 ;; licensed under the GPL v3 (or any subsequent version) terms.
432 ;; The test/*.svg files are placed in the public domain, except for
433 ;; test/Car_Yellow.svg which is licensed under the Free Art License 1.3.
434 (license (list license:gpl2+
435 license:gpl3+
436 license:lal1.3
437 license:lgpl2.1+
438 license:mpl1.1
439 license:public-domain))))
440
a051bf40
FG
441(define-public librttopo
442 (package
443 (name "librttopo")
444 (version "1.1.0")
445 (source
446 (origin
447 (method git-fetch)
448 (uri (git-reference
449 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
450 (commit (string-append "librttopo-" version))))
451 (file-name (git-file-name name version))
452 (sha256
453 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
454 (build-system gnu-build-system)
455 (arguments
456 `(#:phases
457 (modify-phases %standard-phases
458 (add-after 'unpack 'patch-autogen
459 (lambda _
460 (let ((autoconf (which "autoconf"))
461 (autoheader (which "autoheader"))
462 (aclocal (which "aclocal"))
463 (automake (which "automake"))
464 (libtoolize (which "libtoolize")))
465 (substitute* "autogen.sh"
466 (("`which autoconf 2>/dev/null`") autoconf)
467 (("`which autoheader 2>/dev/null`") autoheader)
468 (("ACLOCAL=.*$")
469 (string-append "ACLOCAL=" aclocal "\n"))
470 (("AUTOMAKE=.*$")
471 (string-append "AUTOMAKE=" automake "\n"))
472 (("LIBTOOLIZE=.*$")
473 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
474 #t)))))
475 (native-inputs
8394619b 476 (list autoconf automake libtool pkg-config))
a051bf40 477 (inputs
8394619b 478 (list geos))
a051bf40
FG
479 (synopsis "Library to handle SQL/MM topologies")
480 (description
481 "The RT Topology Library exposes an API to create and manage standard
482(ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
483 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
484 (license license:gpl2+)))
485
f6c507e1
BH
486(define-public libspatialite
487 (package
488 (name "libspatialite")
f33e773c 489 (version "5.0.1")
f6c507e1
BH
490 (source
491 (origin
492 (method url-fetch)
493 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
494 version ".tar.gz"))
495 (sha256
496 (base32
f33e773c 497 "164y82rw2lrp5glfc0rkn7n6xvx5dvlgmh7bb7815067251wkjzf"))))
f6c507e1
BH
498 (build-system gnu-build-system)
499 (native-inputs
8394619b 500 (list pkg-config))
f6c507e1 501 (inputs
8394619b
LC
502 (list freexl
503 geos
504 librttopo
505 libxml2
506 minizip
507 proj
508 sqlite))
f6c507e1 509 (arguments
b202c702
FG
510 `(#:configure-flags
511 '("--enable-rttopo=yes")
512 #:phases
f6c507e1 513 (modify-phases %standard-phases
cd5b2cf5 514 ;; 1 test is failing, ignore it:
f6c507e1
BH
515 (add-after 'unpack 'ignore-broken-tests
516 (lambda _
517 (substitute* '("test/Makefile.in")
cd5b2cf5
GLV
518 (("check_wms\\$\\(EXEEXT\\) check_drop_rename\\$\\(EXEEXT\\) ")
519 "check_wms$(EXEEXT) ")))))))
f6c507e1
BH
520 (synopsis "Extend SQLite to support Spatial SQL capabilities")
521 (description
522 "SpatiaLite is a library intended to extend the SQLite core to support
523fully fledged Spatial SQL capabilities.")
524 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
525 ;; For the genuine libspatialite-sources holds:
526 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
527 ;; Files under src/control_points are from GRASS
528 ;; and are licensed under GPL2+ only.
529 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
530 (license (list license:gpl2+
531 license:lgpl2.1+
532 license:mpl1.1
533 license:public-domain))))
534
3500d7ad
AI
535(define-public proj
536 (package
537 (name "proj")
2a312105 538 (version "7.2.1")
3500d7ad
AI
539 (source
540 (origin
541 (method url-fetch)
542 (uri (string-append "http://download.osgeo.org/proj/proj-"
543 version ".tar.gz"))
544 (sha256
545 (base32
2a312105
FG
546 "050apzdn0isxpsblys1shrl9ccli5vd32kgswlgx1imrbwpg915k"))))
547 (build-system cmake-build-system)
548 (arguments
d42718f8
NK
549 `(#:configure-flags '("-DUSE_EXTERNAL_GTEST=ON")
550 #:phases
551 (modify-phases %standard-phases
552 (add-after 'unpack 'fix-version
553 (lambda _
554 (substitute* "CMakeLists.txt"
555 (("MAJOR 7 MINOR 2 PATCH 0") "MAJOR 7 MINOR 2 PATCH 1")))))))
3500d7ad 556 (inputs
8394619b 557 (list curl libjpeg-turbo libtiff sqlite))
3500d7ad 558 (native-inputs
8394619b 559 (list googletest pkg-config))
3500d7ad
AI
560 (home-page "https://proj.org/")
561 (synopsis "Coordinate transformation software")
562 (description
563 "Proj is a generic coordinate transformation software that transforms
2a312105
FG
564geospatial coordinates from one @acronym{CRS, coordinate reference system}
565to another. This includes cartographic projections as well as geodetic
566transformations. Proj includes command line applications for easy
567conversion of coordinates from text files or directly from user input.
568In addition, Proj also exposes an application programming interface that
569lets developers use the functionality of Proj in their own software.")
3500d7ad
AI
570 (license (list license:expat
571 ;; src/projections/patterson.cpp
572 license:asl2.0
573 ;; src/geodesic.*, src/tests/geodtest.cpp
574 license:x11))))
575
065d0125
BH
576(define-public proj.4
577 (package
578 (name "proj.4")
579 (version "4.9.3")
580 (source (origin
581 (method url-fetch)
582 (uri (string-append "http://download.osgeo.org/proj/proj-"
583 version ".tar.gz"))
584 (sha256
585 (base32
586 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
587 (build-system gnu-build-system)
588 (arguments
589 `(#:phases
590 (modify-phases %standard-phases
591 (add-after 'unpack 'patch-test-paths
592 (lambda _
593 (substitute* '("nad/test27"
594 "nad/test83"
595 "nad/testvarious"
596 "nad/testdatumfile"
597 "nad/testflaky"
598 "nad/testIGNF")
599 (("/bin/rm") (which "rm")))
600 #t))
601 ;; Precision problems on i686 and other platforms. See:
602 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
603 ;; Disable failing test.
604 (add-after 'patch-test-paths 'ignore-failing-tests
605 (lambda _
606 (substitute* '("nad/Makefile.in")
607 (("\tPROJ_LIB.*" all) (string-append "#" all)))
608 #t)))))
609 (inputs
8394619b 610 (list glib))
3fbb7bec 611 (home-page "https://proj.org/")
065d0125
BH
612 (synopsis "Cartographic Projections Library")
613 (description
614 "Proj.4 is a library for converting coordinates between cartographic
615projections.")
616 (license (list license:expat
617 ;; src/PJ_patterson.c
618 license:asl2.0
619 ;; src/geodesic.c/h
620 license:x11
621 ;; Embedded EPSG database.
622 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
623 ;; cmake/*
624 license:boost1.0))))
f2b005f6 625
1c27038a
FG
626(define-public python-pyproj
627 (package
628 (name "python-pyproj")
629 (version "3.2.1")
630 (source
631 (origin
632 (method url-fetch)
633 (uri (pypi-uri "pyproj" version))
634 (sha256
635 (base32
636 "0xrqpy708qlyd7nqjra0dl7nvkqzaj9w0v7wq4j5pxazha9n14sa"))))
637 (build-system python-build-system)
638 (arguments
639 `(#:phases
640 (modify-phases %standard-phases
641 (add-after 'unpack 'set-proj-path
642 (lambda* (#:key inputs #:allow-other-keys)
643 (let ((proj (assoc-ref inputs "proj")))
644 (setenv "PROJ_DIR" proj)
645 (substitute* "pyproj/datadir.py"
646 (("(internal_datadir = ).*$" all var)
647 (string-append var "Path(\"" proj "/share/proj\")\n")))))))))
648 (inputs
8394619b 649 (list proj))
1c27038a 650 (propagated-inputs
8394619b 651 (list python-certifi))
1c27038a 652 (native-inputs
8394619b
LC
653 (list python-cython python-numpy python-pandas python-pytest
654 python-xarray))
1c27038a
FG
655 (home-page "https://github.com/pyproj4/pyproj")
656 (synopsis
657 "Python interface to PROJ")
658 (description
659 "This package provides a Python interface to PROJ, a cartographic
660projections and coordinate transformations library.")
661 (license license:expat)))
662
e159047e
FG
663(define-public python-fiona
664 (package
665 (name "python-fiona")
666 (version "1.8.20")
667 (source
668 (origin
669 (method url-fetch)
670 (uri (pypi-uri "Fiona" version))
671 (sha256
672 (base32
673 "0fql7i7dg1xpbadmk8d26dwp91v7faixxc4wq14zg0kvhp9041d7"))))
674 (build-system python-build-system)
675 (arguments
676 `(#:phases
677 (modify-phases %standard-phases
678 (add-before 'check 'remove-local-fiona
679 (lambda _
680 ; This would otherwise interfere with finding the installed
681 ; fiona when running tests.
682 (delete-file-recursively "fiona")))
683 (replace 'check
684 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
685 (add-installed-pythonpath inputs outputs)
b30caf19 686 (setenv "GDAL_ENABLE_DEPRECATED_DRIVER_GTM" "YES")
e159047e 687 (when tests?
b30caf19
GLV
688 (invoke "pytest"
689 "-m" "not network and not wheel"
690 ;; FIXME: Find why the
691 ;; test_no_append_driver_cannot_append[PCIDSK]
692 ;; test is failing.
693 "-k" "not test_no_append_driver_cannot_append")))))))
e159047e 694 (inputs
8394619b 695 (list gdal))
e159047e 696 (propagated-inputs
8394619b
LC
697 (list python-attrs
698 python-certifi
699 python-click
700 python-click-plugins
701 python-cligj
702 python-munch
703 python-setuptools
704 python-six
705 python-pytz))
e159047e 706 (native-inputs
8394619b
LC
707 (list gdal ; for gdal-config
708 python-boto3
709 python-cython
710 python-pytest
711 python-pytest-cov))
e159047e
FG
712 (home-page "https://github.com/Toblerity/Fiona")
713 (synopsis
714 "Fiona reads and writes spatial data files")
715 (description
716 "Fiona is GDAL’s neat and nimble vector API for Python programmers.
717Fiona is designed to be simple and dependable. It focuses on reading
718and writing data in standard Python IO style and relies upon familiar
719Python types and protocols such as files, dictionaries, mappings, and
720iterators instead of classes specific to OGR. Fiona can read and write
721real-world data using multi-layered GIS formats and zipped virtual file
722systems and integrates readily with other Python GIS packages such as
723pyproj, Rtree, and Shapely.")
724 (license license:bsd-3)))
725
371aa577
FG
726(define-public python-geopandas
727 (package
728 (name "python-geopandas")
f777c156 729 (version "0.10.2")
371aa577
FG
730 (source
731 (origin
732 (method url-fetch)
733 (uri (pypi-uri "geopandas" version))
734 (sha256
735 (base32
f777c156 736 "1nvim2i47ap1zdwy6kxydskf1cir5g4ij8124wvmrqij0zklggzg"))))
371aa577
FG
737 (build-system python-build-system)
738 (arguments
739 '(#:phases
740 (modify-phases %standard-phases
741 (replace 'check
742 (lambda* (#:key tests? #:allow-other-keys)
743 (when tests?
744 (invoke "pytest"
09d0d0f6
FG
745 ; Disable tests that fail due to incompatibilities
746 ; with our pandas version.
747 "-k"
748 (string-append
749 "not test_getitem_invalid"
750 " and not test_value_counts"
751 " and not test_setitem_invalid"
752 " and not test_insert_invalid")
371aa577
FG
753 ; Disable tests that require internet access.
754 "-m" "not web")))))))
755 (propagated-inputs
8394619b 756 (list python-fiona python-pandas python-pyproj python-shapely))
371aa577 757 (native-inputs
8394619b 758 (list python-pytest))
371aa577
FG
759 (home-page "http://geopandas.org")
760 (synopsis "Geographic pandas extensions")
761 (description "The goal of GeoPandas is to make working with
762geospatial data in Python easier. It combines the capabilities of
763Pandas and Shapely, providing geospatial operations in Pandas and a
764high-level interface to multiple geometries to Shapely. GeoPandas
765enables you to easily do operations in Python that would otherwise
766require a spatial database such as PostGIS.")
767 (license license:bsd-3)))
768
e5c5ba74
FG
769(define-public python-osmnx
770 (package
771 (name "python-osmnx")
772 (version "1.1.2")
773 (source
774 (origin
775 ; Fetch from github as the pypi package is missing the tests dir.
776 (method git-fetch)
777 (uri (git-reference
778 (url "https://github.com/gboeing/osmnx")
779 (commit (string-append "v" version))))
780 (file-name (git-file-name name version))
781 (sha256
782 (base32 "1n8qjn184p5a2s3j6x6iyc1i7p3l3xnbqqxm6ajwgwv6j5fw1d5a"))))
783 (build-system python-build-system)
784 (arguments
785 '(#:phases
786 (modify-phases %standard-phases
787 (replace 'check
788 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
789 (when tests?
790 (add-installed-pythonpath inputs outputs)
791 ; TODO: Disable network tests
792 (invoke "pytest" "tests"
793 "-k"
794 (string-append
795 ;; The following tests require network access.
796 "not test_geocode_to_gdf"
797 " and not test_stats"
798 " and not test_osm_xml"
799 " and not test_elevation"
800 " and not test_routing"
801 " and not test_plots"
802 " and not test_find_nearest"
803 " and not test_api_endpoints"
804 " and not test_graph_save_load"
805 " and not test_graph_from_functions"
806 " and not test_geometries"))))))))
807 (propagated-inputs
808 (list python-folium
809 python-geopandas
810 python-matplotlib
811 python-networkx
812 python-numpy
813 python-pandas
814 python-pyproj
815 python-requests
816 python-rtree
817 python-shapely))
818 (native-inputs
819 (list python-numpy python-pytest))
820 (home-page "https://github.com/gboeing/osmnx")
821 (synopsis
822 "Retrieve, model, analyze, and visualize OpenStreetMap street networks")
823 (description
824 "OSMnx is a Python library that lets you download geospatial data
825from OpenStreetMap and model, project, visualize, and analyze real-world
826street networks and any other geospatial geometries. You can download
827and model walkable, drivable, or bikeable urban networks with a single
828line of Python code then easily analyze and visualize them. You can
829just as easily download and work with other infrastructure types,
830amenities/points of interest, building footprints, elevation data,
831street bearings/orientations, and speed/travel time.")
832 (license license:expat)))
833
f2b005f6
AI
834(define-public mapnik
835 (package
836 (name "mapnik")
2e6be591 837 (version "3.1.0")
f2b005f6
AI
838 (source
839 (origin
840 (method url-fetch)
841 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
842 version "/mapnik-v" version ".tar.bz2"))
843 (sha256
844 (base32
2e6be591 845 "0qb2irykja5qhr9apz9r230pcxap9v3j85fi98mj2xd9sa163ms3"))))
f2b005f6
AI
846 (build-system scons-build-system)
847 (inputs
8394619b
LC
848 (list boost
849 cairo
850 freetype
851 harfbuzz
852 icu4c
853 libjpeg-turbo
854 libpng
855 libtiff
856 libwebp
857 libxml2
858 proj.4
859 sqlite
860 zlib))
f2b005f6 861 (native-inputs
2e6be591 862 (list pkg-config postgresql))
f2b005f6 863 (arguments
2e6be591 864 `(#:scons-flags
f2b005f6
AI
865 (list "CC=gcc"
866 (string-append "PREFIX=" %output)
867 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
711ebe77 868 (home-page "https://mapnik.org/")
f2b005f6
AI
869 (synopsis "Toolkit for developing mapping applications")
870 (description "Mapnik is a toolkit for developing mapping applications. It
871is basically a collection of geographic objects like maps, layers,
872datasources, features, and geometries. At its core is a C++ shared library
873providing algorithms and patterns for spatial data access and visualization.
874The library does not rely on any specific windowing system and can be deployed
875to any server environment. It is intended to play fair in a multi-threaded
876environment and is aimed primarily, but not exclusively, at web-based
877development.")
878 (license (list license:lgpl2.1+
879 ;; demo/viewer, demo/python/rundemo.py
880 license:gpl2+
881 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
882 license:boost1.0
883 ;; deps/mapnik/sparsehash
884 license:bsd-3
885 ;; deps/agg
886 (license:non-copyleft "file://deps/agg/copying")))))
887
a2a53274
BH
888(define-public spatialite-gui
889 (package
890 (name "spatialite-gui")
9bd2478e 891 (version "2.1.0-beta1")
a2a53274
BH
892 (source
893 (origin
894 (method url-fetch)
9bd2478e
FG
895 (uri (string-append
896 "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/"
897 "spatialite_gui-" version ".tar.gz"))
a2a53274 898 (sha256
9bd2478e 899 (base32 "0cyv4cycl073p9lnnnglcb72qn71g8h9g5zn4gzw7swcy5nxjj5s"))))
a2a53274
BH
900 (build-system gnu-build-system)
901 (native-inputs
8394619b 902 (list pkg-config))
a2a53274 903 (inputs
8394619b
LC
904 (list curl
905 freexl
906 geos
907 giflib
908 libjpeg-turbo
909 librasterlite2
910 librttopo
911 libspatialite
912 libwebp
913 libxlsxwriter
914 libxml2
915 lz4
916 minizip
917 openjpeg
918 postgresql
919 proj
920 sqlite
921 virtualpg
922 wxwidgets
923 `(,zstd "lib")))
f7f67495
GLV
924 (arguments
925 `(#:phases (modify-phases %standard-phases
926 (add-after 'unpack 'fix-gui
927 (lambda _
928 ;; Fix for the GUI not showing up.
929 (substitute* "Main.cpp"
930 (("Hide\\(\\);") ""))
931 #t)))))
a2a53274
BH
932 (synopsis "Graphical user interface for SpatiaLite")
933 (description "Spatialite-gui provides a visual interface for viewing and
934 maintaining a spatialite database. You can easily see the structure of the
935 tables and data contents using point and click functions, many of which
936 construct common SQL queries, or craft your own SQL queries.")
937 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
938 (license license:gpl3+)))
3d60f426 939
996e45cb
JL
940(define-public gdal
941 (package
942 (name "gdal")
d4c8e8b6 943 (version "3.5.0")
996e45cb
JL
944 (source (origin
945 (method url-fetch)
946 (uri (string-append
947 "http://download.osgeo.org/gdal/" version "/gdal-"
948 version ".tar.gz"))
949 (sha256
950 (base32
d4c8e8b6 951 "0h7dgjx8nk3dd17wwqm2yjnaqciyrd2mz9gcjswpcnmap09wbzrs"))
996e45cb
JL
952 (modules '((guix build utils)))
953 (snippet
954 `(begin
955 ;; TODO: frmts contains a lot more bundled code.
956 (for-each delete-file-recursively
957 ;; bundled code
958 '("frmts/png/libpng"
959 "frmts/gif/giflib"
960 "frmts/jpeg/libjpeg"
961 "frmts/jpeg/libjpeg12"
962 "frmts/gtiff/libtiff"
963 "frmts/gtiff/libgeotiff"
964 "frmts/zlib"
965 "ogr/ogrsf_frmts/geojson/libjson"))))))
6f909b37 966 (build-system cmake-build-system)
996e45cb
JL
967 (arguments
968 `(#:tests? #f
969 #:configure-flags
6f909b37
FG
970 (list "-DGDAL_USE_INTERNAL_LIBS=WHEN_NO_EXTERNAL"
971 "-DGDAL_USE_JPEG12_INTERNAL=OFF")))
996e45cb 972 (inputs
d4c8e8b6
RS
973 (list curl
974 expat
8394619b
LC
975 freexl
976 geos
977 giflib
978 json-c
979 libgeotiff
980 libjpeg-turbo
981 libpng
982 libtiff
983 libwebp
984 netcdf
d4c8e8b6 985 openssl
6f909b37 986 pcre2
8394619b
LC
987 postgresql ; libpq
988 proj
6f909b37 989 qhull
8394619b
LC
990 sqlite
991 zlib))
1ee58405 992 (native-inputs
8394619b 993 (list pkg-config))
e7453b3c 994 (home-page "https://gdal.org/")
996e45cb
JL
995 (synopsis "Raster and vector geospatial data format library")
996 (description "GDAL is a translator library for raster and vector geospatial
997data formats. As a library, it presents a single raster abstract data model
998and single vector abstract data model to the calling application for all
999supported formats. It also comes with a variety of useful command line
1000utilities for data translation and processing.")
1001 (license (list
1002 ;; general license
1003 license:expat
1004 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
1005 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
1006 ;; frmts/mrf/
1007 license:bsd-3
1008 ;; frmts/hdf4/hdf-eos/*
1009 ;; similar to the expat license, but without guarantee exclusion
1010 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
1011 ;; frmts/grib/degrib/
1012 license:public-domain ; with guarantee exclusion
1013 ;; port/cpl_minizip*
1014 ;; Some bsd-inspired license
1015 (license:non-copyleft "file://port/LICENCE_minizip")
1016 ;; alg/internal_libqhull
1017 ;; Some 5-clause license
1018 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
1019 ;; frmts/mrf/libLERC
1020 license:asl2.0))))
2b9be1a6 1021
a18a27be
SB
1022(define-public python-gdal
1023 (package (inherit gdal)
1024 (name "python-gdal")
1025 (build-system python-build-system)
1026 (arguments
1027 '(#:tests? #f ; no tests
1028 #:phases
1029 (modify-phases %standard-phases
1030 (add-before 'build 'chdir
1031 (lambda _
1032 (chdir "swig/python")
1033 #t)))))
1034 (native-inputs '())
1035 (propagated-inputs
8394619b 1036 (list python-numpy))
a18a27be 1037 (inputs
8394619b 1038 (list gdal))
a18a27be
SB
1039 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
1040
ac8fb4b9
VM
1041(define-public python-pyshp
1042 (package
1043 (name "python-pyshp")
1044 (version "2.1.3")
1045 (source
1046 (origin
1047 (method git-fetch)
1048 (uri (git-reference
1049 (url "https://github.com/GeospatialPython/pyshp")
1050 (commit version)))
1051 (file-name (git-file-name name version))
1052 (sha256
1053 (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
1054 (build-system python-build-system)
1055 (arguments
1056 `(#:phases
1057 (modify-phases %standard-phases
1058 (replace 'check
1059 (lambda* (#:key tests? #:allow-other-keys)
1060 (when tests?
1061 ;; This is the only test file.
1062 (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
1063 (native-inputs
8394619b 1064 (list python-pytest python-pytest-runner))
ac8fb4b9
VM
1065 (home-page "https://github.com/GeospatialPython/pyshp")
1066 (synopsis "Read/write support for ESRI Shapefile format")
1067 (description
1068 "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
1069 (license license:expat)))
1070
5ab7fbad
VM
1071(define-public python-cartopy
1072 (package
1073 (name "python-cartopy")
1074 ;; This is a post-release fix that adds build_ext to setup.py.
1075 (version "0.19.0.post1")
1076 (source
1077 (origin
1078 (method url-fetch)
1079 (uri (pypi-uri "Cartopy" version))
1080 (sha256
1081 (base32 "0xnm8z3as3hriivdfd26s6vn5b63gb46x6vxw6gh1mwfm5rlg2sb"))))
1082 (build-system python-build-system)
1083 (arguments
1084 `(#:phases
1085 (modify-phases %standard-phases
1086 (replace 'check
1087 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1088 (when tests?
1089 (add-installed-pythonpath inputs outputs)
1090 (invoke "python" "-m" "pytest" "--pyargs" "cartopy"
1091 ;; These tests require online data.
1092 "-m" "not natural_earth and not network"
1093 ;; This one too but it's not marked as such.
1094 "-k" "not test_gridliner_labels_bbox_style")))))))
1095 (propagated-inputs
8394619b
LC
1096 (list python-matplotlib
1097 python-numpy
1098 python-pykdtree
1099 python-pyshp
1100 python-scipy
1101 python-shapely))
5ab7fbad 1102 (inputs
8394619b 1103 (list geos proj))
5ab7fbad 1104 (native-inputs
8394619b 1105 (list python-cython python-flufl-lock python-pytest))
5ab7fbad
VM
1106 (home-page "https://scitools.org.uk/cartopy/docs/latest/")
1107 (synopsis "Cartographic library for visualisation")
1108 (description
1109 "Cartopy is a Python package designed to make drawing maps for data
1110analysis and visualisation easy.
1111
1112It features:
1113
1114@itemize
1115@item object oriented projection definitions
1116@item point, line, polygon and image transformations between projections
1117@item integration to expose advanced mapping in Matplotlib with a simple and
1118intuitive interface
1119@item powerful vector data handling by integrating shapefile reading with
1120Shapely capabilities
1121@end itemize")
1122 (license license:lgpl3+)))
1123
2b9be1a6
JL
1124(define-public postgis
1125 (package
1126 (name "postgis")
87238a0b 1127 (version "3.2.1")
2b9be1a6
JL
1128 (source (origin
1129 (method url-fetch)
1130 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
1131 version ".tar.gz"))
1132 (sha256
1133 (base32
87238a0b 1134 "0gl9d6xy2an82ldb9sixz5blyngjryq8m3509fr38ffawvfniazv"))))
2b9be1a6
JL
1135 (build-system gnu-build-system)
1136 (arguments
1137 `(#:tests? #f
1138 #:make-flags
1139 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
1140 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
1141 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
1142 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
1143 #:phases
1144 (modify-phases %standard-phases
1145 (add-before 'build 'fix-install-path
1146 (lambda* (#:key outputs #:allow-other-keys)
1147 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
1148 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
1149 (string-append (assoc-ref outputs "out") "/bin"))))))))
1150 (inputs
2495582e
FG
1151 (list gdal
1152 geos
1153 giflib
1154 json-c
1155 libjpeg-turbo
1156 libxml2
f853f075 1157 openssl
2495582e
FG
1158 pcre
1159 postgresql
1160 protobuf-c
1161 proj))
2b9be1a6 1162 (native-inputs
8394619b 1163 (list perl pkg-config))
2b9be1a6
JL
1164 (home-page "https://postgis.net")
1165 (synopsis "Spatial database extender for PostgreSQL")
1166 (description "PostGIS is a spatial database extender for PostgreSQL
1167object-relational database. It adds support for geographic objects allowing
8e3f06c9
JL
1168location queries to be run in SQL. This package provides a PostgreSQL
1169extension.")
2b9be1a6
JL
1170 (license (list
1171 ;; General license
1172 license:gpl2+
1173 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
1174 license:expat
1175 ;; loader/getopt.*
1176 license:public-domain
1177 ;; doc/xsl
1178 license:bsd-3 ; files only say "BSD"
1179 ;; doc
1180 license:cc-by-sa3.0))))
be7c64ba
JL
1181
1182(define-public tegola
1183 (package
1184 (name "tegola")
1185 (version "0.7.0")
1186 (source (origin
1187 (method url-fetch)
1188 (uri (string-append
1189 "https://github.com/go-spatial/tegola/archive/v"
1190 version ".tar.gz"))
1191 (file-name (string-append name "-" version ".tar.gz"))
1192 (sha256
1193 (base32
1194 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
1195 (build-system go-build-system)
1196 (arguments
1197 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
d9ef50b3 1198 #:unpack-path "github.com/go-spatial/tegola"
be7c64ba
JL
1199 #:phases
1200 (modify-phases %standard-phases
1201 (add-before 'build 'set-version
1202 (lambda _
d9ef50b3 1203 (with-directory-excursion "src/github.com/go-spatial/tegola"
be7c64ba
JL
1204 (substitute* '("cmd/tegola/cmd/root.go"
1205 "cmd/tegola_lambda/main.go")
1206 (("version not set") ,version)))
be7c64ba 1207 #t)))))
0d49a4bb 1208 (home-page "https://tegola.io")
be7c64ba
JL
1209 (synopsis "Vector tile server for maps")
1210 (description "Tegola is a free vector tile server written in Go. Tegola
1211takes geospatial data and slices it into vector tiles that can be efficiently
1212delivered to any client.")
1213 (license (list
1214 license:expat
1215 ;; Some packages in vendor have other licenses
1216 license:asl2.0
1217 license:bsd-2
1218 license:bsd-3
1219 license:wtfpl2))))
3bd7611e
JL
1220
1221(define-public imposm3
1222 (package
1223 (name "imposm3")
c3684310 1224 (version "0.11.1")
3bd7611e
JL
1225 (source
1226 (origin
1227 (method url-fetch)
1228 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
1229 version ".tar.gz"))
1230 (file-name (string-append name "-" version ".tar.gz"))
1231 (sha256
1232 (base32
c3684310 1233 "1w7b221z5k9254zn01imycxkyw62xigqizhwvrgxqmq1m9r5410l"))))
3bd7611e
JL
1234 (build-system go-build-system)
1235 (arguments
1236 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
bdc0c20c 1237 #:unpack-path "github.com/omniscale/imposm3"
3bd7611e
JL
1238 #:phases
1239 (modify-phases %standard-phases
3bd7611e
JL
1240 (add-before 'build 'set-version
1241 (lambda _
1242 (substitute* "src/github.com/omniscale/imposm3/version.go"
1243 (("0.0.0-dev") ,version))
1244 #t)))))
1245 (inputs
8394619b 1246 (list geos leveldb))
3bd7611e
JL
1247 (home-page "https://imposm.org/")
1248 (synopsis "OpenStreetMap importer for PostGIS")
1249 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
1250files and imports the data into PostgreSQL/PostGIS databases. It is designed
1251to create databases that are optimized for rendering/tile/map-services.")
1252 (license (list
1253 license:asl2.0
1254 ;; Some dependencies in vendor have different licenses
1255 license:expat
1256 license:bsd-2
1257 license:bsd-3))))
8fa3451c 1258
889e94e3
JL
1259(define-public libosmium
1260 (package
1261 (name "libosmium")
30daa0d9 1262 (version "2.18.0")
889e94e3 1263 (source
f4daf250
TGR
1264 (origin
1265 (method git-fetch)
1266 (uri (git-reference
b0e7b699 1267 (url "https://github.com/osmcode/libosmium")
f4daf250
TGR
1268 (commit (string-append "v" version))))
1269 (file-name (git-file-name name version))
1270 (sha256
30daa0d9 1271 (base32 "0fh57mpii1ksacwfx5rz213j896aklib53jbybld2i517q2mmxr0"))))
889e94e3
JL
1272 (build-system cmake-build-system)
1273 (propagated-inputs
8394619b
LC
1274 (list boost
1275 bzip2
1276 expat
1277 gdal
1278 geos
aa4b555e 1279 lz4
8394619b
LC
1280 proj
1281 protozero
1282 sparsehash
1283 utfcpp
1284 zlib))
889e94e3 1285 (native-inputs
8394619b 1286 (list doxygen))
889e94e3
JL
1287 (home-page "https://osmcode.org/libosmium/")
1288 (synopsis "C++ library for working with OpenStreetMap data")
1289 (description "Libosmium is a fast and flexible C++ library for working with
1290OpenStreetMap data.")
1291 (license license:boost1.0)))
b0e2299a 1292
eeac33a3
NK
1293(define-public osmium-tool
1294 (package
1295 (name "osmium-tool")
1296 (version "1.14.0")
1297 (source
1298 (origin
1299 (method git-fetch)
1300 (uri (git-reference
1301 (url "https://github.com/osmcode/osmium-tool")
1302 (commit (string-append "v" version))))
1303 (file-name (git-file-name name version))
1304 (sha256
1305 (base32 "0zgyqyrs89vch0qnkh9m5xq079sr2wmydy5zz4l8xbysbjf6xry5"))
1306 (modules '((guix build utils)))
1307 (snippet
1308 ;; Remove bundled libraries.
1309 '(delete-file-recursively "include/rapidjson"))))
1310 (build-system cmake-build-system)
1311 (inputs
1312 (list libosmium
1313 rapidjson))
1314 (native-inputs
1315 (list pandoc))
1316 (home-page "https://osmcode.org/osmium-tool/")
1317 (synopsis "Osmium command-line tool")
1318 (description "Command line tool for working with OpenStreetMap data
1319based on the Osmium library.")
1320 (license license:gpl3+)))
1321
b0e2299a
JL
1322(define-public osm2pgsql
1323 (package
1324 (name "osm2pgsql")
dc8e9d6f 1325 (version "1.5.1")
82b47fd9
TGR
1326 (source
1327 (origin
1328 (method git-fetch)
1329 (uri (git-reference
b0e7b699 1330 (url "https://github.com/openstreetmap/osm2pgsql")
82b47fd9
TGR
1331 (commit version)))
1332 (file-name (git-file-name name version))
1333 (sha256
dc8e9d6f 1334 (base32 "0i18mskcs087dn3f3h9n7j0wafn8502m0h13mrjwin38xsz0crfj"))
82b47fd9
TGR
1335 (modules '((guix build utils)))
1336 (snippet
1337 '(begin
1338 (delete-file-recursively "contrib/protozero")
1339 (delete-file-recursively "contrib/libosmium")
1340 #t))))
b0e2299a
JL
1341 (build-system cmake-build-system)
1342 (arguments
1343 `(#:tests? #f; tests fail because we need to setup a database
1344 #:configure-flags
1345 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1346 (assoc-ref %build-inputs "libosmium")
1347 "/include")
1348 (string-append "-DPROTOZERO_INCLUDE_DIR="
1349 (assoc-ref %build-inputs "protozero")
1350 "/include"))))
1351 (inputs
8394619b
LC
1352 (list boost
1353 bzip2
1354 expat
1355 libosmium
1356 lua
1357 postgresql
1358 proj
1359 protozero
1360 zlib))
b0e2299a 1361 (native-inputs
8394619b 1362 (list python python-psycopg2))
b0e2299a
JL
1363 (home-page "https://github.com/openstreetmap/osm2pgsql")
1364 (synopsis "OSM data importer to postgresql")
1365 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1366PostgreSQL / PostGIS database suitable for applications like rendering into a
1367map, geocoding with Nominatim, or general analysis.")
1368 (license license:gpl2+)))
6f91223f
JL
1369
1370(define-public tippecanoe
1371 (package
1372 (name "tippecanoe")
f4b78c22 1373 (version "1.36.0")
8f33d05e
TGR
1374 (source
1375 (origin
1376 (method git-fetch)
1377 (uri (git-reference
b0e7b699 1378 (url "https://github.com/mapbox/tippecanoe")
8f33d05e
TGR
1379 (commit version)))
1380 (file-name (git-file-name name version))
1381 (sha256
f4b78c22 1382 (base32 "0lbmhly4ivnqc6qk1k3sdqvsg6x3nfd8gnjx846bhqj4wag3f88m"))))
6f91223f
JL
1383 (build-system gnu-build-system)
1384 (arguments
1385 `(#:phases
1386 (modify-phases %standard-phases (delete 'configure))
1387 #:test-target "test"
1388 #:make-flags
f4b78c22 1389 (list (string-append "CC=" ,(cc-for-target))
6f91223f
JL
1390 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1391 (inputs
8394619b 1392 (list perl sqlite zlib))
6f91223f
JL
1393 (home-page "https://github.com/mapbox/tippecanoe")
1394 (synopsis "Vector tile server for maps")
1395 (description "Tippecanoe creates scale-independent view of data, so that
1396the texture and density of features is visible at every zoom level, instead of
1397dropping features at lower levels.")
1398 (license license:bsd-2)))
ed72a133
GLV
1399
1400(define-public osmctools
1401 (package
1402 (name "osmctools")
1403 (version "0.9")
1404 (source
1405 (origin
1406 (method git-fetch)
1407 (uri (git-reference
1408 (url "https://gitlab.com/osm-c-tools/osmctools")
1409 (commit version)))
1410 (file-name (git-file-name name version))
1411 (sha256
1412 (base32
1413 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1414 (build-system gnu-build-system)
1415 (native-inputs
8394619b 1416 (list autoconf automake))
ed72a133 1417 (inputs
8394619b 1418 (list zlib))
ed72a133
GLV
1419 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1420 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1421 (description "This project contains a few tools which are used in the
1422OpenStreetMap project. They can be used to convert, filter and update
1423OpenStreetMap data files.")
1424 (license license:agpl3)))
ee34be73
GLV
1425
1426(define-public osm-gps-map
1427 (package
1428 (name "osm-gps-map")
1429 (version "1.1.0")
1430 (source
1431 (origin
1432 (method url-fetch)
1433 (uri (string-append
1434 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1435 version "/osm-gps-map-" version ".tar.gz"))
1436 (sha256
1437 (base32
1438 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1439 (build-system gnu-build-system)
1440 (native-inputs
8394619b 1441 (list gnome-common gtk-doc/stable pkg-config))
ee34be73 1442 (inputs
e3196755 1443 (list cairo glib gobject-introspection gtk+ libsoup-minimal-2))
ee34be73
GLV
1444 (home-page "https://nzjrs.github.io/osm-gps-map/")
1445 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1446 (description
1447 "This package provides a GTK+ widget (and Python bindings) that when
1448given GPS coordinates,draws a GPS track, and points of interest on a moving
1449map display. Downloads map data from a number of websites, including
1450@url{https://www.openstreetmap.org}.")
1451 (license license:gpl2+)))
0f7b8a7f
EF
1452
1453(define-public xygrib
1454 (package
1455 (name "xygrib")
29bdabb6 1456 (version "1.2.6.1")
0f7b8a7f
EF
1457 (source (origin
1458 (method git-fetch)
1459 (uri (git-reference
b0e7b699 1460 (url "https://github.com/opengribs/XyGrib")
0f7b8a7f
EF
1461 (commit (string-append "v" version))))
1462 (file-name (git-file-name name version))
b3ee04cd 1463 (patches (search-patches "xygrib-fix-finding-data.patch"))
0f7b8a7f
EF
1464 (sha256
1465 (base32
29bdabb6 1466 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
0f7b8a7f
EF
1467 (modules '((guix build utils)))
1468 (snippet
40b3e9da
EF
1469 '(begin
1470 (delete-file-recursively "data/fonts")
1471 ;; Fixes compilation, can be removed with the next release.
1472 ;; Upstream link: https://github.com/opengribs/XyGrib/pull/255
1473 (substitute* "src/SkewT.h"
1474 (("QMessageBox>") "QMessageBox>\n#include <QPainterPath>"))
1475 #t))))
0f7b8a7f
EF
1476 (build-system cmake-build-system)
1477 (arguments
b3ee04cd
TJBG
1478 `(#:configure-flags (list "-DGNU_PACKAGE=ON")
1479
1480 #:phases
0f7b8a7f
EF
1481 (modify-phases %standard-phases
1482 (add-after 'unpack 'patch-directories
1483 (lambda* (#:key inputs #:allow-other-keys)
1484 (let ((jpeg (assoc-ref inputs "openjpeg"))
1485 (font (assoc-ref inputs "font-liberation")))
1486 (substitute* "CMakeLists.txt"
0f7b8a7f
EF
1487 ;; Skip looking for the static library.
1488 (("\"libnova.a\"") ""))
1489 ;; Don't use the bundled font-liberation.
1490 (substitute* "src/util/Font.cpp"
1491 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1492 (string-append "\"" font "/share/fonts/truetype/\"")))
1493 (substitute* "src/util/Util.h"
1494 (("pathData\\(\\)\\+\"data/fonts/\"")
b3ee04cd 1495 (string-append "\"" font "/share/fonts/\"")))))))
0f7b8a7f
EF
1496 #:tests? #f)) ; no tests
1497 (native-inputs
eef8e2ec 1498 (list qttools-5))
0f7b8a7f 1499 (inputs
8394619b
LC
1500 (list bzip2
1501 font-liberation
1502 libnova
1503 libpng
1504 openjpeg
1505 proj
1506 qtbase-5
1507 zlib))
b3ee04cd
TJBG
1508 (native-search-paths
1509 (list (search-path-specification
1510 (variable "XDG_DATA_DIRS")
1511 (files '("share")))))
0f7b8a7f
EF
1512 (synopsis "Weather Forecast Visualization")
1513 (description
1514 "XyGrib is a Grib file reader and visualizes meteorological data providing
1515an off-line capability to analyse weather forecasts or hindcasts. It is
1516intended to be used as a capable weather work station for anyone with a serious
1517interest in examining weather. This would include members of the sailing
1518community, private and sport aviators, farmers, weather buffs and many more.
1519XyGrib is the continuation of the zyGrib software package with a new team of
1520volunteers.")
1521 (home-page "https://opengribs.org")
1522 (license license:gpl3+)))
41b4b713
1523
1524(define-public libspatialindex
1525 (package
1526 (name "libspatialindex")
1cbe7a3e 1527 (version "1.9.3")
41b4b713
1528 (source
1529 (origin
1530 (method url-fetch)
1cbe7a3e
AI
1531 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1532 "releases/download/" version "/spatialindex-src-"
1533 version ".tar.bz2"))
41b4b713
1534 (sha256
1535 (base32
1cbe7a3e
AI
1536 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1537 (build-system cmake-build-system)
41b4b713
1538 (home-page "https://libspatialindex.org")
1539 (synopsis "Spatial indexing library")
1540 (description "The purpose of this library is to provide:
1541
1542@itemize
1543 @item An extensible framework that will support robust spatial indexing
1544methods.
1545 @item Support for sophisticated spatial queries. Range, point location,
1546 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1547by spatial constraints) should be easy to deploy and run.
1548 @item Easy to use interfaces for inserting, deleting and updating information.
1549 @item Wide variety of customization capabilities. Basic index and storage
1550characteristics like the page size, node capacity, minimum fan-out, splitting
1551algorithm, etc. should be easy to customize.
1552 @item Index persistence. Internal memory and external memory structures
1553should be supported. Clustered and non-clustered indices should be easy to be
1554persisted.
1555@end itemize
1556")
1557 (license license:expat)))
6dd0e41d 1558
3288d6bf
VM
1559(define-public python-rtree
1560 (package
1561 (name "python-rtree")
41ab2f0d 1562 (version "1.0.0")
3288d6bf
VM
1563 (source
1564 (origin
1565 (method url-fetch)
1566 (uri (pypi-uri "Rtree" version))
1567 (sha256
41ab2f0d 1568 (base32 "10lnhf67c9pb0yisxdqmb52dy6lj1za1h9d4p69v0ihk2a138j6h"))))
3288d6bf
VM
1569 (build-system python-build-system)
1570 (arguments
1571 `(#:phases
1572 (modify-phases %standard-phases
1573 (add-after 'unpack 'find-libspatialindex
1574 (lambda* (#:key inputs #:allow-other-keys)
41ab2f0d
FG
1575 (let ((libspatialindex (assoc-ref inputs "libspatialindex")))
1576 (substitute* "rtree/finder.py"
1577 (("find_library\\(\"spatialindex_c\"\\)")
1578 (string-append "\"" libspatialindex
1579 "/lib/libspatialindex_c.so\""))))))
3288d6bf 1580 (replace 'check
41ab2f0d 1581 (lambda* (#:key outputs tests? #:allow-other-keys)
3288d6bf 1582 (when tests?
41ab2f0d 1583 (invoke "pytest")))))))
3288d6bf 1584 (native-inputs
8394619b 1585 (list python-numpy python-pytest python-wheel))
3288d6bf 1586 (inputs
8394619b 1587 (list libspatialindex))
3288d6bf
VM
1588 (home-page "https://github.com/Toblerity/rtree")
1589 (synopsis "R-Tree spatial index for Python GIS")
1590 (description
1591 "RTree is a Python package with bindings for @code{libspatialindex}.")
1592 (license license:expat)))
1593
6dd0e41d
JL
1594(define-public java-jmapviewer
1595 (package
1596 (name "java-jmapviewer")
8c8c0c63 1597 (version "2.13")
6dd0e41d
JL
1598 (source (origin
1599 (method url-fetch)
1600 (uri (string-append "https://svn.openstreetmap.org/applications/"
1601 "viewer/jmapviewer/releases/" version
1602 "/JMapViewer-" version "-Source.zip"))
1603 (sha256
1604 (base32
8c8c0c63 1605 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
6dd0e41d
JL
1606 (build-system ant-build-system)
1607 (native-inputs
8394619b 1608 (list unzip))
6dd0e41d
JL
1609 (arguments
1610 `(#:build-target "pack"
1611 #:tests? #f; No tests
1612 #:phases
1613 (modify-phases %standard-phases
1614 (add-before 'build 'clean
1615 (lambda* _
1616 (invoke "ant" "clean")))
1617 (replace 'install
1618 (lambda* (#:key outputs #:allow-other-keys)
1619 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1620 (mkdir-p dir)
54cc2b4e
BH
1621 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1622 #t))))))
6dd0e41d
JL
1623 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1624 (synopsis "OSM map integration in Java")
4042f7f8
VC
1625 (description "JMapViewer is a Java component which easily
1626integrates an OSM map view into your Java application. It is maintained as
6dd0e41d
JL
1627an independent project by the JOSM team.")
1628 (license license:gpl2)))
f041db86 1629
f1abc566
JL
1630(define-public java-opening-hours-parser
1631 (package
1632 (name "java-opening-hours-parser")
c9f6fe2c 1633 (version "0.23.0")
f1abc566
JL
1634 (source (origin
1635 (method git-fetch)
1636 (uri (git-reference
1637 (url "https://github.com/simonpoole/OpeningHoursParser")
1638 (commit version)))
1639 (file-name (git-file-name name version))
1640 (sha256
1641 (base32
c9f6fe2c 1642 "0yhbd2ix6h506aljh0jkrnp28m4xcqdcdpnqm30fn08kawdgxgsh"))))
f1abc566
JL
1643 (build-system ant-build-system)
1644 (arguments
1645 `(#:jar-name "java-opening-hours-parser.jar"
1646 #:source-dir "src/main/java"
1647 #:phases
1648 (modify-phases %standard-phases
1649 (add-before 'build 'copy-resources
1650 (lambda _
1651 (copy-recursively "src/main/resources" "build/classes")
1652 #t))
1653 (add-before 'build 'generate-parser
1654 (lambda* _
1655 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1656 (file (string-append dir "/OpeningHoursParser.jj")))
1657 (invoke "javacc" "-DEBUG_PARSER=false"
1658 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1659 "-GRAMMAR_ENCODING=UTF-8"
1660 (string-append "-OUTPUT_DIRECTORY=" dir)
1661 file))
1662 #t)))))
1663 (inputs
8394619b 1664 (list java-jetbrains-annotations))
f1abc566 1665 (native-inputs
8394619b 1666 (list javacc java-junit java-hamcrest-core))
f1abc566
JL
1667 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1668 (synopsis "Java parser for the OpenStreetMap opening hour format")
1669 (description "This is a very simplistic parser for string values according
1670to the OSM opening hours specification.")
1671 (license license:expat)))
1672
f041db86
JL
1673(define-public josm
1674 (package
1675 (name "josm")
81ab2016 1676 (version "18360")
f041db86
JL
1677 (source (origin
1678 (method svn-fetch)
1679 (uri (svn-reference
1680 (url "https://josm.openstreetmap.de/svn/trunk")
1681 (revision (string->number version))
1682 (recursive? #f)))
1683 (sha256
1684 (base32
81ab2016 1685 "0j7fhzh6hs2b5r1a3d1xpy6f5r6q1kh79bck28raang8ldd754c6"))
f041db86
JL
1686 (file-name (string-append name "-" version "-checkout"))
1687 (modules '((guix build utils)))
1688 (snippet
1689 '(begin
1192ae94 1690 (for-each delete-file (find-files "." ".*.jar$"))
f041db86
JL
1691 #t))))
1692 (build-system ant-build-system)
1693 (native-inputs
8394619b 1694 (list javacc))
f041db86 1695 (inputs
8394619b
LC
1696 (list java-commons-jcs
1697 java-commons-compress
1698 java-jmapviewer
1699 java-jsonp-api
1700 java-jsonp-impl ; runtime dependency
1701 java-jsr305
1702 java-metadata-extractor
1703 java-opening-hours-parser
1704 java-openjfx-media
1705 java-signpost-core
1706 java-svg-salamander))
f041db86
JL
1707 (arguments
1708 `(#:tests? #f
1709 #:jar-name "josm.jar"
1710 #:phases
1711 (modify-phases %standard-phases
1712 (add-after 'unpack 'rm-build.xml
1713 (lambda* _
1714 (delete-file "build.xml")
1715 #t))
1716 (add-before 'build 'fix-revision
1717 (lambda* _
1718 (with-output-to-file "REVISION.XML"
1719 (lambda _
1720 (display
1721 (string-append "<info><entry><commit revision=\"" ,version "\">"
1722 "<date>1970-01-01 00:00:00 +0000</date>"
1723 "</commit></entry></info>"))))
1724 #t))
cfdb6770
JL
1725 (add-before 'build 'fix-jcs
1726 (lambda _
1727 ;; This version of JOSM uses an unreleased version of commons-jcs,
1728 ;; which has renamed its classes to another namespace. Rename them
1729 ;; back so they can be used with our version of jcs.
1730 (substitute* (find-files "." ".*.java$")
7125b0d8
CL
1731 (("jcs3") "jcs")
1732 (("ICache.NAME_COMPONENT_DELIMITER") "\":\""))
cfdb6770 1733 #t))
f041db86
JL
1734 (add-before 'build 'fix-classpath
1735 (lambda* (#:key inputs #:allow-other-keys)
1736 (setenv "CLASSPATH"
1737 (string-join
1738 (filter
1739 (lambda (s)
1740 (let ((source (assoc-ref inputs "source")))
1192ae94
CB
1741 (not (equal? (substring s 0 (string-length source))
1742 source))))
f041db86
JL
1743 (string-split (getenv "CLASSPATH") #\:))
1744 ":"))
1745 #t))
1746 (add-before 'build 'generate-parser
1747 (lambda* _
1748 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1749 (out (string-append dir "/parsergen"))
1750 (file (string-append dir "/MapCSSParser.jj")))
1751 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1752 (invoke "javacc" "-DEBUG_PARSER=false"
1753 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1754 "-GRAMMAR_ENCODING=UTF-8"
1755 (string-append "-OUTPUT_DIRECTORY=" out)
1756 file))
1757 #t))
1758 (add-after 'build 'generate-epsg
1759 (lambda _
1760 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1761 "-cp" "build/classes")
1762 (mkdir-p "data/projection")
1763 (with-output-to-file "data/projection/custom-epsg"
1764 (lambda _ (display "")))
1765 (invoke "java" "-cp" "build/classes:scripts:."
1766 "BuildProjectionDefinitions" ".")
1767 #t))
cfdb6770 1768 (add-after 'generate-epsg 'copy-resources
f041db86 1769 (lambda _
cfdb6770 1770 (copy-recursively "resources" "build/classes")
f041db86
JL
1771 #t))
1772 (add-before 'install 'regenerate-jar
1773 (lambda _
1774 ;; We need to regenerate the jar file to add data.
1775 (delete-file "build/jar/josm.jar")
1776 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1777 "build/classes" ".")
1778 #t))
f041db86
JL
1779 (add-before 'build 'copy-revision
1780 (lambda _
1781 (mkdir-p "build/classes")
1782 (with-output-to-file "build/classes/REVISION"
1783 (lambda _
1784 (display
1785 (string-append "Revision: " ,version "\n"
1786 "Is-Local-Build: true\n"
1787 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1788 #t))
1192ae94
CB
1789 (add-after 'install 'install-share-directories
1790 (lambda* (#:key outputs #:allow-other-keys)
1791 (let ((out (assoc-ref outputs "out"))
1792 (share-directories '("applications" "icons" "man" "menu"
f9fd3752
CL
1793 "metainfo" "mime" "pixmaps"))
1794 (desktop "org.openstreetmap.josm.desktop"))
1192ae94
CB
1795 (for-each (lambda (directory)
1796 (copy-recursively (string-append
1797 "native/linux/tested/usr/share/"
1798 directory)
1799 (string-append
1800 out "/share/" directory)))
f9fd3752
CL
1801 share-directories)
1802 (substitute* (string-append out "/share/applications/" desktop)
1803 (("josm-MainApplication") "josm-gui-MainApplication")))
1192ae94 1804 #t))
f041db86
JL
1805 (add-after 'install 'install-bin
1806 (lambda* (#:key outputs inputs #:allow-other-keys)
1807 (let* ((out (assoc-ref outputs "out"))
1808 (bin (string-append out "/bin")))
1809 (mkdir-p bin)
1810 (with-output-to-file (string-append bin "/josm")
1811 (lambda _
1812 (display
1813 (string-append "#!/bin/sh\n"
1814 (assoc-ref inputs "jdk") "/bin/java"
1815 " -cp " out "/share/java/josm.jar:"
1816 (getenv "CLASSPATH")
1817 " org.openstreetmap.josm.gui.MainApplication"))))
1818 (chmod (string-append bin "/josm") #o755))
1819 #t)))))
1820 (home-page "https://josm.openstreetmap.de")
1821 (synopsis "OSM editor")
1822 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1823supports loading GPX tracks, background imagery and OSM data from local
9df26b02 1824sources as well as from online sources and allows editing the OSM data (nodes,
f041db86
JL
1825ways, and relations) and their metadata tags.")
1826 (license license:gpl2+)))
53c9b398
HG
1827
1828(define-public libmaxminddb
1829 (package
1830 (name "libmaxminddb")
07c0b3ce 1831 (version "1.4.3")
53c9b398
HG
1832 (source
1833 (origin
1834 (method url-fetch)
1835 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1836 "/releases/download/" version "/"
1837 "/libmaxminddb-" version ".tar.gz"))
1838 (sha256
07c0b3ce 1839 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
53c9b398
HG
1840 (build-system gnu-build-system)
1841 (arguments
2113ddb7
TGR
1842 `(#:make-flags
1843 (list ,(string-append "CC=" (cc-for-target)))))
53c9b398 1844 (native-inputs
8394619b 1845 (list perl))
53c9b398
HG
1846 (home-page "https://maxmind.github.io/libmaxminddb/")
1847 (synopsis "C library for the MaxMind DB file format")
1848 (description "The libmaxminddb library provides a C library for reading
1849MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1850format is a custom, but open, binary format designed to facilitate fast
1851lookups of IP addresses while allowing flexibility in the type of data
1852associated with an address.")
1853 (license license:asl2.0)))
b1414a81
HG
1854
1855(define-public python-maxminddb
1856 (package
1857 (name "python-maxminddb")
1858 (version "1.5.1")
1859 (source
1860 (origin
1861 (method url-fetch)
1862 (uri (pypi-uri "maxminddb" version))
1863 (sha256
1864 (base32
1865 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1866 (build-system python-build-system)
1867 (arguments
1868 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1869 (inputs
8394619b 1870 (list libmaxminddb))
13b09bfc 1871 (home-page "https://www.maxmind.com/")
b1414a81
HG
1872 (synopsis "Reader for the MaxMind DB format")
1873 (description "MaxMind DB is a binary file format that stores data indexed
1874by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1875MaxMind DB files.")
1876 (license license:asl2.0)))
0a71e34e
HG
1877
1878(define-public python-geoip2
1879 (package
1880 (name "python-geoip2")
1881 (version "2.9.0")
1882 (source
1883 (origin
1884 (method url-fetch)
1885 (uri (pypi-uri "geoip2" version))
1886 (sha256
1887 (base32
1888 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1889 (build-system python-build-system)
1890 (arguments
1891 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1892 (inputs
8394619b 1893 (list python-maxminddb python-requests))
13b09bfc 1894 (home-page "https://www.maxmind.com/")
0a71e34e
HG
1895 (synopsis "MaxMind GeoIP2 API")
1896 (description "Provides an API for the GeoIP2 web services and databases.
1897The API also works with MaxMind’s free GeoLite2 databases.")
1898 (license license:asl2.0)))
30fa6b16
GLV
1899
1900(define-public routino
1901 (package
1902 (name "routino")
e2492f58 1903 (version "3.3.3")
30fa6b16
GLV
1904 (source
1905 (origin
1906 (method url-fetch)
1907 (uri (string-append "http://www.routino.org/download/routino-"
1908 version ".tgz"))
1909 (sha256
e2492f58 1910 (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
30fa6b16
GLV
1911 (build-system gnu-build-system)
1912 (native-inputs
8394619b 1913 (list perl))
30fa6b16 1914 (inputs
8394619b 1915 (list bzip2 xz zlib))
30fa6b16
GLV
1916 (arguments
1917 `(#:test-target "test"
1918 #:phases
1919 (modify-phases %standard-phases
1920 (replace 'configure
1921 (lambda* (#:key outputs #:allow-other-keys)
1922 (substitute* "Makefile.conf"
1923 (("prefix=/usr/local")
1924 (string-append "prefix=" (assoc-ref outputs "out")))
1925 (("LDFLAGS_LDSO=-Wl,-R\\.")
1926 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1927 (("#CFLAGS\\+=-DUSE_XZ")
1928 "CFLAGS+=-DUSE_XZ")
1929 (("#LDFLAGS\\+=-llzma")
1930 "LDFLAGS+=-llzma"))
1931 #t)))))
1932 (synopsis "Routing application for OpenStreetMap data")
1933 (description
1934 "Routino is an application for finding a route between two points
1935using the dataset of topographical information collected by
1936@url{https://www.OpenStreetMap.org}.")
1937 (home-page "https://www.routino.org/")
1938 (license license:agpl3+)))
bccbeece
GLV
1939
1940(define-public qmapshack
1941 (package
1942 (name "qmapshack")
4db16b9c 1943 (version "1.16.1")
bccbeece
GLV
1944 (source
1945 (origin
1946 (method git-fetch)
1947 (uri (git-reference
b0e7b699 1948 (url "https://github.com/Maproom/qmapshack")
bccbeece
GLV
1949 (commit (string-append "V_" version))))
1950 (file-name (git-file-name name version))
1951 (sha256
4db16b9c 1952 (base32 "184fqmsfzr3b333ssizjk6gvv7mncmygq8dj5r7rsvs5md26z2ys"))))
bccbeece
GLV
1953 (build-system qt-build-system)
1954 (native-inputs
eef8e2ec 1955 (list pkg-config qttools-5))
bccbeece 1956 (inputs
8394619b
LC
1957 (list gdal
1958 libjpeg-turbo
1959 proj
1960 qtbase-5
735d340a 1961 qtdeclarative-5
8394619b 1962 qtlocation
0938c3e3 1963 qtwebchannel-5
a0beb297 1964 qtwebengine-5
4db16b9c 1965 quazip
8394619b
LC
1966 routino
1967 sqlite ; See wrap phase
1968 zlib))
bccbeece
GLV
1969 (arguments
1970 `(#:tests? #f
1971 #:phases
1972 (modify-phases %standard-phases
1973 (add-after 'unpack 'fix-cmake-modules
1974 (lambda* (#:key inputs #:allow-other-keys)
1975 (substitute* "CMakeLists.txt"
1976 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1977 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1978 (substitute* "cmake/Modules/FindROUTINO.cmake"
1979 (("/usr/local")
4db16b9c 1980 (assoc-ref inputs "routino"))))))))
bccbeece
GLV
1981 (synopsis "GPS mapping application")
1982 (description
1983 "QMapShack can be used to plan your next outdoor trip or to visualize and
1984archive all the GPS recordings of your past trips. It is the successor of the
1985QLandkarte GT application.")
1986 (home-page "https://github.com/Maproom/qmapshack/wiki")
1987 (license license:gpl3+)))
133de9ab
GLV
1988
1989(define-public readosm
1990 (package
1991 (name "readosm")
86f8472b 1992 (version "1.1.0a")
133de9ab
GLV
1993 (source
1994 (origin
1995 (method url-fetch)
1996 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1997 "readosm-" version ".tar.gz"))
1998 (sha256
b7ab88bc 1999 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
133de9ab
GLV
2000 (build-system gnu-build-system)
2001 (inputs
8394619b 2002 (list expat zlib))
133de9ab
GLV
2003 (synopsis "Data extractor for OpenStreetMap files")
2004 (description
2005 "ReadOSM is a library to extract valid data from within an OpenStreetMap
2006input file (in @code{.osm} or @code{.osm.pbf} format).")
2007 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
2008 (license (list license:gpl2+
2009 license:lgpl2.1+
2010 license:mpl1.1))))
0ccc1385 2011
6be69452
SH
2012(define-public shapelib
2013 (package
2014 (name "shapelib")
2015 (version "1.5.0")
2016 (source
2017 (origin
2018 (method git-fetch)
2019 (uri (git-reference
2020 (url "https://github.com/OSGeo/shapelib")
2021 (commit (string-append "v" version))))
2022 (file-name (git-file-name name version))
2023 (sha256
2024 (base32 "1lzch0jf6yqhw391phhafzw4ghmiz98zkf698h4fmq109fa2vhqd"))))
2025 (build-system gnu-build-system)
2026 (native-inputs
8394619b 2027 (list autoconf automake libtool))
6be69452
SH
2028 (home-page "http://shapelib.maptools.org/")
2029 (synopsis "Provides C library to write and update ESRI Shapefiles")
2030 (description
2031 "The Shapefile C Library provides the ability to write simple C programs
2032for reading, writing and updating (to a limited extent) ESRI Shapefiles, and the
2033associated attribute file (@file{.dbf}).")
2034 (license license:gpl2+)))
2035
0ccc1385
GLV
2036(define-public spatialite-tools
2037 (package
2038 (name "spatialite-tools")
f33e773c 2039 (version "5.0.1")
0ccc1385
GLV
2040 (source
2041 (origin
2042 (method url-fetch)
2043 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
2044 "spatialite-tools-" version ".tar.gz"))
2045 (sha256
f33e773c 2046 (base32 "070p6pg541wvwb28wkn7k0z1qdyirik2qc2jpj4pf0vzx02w414n"))))
0ccc1385
GLV
2047 (build-system gnu-build-system)
2048 (native-inputs
8394619b 2049 (list pkg-config))
0ccc1385 2050 (inputs
8394619b
LC
2051 (list expat
2052 freexl
2053 geos
2054 librttopo
2055 libspatialite
2056 libxml2
2057 minizip
2058 proj
2059 readosm
2060 sqlite))
0ccc1385
GLV
2061 (synopsis "Collection of command line tools for SpatiaLite")
2062 (description
2063 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
2064tools supporting SpatiaLite.")
2065 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
2066 (license license:gpl3+)))
ec73c90e
GLV
2067
2068(define-public virtualpg
2069 (package
2070 (name "virtualpg")
b2a94e59 2071 (version "2.0.1")
ec73c90e
GLV
2072 (source
2073 (origin
2074 (method url-fetch)
2075 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
2076 "virtualpg-" version ".tar.gz"))
2077 (sha256
b2a94e59 2078 (base32 "12z0l7368r4116ljzg7nljy5hf425r11vxc540w79wlzikmynamy"))))
ec73c90e
GLV
2079 (build-system gnu-build-system)
2080 (inputs
8394619b 2081 (list postgresql sqlite))
ec73c90e
GLV
2082 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
2083 (description
2084 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
2085the VirtualPostgres driver, allowing to directly exchange data between SQLite
2086and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
2087exchanged form one Spatial DBMS and the other.")
2088 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
2089 (license (list license:gpl2+
2090 license:lgpl2.1+
2091 license:mpl1.1))))
7b1fb40d
GLV
2092
2093(define-public opencpn
2094 (package
2095 (name "opencpn")
2da3c84a 2096 (version "5.6.0")
7b1fb40d
GLV
2097 (source
2098 (origin
2099 (method git-fetch)
2100 (uri (git-reference
b0e7b699 2101 (url "https://github.com/OpenCPN/OpenCPN")
2da3c84a 2102 (commit (string-append "Release_" version))))
7b1fb40d
GLV
2103 (file-name (git-file-name name version))
2104 (sha256
2da3c84a 2105 (base32 "0g5x45wv3djfjmigk6kgs0i63yp8rs1fbmm4pb15wb3z6dml624y"))))
7b1fb40d
GLV
2106 (build-system cmake-build-system)
2107 (native-inputs
2108 `(("gettext" ,gettext-minimal)
2109 ("pkg-config" ,pkg-config)))
2110 (inputs
2da3c84a
GLV
2111 (list alsa-utils
2112 bzip2
8394619b
LC
2113 cairo
2114 curl
2da3c84a 2115 eudev
8394619b
LC
2116 glu
2117 gtk+
2da3c84a 2118 jasper
8394619b
LC
2119 libarchive
2120 libelf
2121 libexif
2da3c84a 2122 libjpeg-turbo
8394619b 2123 libsndfile
2da3c84a 2124 libusb
8394619b
LC
2125 lz4
2126 mesa
2127 pango
2128 portaudio
2129 sqlite
2130 tinyxml
2131 wxsvg
2132 wxwidgets
2133 xz
2134 zlib))
7b1fb40d 2135 (arguments
4d021659
GLV
2136 `(#:configure-flags '("-DOCPN_USE_BUNDLED_LIBS=OFF"
2137 "-DOCPN_ENABLE_PORTAUDIO=ON"
2138 "-DOCPN_ENABLE_SNDFILE=ON"
2139 "-DOCPN_BUNDLE_TCDATA=ON"
2140 "-DOCPN_BUNDLE_GSHHS=ON")
7b1fb40d
GLV
2141 #:tests? #f ; No tests defined
2142 #:phases
2143 (modify-phases %standard-phases
2144 (add-after 'unpack 'fix-build
4d021659 2145 (lambda* (#:key inputs #:allow-other-keys)
7b1fb40d 2146 (substitute* "CMakeLists.txt"
4d021659
GLV
2147 (("wx-32.c; cc")
2148 "wx-32.c; gcc")
2149 (("\"/bin/sh\" \"-c\"")
2150 (string-append "\"" (which "bash") "\" \"-c\""))
2151 (("include\\(TargetSetup\\)")
2152 "set(PKG_TARGET \"guix\")\nset(PKG_TARGET_VERSION 1)")))))))
7b1fb40d
GLV
2153 (synopsis "Chart plotter and marine GPS navigation software")
2154 (description
2155 "OpenCPN is a chart plotter and marine navigation software designed to be
2156used at the helm station of your boat while underway. Chart a course and
2157track your position right from your laptop.")
2158 (home-page "https://opencpn.org/")
2159 (license (list license:asl2.0
2160 license:cc0
2161 license:bsd-2
2162 license:bsd-3
2163 license:expat
2164 license:gpl3+
2165 license:lgpl2.1+
2166 license:lgpl3+
2167 license:sgifreeb2.0
2168 license:zlib))))
9fce5914 2169
02c9a069
NK
2170(define-public openorienteering-mapper
2171 (package
2172 (name "openorienteering-mapper")
2173 (version "0.9.5")
2174 (source (origin
2175 (method git-fetch)
2176 (uri (git-reference
2177 (url "https://github.com/OpenOrienteering/mapper")
2178 (commit (string-append "v" version))))
2179 (file-name (git-file-name name version))
2180 (sha256
2181 (base32
2182 "11b578h8f3q9yvphbjhqmy2w1cfc9skslzawypqmc3k44v24aj0s"))))
2183 (build-system cmake-build-system)
2184 (arguments
2185 `(#:tests? #f
2186 #:configure-flags
2187 (list
2188 "-DLICENSING_PROVIDER:BOOL=OFF"
2189 "-DMapper_MANUAL_QTHELP:BOOL=OFF")))
2190 (inputs
2191 `(("clipper" ,clipper)
2192 ("cups" ,cups)
2193 ("gdal" ,gdal)
2194 ("proj" ,proj)
2195 ("qtbase" ,qtbase-5)
2196 ("qtimageformats" ,qtimageformats)
2197 ("qtlocation" ,qtlocation)
2198 ("qtsensors" ,qtsensors)
2199 ("zlib" ,zlib)))
2200 (native-inputs
2201 `(("doxygen" ,doxygen)
eef8e2ec 2202 ("qttools-5" ,qttools-5)))
02c9a069
NK
2203 (home-page "https://www.openorienteering.org/apps/mapper/")
2204 (synopsis "OpenOrienteering Mapper (OOM)")
2205 (description
2206 "OpenOrienteering Mapper is a software for creating maps for the
2207orienteering sport.")
2208 (license license:gpl3+)))
2209
9fce5914 2210(define-public grass
df70fd33 2211 (let* ((version "7.8.7")
9fce5914
GLV
2212 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
2213 (grassxx (string-append "grass" majorminor)))
2214 (package
2215 (name "grass")
2216 (version version)
2217 (source
2218 (origin
2219 (method url-fetch)
2220 (uri (string-append "https://grass.osgeo.org/" grassxx
2221 "/source/grass-" version ".tar.gz"))
2222 (sha256
df70fd33 2223 (base32 "0sbz0ba9p963phvd0gmvfqq1fg4ixpipzcjbf20ys86qavjppzsg"))))
9fce5914
GLV
2224 (build-system gnu-build-system)
2225 (inputs
1628d57b 2226 `(("bzip2" ,bzip2)
9fce5914
GLV
2227 ("cairo" ,cairo)
2228 ("fftw" ,fftw)
2229 ("freetype" ,freetype)
2230 ("gdal" ,gdal)
2231 ("geos" ,geos)
2232 ("glu" ,glu)
2233 ("lapack" ,lapack)
2234 ("libpng" ,libpng)
2235 ("libtiff" ,libtiff)
2236 ("mesa" ,mesa)
2237 ("mariadb-dev" ,mariadb "dev")
2238 ("mariadb-lib" ,mariadb "lib")
2239 ("netcdf" ,netcdf)
2240 ("openblas" ,openblas)
2241 ("perl" ,perl)
2242 ("postgresql" ,postgresql)
552fde3b 2243 ("proj" ,proj)
9fce5914
GLV
2244 ("python" ,python)
2245 ("python-dateutil" ,python-dateutil)
2246 ("python-numpy" ,python-numpy)
2247 ("python-wxpython" ,python-wxpython)
2248 ("readline" ,readline)
2249 ("sqlite" ,sqlite)
2250 ("wxwidgets" ,wxwidgets)
2251 ("zlib" ,zlib)
2252 ("zstd" ,zstd "lib")))
2253 (native-inputs
2254 `(("bash" ,bash-minimal)
2255 ("bison" ,bison)
2256 ("flex" ,flex)
2257 ("pkg-config" ,pkg-config)))
2258 (arguments
2259 `(#:tests? #f ; No tests
2260 #:modules ((guix build gnu-build-system)
2261 ((guix build python-build-system) #:prefix python:)
2262 (guix build utils))
2263 #:imported-modules (,@%gnu-build-system-modules
2264 (guix build python-build-system))
2265 #:phases
2266 (modify-phases %standard-phases
2267 (replace 'configure
2268 (lambda* (#:key inputs outputs #:allow-other-keys)
bc64d955 2269 (let ((shell (search-input-file inputs "/bin/bash")))
9fce5914
GLV
2270 (setenv "SHELL" shell)
2271 (setenv "CONFIG_SHELL" shell)
2272 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
2273 (assoc-ref outputs "out")
2274 "/" ,grassxx "/lib")))
2275 (invoke "./configure"
2276 (string-append "--prefix="
2277 (assoc-ref outputs "out"))
2278 "--with-blas"
2279 "--with-bzlib"
2280 (string-append "--with-freetype-includes="
2281 (assoc-ref inputs "freetype")
2282 "/include/freetype2")
2283 (string-append "--with-freetype-libs="
2284 (assoc-ref inputs "freetype")
2285 "/lib")
2286 "--with-geos"
2287 "--with-lapack"
2288 "--with-mysql"
2289 (string-append "--with-mysql-includes="
2290 (assoc-ref inputs "mariadb-dev")
2291 "/include/mysql")
2292 (string-append "--with-mysql-libs="
2293 (assoc-ref inputs "mariadb-lib")
2294 "/lib")
2295 "--with-netcdf"
2296 "--with-postgres"
2297 (string-append "--with-proj-share="
552fde3b 2298 (assoc-ref inputs "proj")
9fce5914
GLV
2299 "/share/proj")
2300 "--with-pthread"
2301 "--with-readline"
2302 "--with-sqlite"
2303 "--with-wxwidgets")))
2304 (add-after 'install 'install-links
2305 (lambda* (#:key outputs #:allow-other-keys)
2306 ;; Put links for includes and libraries in the standard places.
2307 (let* ((out (assoc-ref outputs "out"))
2308 (dir (string-append out "/" ,grassxx)))
2309 (symlink (string-append dir "/include")
2310 (string-append out "/include"))
2311 (symlink (string-append dir "/lib")
2312 (string-append out "/lib")))
2313 #t))
6c03d15d
TGR
2314 (add-after 'install-links 'python:wrap
2315 (assoc-ref python:%standard-phases 'wrap))
2316 (add-after 'python:wrap 'wrap-with-python-interpreter
2317 (lambda* (#:key outputs #:allow-other-keys)
2318 (let ((out (assoc-ref outputs "out")))
2319 (wrap-program (string-append out "/bin/" ,grassxx)
2320 `("GRASS_PYTHON" = (,(which "python3"))))
2321 #t))))))
9fce5914
GLV
2322 (synopsis "GRASS Geographic Information System")
2323 (description
2324 "GRASS (Geographic Resources Analysis Support System), is a Geographic
2325Information System (GIS) software suite used for geospatial data management and
2326analysis, image processing, graphics and maps production, spatial modeling, and
2327visualization.")
2328 (home-page "https://grass.osgeo.org/")
2329 (license license:gpl2+))))
f7ac2fe1
GLV
2330
2331(define-public saga
2332 (package
2333 (name "saga")
4f5babf9 2334 (version "8.2.1")
f7ac2fe1
GLV
2335 (source
2336 (origin
2337 (method url-fetch)
2338 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
2339 (version-major version) "/SAGA%20-%20" version
2340 "/saga-" version ".tar.gz"))
2341 (sha256
4f5babf9
FG
2342 (base32 "008izjs6gvj09abxf16ssl1xy0ay3ljq4jswbggp6wiiq459minv"))))
2343 (build-system cmake-build-system)
f7ac2fe1 2344 (native-inputs
8394619b 2345 (list pkg-config swig))
f7ac2fe1 2346 (inputs
8394619b
LC
2347 (list curl
2348 fftw
2349 gdal
2350 hdf5
2351 jasper
2352 libharu
2353 libtiff
2354 opencv
2355 postgresql
2356 proj
2357 python
2358 qhull
2359 unixodbc
2360 vigra
2361 wxwidgets))
f7ac2fe1 2362 (arguments
4f5babf9
FG
2363 '(#:tests? #f
2364 #:phases
2365 (modify-phases %standard-phases
2366 (add-before 'configure 'cd-to-source-dir
2367 (lambda _
2368 (chdir "saga-gis"))))))
f7ac2fe1
GLV
2369 (synopsis "System for Automated Geoscientific Analyses")
2370 (description
2371 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
2372Information System (GIS) software. It has been designed for an easy and
2373effective implementation of spatial algorithms and it offers a comprehensive,
2374growing set of geoscientific methods.")
2375 (home-page "http://www.saga-gis.org")
2376 (license (list license:gpl2+ license:lgpl2.1+))))
151f3d41
GLV
2377
2378(define-public qgis
2379 (package
2380 (name "qgis")
4cd8bab7 2381 (version "3.16.3")
151f3d41
GLV
2382 (source
2383 (origin
2384 (method url-fetch)
2385 (uri (string-append "https://qgis.org/downloads/qgis-"
2386 version ".tar.bz2"))
2387 (sha256
4cd8bab7 2388 (base32 "012dv8dcg7w4lf6k37i41wialwhi0kpkxw2dnq19yqqk35632mzx"))))
151f3d41
GLV
2389 (build-system cmake-build-system)
2390 (arguments
2391 `(#:modules ((guix build cmake-build-system)
2392 ((guix build python-build-system) #:prefix python:)
2393 (guix build qt-utils)
2394 (guix build utils))
2395 #:imported-modules (,@%cmake-build-system-modules
2396 (guix build python-build-system)
2397 (guix build qt-utils))
4235c6ee
LF
2398 #:configure-flags
2399 '("-DWITH_QTWEBKIT=NO")
151f3d41
GLV
2400 #:phases
2401 (modify-phases %standard-phases
2402 ;; Configure correct path to PyQt5 SIP directory
2403 (add-after 'unpack 'configure-pyqt5-sip-path
2404 (lambda* (#:key inputs #:allow-other-keys)
4cd8bab7
GLV
2405 (substitute* "cmake/FindPyQt5.py"
2406 (("sip_dir = cfg.default_sip_dir")
2407 (string-append "sip_dir = \""
2408 (assoc-ref inputs "python-pyqt+qscintilla")
c990604c
BT
2409 "/share/sip\""))
2410 ;; Fix building with python-sip@5.
2411 ;;
2412 ;; The reason for this is that python-sip@5 introduces some
2413 ;; changes such as a new build system 'sip-build' as well as the
2414 ;; use of the path "/lib/pythonX.X/site-packages/*/bindings/"
2415 ;; instead of "/share/sip/" for .sip files. However, we do not
2416 ;; actually use that those yet. QGIS detects SIP5 and assumes we
2417 ;; are, messing up the build. The long term solution is to fully
2418 ;; upgrade SIP, use sip-build and fix all failing packages, but
2419 ;; for now I just want to get the build working.
2420 ((".pyqt_sip_dir...os.path.join.*,")
2421 (string-append "'pyqt_sip_dir': \""
2422 (assoc-ref inputs "python-pyqt+qscintilla")
2423 "/share/sip" "\",")))
4cd8bab7
GLV
2424 (substitute* (list "scripts/prepare_commit.sh"
2425 "scripts/qstringfixup.sh"
2426 "scripts/release.pl"
2427 "scripts/runtests_local_travis_config.sh"
151f3d41
GLV
2428 "scripts/sip_include.sh"
2429 "scripts/sipdiff"
2430 "scripts/sipify_all.sh"
2431 "scripts/spell_check/check_spelling.sh"
2432 "scripts/spell_check/spell_test.sh"
4cd8bab7 2433 "scripts/verify_indentation.sh"
151f3d41
GLV
2434 "tests/code_layout/test_banned_keywords.sh"
2435 "tests/code_layout/test_licenses.sh"
2436 "tests/code_layout/test_shellcheck.sh"
2437 "tests/code_layout/test_sip_include.sh"
4cd8bab7 2438 "tests/code_layout/test_sipfiles.sh"
151f3d41
GLV
2439 "tests/code_layout/test_sipify.sh")
2440 (("\\$\\(git rev-parse --show-toplevel\\)")
2441 (getcwd)))
2442 (substitute* "tests/code_layout/test_sip_include.sh"
2443 (("^REV=.*") "REV=currentrev\n"))
2444 #t))
2445 (replace 'check
4235c6ee
LF
2446 (lambda* (#:key inputs tests? #:allow-other-keys)
2447 (when tests?
151f3d41 2448 (setenv "HOME" "/tmp")
07e98fb9 2449 (system "Xvfb :1 &")
151f3d41
GLV
2450 (setenv "DISPLAY" ":1")
2451 (setenv "TRAVIS" "true")
2452 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2453 (invoke "ctest"
2454 "-E" (string-join
2455 '(;; Disable tests that require network access
2456 "qgis_filedownloader"
2457 ;; TODO: Find why the following tests fail
151f3d41
GLV
2458 "ProcessingGdalAlgorithmsRasterTest"
2459 "ProcessingGdalAlgorithmsVectorTest"
2460 "ProcessingGrass7AlgorithmsImageryTest"
2461 "ProcessingGrass7AlgorithmsRasterTest"
2462 "ProcessingGrass7AlgorithmsVectorTest"
2463 "ProcessingOtbAlgorithmsTest"
4cd8bab7
GLV
2464 "ProcessingQgisAlgorithmsTestPt1"
2465 "ProcessingQgisAlgorithmsTestPt2"
2466 "ProcessingQgisAlgorithmsTestPt3"
2467 "ProcessingQgisAlgorithmsTestPt4"
151f3d41 2468 "PyCoreAdittions"
151f3d41 2469 "PyQgsAnnotation"
4cd8bab7 2470 "PyQgsAppStartup"
706c7a7a 2471 "PyQgsAuthBasicMethod"
151f3d41 2472 "PyQgsAuthenticationSystem"
4cd8bab7
GLV
2473 "PyQgsAuxiliaryStorage"
2474 "PyQgsDBManagerGpkg"
2475 "PyQgsDBManagerSpatialite"
2476 "PyQgsDataItem"
2477 "PyQgsFieldValidator"
151f3d41
GLV
2478 "PyQgsFileUtils"
2479 "PyQgsGeometryTest"
2480 "PyQgsImageCache"
4cd8bab7
GLV
2481 "PyQgsImportIntoPostGIS"
2482 "PyQgsLayerDependencies"
0213f094
GLV
2483 "PyQgsLayerMetadata"
2484 "PyQgsLayout"
151f3d41 2485 "PyQgsLayoutExporter"
4cd8bab7 2486 "PyQgsLayoutHtml"
151f3d41 2487 "PyQgsLayoutLegend"
4cd8bab7 2488 "PyQgsLayoutMapGrid"
23674690 2489 "PyQgsMapClippingUtils"
151f3d41 2490 "PyQgsMapLayer"
4cd8bab7
GLV
2491 "PyQgsMetadataBase"
2492 "PyQgsOGRProvider"
151f3d41 2493 "PyQgsOGRProviderGpkg"
4cd8bab7 2494 "PyQgsOapifProvider"
151f3d41 2495 "PyQgsPalLabelingLayout"
23674690 2496 "PyQgsProcessingInPlace"
4cd8bab7 2497 "PyQgsProject"
151f3d41 2498 "PyQgsProviderConnectionGpkg"
4cd8bab7
GLV
2499 "PyQgsProviderConnectionPostgres"
2500 "PyQgsProviderConnectionSpatialite"
2501 "PyQgsPythonProvider"
2502 "PyQgsRasterLayer"
afc74449 2503 "PyQgsRasterResampler"
4cd8bab7
GLV
2504 "PyQgsRulebasedRenderer"
2505 "PyQgsSelectiveMasking"
2506 "PyQgsSettings"
151f3d41 2507 "PyQgsShapefileProvider"
4cd8bab7 2508 "PyQgsSpatialiteProvider"
151f3d41 2509 "PyQgsSvgCache"
4cd8bab7 2510 "PyQgsSymbolExpressionVariables"
151f3d41 2511 "PyQgsTextRenderer"
151f3d41
GLV
2512 "PyQgsVectorFileWriter"
2513 "PyQgsVectorLayer"
2514 "PyQgsVectorLayerUtils"
2515 "PyQgsVirtualLayerProvider"
2516 "PyQgsWFSProvider"
4cd8bab7
GLV
2517 "qgis_arcgisrestutilstest"
2518 "qgis_authmanagertest"
2519 "qgis_compositionconvertertest"
2520 "qgis_coordinatereferencesystemtest"
2521 "qgis_expressiontest"
2522 "qgis_fontmarkertest"
151f3d41 2523 "qgis_geometrycheckstest"
4cd8bab7
GLV
2524 "qgis_geometrytest"
2525 "qgis_gpsinformationwidget"
2526 "qgis_grassprovidertest7"
2527 "qgis_imagecachetest"
2528 "qgis_labelingenginetest"
2529 "qgis_layouthtmltest"
4235c6ee 2530 "qgis_layoutlabeltest"
4cd8bab7
GLV
2531 "qgis_layoutmanualtabletest"
2532 "qgis_layoutmapgridtest"
23674690 2533 "qgis_layoutmapoverviewtest"
4cd8bab7 2534 "qgis_layoutmaptest"
4235c6ee 2535 "qgis_layoutmultiframetest"
4cd8bab7
GLV
2536 "qgis_layoutpicturetest"
2537 "qgis_layouttabletest"
4235c6ee 2538 "qgis_layouttest"
4cd8bab7
GLV
2539 "qgis_mapdevicepixelratiotest"
2540 "qgis_maprendererjobtest"
23674690 2541 "qgis_meshcontourstest"
4cd8bab7
GLV
2542 "qgis_ogrproviderguitest"
2543 "qgis_painteffecttest"
2544 "qgis_pallabelingtest"
2545 "qgis_processingtest"
2546 "qgis_rasterlayertest"
151f3d41 2547 "qgis_shellcheck"
151f3d41 2548 "qgis_sip_include"
4cd8bab7
GLV
2549 "qgis_sip_uptodate"
2550 "qgis_sipify"
2551 "qgis_styletest"
2552 "qgis_svgmarkertest"
2553 "qgis_taskmanagertest"
2554 "qgis_wcsprovidertest"
23674690
FG
2555 "qgis_ziplayertest"
2556 "TestQgsRandomMarkerSymbolLayer")
4235c6ee 2557 "|")))))
151f3d41
GLV
2558 (add-after 'install 'wrap-python
2559 (assoc-ref python:%standard-phases 'wrap))
2560 (add-after 'wrap-python 'wrap-qt
7e24e1e5
HG
2561 (lambda* (#:key outputs inputs #:allow-other-keys)
2562 (let ((out (assoc-ref outputs "out")))
2563 (wrap-qt-program "qgis" #:output out #:inputs inputs))
5ef1b175
GLV
2564 #t))
2565 (add-after 'wrap-qt 'wrap-gis
2566 (lambda* (#:key inputs outputs #:allow-other-keys)
5e686e0a
GLV
2567 ;; TODO: Find if there is a way to get SAGA to work.
2568 ;; Currently QGIS says "version of SAGA not supported".
2569 ;; Disable it for now.
5ef1b175 2570 (let* ((out (assoc-ref outputs "out"))
5e686e0a 2571 ;;(saga (string-append (assoc-ref inputs "saga") "/bin"))
5ef1b175
GLV
2572 (grass-version ,(package-version grass))
2573 (grass-majorminor (string-join
2574 (list-head
2575 (string-split grass-version #\.) 2)
2576 ""))
2577 (grass (string-append (assoc-ref inputs "grass")
2578 "/grass" grass-majorminor)))
2579 (wrap-program (string-append out "/bin/qgis")
5e686e0a 2580 ;;`("PATH" ":" prefix (,saga))
5ef1b175
GLV
2581 `("QGIS_PREFIX_PATH" = (,out))
2582 `("GISBASE" = (,grass))))
151f3d41
GLV
2583 #t)))))
2584 (inputs
8394619b
LC
2585 (list exiv2
2586 expat
2587 gdal
2588 geos
2589 gpsbabel
2590 grass
2591 gsl
2592 hdf5
2593 libspatialindex
2594 libspatialite
2595 libxml2
2596 libzip
2597 netcdf
2598 postgresql
2599 proj
2600 protobuf
2601 python
2602 python-chardet
2603 python-dateutil
2604 python-future
2605 python-gdal
2606 python-jinja2
2607 python-numpy
2608 python-owslib
2609 python-psycopg2
2610 python-pygments
2611 python-pyqt+qscintilla
2612 python-pytz
2613 python-pyyaml
2614 python-requests
2615 python-sip
2616 python-six
2617 python-urllib3
2618 qca
2619 qscintilla
2620 qtbase-5
735d340a 2621 qtdeclarative-5
8394619b
LC
2622 qtkeychain
2623 qtlocation
2624 qtserialport
1ef04fb2 2625 qtsvg-5
8394619b
LC
2626 qwt
2627 ;;("saga" ,saga)
2628 sqlite))
151f3d41 2629 (native-inputs
8394619b
LC
2630 (list bison
2631 flex
2632 perl
2633 perl-yaml-tiny
2634 pkg-config
2635 python-mock
2636 python-nose2
eef8e2ec 2637 qttools-5
8394619b
LC
2638 shellcheck
2639 xorg-server-for-tests))
151f3d41
GLV
2640 (home-page "https://qgis.org")
2641 (synopsis "Geographical information system")
2642 (description "QGIS is an easy to use Geographical Information
2643System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2644raster and vector data formats, with new support easily added using the plugin
2645architecture.")
2646 (license
2647 (list
2648 license:asl1.1
2649 license:asl2.0
2650 license:bsd-2
2651 license:bsd-3
2652 license:boost1.0
2653 license:cc-by3.0
2654 license:cc-by4.0
2655 license:cc-by-sa3.0
2656 license:cc-by-sa4.0
2657 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2658 (license:fsf-free "file://debian/copyright" "Go Squared")
2659 license:expat
2660 license:fdl1.2+
2661 (license:fsf-free
2662 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2663 (license:fsf-free
2664 "file://debian/copyright"
2665 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2666 license:gpl2
2667 license:gpl2+
2668 license:gpl3
2669 license:gpl3+
2670 license:isc
2671 license:lgpl2.0+
2672 license:lgpl2.1
2673 license:lgpl2.1+
2674 license:lgpl3
2675 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2676 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2677 (license:non-copyleft
2678 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2679 "NCL Source Code License")
2680 license:ogl-psi1.0
2681 license:opl1.0+
2682 license:public-domain
2683 license:qwt1.0))))
ff1233d8
EF
2684
2685(define-public python-geographiclib
2686 (package
2687 (name "python-geographiclib")
2688 (version "1.50")
2689 (source
2690 (origin
2691 (method url-fetch)
2692 (uri (pypi-uri "geographiclib" version))
2693 (sha256
2694 (base32
2695 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2696 (build-system python-build-system)
2697 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2698 (synopsis "Python geodesic routines from GeographicLib")
2699 (description
2700 "This is a python implementation of the geodesic routines in GeographicLib.")
2701 (license license:expat)))
481b0923
EF
2702
2703(define-public python-geopy
2704 (package
2705 (name "python-geopy")
2706 (version "2.0.0")
2707 (source
2708 (origin
2709 (method url-fetch)
2710 (uri (pypi-uri "geopy" version))
2711 (sha256
2712 (base32
2713 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2714 (build-system python-build-system)
2715 (propagated-inputs
8394619b 2716 (list python-geographiclib))
481b0923 2717 (native-inputs
8394619b
LC
2718 (list python-async-generator
2719 python-coverage
2720 python-flake8
2721 python-isort
2722 python-pytest
2723 python-pytest-aiohttp
2724 python-readme-renderer
2725 python-pytz))
481b0923
EF
2726 (home-page "https://github.com/geopy/geopy")
2727 (synopsis "Geocoding library for Python")
2728 (description "@code{geopy} is a Python client for several popular geocoding
2729web services. @code{geopy} makes it easy for Python developers to locate the
2730coordinates of addresses, cities, countries, and landmarks across the globe
2731using third-party geocoders and other data sources.")
2732 (license license:expat)))
769326cf 2733
08326f3d
JL
2734(define-public gplates
2735 (package
2736 (name "gplates")
9f1713f2
MB
2737 ;; Note: use a pre-release to cope with newer Boost, ref
2738 ;; https://discourse.gplates.org/t/compilation-error-with-boost-1-77/452/3
2739 (version "2.3.01-beta.3")
08326f3d
JL
2740 (source (origin
2741 (method url-fetch)
9f1713f2
MB
2742 (uri "https://cloudstor.aarnet.edu.au/plus/s\
2743/ojsYNOyUYE3evNp/download?path=%2F&files=gplates_2.3.1-beta.3_src.zip")
2744 (file-name (string-append name "-" version ".zip"))
08326f3d
JL
2745 (sha256
2746 (base32
9f1713f2 2747 "06i87dfab0cq9gdi5mh6sf9wigawpp0d05zbyslv910443i26gwv"))))
08326f3d
JL
2748 (build-system cmake-build-system)
2749 (arguments
2750 `(#:configure-flags (list "-DBoost_NO_BOOST_CMAKE=ON")
9f1713f2
MB
2751 #:tests? #f)) ;no test target
2752 (native-inputs
2753 (list unzip)) ;for the beta
08326f3d 2754 (inputs
9f1713f2
MB
2755 (list boost
2756 cgal
2757 gdal
2758 glew
2759 glu
2760 gmp
2761 mesa
2762 mpfr
2763 proj
2764 python-3
2765 python-numpy
2766 qtbase-5
1ef04fb2 2767 qtsvg-5
9f1713f2
MB
2768 qtxmlpatterns
2769 qwt
2770 zlib))
08326f3d
JL
2771 (home-page "https://www.gplates.org")
2772 (synopsis "Plate tectonics simulation program")
2773 (description "GPlates is a plate tectonics program. Manipulate
2774reconstructions of geological and paleogeographic features through geological
2775time. Interactively visualize vector, raster and volume data.")
2776 (license license:gpl2+)))