Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / geo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31 (define-module (gnu packages geo)
32 #:use-module (guix build-system ant)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system glib-or-gtk)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system go)
37 #:use-module (guix build-system meson)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system qt)
40 #:use-module (guix build-system scons)
41 #:use-module (guix build-system r)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix svn-download)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix utils)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages astronomy)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages databases)
55 #:use-module (gnu packages datastructures)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages fonts)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages image)
63 #:use-module (gnu packages icu4c)
64 #:use-module (gnu packages java)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages pcre)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages protobuf)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-web)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages sqlite)
76 #:use-module (gnu packages web)
77 #:use-module (gnu packages webkit)
78 #:use-module (gnu packages wxwidgets)
79 #:use-module (gnu packages xml))
80
81 (define-public geos
82 (package
83 (name "geos")
84 (version "3.8.0")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "http://download.osgeo.org/geos/geos-"
88 version
89 ".tar.bz2"))
90 (sha256
91 (base32
92 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
93 (build-system gnu-build-system)
94 (arguments `(#:phases
95 (modify-phases %standard-phases
96 (add-after
97 'unpack 'patch-test-shebangs
98 (lambda _
99 (substitute* '("tests/xmltester/testrunner.sh"
100 "tests/geostest/testrunner.sh")
101 (("/bin/sh") (which "sh")))
102 #t)))))
103 (inputs
104 `(("glib" ,glib)))
105 (home-page "https://geos.osgeo.org/")
106 (synopsis "Geometry Engine for Geographic Information Systems")
107 (description
108 "GEOS provides a spatial object model and fundamental geometric
109 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
110 it aims to contain the complete functionality of JTS in C++. This
111 includes all the OpenGIS Simple Features for SQL spatial predicate
112 functions and spatial operators, as well as specific JTS enhanced
113 topology functions.")
114 (license (list license:lgpl2.1+ ; Main distribution.
115 license:zlib ; tests/xmltester/tinyxml/*
116 license:public-domain)))) ; include/geos/timeval.h
117
118 (define-public gnome-maps
119 (package
120 (name "gnome-maps")
121 (version "3.32.2.1")
122 (source (origin
123 (method url-fetch)
124 (uri (string-append "mirror://gnome/sources/" name "/"
125 (version-major+minor version) "/"
126 name "-" version ".tar.xz"))
127 (sha256
128 (base32
129 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
130 (build-system meson-build-system)
131 (arguments
132 `(#:glib-or-gtk? #t
133 #:phases
134 (modify-phases %standard-phases
135 (add-after 'unpack 'skip-gtk-update-icon-cache
136 ;; Don't create 'icon-theme.cache'.
137 (lambda _
138 (substitute* "meson_post_install.py"
139 (("gtk-update-icon-cache") "true"))
140 #t))
141 (add-after 'install 'wrap
142 (lambda* (#:key inputs outputs #:allow-other-keys)
143 (let ((out (assoc-ref outputs "out"))
144 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
145 (geocode-glib-path (string-append
146 (assoc-ref inputs "geocode-glib")
147 "/lib"))
148 (goa-path (string-append
149 (assoc-ref inputs "gnome-online-accounts:lib")
150 "/lib"))
151 (gdk-pixbuf-path (string-append
152 (assoc-ref inputs "gdk-pixbuf")
153 "/lib"))
154 (webkitgtk-path (string-append
155 (assoc-ref inputs "webkitgtk")
156 "/lib")))
157 (wrap-program (string-append out "/bin/gnome-maps")
158 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
159
160 ;; There seems to be no way to embed the path of
161 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
162 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
163 ;; libgeocode-glib.so.0
164 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
165 ,webkitgtk-path
166 ,gdk-pixbuf-path
167 ,geocode-glib-path)))
168 #t))))))
169 (native-inputs
170 `(("gobject-introspection" ,gobject-introspection)
171 ("intltool" ,intltool)
172 ("pkg-config" ,pkg-config)))
173 (inputs
174 `(("folks" ,folks)
175 ("libchamplain" ,libchamplain)
176 ("libgee" ,libgee)
177 ("libsecret" ,libsecret)
178 ("libsoup" ,libsoup)
179 ("libgweather" ,libgweather)
180 ("libxml2" ,libxml2)
181 ("gdk-pixbuf" ,gdk-pixbuf+svg)
182 ("glib-networking" ,glib-networking)
183 ("geoclue" ,geoclue)
184 ("geocode-glib" ,geocode-glib)
185 ("gfbgraph" ,gfbgraph)
186 ("gjs" ,gjs)
187 ("glib" ,glib)
188 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
189 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
190 ("rest" ,rest)
191 ("webkitgtk" ,webkitgtk)))
192 (propagated-inputs
193 `(("gtk+3" ,gtk+)))
194 (synopsis "Graphical map viewer and wayfinding program")
195 (description "GNOME Maps is a graphical map viewer. It uses map data from
196 the OpenStreetMap project. It can provide directions for walking, bicycling,
197 and driving.")
198 (home-page "https://wiki.gnome.org/Apps/Maps")
199 (license license:gpl2+)))
200
201 (define-public libgaiagraphics
202 (package
203 (name "libgaiagraphics")
204 (version "0.5")
205 (source
206 (origin
207 (method url-fetch)
208 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
209 version ".tar.gz"))
210 (sha256
211 (base32
212 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
213 (build-system gnu-build-system)
214 (native-inputs
215 `(("pkg-config" ,pkg-config)))
216 (inputs
217 `(("cairo" ,cairo)
218 ("libpng" ,libpng)
219 ("libjpeg-turbo" ,libjpeg-turbo)
220 ("libtiff" ,libtiff)
221 ("libgeotiff" ,libgeotiff)
222 ("proj.4" ,proj.4)
223 ("libxml2" ,libxml2)
224 ("zlib" ,zlib)))
225 (synopsis "Gaia common graphics support")
226 (description "libgaiagraphics is a library supporting
227 common-utility raster handling methods.")
228 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
229 (license license:lgpl3+)))
230
231 (define-public libgeotiff
232 (package
233 (name "libgeotiff")
234 (version "1.5.1")
235 (source
236 (origin
237 (method url-fetch)
238 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
239 version ".tar.gz"))
240 (patches (search-patches
241 ;; See libgeotiff 1.5.1 issue
242 ;; https://github.com/OSGeo/libgeotiff/issues/22
243 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
244 (sha256
245 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
246 (modules '((guix build utils)))
247 (snippet
248 '(begin
249 ;; Remove .csv files, distributed from EPSG under a restricted
250 ;; license. See LICENSE for full license text.
251 (for-each delete-file (find-files "." "\\.csv$"))
252 #t))))
253 (build-system gnu-build-system)
254 (inputs
255 `(("libjpeg-turbo" ,libjpeg-turbo)
256 ("libtiff" ,libtiff)
257 ("zlib" ,zlib)))
258 (propagated-inputs
259 `(;; libgeotiff headers include proj headers, so ensure those are available.
260 ("proj" ,proj)))
261 (arguments
262 `(#:configure-flags
263 (list "--disable-static"
264 "--with-zlib" "--with-jpeg"
265 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
266 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
267 (description "libgeotiff is a library on top of libtiff for reading and
268 writing GeoTIFF information tags.")
269 (home-page "https://trac.osgeo.org/geotiff/")
270 ;; This is a mixture of various contributions under different licenses.
271 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
272 ;; states, as its commercial redistribution is restricted. Hence, we have
273 ;; removed it from the package.
274 (license (list license:public-domain
275 license:x11
276 license:bsd-3
277 (license:non-copyleft "file://LICENSE"
278 "See LICENSE in the distribution.")))))
279
280 (define-public libspatialite
281 (package
282 (name "libspatialite")
283 (version "4.3.0a")
284 (source
285 (origin
286 (method url-fetch)
287 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
288 version ".tar.gz"))
289 (sha256
290 (base32
291 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
292 (build-system gnu-build-system)
293 (native-inputs
294 `(("pkg-config" ,pkg-config)))
295 (inputs
296 `(("freexl" ,freexl)
297 ("geos" ,geos)
298 ("libxml2" ,libxml2)
299 ("proj.4" ,proj.4)
300 ("sqlite" ,sqlite)
301 ("zlib" ,zlib)))
302 (arguments
303 `(#:phases
304 (modify-phases %standard-phases
305 ;; 3 tests are failing, ignore them:
306 (add-after 'unpack 'ignore-broken-tests
307 (lambda _
308 (substitute* '("test/Makefile.in")
309 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
310 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
311 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
312 #t)))))
313 (synopsis "Extend SQLite to support Spatial SQL capabilities")
314 (description
315 "SpatiaLite is a library intended to extend the SQLite core to support
316 fully fledged Spatial SQL capabilities.")
317 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
318 ;; For the genuine libspatialite-sources holds:
319 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
320 ;; Files under src/control_points are from GRASS
321 ;; and are licensed under GPL2+ only.
322 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
323 (license (list license:gpl2+
324 license:lgpl2.1+
325 license:mpl1.1
326 license:public-domain))))
327
328 (define-public proj
329 (package
330 (name "proj")
331 (version "6.3.1")
332 (source
333 (origin
334 (method url-fetch)
335 (uri (string-append "http://download.osgeo.org/proj/proj-"
336 version ".tar.gz"))
337 (sha256
338 (base32
339 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
340 (build-system gnu-build-system)
341 (inputs
342 `(("sqlite" ,sqlite)))
343 (native-inputs
344 `(("pkg-config" ,pkg-config)))
345 (home-page "https://proj.org/")
346 (synopsis "Coordinate transformation software")
347 (description
348 "Proj is a generic coordinate transformation software that transforms
349 geospatial coordinates from one coordinate reference system (CRS) to another.
350 This includes cartographic projections as well as geodetic transformations.
351 PROJ includes command line applications for easy conversion of coordinates
352 from text files or directly from user input. In addition, proj also exposes
353 an application programming interface that lets developers use the
354 functionality of proj in their own software.")
355 (license (list license:expat
356 ;; src/projections/patterson.cpp
357 license:asl2.0
358 ;; src/geodesic.*, src/tests/geodtest.cpp
359 license:x11))))
360
361 (define-public proj.4
362 (package
363 (name "proj.4")
364 (version "4.9.3")
365 (source (origin
366 (method url-fetch)
367 (uri (string-append "http://download.osgeo.org/proj/proj-"
368 version ".tar.gz"))
369 (sha256
370 (base32
371 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
372 (build-system gnu-build-system)
373 (arguments
374 `(#:phases
375 (modify-phases %standard-phases
376 (add-after 'unpack 'patch-test-paths
377 (lambda _
378 (substitute* '("nad/test27"
379 "nad/test83"
380 "nad/testvarious"
381 "nad/testdatumfile"
382 "nad/testflaky"
383 "nad/testIGNF")
384 (("/bin/rm") (which "rm")))
385 #t))
386 ;; Precision problems on i686 and other platforms. See:
387 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
388 ;; Disable failing test.
389 (add-after 'patch-test-paths 'ignore-failing-tests
390 (lambda _
391 (substitute* '("nad/Makefile.in")
392 (("\tPROJ_LIB.*" all) (string-append "#" all)))
393 #t)))))
394 (inputs
395 `(("glib" ,glib)))
396 (home-page "https://proj.org/")
397 (synopsis "Cartographic Projections Library")
398 (description
399 "Proj.4 is a library for converting coordinates between cartographic
400 projections.")
401 (license (list license:expat
402 ;; src/PJ_patterson.c
403 license:asl2.0
404 ;; src/geodesic.c/h
405 license:x11
406 ;; Embedded EPSG database.
407 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
408 ;; cmake/*
409 license:boost1.0))))
410
411 (define-public mapnik
412 (package
413 (name "mapnik")
414 (version "3.0.18")
415 (source
416 (origin
417 (method url-fetch)
418 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
419 version "/mapnik-v" version ".tar.bz2"))
420 (sha256
421 (base32
422 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
423 (build-system scons-build-system)
424 (inputs
425 `(("boost" ,boost)
426 ("cairo" ,cairo)
427 ("freetype" ,freetype)
428 ("harfbuzz" ,harfbuzz)
429 ("icu4c" ,icu4c)
430 ("libjpeg-turbo" ,libjpeg-turbo)
431 ("libpng" ,libpng)
432 ("libtiff" ,libtiff)
433 ("libwebp" ,libwebp)
434 ("libxml2" ,libxml2)
435 ("proj.4" ,proj.4)
436 ("sqlite" ,sqlite)
437 ("zlib" ,zlib)))
438 (native-inputs
439 `(("pkg-config" ,pkg-config)))
440 (arguments
441 `(#:scons ,scons-python2
442 #:scons-flags
443 (list "CC=gcc"
444 (string-append "PREFIX=" %output)
445 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
446 (home-page "https://mapnik.org/")
447 (synopsis "Toolkit for developing mapping applications")
448 (description "Mapnik is a toolkit for developing mapping applications. It
449 is basically a collection of geographic objects like maps, layers,
450 datasources, features, and geometries. At its core is a C++ shared library
451 providing algorithms and patterns for spatial data access and visualization.
452 The library does not rely on any specific windowing system and can be deployed
453 to any server environment. It is intended to play fair in a multi-threaded
454 environment and is aimed primarily, but not exclusively, at web-based
455 development.")
456 (license (list license:lgpl2.1+
457 ;; demo/viewer, demo/python/rundemo.py
458 license:gpl2+
459 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
460 license:boost1.0
461 ;; deps/mapnik/sparsehash
462 license:bsd-3
463 ;; deps/agg
464 (license:non-copyleft "file://deps/agg/copying")))))
465
466 (define-public python2-mapnik
467 (package
468 (name "python2-mapnik")
469 (version "3.0.16")
470 (source
471 (origin
472 (method url-fetch)
473 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
474 version ".tar.gz"))
475 (file-name (string-append name "-" version ".tar.gz"))
476 (sha256
477 (base32
478 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
479 (build-system python-build-system)
480 (inputs
481 `(("boost" ,boost)
482 ("harfbuzz" ,harfbuzz)
483 ("icu4c" ,icu4c)
484 ("libjpeg-turbo" ,libjpeg-turbo)
485 ("libpng" ,libpng)
486 ("libtiff" ,libtiff)
487 ("libwebp" ,libwebp)
488 ("mapnik" ,mapnik)
489 ("proj.4" ,proj.4)
490 ("python2-pycairo" ,python2-pycairo)))
491 (native-inputs
492 (let ((test-data-input
493 (lambda (repository version hash)
494 (origin
495 (method url-fetch)
496 (uri (string-append "https://github.com/mapnik/" repository
497 "/archive/v" version ".tar.gz"))
498 (file-name (string-append "python-mapnik-" repository
499 "-" version ".tar.gz"))
500 (sha256 (base32 hash))))))
501 `(("python2-nose" ,python2-nose)
502 ;; Test data is released as separate tarballs
503 ("test-data"
504 ,(test-data-input "test-data" "3.0.18"
505 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
506 ("test-data-visual"
507 ,(test-data-input "test-data-visual" "3.0.18"
508 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
509 (arguments
510 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
511 #:phases
512 (modify-phases %standard-phases
513 ;; Unpack test data into the source tree
514 (add-after 'unpack 'unpack-submodules
515 (lambda* (#:key inputs #:allow-other-keys)
516 (let ((unpack (lambda (source target)
517 (with-directory-excursion target
518 (invoke "tar" "xvf" (assoc-ref inputs source)
519 "--strip-components=1")))))
520 (unpack "test-data" "test/data")
521 (unpack "test-data-visual" "test/data-visual"))))
522 ;; Skip failing tests
523 (add-after 'unpack 'skip-tests
524 (lambda _
525 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
526 "test_unicode_regex_replace"
527 "test_proj_antimeridian_bbox"
528 "test_render_with_scale_factor")))
529 (substitute* "setup.cfg"
530 (("\\[nosetests\\]" all)
531 (string-append all "\nexclude=^("
532 (string-join skipped-tests "|") ")$")))))))))
533 (home-page "https://github.com/mapnik/python-mapnik")
534 (synopsis "Python bindings for Mapnik")
535 (description "This package provides Python bindings for Mapnik.")
536 (license license:lgpl2.1+)))
537
538 (define-public spatialite-gui
539 (package
540 (name "spatialite-gui")
541 (version "1.7.1")
542 (source
543 (origin
544 (method url-fetch)
545 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
546 version ".tar.gz"))
547 (sha256
548 (base32
549 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
550 (build-system gnu-build-system)
551 (native-inputs
552 `(("pkg-config" ,pkg-config)))
553 (inputs
554 `(("freexl" ,freexl)
555 ("geos" ,geos)
556 ("libgaiagraphics" ,libgaiagraphics)
557 ("libjpeg-turbo" ,libjpeg-turbo)
558 ("libspatialite" ,libspatialite)
559 ("libxml2" ,libxml2)
560 ("proj.4" ,proj.4)
561 ("sqlite" ,sqlite)
562 ("wxwidgets" ,wxwidgets-2)
563 ("zlib" ,zlib)))
564 (synopsis "Graphical user interface for SpatiaLite")
565 (description "Spatialite-gui provides a visual interface for viewing and
566 maintaining a spatialite database. You can easily see the structure of the
567 tables and data contents using point and click functions, many of which
568 construct common SQL queries, or craft your own SQL queries.")
569 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
570 (license license:gpl3+)))
571
572 (define-public gdal
573 (package
574 (name "gdal")
575 (version "3.0.4")
576 (source (origin
577 (method url-fetch)
578 (uri (string-append
579 "http://download.osgeo.org/gdal/" version "/gdal-"
580 version ".tar.gz"))
581 (sha256
582 (base32
583 "10symyajj1b7j98f889lqxxbmhcyvlhq9gg0l42h69bv22wx45gw"))
584 (modules '((guix build utils)))
585 (snippet
586 `(begin
587 ;; TODO: frmts contains a lot more bundled code.
588 (for-each delete-file-recursively
589 ;; bundled code
590 '("frmts/png/libpng"
591 "frmts/gif/giflib"
592 "frmts/jpeg/libjpeg"
593 "frmts/jpeg/libjpeg12"
594 "frmts/gtiff/libtiff"
595 "frmts/gtiff/libgeotiff"
596 "frmts/zlib"
597 "ogr/ogrsf_frmts/geojson/libjson"))))))
598 (build-system gnu-build-system)
599 (arguments
600 `(#:tests? #f
601 #:configure-flags
602 (let-syntax ((with (syntax-rules ()
603 ((_ option input)
604 (string-append option "="
605 (assoc-ref %build-inputs input))))))
606 (list
607 ;; TODO: --with-pcidsk, --with-pcraster
608 (with "--with-freexl" "freexl")
609 (with "--with-libjson-c" "json-c")
610 (with "--with-png" "libpng")
611 (with "--with-webp" "libwebp")
612 (with "--with-gif" "giflib")
613 (with "--with-jpeg" "libjpeg-turbo")
614 (with "--with-libtiff" "libtiff")
615 (with "--with-geotiff" "libgeotiff")
616 (with "--with-libz" "zlib")
617 (with "--with-expat" "expat")
618 (with "--with-sqlite3" "sqlite")
619 "--with-pcre"))
620 #:phases
621 (modify-phases %standard-phases
622 (add-before 'build 'fix-path
623 (lambda _
624 (substitute* "frmts/mrf/mrf_band.cpp"
625 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
626 (inputs
627 `(("expat" ,expat)
628 ("freexl" ,freexl)
629 ("geos" ,geos)
630 ("giflib" ,giflib)
631 ("json-c" ,json-c)
632 ("libgeotiff" ,libgeotiff)
633 ("libjpeg-turbo" ,libjpeg-turbo)
634 ("libpng" ,libpng)
635 ("libtiff" ,libtiff)
636 ("libwebp" ,libwebp)
637 ("netcdf" ,netcdf)
638 ("pcre" ,pcre)
639 ("proj" ,proj)
640 ("sqlite" ,sqlite)
641 ("zlib" ,zlib)))
642 (home-page "https://gdal.org/")
643 (synopsis "Raster and vector geospatial data format library")
644 (description "GDAL is a translator library for raster and vector geospatial
645 data formats. As a library, it presents a single raster abstract data model
646 and single vector abstract data model to the calling application for all
647 supported formats. It also comes with a variety of useful command line
648 utilities for data translation and processing.")
649 (license (list
650 ;; general license
651 license:expat
652 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
653 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
654 ;; frmts/mrf/
655 license:bsd-3
656 ;; frmts/hdf4/hdf-eos/*
657 ;; similar to the expat license, but without guarantee exclusion
658 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
659 ;; frmts/grib/degrib/
660 license:public-domain ; with guarantee exclusion
661 ;; port/cpl_minizip*
662 ;; Some bsd-inspired license
663 (license:non-copyleft "file://port/LICENCE_minizip")
664 ;; alg/internal_libqhull
665 ;; Some 5-clause license
666 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
667 ;; frmts/mrf/libLERC
668 license:asl2.0))))
669
670 (define-public python-gdal
671 (package (inherit gdal)
672 (name "python-gdal")
673 (build-system python-build-system)
674 (arguments
675 '(#:tests? #f ; no tests
676 #:phases
677 (modify-phases %standard-phases
678 (add-before 'build 'chdir
679 (lambda _
680 (chdir "swig/python")
681 #t)))))
682 (native-inputs '())
683 (propagated-inputs
684 `(("python-numpy" ,python-numpy)))
685 (inputs
686 `(("gdal" ,gdal)))
687 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
688
689 (define-public postgis
690 (package
691 (name "postgis")
692 (version "3.0.0")
693 (source (origin
694 (method url-fetch)
695 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
696 version ".tar.gz"))
697 (sha256
698 (base32
699 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
700 (build-system gnu-build-system)
701 (arguments
702 `(#:tests? #f
703 #:make-flags
704 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
705 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
706 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
707 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
708 #:phases
709 (modify-phases %standard-phases
710 (add-before 'build 'fix-install-path
711 (lambda* (#:key outputs #:allow-other-keys)
712 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
713 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
714 (string-append (assoc-ref outputs "out") "/bin"))))))))
715 (inputs
716 `(("gdal" ,gdal)
717 ("geos" ,geos)
718 ("json-c" ,json-c)
719 ("libjpeg" ,libjpeg-turbo)
720 ("libxml2" ,libxml2)
721 ("pcre" ,pcre)
722 ("postgresql" ,postgresql)
723 ("proj" ,proj)))
724 (native-inputs
725 `(("perl" ,perl)
726 ("pkg-config" ,pkg-config)))
727 (home-page "https://postgis.net")
728 (synopsis "Spatial database extender for PostgreSQL")
729 (description "PostGIS is a spatial database extender for PostgreSQL
730 object-relational database. It adds support for geographic objects allowing
731 location queries to be run in SQL. This package provides a PostgreSQL
732 extension.")
733 (license (list
734 ;; General license
735 license:gpl2+
736 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
737 license:expat
738 ;; loader/getopt.*
739 license:public-domain
740 ;; doc/xsl
741 license:bsd-3 ; files only say "BSD"
742 ;; doc
743 license:cc-by-sa3.0))))
744
745 (define-public tegola
746 (package
747 (name "tegola")
748 (version "0.7.0")
749 (source (origin
750 (method url-fetch)
751 (uri (string-append
752 "https://github.com/go-spatial/tegola/archive/v"
753 version ".tar.gz"))
754 (file-name (string-append name "-" version ".tar.gz"))
755 (sha256
756 (base32
757 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
758 (build-system go-build-system)
759 (arguments
760 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
761 #:unpack-path "github.com/go-spatial/tegola"
762 #:phases
763 (modify-phases %standard-phases
764 (add-before 'build 'set-version
765 (lambda _
766 (with-directory-excursion "src/github.com/go-spatial/tegola"
767 (substitute* '("cmd/tegola/cmd/root.go"
768 "cmd/tegola_lambda/main.go")
769 (("version not set") ,version)))
770 #t)))))
771 (home-page "http://tegola.io")
772 (synopsis "Vector tile server for maps")
773 (description "Tegola is a free vector tile server written in Go. Tegola
774 takes geospatial data and slices it into vector tiles that can be efficiently
775 delivered to any client.")
776 (license (list
777 license:expat
778 ;; Some packages in vendor have other licenses
779 license:asl2.0
780 license:bsd-2
781 license:bsd-3
782 license:wtfpl2))))
783
784 (define-public imposm3
785 (package
786 (name "imposm3")
787 (version "0.6.0-alpha.4")
788 (source
789 (origin
790 (method url-fetch)
791 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
792 version ".tar.gz"))
793 (file-name (string-append name "-" version ".tar.gz"))
794 (sha256
795 (base32
796 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
797 (build-system go-build-system)
798 (arguments
799 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
800 #:unpack-path "github.com/omniscale/imposm3"
801 #:phases
802 (modify-phases %standard-phases
803 (add-before 'build 'set-version
804 (lambda _
805 (substitute* "src/github.com/omniscale/imposm3/version.go"
806 (("0.0.0-dev") ,version))
807 #t)))))
808 (inputs
809 `(("geos" ,geos)
810 ("leveldb" ,leveldb)))
811 (home-page "https://imposm.org/")
812 (synopsis "OpenStreetMap importer for PostGIS")
813 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
814 files and imports the data into PostgreSQL/PostGIS databases. It is designed
815 to create databases that are optimized for rendering/tile/map-services.")
816 (license (list
817 license:asl2.0
818 ;; Some dependencies in vendor have different licenses
819 license:expat
820 license:bsd-2
821 license:bsd-3))))
822
823 (define-public libosmium
824 (package
825 (name "libosmium")
826 (version "2.14.2")
827 (source
828 (origin
829 (method git-fetch)
830 (uri (git-reference
831 (url "https://github.com/osmcode/libosmium.git")
832 (commit (string-append "v" version))))
833 (file-name (git-file-name name version))
834 (sha256
835 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
836 (build-system cmake-build-system)
837 (propagated-inputs
838 `(("boost" ,boost)
839 ("expat" ,expat)
840 ("gdal" ,gdal)
841 ("geos" ,geos)
842 ("proj.4" ,proj.4)
843 ("protozero" ,protozero)
844 ("sparsehash" ,sparsehash)
845 ("zlib" ,zlib)))
846 (native-inputs
847 `(("doxygen" ,doxygen)))
848 (home-page "https://osmcode.org/libosmium/")
849 (synopsis "C++ library for working with OpenStreetMap data")
850 (description "Libosmium is a fast and flexible C++ library for working with
851 OpenStreetMap data.")
852 (license license:boost1.0)))
853
854 (define-public osm2pgsql
855 (package
856 (name "osm2pgsql")
857 (version "0.96.0")
858 (source
859 (origin
860 (method git-fetch)
861 (uri (git-reference
862 (url "https://github.com/openstreetmap/osm2pgsql.git")
863 (commit version)))
864 (file-name (git-file-name name version))
865 (sha256
866 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
867 (modules '((guix build utils)))
868 (snippet
869 '(begin
870 (delete-file-recursively "contrib/protozero")
871 (delete-file-recursively "contrib/libosmium")
872 #t))))
873 (build-system cmake-build-system)
874 (arguments
875 `(#:tests? #f; tests fail because we need to setup a database
876 #:configure-flags
877 (list (string-append "-DOSMIUM_INCLUDE_DIR="
878 (assoc-ref %build-inputs "libosmium")
879 "/include")
880 (string-append "-DPROTOZERO_INCLUDE_DIR="
881 (assoc-ref %build-inputs "protozero")
882 "/include"))))
883 (inputs
884 `(("boost" ,boost)
885 ("expat" ,expat)
886 ("libosmium" ,libosmium)
887 ("lua" ,lua)
888 ("postgresql" ,postgresql)
889 ("proj.4" ,proj.4)
890 ("protozero" ,protozero)
891 ("zlib" ,zlib)))
892 (native-inputs
893 `(("python-2" ,python-2)
894 ("python2-psycopg2" ,python2-psycopg2)))
895 (home-page "https://github.com/openstreetmap/osm2pgsql")
896 (synopsis "OSM data importer to postgresql")
897 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
898 PostgreSQL / PostGIS database suitable for applications like rendering into a
899 map, geocoding with Nominatim, or general analysis.")
900 (license license:gpl2+)))
901
902 (define-public tippecanoe
903 (package
904 (name "tippecanoe")
905 (version "1.31.5")
906 (source
907 (origin
908 (method git-fetch)
909 (uri (git-reference
910 (url "https://github.com/mapbox/tippecanoe.git")
911 (commit version)))
912 (file-name (git-file-name name version))
913 (sha256
914 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
915 (build-system gnu-build-system)
916 (arguments
917 `(#:phases
918 (modify-phases %standard-phases (delete 'configure))
919 #:test-target "test"
920 #:make-flags
921 (list "CC=gcc"
922 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
923 (inputs
924 `(("perl" ,perl)
925 ("sqlite" ,sqlite)
926 ("zlib" ,zlib)))
927 (home-page "https://github.com/mapbox/tippecanoe")
928 (synopsis "Vector tile server for maps")
929 (description "Tippecanoe creates scale-independent view of data, so that
930 the texture and density of features is visible at every zoom level, instead of
931 dropping features at lower levels.")
932 (license license:bsd-2)))
933
934 (define-public osmctools
935 (package
936 (name "osmctools")
937 (version "0.9")
938 (source
939 (origin
940 (method git-fetch)
941 (uri (git-reference
942 (url "https://gitlab.com/osm-c-tools/osmctools")
943 (commit version)))
944 (file-name (git-file-name name version))
945 (sha256
946 (base32
947 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
948 (build-system gnu-build-system)
949 (native-inputs
950 `(("autoconf" ,autoconf)
951 ("automake" ,automake)))
952 (inputs
953 `(("zlib" ,zlib)))
954 (home-page "https://gitlab.com/osm-c-tools/osmctools")
955 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
956 (description "This project contains a few tools which are used in the
957 OpenStreetMap project. They can be used to convert, filter and update
958 OpenStreetMap data files.")
959 (license license:agpl3)))
960
961 (define-public osm-gps-map
962 (package
963 (name "osm-gps-map")
964 (version "1.1.0")
965 (source
966 (origin
967 (method url-fetch)
968 (uri (string-append
969 "https://github.com/nzjrs/osm-gps-map/releases/download/"
970 version "/osm-gps-map-" version ".tar.gz"))
971 (sha256
972 (base32
973 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
974 (build-system gnu-build-system)
975 (native-inputs
976 `(("gnome-common" ,gnome-common)
977 ("gtk-doc" ,gtk-doc)
978 ("pkg-config" ,pkg-config)))
979 (inputs
980 `(("cairo" ,cairo)
981 ("glib" ,glib)
982 ("gobject-introspection" ,gobject-introspection)
983 ("gtk+" ,gtk+)
984 ("libsoup" ,libsoup)))
985 (home-page "https://nzjrs.github.io/osm-gps-map/")
986 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
987 (description
988 "This package provides a GTK+ widget (and Python bindings) that when
989 given GPS coordinates,draws a GPS track, and points of interest on a moving
990 map display. Downloads map data from a number of websites, including
991 @url{https://www.openstreetmap.org}.")
992 (license license:gpl2+)))
993
994 (define-public xygrib
995 (package
996 (name "xygrib")
997 (version "1.2.6.1")
998 (source (origin
999 (method git-fetch)
1000 (uri (git-reference
1001 (url "https://github.com/opengribs/XyGrib.git")
1002 (commit (string-append "v" version))))
1003 (file-name (git-file-name name version))
1004 (sha256
1005 (base32
1006 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1007 (modules '((guix build utils)))
1008 (snippet
1009 '(begin (delete-file-recursively "data/fonts") #t))))
1010 (build-system cmake-build-system)
1011 (arguments
1012 `(#:phases
1013 (modify-phases %standard-phases
1014 (add-after 'unpack 'patch-directories
1015 (lambda* (#:key inputs #:allow-other-keys)
1016 (let ((jpeg (assoc-ref inputs "openjpeg"))
1017 (font (assoc-ref inputs "font-liberation")))
1018 (substitute* "CMakeLists.txt"
1019 ;; Find libjpeg.
1020 (("/usr") jpeg)
1021 ;; Fix install locations.
1022 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1023 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1024 ;; Skip looking for the static library.
1025 (("\"libnova.a\"") ""))
1026 ;; Don't use the bundled font-liberation.
1027 (substitute* "src/util/Font.cpp"
1028 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1029 (string-append "\"" font "/share/fonts/truetype/\"")))
1030 (substitute* "src/util/Util.h"
1031 (("pathData\\(\\)\\+\"data/fonts/\"")
1032 (string-append "\"" font "/share/fonts/\""))))
1033 #t)))
1034 #:tests? #f)) ; no tests
1035 (native-inputs
1036 `(("qttools" ,qttools)))
1037 (inputs
1038 `(("bzip2" ,bzip2)
1039 ("font-liberation" ,font-liberation)
1040 ("libnova" ,libnova)
1041 ("libpng" ,libpng)
1042 ("openjpeg" ,openjpeg)
1043 ("proj.4" ,proj.4)
1044 ("qtbase" ,qtbase)
1045 ("zlib" ,zlib)))
1046 (synopsis "Weather Forecast Visualization")
1047 (description
1048 "XyGrib is a Grib file reader and visualizes meteorological data providing
1049 an off-line capability to analyse weather forecasts or hindcasts. It is
1050 intended to be used as a capable weather work station for anyone with a serious
1051 interest in examining weather. This would include members of the sailing
1052 community, private and sport aviators, farmers, weather buffs and many more.
1053 XyGrib is the continuation of the zyGrib software package with a new team of
1054 volunteers.")
1055 (home-page "https://opengribs.org")
1056 (license license:gpl3+)))
1057
1058 (define-public libspatialindex
1059 (package
1060 (name "libspatialindex")
1061 (version "1.9.3")
1062 (source
1063 (origin
1064 (method url-fetch)
1065 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1066 "releases/download/" version "/spatialindex-src-"
1067 version ".tar.bz2"))
1068 (sha256
1069 (base32
1070 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1071 (build-system cmake-build-system)
1072 (home-page "https://libspatialindex.org")
1073 (synopsis "Spatial indexing library")
1074 (description "The purpose of this library is to provide:
1075
1076 @itemize
1077 @item An extensible framework that will support robust spatial indexing
1078 methods.
1079 @item Support for sophisticated spatial queries. Range, point location,
1080 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1081 by spatial constraints) should be easy to deploy and run.
1082 @item Easy to use interfaces for inserting, deleting and updating information.
1083 @item Wide variety of customization capabilities. Basic index and storage
1084 characteristics like the page size, node capacity, minimum fan-out, splitting
1085 algorithm, etc. should be easy to customize.
1086 @item Index persistence. Internal memory and external memory structures
1087 should be supported. Clustered and non-clustered indices should be easy to be
1088 persisted.
1089 @end itemize
1090 ")
1091 (license license:expat)))
1092
1093 (define-public java-jmapviewer
1094 (package
1095 (name "java-jmapviewer")
1096 (version "2.13")
1097 (source (origin
1098 (method url-fetch)
1099 (uri (string-append "https://svn.openstreetmap.org/applications/"
1100 "viewer/jmapviewer/releases/" version
1101 "/JMapViewer-" version "-Source.zip"))
1102 (sha256
1103 (base32
1104 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1105 (build-system ant-build-system)
1106 (native-inputs
1107 `(("unzip" ,unzip)))
1108 (arguments
1109 `(#:build-target "pack"
1110 #:tests? #f; No tests
1111 #:phases
1112 (modify-phases %standard-phases
1113 (add-before 'build 'clean
1114 (lambda* _
1115 (invoke "ant" "clean")))
1116 (replace 'install
1117 (lambda* (#:key outputs #:allow-other-keys)
1118 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1119 (mkdir-p dir)
1120 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1121 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1122 (synopsis "OSM map integration in Java")
1123 (description "JMapViewer is a Java component which allows to easily
1124 integrate an OSM map view into your Java application. It is maintained as
1125 an independent project by the JOSM team.")
1126 (license license:gpl2)))
1127
1128 (define-public josm
1129 (package
1130 (name "josm")
1131 (version "15937")
1132 (source (origin
1133 (method svn-fetch)
1134 (uri (svn-reference
1135 (url "https://josm.openstreetmap.de/svn/trunk")
1136 (revision (string->number version))
1137 (recursive? #f)))
1138 (sha256
1139 (base32
1140 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
1141 (file-name (string-append name "-" version "-checkout"))
1142 (modules '((guix build utils)))
1143 (snippet
1144 '(begin
1145 (for-each delete-file (find-files "." ".*.jar$"))
1146 #t))))
1147 (build-system ant-build-system)
1148 (native-inputs
1149 `(("javacc" ,javacc)))
1150 (inputs
1151 `(("java-commons-jcs" ,java-commons-jcs)
1152 ("java-commons-compress" ,java-commons-compress)
1153 ("java-jmapviewer" ,java-jmapviewer)
1154 ("java-jsonp-api" ,java-jsonp-api)
1155 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1156 ("java-metadata-extractor" ,java-metadata-extractor)
1157 ("java-openjfx-media" ,java-openjfx-media)
1158 ("java-signpost-core" ,java-signpost-core)
1159 ("java-svg-salamander" ,java-svg-salamander)))
1160 (arguments
1161 `(#:tests? #f
1162 #:jar-name "josm.jar"
1163 #:phases
1164 (modify-phases %standard-phases
1165 (add-after 'unpack 'rm-build.xml
1166 (lambda* _
1167 (delete-file "build.xml")
1168 #t))
1169 (add-before 'build 'fix-revision
1170 (lambda* _
1171 (with-output-to-file "REVISION.XML"
1172 (lambda _
1173 (display
1174 (string-append "<info><entry><commit revision=\"" ,version "\">"
1175 "<date>1970-01-01 00:00:00 +0000</date>"
1176 "</commit></entry></info>"))))
1177 #t))
1178 (add-before 'build 'fix-classpath
1179 (lambda* (#:key inputs #:allow-other-keys)
1180 (setenv "CLASSPATH"
1181 (string-join
1182 (filter
1183 (lambda (s)
1184 (let ((source (assoc-ref inputs "source")))
1185 (not (equal? (substring s 0 (string-length source)) source))))
1186 (string-split (getenv "CLASSPATH") #\:))
1187 ":"))
1188 #t))
1189 (add-before 'build 'generate-parser
1190 (lambda* _
1191 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1192 (out (string-append dir "/parsergen"))
1193 (file (string-append dir "/MapCSSParser.jj")))
1194 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1195 (invoke "javacc" "-DEBUG_PARSER=false"
1196 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1197 "-GRAMMAR_ENCODING=UTF-8"
1198 (string-append "-OUTPUT_DIRECTORY=" out)
1199 file))
1200 #t))
1201 (add-after 'build 'generate-epsg
1202 (lambda _
1203 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1204 "-cp" "build/classes")
1205 (mkdir-p "data/projection")
1206 (with-output-to-file "data/projection/custom-epsg"
1207 (lambda _ (display "")))
1208 (invoke "java" "-cp" "build/classes:scripts:."
1209 "BuildProjectionDefinitions" ".")
1210 #t))
1211 (add-after 'generate-epsg 'copy-data
1212 (lambda _
1213 (mkdir-p "build/classes")
1214 (rename-file "data" "build/classes/data")
1215 #t))
1216 (add-before 'install 'regenerate-jar
1217 (lambda _
1218 ;; We need to regenerate the jar file to add data.
1219 (delete-file "build/jar/josm.jar")
1220 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1221 "build/classes" ".")
1222 #t))
1223 (add-before 'build 'copy-styles
1224 (lambda _
1225 (mkdir-p "build/classes")
1226 (rename-file "styles" "build/classes/styles")
1227 #t))
1228 (add-before 'build 'copy-images
1229 (lambda _
1230 (mkdir-p "build/classes")
1231 (rename-file "images" "build/classes/images")
1232 #t))
1233 (add-before 'build 'copy-revision
1234 (lambda _
1235 (mkdir-p "build/classes")
1236 (with-output-to-file "build/classes/REVISION"
1237 (lambda _
1238 (display
1239 (string-append "Revision: " ,version "\n"
1240 "Is-Local-Build: true\n"
1241 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1242 #t))
1243 (add-after 'install 'install-bin
1244 (lambda* (#:key outputs inputs #:allow-other-keys)
1245 (let* ((out (assoc-ref outputs "out"))
1246 (bin (string-append out "/bin")))
1247 (mkdir-p bin)
1248 (with-output-to-file (string-append bin "/josm")
1249 (lambda _
1250 (display
1251 (string-append "#!/bin/sh\n"
1252 (assoc-ref inputs "jdk") "/bin/java"
1253 " -cp " out "/share/java/josm.jar:"
1254 (getenv "CLASSPATH")
1255 " org.openstreetmap.josm.gui.MainApplication"))))
1256 (chmod (string-append bin "/josm") #o755))
1257 #t)))))
1258 (home-page "https://josm.openstreetmap.de")
1259 (synopsis "OSM editor")
1260 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1261 supports loading GPX tracks, background imagery and OSM data from local
1262 sources as well as from online sources and allows to edit the OSM data (nodes,
1263 ways, and relations) and their metadata tags.")
1264 (license license:gpl2+)))
1265
1266 (define-public libmaxminddb
1267 (package
1268 (name "libmaxminddb")
1269 (version "1.4.2")
1270 (source
1271 (origin
1272 (method url-fetch)
1273 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1274 "/releases/download/" version "/"
1275 "/libmaxminddb-" version ".tar.gz"))
1276 (sha256
1277 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1278 (build-system gnu-build-system)
1279 (arguments
1280 `(#:phases
1281 (modify-phases %standard-phases
1282 (add-before 'configure 'set-cc-to-gcc
1283 (lambda _
1284 (setenv "CC" "gcc"))))))
1285 (native-inputs
1286 `(("perl" ,perl)))
1287 (home-page "https://maxmind.github.io/libmaxminddb/")
1288 (synopsis "C library for the MaxMind DB file format")
1289 (description "The libmaxminddb library provides a C library for reading
1290 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1291 format is a custom, but open, binary format designed to facilitate fast
1292 lookups of IP addresses while allowing flexibility in the type of data
1293 associated with an address.")
1294 (license license:asl2.0)))
1295
1296 (define-public python-maxminddb
1297 (package
1298 (name "python-maxminddb")
1299 (version "1.5.1")
1300 (source
1301 (origin
1302 (method url-fetch)
1303 (uri (pypi-uri "maxminddb" version))
1304 (sha256
1305 (base32
1306 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1307 (build-system python-build-system)
1308 (arguments
1309 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1310 (inputs
1311 `(("libmaxminddb" ,libmaxminddb)))
1312 (home-page "https://www.maxmind.com/")
1313 (synopsis "Reader for the MaxMind DB format")
1314 (description "MaxMind DB is a binary file format that stores data indexed
1315 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1316 MaxMind DB files.")
1317 (license license:asl2.0)))
1318
1319 (define-public python-geoip2
1320 (package
1321 (name "python-geoip2")
1322 (version "2.9.0")
1323 (source
1324 (origin
1325 (method url-fetch)
1326 (uri (pypi-uri "geoip2" version))
1327 (sha256
1328 (base32
1329 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1330 (build-system python-build-system)
1331 (arguments
1332 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1333 (inputs
1334 `(("python-maxminddb" ,python-maxminddb)
1335 ("python-requests" ,python-requests)))
1336 (home-page "https://www.maxmind.com/")
1337 (synopsis "MaxMind GeoIP2 API")
1338 (description "Provides an API for the GeoIP2 web services and databases.
1339 The API also works with MaxMind’s free GeoLite2 databases.")
1340 (license license:asl2.0)))
1341
1342 (define-public routino
1343 (package
1344 (name "routino")
1345 (version "3.3.2")
1346 (source
1347 (origin
1348 (method url-fetch)
1349 (uri (string-append "http://www.routino.org/download/routino-"
1350 version ".tgz"))
1351 (sha256
1352 (base32
1353 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1354 (build-system gnu-build-system)
1355 (native-inputs
1356 `(("perl" ,perl)))
1357 (inputs
1358 `(("bzip2" ,bzip2)
1359 ("xz" ,xz)
1360 ("zlib" ,zlib)))
1361 (arguments
1362 `(#:test-target "test"
1363 #:phases
1364 (modify-phases %standard-phases
1365 (replace 'configure
1366 (lambda* (#:key outputs #:allow-other-keys)
1367 (substitute* "Makefile.conf"
1368 (("prefix=/usr/local")
1369 (string-append "prefix=" (assoc-ref outputs "out")))
1370 (("LDFLAGS_LDSO=-Wl,-R\\.")
1371 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1372 (("#CFLAGS\\+=-DUSE_XZ")
1373 "CFLAGS+=-DUSE_XZ")
1374 (("#LDFLAGS\\+=-llzma")
1375 "LDFLAGS+=-llzma"))
1376 #t)))))
1377 (synopsis "Routing application for OpenStreetMap data")
1378 (description
1379 "Routino is an application for finding a route between two points
1380 using the dataset of topographical information collected by
1381 @url{https://www.OpenStreetMap.org}.")
1382 (home-page "https://www.routino.org/")
1383 (license license:agpl3+)))
1384
1385 (define-public qmapshack
1386 (package
1387 (name "qmapshack")
1388 (version "1.14.0")
1389 (source
1390 (origin
1391 (method git-fetch)
1392 (uri (git-reference
1393 (url "https://github.com/Maproom/qmapshack.git")
1394 (commit (string-append "V_" version))))
1395 (file-name (git-file-name name version))
1396 (sha256
1397 (base32
1398 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1399 (build-system qt-build-system)
1400 (native-inputs
1401 `(("pkg-config" ,pkg-config)
1402 ("qttools" ,qttools)))
1403 (inputs
1404 `(("gdal" ,gdal)
1405 ("libjpeg-turbo" ,libjpeg-turbo)
1406 ("proj" ,proj)
1407 ("qtbase" ,qtbase)
1408 ("qtdeclarative" ,qtdeclarative)
1409 ("qtlocation" ,qtlocation)
1410 ("qtwebchannel" ,qtwebchannel)
1411 ("qtwebengine" ,qtwebengine)
1412 ("quazip" ,quazip)
1413 ("routino" ,routino)
1414 ("sqlite" ,sqlite) ; See wrap phase
1415 ("zlib" ,zlib)))
1416 (arguments
1417 `(#:tests? #f
1418 #:phases
1419 (modify-phases %standard-phases
1420 (add-after 'unpack 'fix-cmake-modules
1421 (lambda* (#:key inputs #:allow-other-keys)
1422 (substitute* "CMakeLists.txt"
1423 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1424 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1425 (substitute* "cmake/Modules/FindROUTINO.cmake"
1426 (("/usr/local")
1427 (assoc-ref inputs "routino")))
1428 ;; The following fixes are included as patches in the sources
1429 ;; of QMapShack, but they are not applied by default, for
1430 ;; some reason...
1431 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1432 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1433 #t))
1434 (add-after 'install 'wrap
1435 ;; The program fails to find the QtWebEngineProcess program,
1436 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1439 (qtwebengineprocess (string-append
1440 (assoc-ref inputs "qtwebengine")
1441 "/lib/qt5/libexec/QtWebEngineProcess")))
1442 (for-each (lambda (program)
1443 (wrap-program program
1444 `("QTWEBENGINEPROCESS_PATH" =
1445 (,qtwebengineprocess))))
1446 (find-files bin ".*")))
1447 #t)))))
1448 (synopsis "GPS mapping application")
1449 (description
1450 "QMapShack can be used to plan your next outdoor trip or to visualize and
1451 archive all the GPS recordings of your past trips. It is the successor of the
1452 QLandkarte GT application.")
1453 (home-page "https://github.com/Maproom/qmapshack/wiki")
1454 (license license:gpl3+)))
1455
1456 (define-public readosm
1457 (package
1458 (name "readosm")
1459 (version "1.1.0")
1460 (source
1461 (origin
1462 (method url-fetch)
1463 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1464 "readosm-" version ".tar.gz"))
1465 (sha256
1466 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1467 (build-system gnu-build-system)
1468 (inputs
1469 `(("expat" ,expat)
1470 ("zlib" ,zlib)))
1471 (synopsis "Data extractor for OpenStreetMap files")
1472 (description
1473 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1474 input file (in @code{.osm} or @code{.osm.pbf} format).")
1475 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1476 (license (list license:gpl2+
1477 license:lgpl2.1+
1478 license:mpl1.1))))
1479
1480 (define-public spatialite-tools
1481 (package
1482 (name "spatialite-tools")
1483 (version "4.3.0")
1484 (source
1485 (origin
1486 (method url-fetch)
1487 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1488 "spatialite-tools-" version ".tar.gz"))
1489 (sha256
1490 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1491 (build-system gnu-build-system)
1492 (native-inputs
1493 `(("pkg-config" ,pkg-config)))
1494 (inputs
1495 `(("expat" ,expat)
1496 ("freexl" ,freexl)
1497 ("geos" ,geos)
1498 ("libspatialite" ,libspatialite)
1499 ("libxml2" ,libxml2)
1500 ("proj.4" ,proj.4)
1501 ("readosm" ,readosm)
1502 ("sqlite" ,sqlite)
1503 ("zlib" ,zlib)))
1504 (synopsis "Collection of command line tools for SpatiaLite")
1505 (description
1506 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1507 tools supporting SpatiaLite.")
1508 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1509 (license license:gpl3+)))