gnu: go-github-com-gogo-protobuf: Update to 0.5-1.35b81a0.
[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 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages geo)
22 #:use-module (guix build-system glib-or-gtk)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix download)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix utils)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages gnome)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages image)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages webkit)
35 #:use-module (gnu packages xml))
36
37 (define-public geos
38 (package
39 (name "geos")
40 (version "3.6.1")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append "http://download.osgeo.org/geos/geos-"
44 version
45 ".tar.bz2"))
46 (sha256
47 (base32
48 "1icz31kd5sml2kdxhjznvmv33zfr6nig9l0i6bdcz9q9g8x4wbja"))))
49 (build-system gnu-build-system)
50 (arguments `(#:phases
51 (modify-phases %standard-phases
52 (add-after
53 'unpack 'patch-test-shebangs
54 (lambda _
55 (substitute* '("tests/xmltester/testrunner.sh"
56 "tests/geostest/testrunner.sh")
57 (("/bin/sh") (which "sh")))
58 #t)))))
59 (inputs
60 `(("glib" ,glib)))
61 (home-page "https://geos.osgeo.org/")
62 (synopsis "Geometry Engine for Geographic Information Systems")
63 (description
64 "GEOS provides a spatial object model and fundamental geometric
65 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
66 it aims to contain the complete functionality of JTS in C++. This
67 includes all the OpenGIS Simple Features for SQL spatial predicate
68 functions and spatial operators, as well as specific JTS enhanced
69 topology functions.")
70 (license (list license:lgpl2.1+ ; Main distribution.
71 license:zlib ; tests/xmltester/tinyxml/*
72 license:public-domain)))) ; include/geos/timeval.h
73
74 ;;; FIXME GNOME Maps only runs within GNOME. On i3, it fails with this error:
75 ;;; (org.gnome.Maps:8568): GLib-GIO-ERROR **: Settings schema
76 ;;; 'org.gnome.desktop.interface' is not installed
77 (define-public gnome-maps
78 (package
79 (name "gnome-maps")
80 (version "3.26.2")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "mirror://gnome/sources/" name "/"
84 (version-major+minor version) "/"
85 name "-" version ".tar.xz"))
86 (sha256
87 (base32
88 "0l40l7m9dyphvasiq1jxrn6ivavs1xwzn0bzz2x1z7x73955q783"))))
89 (build-system glib-or-gtk-build-system)
90 (arguments
91 `(#:configure-flags ;; Ensure that geoclue is referred to by output.
92 (list (string-append "LDFLAGS=-L"
93 (assoc-ref %build-inputs "geoclue") "/lib")
94 (string-append "CFLAGS=-I"
95 (assoc-ref %build-inputs "geoclue") "/include"))
96 #:phases
97 (modify-phases %standard-phases
98 (add-after 'install 'wrap
99 (lambda* (#:key inputs outputs #:allow-other-keys)
100 (let ((out (assoc-ref outputs "out"))
101 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
102 (goa-path (string-append
103 (assoc-ref inputs "gnome-online-accounts")
104 "/lib"))
105 (webkitgtk-path (string-append
106 (assoc-ref inputs "webkitgtk")
107 "/lib")))
108 (wrap-program (string-append out "/bin/gnome-maps")
109 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
110
111 ;; There seems to be no way to embed the path of
112 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37 and
113 ;; libjavascriptcoregtk-4.0.so.18.
114 `("LD_LIBRARY_PATH" ":" prefix (,goa-path ,webkitgtk-path)))
115 #t))))))
116 (native-inputs
117 `(("gobject-introspection" ,gobject-introspection)
118 ("intltool" ,intltool)
119 ("pkg-config" ,pkg-config)))
120 (inputs
121 `(("folks" ,folks)
122 ("libchamplain" ,libchamplain)
123 ("libgee" ,libgee)
124 ("libxml2" ,libxml2)
125 ("geoclue" ,geoclue)
126 ("geocode-glib" ,geocode-glib)
127 ("gfbgraph" ,gfbgraph)
128 ("gjs" ,gjs)
129 ("glib" ,glib)
130 ("gnome-online-accounts" ,gnome-online-accounts)
131 ("rest" ,rest)
132 ("webkitgtk" ,webkitgtk)))
133 (propagated-inputs
134 `(("gtk+3" ,gtk+)))
135 (synopsis "Graphical map viewer and wayfinding program")
136 (description "GNOME Maps is a graphical map viewer. It uses map data from
137 the OpenStreetMap project. It can provide directions for walking, bicycling,
138 and driving.")
139 (home-page "https://wiki.gnome.org/Apps/Maps")
140 (license license:gpl2+)))
141
142 (define-public libgeotiff
143 (package
144 (name "libgeotiff")
145 (version "1.4.2")
146 (source
147 (origin
148 (method url-fetch)
149 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
150 version ".tar.gz"))
151 (sha256
152 (base32
153 "0vjy3bwfhljjx66p9w999i4mdhsf7vjshx29yc3pn5livf5091xd"))
154 (modules '((guix build utils)))
155 (snippet
156 '(begin
157 ;; Remove .csv files, distributed from EPSG under a restricted
158 ;; license. See LICENSE for full license text.
159 (for-each delete-file (find-files "." "\\.csv$"))
160 ;; Now that we have removed the csv files, we need to modify the Makefile.
161 (substitute* "Makefile.in"
162 (("^all-am: .*$")
163 "all-am: Makefile $(LTLIBRARIES) $(HEADERS) geo_config.h\n")
164 (("^install-data-am: .*$")
165 "install-data-am: install-includeHEADERS"))))))
166 (build-system gnu-build-system)
167 (inputs
168 `(("libjpeg-turbo" ,libjpeg-turbo)
169 ("libtiff" ,libtiff)
170 ("proj.4" ,proj.4)
171 ("zlib" ,zlib)))
172 (arguments
173 `(#:configure-flags
174 (list (string-append "--with-zlib")
175 (string-append "--with-jpeg")
176 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
177 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
178 (description "libgeotiff is a library on top of libtiff for reading and
179 writing GeoTIFF information tags.")
180 (home-page "https://trac.osgeo.org/geotiff/")
181 ;; This is a mixture of various contributions under different licenses.
182 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
183 ;; states, as its commercial redistribution is restricted. Hence, we have
184 ;; removed it from the package.
185 (license (list license:public-domain
186 license:x11
187 license:bsd-3
188 (license:non-copyleft "file://LICENSE"
189 "See LICENSE in the distribution.")))))
190
191 (define-public proj.4
192 (package
193 (name "proj.4")
194 (version "4.9.3")
195 (source (origin
196 (method url-fetch)
197 (uri (string-append "http://download.osgeo.org/proj/proj-"
198 version ".tar.gz"))
199 (sha256
200 (base32
201 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
202 (build-system gnu-build-system)
203 (arguments
204 `(#:phases
205 (modify-phases %standard-phases
206 (add-after 'unpack 'patch-test-paths
207 (lambda _
208 (substitute* '("nad/test27"
209 "nad/test83"
210 "nad/testvarious"
211 "nad/testdatumfile"
212 "nad/testflaky"
213 "nad/testIGNF")
214 (("/bin/rm") (which "rm")))
215 #t))
216 ;; Precision problems on i686 and other platforms. See:
217 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
218 ;; Disable failing test.
219 (add-after 'patch-test-paths 'ignore-failing-tests
220 (lambda _
221 (substitute* '("nad/Makefile.in")
222 (("\tPROJ_LIB.*" all) (string-append "#" all)))
223 #t)))))
224 (inputs
225 `(("glib" ,glib)))
226 (home-page "http://proj4.org/")
227 (synopsis "Cartographic Projections Library")
228 (description
229 "Proj.4 is a library for converting coordinates between cartographic
230 projections.")
231 (license (list license:expat
232 ;; src/PJ_patterson.c
233 license:asl2.0
234 ;; src/geodesic.c/h
235 license:x11
236 ;; Embedded EPSG database.
237 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
238 ;; cmake/*
239 license:boost1.0))))