aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/geo.scm
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2018-04-16 10:45:52 +0200
committerJulien Lepiller <julien@lepiller.eu>2018-05-23 23:07:10 +0200
commit2b9be1a63aef1a0e67e94bfd9a676b6cb5c8463f (patch)
tree2bd60baf5e0e2de294ede70b60e114f34b876e57 /gnu/packages/geo.scm
parent996e45cbf7e46977e16c4ebc5ecc394db28f4a21 (diff)
downloadguix-2b9be1a63aef1a0e67e94bfd9a676b6cb5c8463f.tar
guix-2b9be1a63aef1a0e67e94bfd9a676b6cb5c8463f.tar.gz
gnu: Add postgis.
* gnu/packages/geo.scm (postgis): New variable.
Diffstat (limited to 'gnu/packages/geo.scm')
-rw-r--r--gnu/packages/geo.scm54
1 files changed, 54 insertions, 0 deletions
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 924d13867e..9995ff3e88 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -45,6 +45,7 @@
#:use-module (gnu packages image)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages pcre)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages statistics)
@@ -705,3 +706,56 @@ utilities for data translation and processing.")
(license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
;; frmts/mrf/libLERC
license:asl2.0))))
+
+(define-public postgis
+ (package
+ (name "postgis")
+ (version "2.4.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1hm8migjb53cymp4qvg1h20yqllmy9f7x0awv5450391i6syyqq6"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:make-flags
+ (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
+ (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
+ (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
+ (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'fix-install-path
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
+ (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
+ (string-append (assoc-ref outputs "out") "/bin"))))))))
+ (inputs
+ `(("gdal" ,gdal)
+ ("geos" ,geos)
+ ("libxml2" ,libxml2)
+ ("pcre" ,pcre)
+ ("postgresql" ,postgresql)
+ ("proj.4" ,proj.4)))
+ (native-inputs
+ `(("perl" ,perl)
+ ("pkg-config" ,pkg-config)))
+ (home-page "https://postgis.net")
+ (synopsis "Spatial database extender for PostgreSQL")
+ (description "PostGIS is a spatial database extender for PostgreSQL
+object-relational database. It adds support for geographic objects allowing
+location queries to be run in SQL.")
+ (license (list
+ ;; General license
+ license:gpl2+
+ ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
+ license:expat
+ ;; loader/getopt.*
+ license:public-domain
+ ;; doc/xsl
+ license:bsd-3 ; files only say "BSD"
+ ;; doc
+ license:cc-by-sa3.0))))