Bug 226962

Summary: databases/postgis24 Question: How to run postgis24 with postgresql10 ?
Product: Ports & Packages Reporter: Don Jackson <dcj+freebsd-bugs>
Component: Individual Port(s)Assignee: Walter Schwarzenfeld <w.schwarzenfeld>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: FreeBSD, john, lbartoletti, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (lbartoletti)
Version: Latest   
Hardware: Any   
OS: Any   

Description Don Jackson 2018-03-27 04:40:50 UTC
When I install the postgis24 package, it removes the postgresql10 pkg, and installs postgresql95.

Is there a way to run postgis24 with postgresql10?

Would building the port on a machine with pg10 work?

Or does changing the postgis pkg/port require a non-trivial effort to change the postgis source/build-system?

Thanks in advance for any tips/pointers/advice.
Comment 1 Loïc Bartoletti freebsd_committer freebsd_triage 2018-03-27 05:40:45 UTC
Yes, normally, it will be possible with this USE
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213038
Comment 2 Shane 2018-03-30 18:51:30 UTC
postgis is setup with USES=pgsql - this means is uses whatever postgresql version is set as default.

If you are installing the postgis pkg from the public pkg repo, then it will have been built to use postgresql 9.5 which is the system default version, leading to it wanting to replace your existing PG10 install. To use postgis with another version you will need to compile it yourself, building the port should prefer an installed version over the default settings.

If you were setting up your own pkg repo you would need to adjust your default version by adding DEFAULT_VERSIONS= pgsql=10 to the make.conf. You can also do that if you build all your own ports.

You will get the same issue with other ports that depend on the postgresql client libraries.
Comment 3 John Parkey 2018-05-01 19:40:50 UTC
I am having a similar problem.  I am building using synth, on FreeBSD 11.1.

My /etc/make.conf contains a line to add DEFAULT_VERSIONS+=pgsql=10

I have cleared down the whole environment, so that I am building everything from scratch.  First I build postgresql10-server, -client, -contrib, to make sure that they are all there.  If I then try to build postgis24, something in the dependency tree causes postgresql95-server to be pulled in.

I stripped it right back and found that graphics/gdal pulls in 17 dependencies, and this results in postgresql95-server being built again.  I edited the Makefile for graphics/gdal to include 'pgsql' in the USES directive, but this didn't solve the problem.  Looking at the dependencies, it wasn't clear to me what was causing this - I thought that it might be something to do with graphics/libgeotiff, but I couldn't find anything definitive (and, to be honest, I don't really know what I am looking for).

I edited /usr/ports/Mk/bsd.default-versions.mk and set PGSQL_DEFAULT?= 10 - this allowed graphics/gdal to build, and so then I tried databases/postgis24 which pulled in a further 168 dependencies, and everything built cleanly (hurrah! finally some progress after two days).  The remaining 728 packages are building now, so I am hopeful that they will complete without postgresql95 being pulled in again.

Clearly what I have done is a bit of a hack, and I risk the bsd.default-versions.mk file being overwritten at some point when I refresh the ports, but hopefully it will help to narrow down the source of the problem.
Comment 4 Loïc Bartoletti freebsd_committer freebsd_triage 2018-11-03 08:01:28 UTC
With https://reviews.freebsd.org/D17320 only the latest stable postgis version will be available.
Comment 5 Loïc Bartoletti freebsd_committer freebsd_triage 2019-03-16 12:44:31 UTC
I updated postgis. To install postgis24 you must do it manually since the pkg is still available with the default version of postgresql version 9.5 to date

you can first install postgresql10 and then compile the postgis24 port by doing
make -C /usr/ports/databases/postgis24

For information postgis25 is available in ports.
Comment 6 Loïc Bartoletti freebsd_committer freebsd_triage 2019-03-28 19:08:45 UTC
could it be closed?
Comment 7 Walter Schwarzenfeld freebsd_triage 2019-08-13 19:22:15 UTC
More than a year no answer from reporter, I close with feedback timeout!