From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f80I1-0004pQ-5C for guix-patches@gnu.org; Mon, 16 Apr 2018 05:19:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f80Hu-0005M7-NS for guix-patches@gnu.org; Mon, 16 Apr 2018 05:19:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47161) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f80Hu-0005Ly-Hj for guix-patches@gnu.org; Mon, 16 Apr 2018 05:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f80Hu-00083o-93 for guix-patches@gnu.org; Mon, 16 Apr 2018 05:19:02 -0400 Subject: [bug#31175] [PATCH] gnu: Add postgis. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f80Hf-0004Rb-Uz for guix-patches@gnu.org; Mon, 16 Apr 2018 05:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f80Hc-0005Fn-Og for guix-patches@gnu.org; Mon, 16 Apr 2018 05:18:47 -0400 Received: from lepiller.eu ([89.234.186.109]:44456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f80Hc-0005E2-Bq for guix-patches@gnu.org; Mon, 16 Apr 2018 05:18:44 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 904748cc (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 16 Apr 2018 09:21:43 +0000 (UTC) Date: Mon, 16 Apr 2018 11:18:21 +0200 From: Julien Lepiller Message-ID: <20180416111821.48042726@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/JHdH6yC2Wy=rlBd5RXVe/ku" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31175@debbugs.gnu.org --MP_/JHdH6yC2Wy=rlBd5RXVe/ku Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, here are two patches to add postgis and its dependency gdal. --MP_/JHdH6yC2Wy=rlBd5RXVe/ku Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-Add-gdal.patch >From ef9ce433164c4018642d436fa5a7849ddd6c37b6 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 16 Apr 2018 10:36:53 +0200 Subject: [PATCH 1/2] gnu: Add gdal. * gnu/packages/geo.scm (gdal): New variable. --- gnu/packages/geo.scm | 93 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 9c7c071db..08c843728 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -43,6 +43,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages image) #:use-module (gnu packages icu4c) + #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages statistics) @@ -611,3 +612,95 @@ spatial data and models on top of static maps from various online sources (e.g Google Maps and Stamen Maps). It includes tools common to those tasks, including functions for geolocation and routing.") (license license:gpl2))) + +(define-public gdal + (package + (name "gdal") + (version "2.2.4") + (source (origin + (method url-fetch) + (uri (string-append + "http://download.osgeo.org/gdal/" version "/gdal-" + version ".tar.gz")) + (sha256 + (base32 + "1951f7b69x3d1vic0rmq92q8f4bj3hbxnxmj5jl0cc3zg0isgmdr")) + (modules '((guix build utils))) + (snippet + `(begin + ;; TODO: frmts contains a lot more bundled code. + (for-each delete-file-recursively + ;; bundled code + '("frmts/png/libpng" + "frmts/gif/giflib" + "frmts/jpeg/libjpeg" + "frmts/jpeg/libjpeg12" + "frmts/gtiff/libtiff" + "frmts/gtiff/libgeotiff" + "frmts/zlib" + "ogr/ogrsf_frmts/geojson/libjson")))))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:configure-flags + (let-syntax ((with (syntax-rules () + ((_ option input) + (string-append option "=" + (assoc-ref %build-inputs input)))))) + (list + ;; TODO: --with-pcidsk, --with-pcraster + (with "--with-freexl" "freexl") + (with "--with-libjson-c" "json-c") + (with "--with-png" "libpng") + (with "--with-webp" "libwebp") + (with "--with-gif" "giflib") + (with "--with-jpeg" "libjpeg") + (with "--with-libtiff" "libtiff") + (with "--with-geotiff" "libgeotiff") + (with "--with-libz" "zlib") + "--with-pcre")) + #:phases + (modify-phases %standard-phases + (add-before 'build 'fix-path + (lambda _ + (substitute* "frmts/mrf/mrf_band.cpp" + (("\"../zlib/zlib.h\"") ""))))))) + (inputs + `(("freexl" ,freexl) + ("geos" ,geos) + ("giflib" ,giflib) + ("json-c" ,json-c) + ("libgeotiff" ,libgeotiff) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("libwebp" ,libwebp) + ("pcre" ,pcre) + ("zlib" ,zlib))) + (home-page "http://www.gdal.org/") + (synopsis "Raster and vector geospation data format library") + (description "GDAL is a translator library for raster and vector geospatial +data formats. As a library, it presents a single raster abstract data model +and single vector abstract data model to the calling application for all +supported formats. It also comes with a variety of useful command line +utilities for data translation and processing.") + (license (list + ; general license + license:expat + ; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf, + ; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp + ; frmts/mrf/ + license:bsd-3 + ; frmts/hdf4/hdf-eos/* + ; similar to the expat license, but without guarantee exclusion + (license:non-copyleft "file://frmts/hdf4/hdf-eos/README") + ; frmts/grib/degrib/ + license:public-domain ; with guarantee exclusion + ; port/cpl_minizip* + ; Some bsd-inspired license + (license:non-copyleft "file://port/LICENCE_minizip") + ; alg/internal_libqhull + ; Some 5-clause license + (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt") + ; frmts/mrf/libLERC + license:asl2.0)))) -- 2.17.0 --MP_/JHdH6yC2Wy=rlBd5RXVe/ku Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-gnu-Add-postgis.patch >From 0f844a0c65c484d0d52e67db1f63bc2892ef0aec Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 16 Apr 2018 10:45:52 +0200 Subject: [PATCH 2/2] gnu: Add postgis. * gnu/packages/geo.scm (postgis): New variable. --- gnu/packages/geo.scm | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 08c843728..1739e1e68 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -44,6 +44,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) @@ -704,3 +705,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)))) -- 2.17.0 --MP_/JHdH6yC2Wy=rlBd5RXVe/ku--