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