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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
43 (uri (string-append "http://download.osgeo.org/geos/geos-"
48 "1icz31kd5sml2kdxhjznvmv33zfr6nig9l0i6bdcz9q9g8x4wbja"))))
49 (build-system gnu-build-system)
51 (modify-phases %standard-phases
53 'unpack 'patch-test-shebangs
55 (substitute* '("tests/xmltester/testrunner.sh"
56 "tests/geostest/testrunner.sh")
57 (("/bin/sh") (which "sh")))
61 (home-page "https://geos.osgeo.org/")
62 (synopsis "Geometry Engine for Geographic Information Systems")
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
70 (license (list license:lgpl2.1+ ; Main distribution.
71 license:zlib ; tests/xmltester/tinyxml/*
72 license:public-domain)))) ; include/geos/timeval.h
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
83 (uri (string-append "mirror://gnome/sources/" name "/"
84 (version-major+minor version) "/"
85 name "-" version ".tar.xz"))
88 "0l40l7m9dyphvasiq1jxrn6ivavs1xwzn0bzz2x1z7x73955q783"))))
89 (build-system glib-or-gtk-build-system)
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"))
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")
105 (webkitgtk-path (string-append
106 (assoc-ref inputs "webkitgtk")
108 (wrap-program (string-append out "/bin/gnome-maps")
109 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
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)))
117 `(("gobject-introspection" ,gobject-introspection)
118 ("intltool" ,intltool)
119 ("pkg-config" ,pkg-config)))
122 ("libchamplain" ,libchamplain)
126 ("geocode-glib" ,geocode-glib)
127 ("gfbgraph" ,gfbgraph)
130 ("gnome-online-accounts" ,gnome-online-accounts)
132 ("webkitgtk" ,webkitgtk)))
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,
139 (home-page "https://wiki.gnome.org/Apps/Maps")
140 (license license:gpl2+)))
142 (define-public libgeotiff
149 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
153 "0vjy3bwfhljjx66p9w999i4mdhsf7vjshx29yc3pn5livf5091xd"))
154 (modules '((guix build utils)))
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"
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)
168 `(("libjpeg-turbo" ,libjpeg-turbo)
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
188 (license:non-copyleft "file://LICENSE"
189 "See LICENSE in the distribution.")))))
191 (define-public proj.4
197 (uri (string-append "http://download.osgeo.org/proj/proj-"
201 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
202 (build-system gnu-build-system)
205 (modify-phases %standard-phases
206 (add-after 'unpack 'patch-test-paths
208 (substitute* '("nad/test27"
214 (("/bin/rm") (which "rm")))
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
221 (substitute* '("nad/Makefile.in")
222 (("\tPROJ_LIB.*" all) (string-append "#" all)))
226 (home-page "http://proj4.org/")
227 (synopsis "Cartographic Projections Library")
229 "Proj.4 is a library for converting coordinates between cartographic
231 (license (list license:expat
232 ;; src/PJ_patterson.c
236 ;; Embedded EPSG database.
237 (license:non-copyleft "http://www.epsg.org/TermsOfUse")