gnu: python-pandas: Fix build on 32-bit.
[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 glib)
29 #:use-module (gnu packages gnome)
30 #:use-module (gnu packages gtk)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages webkit)
33 #:use-module (gnu packages xml))
34
35 (define-public geos
36 (package
37 (name "geos")
38 (version "3.6.1")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append "http://download.osgeo.org/geos/geos-"
42 version
43 ".tar.bz2"))
44 (sha256
45 (base32
46 "1icz31kd5sml2kdxhjznvmv33zfr6nig9l0i6bdcz9q9g8x4wbja"))))
47 (build-system gnu-build-system)
48 (arguments `(#:phases
49 (modify-phases %standard-phases
50 (add-after
51 'unpack 'patch-test-shebangs
52 (lambda _
53 (substitute* '("tests/xmltester/testrunner.sh"
54 "tests/geostest/testrunner.sh")
55 (("/bin/sh") (which "sh")))
56 #t)))))
57 (inputs
58 `(("glib" ,glib)))
59 (home-page "https://geos.osgeo.org/")
60 (synopsis "Geometry Engine for Geographic Information Systems")
61 (description
62 "GEOS provides a spatial object model and fundamental geometric
63 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
64 it aims to contain the complete functionality of JTS in C++. This
65 includes all the OpenGIS Simple Features for SQL spatial predicate
66 functions and spatial operators, as well as specific JTS enhanced
67 topology functions.")
68 (license (list license:lgpl2.1+ ; Main distribution.
69 license:zlib ; tests/xmltester/tinyxml/*
70 license:public-domain)))) ; include/geos/timeval.h
71
72 ;;; FIXME GNOME Maps only runs within GNOME. On i3, it fails with this error:
73 ;;; (org.gnome.Maps:8568): GLib-GIO-ERROR **: Settings schema
74 ;;; 'org.gnome.desktop.interface' is not installed
75 (define-public gnome-maps
76 (package
77 (name "gnome-maps")
78 (version "3.18.3")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "mirror://gnome/sources/" name "/"
82 (version-major+minor version) "/"
83 name "-" version ".tar.xz"))
84 (sha256
85 (base32
86 "1vdnr2wmhqhql2gxd5n1ijwk88qhim14izbkczncg35846hfsr5i"))))
87 (build-system glib-or-gtk-build-system)
88 (arguments
89 `(#:configure-flags ; Ensure that geoclue is referred to by output.
90 (list (string-append "LDFLAGS=-L"
91 (assoc-ref %build-inputs "geoclue") "/lib")
92 (string-append "CFLAGS=-I"
93 (assoc-ref %build-inputs "geoclue") "/include"))
94 #:phases
95 (modify-phases %standard-phases
96 (add-after
97 'install 'wrap
98 (lambda* (#:key inputs outputs #:allow-other-keys)
99 (let ((out (assoc-ref outputs "out"))
100 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
101 (goa-path (string-append
102 (assoc-ref inputs "gnome-online-accounts")
103 "/lib")))
104 (wrap-program (string-append out "/bin/gnome-maps")
105 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
106
107 ;; There seems to be no way to embed the path of libgoa-1.0.so.0.
108 `("LD_LIBRARY_PATH" ":" prefix (,goa-path)))
109 #t))))))
110 (native-inputs
111 `(("gobject-introspection" ,gobject-introspection)
112 ("intltool" ,intltool)
113 ("pkg-config" ,pkg-config)))
114 (inputs
115 `(("folks" ,folks)
116 ("libchamplain" ,libchamplain)
117 ("libgee" ,libgee)
118 ("libxml2" ,libxml2)
119 ("geoclue" ,geoclue)
120 ("geocode-glib" ,geocode-glib)
121 ("gfbgraph" ,gfbgraph)
122 ("gjs" ,gjs)
123 ("glib" ,glib)
124 ("gnome-online-accounts" ,gnome-online-accounts)
125 ("rest" ,rest)
126 ("webkitgtk" ,webkitgtk)))
127 (propagated-inputs
128 `(("gtk+3" ,gtk+)))
129 (synopsis "Graphical map viewer and wayfinding program")
130 (description "GNOME Maps is a graphical map viewer. It uses map data from
131 the OpenStreetMap project. It can provide directions for walking, bicycling,
132 and driving.")
133 (home-page "https://wiki.gnome.org/Apps/Maps")
134 (license license:gpl2+)))
135
136 (define-public proj.4
137 (package
138 (name "proj.4")
139 (version "4.9.3")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "http://download.osgeo.org/proj/proj-"
143 version ".tar.gz"))
144 (sha256
145 (base32
146 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
147 (build-system gnu-build-system)
148 (arguments
149 `(#:phases
150 (modify-phases %standard-phases
151 (add-after 'unpack 'patch-test-paths
152 (lambda _
153 (substitute* '("nad/test27"
154 "nad/test83"
155 "nad/testvarious"
156 "nad/testdatumfile"
157 "nad/testflaky"
158 "nad/testIGNF")
159 (("/bin/rm") (which "rm")))
160 #t))
161 ;; Precision problems on i686 and other platforms. See:
162 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
163 ;; Disable failing test.
164 (add-after 'patch-test-paths 'ignore-failing-tests
165 (lambda _
166 (substitute* '("nad/Makefile.in")
167 (("\tPROJ_LIB.*" all) (string-append "#" all)))
168 #t)))))
169 (inputs
170 `(("glib" ,glib)))
171 (home-page "http://proj4.org/")
172 (synopsis "Cartographic Projections Library")
173 (description
174 "Proj.4 is a library for converting coordinates between cartographic
175 projections.")
176 (license (list license:expat
177 ;; src/PJ_patterson.c
178 license:asl2.0
179 ;; src/geodesic.c/h
180 license:x11
181 ;; Embedded EPSG database.
182 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
183 ;; cmake/*
184 license:boost1.0))))