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