guix-more/more/packages/geo.scm

geo.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix is distributed in the hope that it will be useful, but
12
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages geo)
20
  #:use-module (guix packages)
21
  #:use-module (guix download)
22
  #:use-module (guix git-download)
23
  #:use-module (guix build-system gnu)
24
  #:use-module (guix build-system go)
25
  #:use-module ((guix licenses) #:prefix license:)
26
  #:use-module (gnu packages)
27
  #:use-module (gnu packages compression)
28
  #:use-module (gnu packages databases)
29
  #:use-module (gnu packages geo)
30
  #:use-module (gnu packages image)
31
  #:use-module (gnu packages pcre)
32
  #:use-module (gnu packages perl)
33
  #:use-module (gnu packages pkg-config)
34
  #:use-module (gnu packages web)
35
  #:use-module (gnu packages xml))
36
37
(define-public tegola
38
  (package
39
    (name "tegola")
40
    (version "0.6.3")
41
    (source (origin
42
              (method url-fetch)
43
              (uri (string-append
44
                     "https://github.com/go-spatial/tegola/archive/v"
45
                     version ".tar.gz"))
46
              (sha256
47
               (base32
48
                "0172ikggayprxmhhm9yfk1gc4i8m48llc8zzgqklbijkdpvp1zh0"))))
49
    (build-system go-build-system)
50
    (arguments
51
     `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
52
       #:unpack-path "github.com/go-spatial"
53
       #:phases
54
       (modify-phases %standard-phases
55
         (add-before 'build 'rename-import
56
           (lambda _
57
             (rename-file (string-append "src/github.com/go-spatial/tegola-" ,version)
58
                          "src/github.com/go-spatial/tegola")
59
             #t)))))
60
    (home-page "http://tegola.io")
61
    (synopsis "Vector tile server for maps")
62
    (description "Tegola is a free vector tile server written in Go.  Tegola
63
takes geospatial data and slices it into vector tiles that can be efficiently
64
delivered to any client.")
65
    (license license:expat)))
66
67
(define-public imposm3
68
  (package
69
    (name "imposm3")
70
    (version "0.6.0-alpha.4")
71
    (source
72
      (origin
73
        (method url-fetch)
74
        (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
75
			    version ".tar.gz"))
76
	(file-name (string-append name "-" version ".tar.gz"))
77
        (sha256
78
         (base32
79
          "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
80
    (build-system go-build-system)
81
    (arguments
82
     `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
83
       #:unpack-path "github.com/omniscale"
84
       #:phases
85
       (modify-phases %standard-phases
86
         (add-before 'build 'rename-import
87
           (lambda _
88
             (rename-file (string-append "src/github.com/omniscale/imposm3-" ,version)
89
                          "src/github.com/omniscale/imposm3")
90
             #t)))))
91
    (inputs
92
     `(("geos" ,geos)
93
       ("leveldb" ,leveldb)))
94
    (home-page "http://imposm.org/")
95
    (synopsis "OpenStreetMap importer for PostGIS.")
96
    (description "OpenStreetMap importer for PostGIS.")
97
    (license license:asl2.0)))
98
99
(define-public osmconvert
100
  (package
101
    (name "osmconvert")
102
    (version "0")
103
    (source (origin
104
	      (method url-fetch)
105
	      (uri (string-append "http://m.m.i24.cc/osmconvert.c"))
106
	      (sha256
107
	       (base32
108
		"19glwq8w5sl8579zxbpydj56lybs94nrf47f3i2xjwlkmzrlljfv"))))
109
    (build-system gnu-build-system)
110
    (arguments
111
     `(#:tests? #f; no tests
112
       #:phases
113
       (modify-phases %standard-phases
114
	 (delete 'unpack)
115
	 (delete 'configure)
116
	 (delete 'install)
117
	 (replace 'build
118
	   (lambda* (#:key inputs outputs #:allow-other-keys)
119
	     (mkdir-p (string-append (assoc-ref outputs "out") "/bin"))
120
	     (invoke "gcc" (assoc-ref inputs "source") "-lz" "-o"
121
		     (string-append (assoc-ref outputs "out") "/bin/osmconvert"))
122
	     (chmod (string-append (assoc-ref outputs "out") "/bin/osmconvert")
123
		    #o755)
124
	     #t)))))
125
    (inputs
126
     `(("zlib" ,zlib)))
127
    (home-page "")
128
    (synopsis "")
129
    (description "")
130
    (license license:agpl3+)))
131