| 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 | ;;; FIXME GNOME Maps only runs within GNOME. On i3, it fails with this error: |
| 36 | ;;; (org.gnome.Maps:8568): GLib-GIO-ERROR **: Settings schema |
| 37 | ;;; 'org.gnome.desktop.interface' is not installed |
| 38 | (define-public gnome-maps |
| 39 | (package |
| 40 | (name "gnome-maps") |
| 41 | (version "3.18.3") |
| 42 | (source (origin |
| 43 | (method url-fetch) |
| 44 | (uri (string-append "mirror://gnome/sources/" name "/" |
| 45 | (version-major+minor version) "/" |
| 46 | name "-" version ".tar.xz")) |
| 47 | (sha256 |
| 48 | (base32 |
| 49 | "1vdnr2wmhqhql2gxd5n1ijwk88qhim14izbkczncg35846hfsr5i")))) |
| 50 | (build-system glib-or-gtk-build-system) |
| 51 | (arguments |
| 52 | `(#:configure-flags ; Ensure that geoclue is referred to by output. |
| 53 | (list (string-append "LDFLAGS=-L" |
| 54 | (assoc-ref %build-inputs "geoclue") "/lib") |
| 55 | (string-append "CFLAGS=-I" |
| 56 | (assoc-ref %build-inputs "geoclue") "/include")) |
| 57 | #:phases |
| 58 | (modify-phases %standard-phases |
| 59 | (add-after |
| 60 | 'install 'wrap |
| 61 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 62 | (let ((out (assoc-ref outputs "out")) |
| 63 | (gi-typelib-path (getenv "GI_TYPELIB_PATH")) |
| 64 | (goa-path (string-append |
| 65 | (assoc-ref inputs "gnome-online-accounts") |
| 66 | "/lib"))) |
| 67 | (wrap-program (string-append out "/bin/gnome-maps") |
| 68 | `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)) |
| 69 | |
| 70 | ;; There seems to be no way to embed the path of libgoa-1.0.so.0. |
| 71 | `("LD_LIBRARY_PATH" ":" prefix (,goa-path))) |
| 72 | #t)))))) |
| 73 | (native-inputs |
| 74 | `(("gobject-introspection" ,gobject-introspection) |
| 75 | ("intltool" ,intltool) |
| 76 | ("pkg-config" ,pkg-config))) |
| 77 | (inputs |
| 78 | `(("folks" ,folks) |
| 79 | ("libchamplain" ,libchamplain) |
| 80 | ("libgee" ,libgee) |
| 81 | ("libxml2" ,libxml2) |
| 82 | ("geoclue" ,geoclue) |
| 83 | ("geocode-glib" ,geocode-glib) |
| 84 | ("gfbgraph" ,gfbgraph) |
| 85 | ("gjs" ,gjs) |
| 86 | ("glib" ,glib) |
| 87 | ("gnome-online-accounts" ,gnome-online-accounts) |
| 88 | ("rest" ,rest) |
| 89 | ("webkitgtk" ,webkitgtk))) |
| 90 | (propagated-inputs |
| 91 | `(("gtk+3" ,gtk+))) |
| 92 | (synopsis "Graphical map viewer and wayfinding program") |
| 93 | (description "GNOME Maps is a graphical map viewer. It uses map data from |
| 94 | the OpenStreetMap project. It can provide directions for walking, bicycling, |
| 95 | and driving.") |
| 96 | (home-page "https://wiki.gnome.org/Apps/Maps") |
| 97 | (license license:gpl2+))) |
| 98 | |
| 99 | (define-public proj.4 |
| 100 | (package |
| 101 | (name "proj.4") |
| 102 | (version "4.9.3") |
| 103 | (source (origin |
| 104 | (method url-fetch) |
| 105 | (uri (string-append "http://download.osgeo.org/proj/proj-" |
| 106 | version ".tar.gz")) |
| 107 | (sha256 |
| 108 | (base32 |
| 109 | "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139")))) |
| 110 | (build-system gnu-build-system) |
| 111 | (arguments |
| 112 | `(#:phases |
| 113 | (modify-phases %standard-phases |
| 114 | (add-after 'unpack 'patch-test-paths |
| 115 | (lambda _ |
| 116 | (substitute* '("nad/test27" |
| 117 | "nad/test83" |
| 118 | "nad/testvarious" |
| 119 | "nad/testdatumfile" |
| 120 | "nad/testflaky" |
| 121 | "nad/testIGNF") |
| 122 | (("/bin/rm") (which "rm"))) |
| 123 | #t)) |
| 124 | ;; Precision problems on i686 and other platforms. See: |
| 125 | ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255 |
| 126 | ;; Disable failing test. |
| 127 | (add-after 'patch-test-paths 'ignore-failing-tests |
| 128 | (lambda _ |
| 129 | (substitute* '("nad/Makefile.in") |
| 130 | (("\tPROJ_LIB.*" all) (string-append "#" all))) |
| 131 | #t))))) |
| 132 | (inputs |
| 133 | `(("glib" ,glib))) |
| 134 | (home-page "http://proj4.org/") |
| 135 | (synopsis "Cartographic Projections Library") |
| 136 | (description |
| 137 | "Proj.4 is a library for converting coordinates between cartographic |
| 138 | projections.") |
| 139 | (license (list license:expat |
| 140 | ;; src/PJ_patterson.c |
| 141 | license:asl2.0 |
| 142 | ;; src/geodesic.c/h |
| 143 | license:x11 |
| 144 | ;; Embedded EPSG database. |
| 145 | (license:non-copyleft "http://www.epsg.org/TermsOfUse") |
| 146 | ;; cmake/* |
| 147 | license:boost1.0)))) |