diff --git a/gnu/local.mk b/gnu/local.mk index fb4babfdb..da6d65952 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -991,6 +991,7 @@ dist_patch_DATA = \ %D%/packages/patches/policycoreutils-make-sepolicy-use-python3.patch \ %D%/packages/patches/portaudio-audacity-compat.patch \ %D%/packages/patches/portmidi-modular-build.patch \ + %D%/packages/patches/postgis-config.patch \ %D%/packages/patches/procmail-ambiguous-getline-debian.patch \ %D%/packages/patches/procmail-CVE-2014-3618.patch \ %D%/packages/patches/procmail-CVE-2017-16844.patch \ diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 5a24ed614..681108977 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -26,15 +26,89 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages compression) + #:use-module (gnu packages databases) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages image) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages web) #:use-module (gnu packages webkit) #:use-module (gnu packages xml)) +(define-public gdal + (package + (name "gdal") + (version "2.2.3") + (source (origin + (method url-fetch) + (uri (string-append "http://download.osgeo.org/gdal/2.2.3/gdal-" + version + ".tar.xz")) + (sha256 + (base32 + "02wdifcblmqi9ffp5c0ahvwcs5bsx1qpjpsvlbsm6dkb8wyxca53")))) + (build-system gnu-build-system) + ;; (inputs + ;; `(("json-c" ,json-c) + ;; ("geos" ,geos))) + (arguments + `(#:tests? #f)) + ;; #:configure-flags + ;; (list + ;; (string-append "--with-libjson-c=" (assoc-ref %build-inputs "json-c"))))) + (synopsis "Geospatial Data Abstraction Library") + (description " GDAL is a translator library for raster geospatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. The related OGR library (which lives within the GDAL source tree) provides a similar capability for simple features vector data. + +GDAL supports 40+ popular data formats, including commonly used ones (GeoTIFF, JPEG, PNG and more) as well as the ones used in GIS and remote sensing software packages (ERDAS Imagine, ESRI Arc/Info, ENVI, PCI Geomatics). Also supported many remote sensing and scientific data distribution formats such as HDF, EOS FAST, NOAA L1B, NetCDF, FITS. + +OGR library supports popular vector formats like ESRI Shapefile, TIGER data, S57, MapInfo File, DGN, GML and more.") + (home-page "http://gdal.org/") + ;; FIXME - many licenses + (license license:gpl2+))) + +(define-public postgis + (package + (name "postgis") + (version "2.4.2") + (source (origin + (method url-fetch) + (uri (string-append "http://download.osgeo.org/postgis/source/postgis-" + version + ".tar.gz")) + (sha256 + (base32 + "1n91lgbz0f40gicls722c8xnap1zb84j2mr240xdah6lkv4mnqi3")) + (patches (search-patches "postgis-config.patch")))) + (build-system gnu-build-system) + (inputs + `(("perl" ,perl) + ("proj.4" ,proj.4) + ("geos" ,geos) + ("gdal" ,gdal) + ("libxml2" ,libxml2) + ("postgresql" ,postgresql) + ;; Disabling json-c for now. If used, build fails to find + ;; json_object_private.h, which the json-c Makefile.am is configured + ;; not to output. Rekado suggested adding sources of json-c to the + ;; package. + ;; + ;; ("json-c" ,json-c) + )) + (native-inputs + `(("gdal" ,gdal))) + + (arguments + '(#:tests? #f)) + (synopsis "") + (description "") + (home-page "") + ;; FIXME + (license license:gpl2+))) + (define-public geos (package (name "geos") @@ -72,6 +146,7 @@ topology functions.") license:zlib ; tests/xmltester/tinyxml/* license:public-domain)))) ; include/geos/timeval.h + ;;; FIXME GNOME Maps only runs within GNOME. On i3, it fails with this error: ;;; (org.gnome.Maps:8568): GLib-GIO-ERROR **: Settings schema ;;; 'org.gnome.desktop.interface' is not installed diff --git a/gnu/packages/patches/postgis-config.patch b/gnu/packages/patches/postgis-config.patch new file mode 100644 index 000000000..a6ec1833a --- /dev/null +++ b/gnu/packages/patches/postgis-config.patch @@ -0,0 +1,23 @@ +diff --git a/configure.ac b/configure.ac +index b9432df..fe9d824 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -453,7 +453,8 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then + + PGSQL_PKGLIBDIR=`"$PG_CONFIG" --pkglibdir` + PGSQL_LIBDIR=`"$PG_CONFIG" --libdir` +- PGSQL_SHAREDIR=`"$PG_CONFIG" --sharedir` ++ # Seems this one doesn't take effect? ++ PGSQL_SHAREDIR=/share/ + + AC_MSG_RESULT([checking PostgreSQL version... $PGSQL_FULL_VERSION]) + dnl Ensure that we are using PostgreSQL >= 9.3 +@@ -504,7 +505,7 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then + AC_SUBST([PGSQL_BINDIR]) + + dnl Extract the share directory +- PGSQL_SHAREDIR=`"$PG_CONFIG" --sharedir` ++ PGSQL_SHAREDIR=/share/ + + AC_SUBST([PGSQL_SHAREDIR]) +