Re: How do I correctly relocate PostGIS control files?

2020-11-02 Thread Julien Lepiller
The service simply builds a union-build of the postgis and postgresql packages, 
because postgresql looks for its extensions in the directory it's run from.

It could be that this behavior changed, or that the postgis package doesn't 
build its extension as expected.

To cgeck these hypothesis: can you check the error message contains the store 
path of the union (as opposed to only postresql). You should be able to find 
some of postgis files there in addition to postgresql files. For the second 
hypothesis, can you find the postgis.control file in the postgis package itself?

Le 2 novembre 2020 17:40:09 GMT-05:00, Gary Johnson  
a écrit :
>Hi Guix,
>
>I use Postgresql with PostGIS extensively for geospatial software
>development. While the default set of postgresql (v10.13) and postgis
>(v3.0.2) packages in Guix have worked well for me for some time, I am
>now in need of upgrading to the latest version in order to utilize
>newer
>functionality in the database software.
>
>To do this, I created a derivative package for postgresql (v13.0) as
>well as a derivative postgis package that uses the new postgresql
>package as an input. These packages compile and install correctly with
>"guix package -i".
>
>Here's my code:
>
>;;=
>
>(define-module (my-packages postgresql-13)
>#:use-module ((guix packages)  #:select (package origin
>base32))
>  #:use-module ((guix download)  #:select (url-fetch))
>  #:use-module ((gnu packages databases) #:select (postgresql))
>#:use-module ((gnu packages geo)   #:select (postgis gdal geos
>proj))
>  #:use-module ((gnu packages image) #:select (giflib))
>  #:use-module ((gnu packages web)   #:select (json-c))
>  #:use-module ((gnu packages image) #:select (libjpeg-turbo))
>  #:use-module ((gnu packages xml)   #:select (libxml2))
>  #:use-module ((gnu packages pcre)  #:select (pcre)))
>
>(define-public postgresql-13
>  (package
>   (inherit postgresql)
>   (name "postgresql")
>   (version "13.0")
>   (source (origin
>(method url-fetch)
>  (uri (string-append "https://ftp.postgresql.org/pub/source/v;
>version "/postgresql-" version ".tar.bz2"))
>(sha256
> (base32
>   "15i2b7m9a9430idqdgvrcyx66cpxz0v2d81nfqcm8ss3inz51rw0"))
>
>(define-public postgis-for-postgresql-13
>  (package
>   (inherit postgis)
>   (name "postgis")
>   (version "3.0.2")
>   (inputs
>`(("gdal" ,gdal)
>  ("geos" ,geos)
>  ("giflib" ,giflib)
>  ("json-c" ,json-c)
>  ("libjpeg" ,libjpeg-turbo)
>  ("libxml2" ,libxml2)
>  ("pcre" ,pcre)
>  ("postgresql" ,postgresql-13)
>  ("proj" ,proj)
>
>;;=
>
>Next, I moved to my OS config.scm file to set up the Postgresql
>Shepherd
>service and add PostGIS as an extension package for the DB, which
>should
>make its control files available to Postgresql at runtime.
>
>Here are the relevant sections:
>
>;;=
>
>(use-modules ... 
>((gnu services databases)#:select (postgresql-service-type
>postgresql-configuration postgresql-config-file))
>((my-packages postgresql-13) #:select (postgresql-13
>postgis-for-postgresql-13)))
>
>(operating-system
> ...
> (packages (cons* ...
>postgresql-13 postgis-for-postgresql-13 ; psql, raster2pgsql,
>shp2pgsql, etc.
>  %base-packages))
> (services (cons* ...
> (service postgresql-service-type (postgresql-configuration
> (postgresql postgresql-13)
>  (extension-packages (list postgis-for-postgresql-13))
>   (config-file (postgresql-config-file
> (hba-file my-postgres-hba)
>  (extra-config '(("max_worker_processes" "12")
>  ("max_parallel_workers" "40")
>   ("max_parallel_maintenance_workers" "8")
>("max_parallel_workers_per_gather" "4")
>   ("parallel_leader_participation" "on")))
>  %desktop-services)))
>
>;;=
>
>This compiles and installs successfully with "guix system reconfigure".
>
>However, when I connect to the Postgresql server with "psql -U
>postgres"
>and attempt to add the PostGIS extension to a database, I get the
>dreaded "could not open extension control file" error:
>

Broken emacs-treemacs package in current Guix

2020-11-02 Thread Gary Johnson
Hi Guix,

I recently moved my Emacs package management from ELPA to Guix, and
after creating quite a few additional package declarations using the
amazing "guix import elpa" command, I now have a working system that
doesn't have any packages installed through ELPA. Pretty cool stuff.

However, one package is sadly failing to build on my current
installation of Guix: emacs-treemacs

If I try to build the emacs-treemacs package that comes with Guix
(declared in emacs-xyz.scm), this crashes out due to a failing test
during its "make test" phase.

As an alternative, I tried creating a new emacs-treemacs-melpa package
with "guix import elpa". Here's the resulting code once I added in the
necessary module imports:

;;==

(define-module (my-packages emacs-packages)
  #:use-module ((guix packages)   #:select (package origin base32))
  #:use-module ((guix download)   #:select (url-fetch))
  #:use-module ((guix build-system emacs) #:select (emacs-build-system))
  #:use-module ((gnu packages emacs-xyz)  #:select (emacs-dash
emacs-s
emacs-f
emacs-ace-window
emacs-pfuture
emacs-hydra
emacs-ht)))

(define-public emacs-treemacs-melpa
  (package
   (name "emacs-treemacs-melpa")
   (version "20201026.2006")
   (source
(origin
 (method url-fetch)
 (uri (string-append
   "https://melpa.org/packages/treemacs-;
   version
   ".tar"))
 (sha256
  (base32
   "10dlxizx3nhviz5sfbfavsfglpwschkl3z3wwryw8930bp0swh5h"
   (build-system emacs-build-system)
   (propagated-inputs
`(("emacs-dash" ,emacs-dash)
  ("emacs-s" ,emacs-s)
  ("emacs-f" ,emacs-f)
  ("emacs-ace-window" ,emacs-ace-window)
  ("emacs-pfuture" ,emacs-pfuture)
  ("emacs-hydra" ,emacs-hydra)
  ("emacs-ht" ,emacs-ht)))
   (home-page
"https://github.com/Alexander-Miller/treemacs;)
   (synopsis "A tree style file explorer package")
   (description
"A powerful and flexible file tree project explorer.")
   (license #f)))

;;==

This package successfully compiles and installs with "guix package -i".

However, when I open treemacs, none of its icons are available, and my
*Messages* buffer is filled with these error messages:

;;==

Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/root-closed.png’
 [47 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/dir-closed.png’
 [7 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/js.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/npm.png’ 
[2 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/txt.png’ [2 
times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/org.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/license.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/txt.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/git.png’ [2 
times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/js.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/root-closed.png’
 [11 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/dir-closed.png’
 [7 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/js.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/npm.png’ 
[2 times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/txt.png’ [2 
times]
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/org.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/vsc/license.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/txt.png’
Cannot find image file 
‘/home/gjohnson/.guix-profile/share/emacs/site-lisp/icons/default/git.png’ [2 
times]
Cannot find image file 

How do I correctly relocate PostGIS control files?

2020-11-02 Thread Gary Johnson
Hi Guix,

I use Postgresql with PostGIS extensively for geospatial software
development. While the default set of postgresql (v10.13) and postgis
(v3.0.2) packages in Guix have worked well for me for some time, I am
now in need of upgrading to the latest version in order to utilize newer
functionality in the database software.

To do this, I created a derivative package for postgresql (v13.0) as
well as a derivative postgis package that uses the new postgresql
package as an input. These packages compile and install correctly with
"guix package -i".

Here's my code:

;;=

(define-module (my-packages postgresql-13)
  #:use-module ((guix packages)  #:select (package origin base32))
  #:use-module ((guix download)  #:select (url-fetch))
  #:use-module ((gnu packages databases) #:select (postgresql))
  #:use-module ((gnu packages geo)   #:select (postgis gdal geos proj))
  #:use-module ((gnu packages image) #:select (giflib))
  #:use-module ((gnu packages web)   #:select (json-c))
  #:use-module ((gnu packages image) #:select (libjpeg-turbo))
  #:use-module ((gnu packages xml)   #:select (libxml2))
  #:use-module ((gnu packages pcre)  #:select (pcre)))

(define-public postgresql-13
  (package
   (inherit postgresql)
   (name "postgresql")
   (version "13.0")
   (source (origin
(method url-fetch)
(uri (string-append "https://ftp.postgresql.org/pub/source/v;
version "/postgresql-" version ".tar.bz2"))
(sha256
 (base32
  "15i2b7m9a9430idqdgvrcyx66cpxz0v2d81nfqcm8ss3inz51rw0"))

(define-public postgis-for-postgresql-13
  (package
   (inherit postgis)
   (name "postgis")
   (version "3.0.2")
   (inputs
`(("gdal" ,gdal)
  ("geos" ,geos)
  ("giflib" ,giflib)
  ("json-c" ,json-c)
  ("libjpeg" ,libjpeg-turbo)
  ("libxml2" ,libxml2)
  ("pcre" ,pcre)
  ("postgresql" ,postgresql-13)
  ("proj" ,proj)

;;=

Next, I moved to my OS config.scm file to set up the Postgresql Shepherd
service and add PostGIS as an extension package for the DB, which should
make its control files available to Postgresql at runtime.

Here are the relevant sections:

;;=

(use-modules ... 
 ((gnu services databases)#:select (postgresql-service-type 
postgresql-configuration postgresql-config-file))
 ((my-packages postgresql-13) #:select (postgresql-13 
postgis-for-postgresql-13)))

(operating-system
 ...
 (packages (cons* ...
  postgresql-13 postgis-for-postgresql-13 ; psql, raster2pgsql, 
shp2pgsql, etc.
  %base-packages))
 (services (cons* ...
  (service postgresql-service-type (postgresql-configuration
(postgresql postgresql-13)
(extension-packages (list 
postgis-for-postgresql-13))
(config-file 
(postgresql-config-file
  (hba-file 
my-postgres-hba)
  (extra-config 
'(("max_worker_processes" "12")

  ("max_parallel_workers" "40")

  ("max_parallel_maintenance_workers" "8")

  ("max_parallel_workers_per_gather" "4")

  ("parallel_leader_participation" "on")))
  %desktop-services)))

;;=

This compiles and installs successfully with "guix system reconfigure".

However, when I connect to the Postgresql server with "psql -U postgres"
and attempt to add the PostGIS extension to a database, I get the
dreaded "could not open extension control file" error:

;;=

db=# create extension postgis;
ERROR:  could not open extension control file

"/gnu/store/8m48v5132qpmxim9s4g9vca59qgay2d9-postgresql-13.0/share/extension/postgis.control":
 No such file or directory


Re: guix environment guix for guix manual

2020-11-02 Thread Hubert Lombard
Hi, Julien!

Thank you so much!

Cheers

Le Sun, 01 Nov 2020 19:48:17 -0500,
Julien Lepiller  a écrit :

> Le 1 novembre 2020 17:01:44 GMT-05:00, Hubert Lombard
>  a écrit :
> >Hi help-guix!
> >
> >I've made:
> >
> >$ guix environment --ad-hoc git -- git clone
> >https://git.savannah.gnu.org/git/guix.git
> >
> >With the current guix-manual-1.2.0-pre2.fr.po:
> >
> >$ cd guix
> >~/guix$ cp /home/hubert/Guix\ System/Contributions/TP\
> >guix-manual/fr.po/guix-manual-1.2.0-pre2.fr.po
> >po/doc/guix-manual.fr.po ~/guix$ guix environment guix ~/guix [env]$
> >./bootstrap ~/guix [env]$ ./configure --localstatedir=/var
> >~/guix [env]$ make
> >~/guix [env]$ make info && info -f doc/guix.fr.info
> >
> >I know now that I should have make '$ cp /home/hubert/Guix\
> >System/Contributions/TP\ guix-manual/fr.po/ po/doc/guix-manual.fr.po'
> >
> >But, do you think it's Ok anyway?  
> 
> Yes, as long as you copied the file you wanted to compile.
> 
> >
> >Otherwise, it seemed to work...
> >
> >In the 'make' phase, I saw: : warning: shadows
> >previous definition of `-location' at  for
> >(almost?) each 'gnu/services/...' Do you think it's normal or I'll
> >have to retry?  
> 
> This is only a warning for guix code, it's not related to the manual
> at all. So all is good.
> 
> >
> >The last command produced the guix manual and it seems good.
> >
> >Do I need to make a: '$ po4a-updatepo'?  
> 
> Not by yourself. It's done by me when I generate a new pot for the TP
> :)
> 
> >
> >In doubt, I prefer to be sure ;-)
> >
> >Thanks in advance for your advice!
> >
> >Cheers,  



--