From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Sturmfels Subject: Overriding PostGIS install directories Date: Fri, 19 Jan 2018 16:10:51 +1100 Message-ID: <87r2qm5t7o.fsf@sturm.com.au> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecOxI-0008Ld-7e for guix-devel@gnu.org; Fri, 19 Jan 2018 00:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecOxE-0001Mo-5m for guix-devel@gnu.org; Fri, 19 Jan 2018 00:11:08 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecOxD-0001MW-Sk for guix-devel@gnu.org; Fri, 19 Jan 2018 00:11:04 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2359E20B90 for ; Fri, 19 Jan 2018 00:11:01 -0500 (EST) Received: from Marseille (203-214-132-4.perm.iinet.net.au [203.214.132.4]) by mail.messagingengine.com (Postfix) with ESMTPA id 1948C24235 for ; Fri, 19 Jan 2018 00:10:59 -0500 (EST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Folks, I'm attempting to add PostGIS to Guix - a GIS extension for PostgreSQL. The build phase runs ok, but the install phase fails trying to write to the postgresql package: /gnu/store/42d5rjrdkln6nwvzwdc8dyd4w6iy3n5j-coreutils-8.27/bin/mkdir: cannot create directory =E2=80=98/gnu/store/0haa85i5rhpxmmninqpkyn3rqax83887-postgresql-10.1/shar= e/contrib=E2=80=99: Permission denied That directory comes from `pg_config --sharedir`, run during configure. I'm trying to force configure to use /share instead by patching configure.ac as attached. The patch seems like it's being applied, as I can see the change in /tmp/guix-build-postgis-2.4.2.drv-7/postgis-2.4.2/configure.ac, but it seems that the corresponding "configure" file is unchanged, so I'm obviously missing something. Any thoughts on this or a better approach? Regards, Ben Ben Sturmfels Sturm Software Engineering www.sturm.com.au (03) 9024 2467 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gdal-and-postgis-wip.patch Content-Transfer-Encoding: quoted-printable diff --git a/gnu/local.mk b/gnu/local.mk index fb4babfdb..da6d65952 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -991,6 +991,7 @@ dist_patch_DATA =3D \ %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 =2D-- 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)) =20 +(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/gd= al-" + 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=3D" (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 cal= ling application for all supported formats. The related OGR library (which= lives within the GDAL source tree) provides a similar capability for simpl= e features vector data. + +GDAL supports 40+ popular data formats, including commonly used ones (GeoT= IFF, 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). Al= so supported many remote sensing and scientific data distribution formats s= uch as HDF, EOS FAST, NOAA L1B, NetCDF, FITS. + +OGR library supports popular vector formats like ESRI Shapefile, TIGER dat= a, 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/sourc= e/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 =20 + ;;; FIXME GNOME Maps only runs within GNOME. On i3, it fails with this err= or: ;;; (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/patch= es/postgis-config.patch new file mode 100644 index 000000000..a6ec1833a =2D-- /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" =3D "xno"; then +=20 + PGSQL_PKGLIBDIR=3D`"$PG_CONFIG" --pkglibdir` + PGSQL_LIBDIR=3D`"$PG_CONFIG" --libdir` +- PGSQL_SHAREDIR=3D`"$PG_CONFIG" --sharedir` ++ # Seems this one doesn't take effect? ++ PGSQL_SHAREDIR=3D/share/ +=20 + AC_MSG_RESULT([checking PostgreSQL version... $PGSQL_FULL_VERSION]) + dnl Ensure that we are using PostgreSQL >=3D 9.3 +@@ -504,7 +505,7 @@ if test "x$LIBLWGEOM_ONLY" =3D "xno"; then + AC_SUBST([PGSQL_BINDIR]) +=20 + dnl Extract the share directory +- PGSQL_SHAREDIR=3D`"$PG_CONFIG" --sharedir` ++ PGSQL_SHAREDIR=3D/share/ +=20 + AC_SUBST([PGSQL_SHAREDIR]) +=20 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEPn825zvdanEG+SAhAjwF4snAaPAFAlphfdsACgkQAjwF4snA aPDLUg/8DB8CyFQxo5LVj/C+KmTcQe5rgFhW+06rqVAjVg3GVLrNKClzb/SdIIbQ HapKG/yWtUXBzDf6wnWVvSNx92OEcmC6HkmlUMWOzYcmtM+si40bgAfmOHe3x6vl aLfjreo3t/FWKgAM7309sAu6UrR2XErqPtbtpRvGF2dD5Ft8foWl7Ca8gwplTIrD 3dBJnRrbDnhkNDaiabCjzhz50OT8Qq0EbC3ywfPnI42XufuXZ6fzPpl+nKraMF7X D7LIS3qf/pK4hKH8rEpm/oKY7CCiV95Y/5Ebiu0SBti/3h7q6e4BiO7OpHyNwV8O 4D0reI0ifW7wFQ00PNazUIZIYQz33J0EZ7Sa8Vlz++JQ9Q234wWQpUjtLohB8I4/ nInprN2z3Yl8lwDhoowUwevPWIlh9haXYWGQ85IauhnPCHuQ0+NOJqdQImluyGqh FvrvLHZOMQvRwIfKpKk3C3xqQQwndeAxfBJZviFW9RZ+E40JWXhhV2riQkmwTcRW YsTJ5XSAywvfkicpWXT+udjtW5/Bmf3F8+1GAanb5MxHbF5AbJZF5EWcj8B24UWK jscp8e3sEwXFgX8eWlCBE6SSy7ff4XSUWVprqQIWVXbWiR9KdJdv53hQIq3bkKnE pQP2dEbjSlvW5rpJQPwxZc9eLCFOmcqk650RWM6Sk0JFs/EIDj4= =iymd -----END PGP SIGNATURE----- --==-=-=--