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