[Proposal] Generate pkg-config for server module development
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t52918psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 27, 2026 at 05:35 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t52918_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t52918_1 && git checkout t52918_1Patchset v1 (message #1) is on t52918_1
Hello hackers!
I've been looking into making it easier for extension authors to use
other build
systems than make. I don't have everything in place just yet, but I
believe this
first part where we generate pkg-config files for building server
modules can be
useful on it's own.
I'm not entirely sure about what parameters we should include in the
pkg-config
file, but what I have in the attached patch is inspired by PGXS and the
pkg-config files we already generate for shared libraries.
A meson.build file using this could look something like this:
project('my_extension', 'c', default_options: { 'b_lundef': false })
pg_dep = dependency('postgresql-server')
shared_library(
'my_extension',
name_prefix: '',
sources: ['src/my_code.c'],
dependencies: pg_dep,
install: true,
install_dir: pg_dep.get_variable('libdir'),
)
I choose the Makefile to add this to quite arbitrarily, I'm sure
arguments can
be made for many of them.
Any feedback is highly appreciated! We would also need to add pkg-config for
building frontend tools I believe.
--
Anders Åstrand
Percona
On 12/17/25 3:17 PM, Anders Åstrand wrote:
I'm not entirely sure about what parameters we should include in the
pkg-config
file, but what I have in the attached patch is inspired by PGXS and the
pkg-config files we already generate for shared libraries.
Have you looked at Nazir's work in progress for generating pkg-config
files in Meson[1]? Maybe he has some ideas for what parameters to
include. In general I think the goal should be to include the stuff
which is in pg_conifg.
Will look at the actual patch later.
References
1.
/messages/by-id/CAN55FZ138OBEehyxD1FKySMxKFteqf_VOR8LBkz-055YGU12rg@mail.gmail.com
Andreas
On 2026-01-03 01:24, Andreas Karlsson wrote:
On 12/17/25 3:17 PM, Anders Åstrand wrote:
I'm not entirely sure about what parameters we should include in the
pkg-config
file, but what I have in the attached patch is inspired by PGXS and the
pkg-config files we already generate for shared libraries.Have you looked at Nazir's work in progress for generating pkg-config
files in Meson[1]? Maybe he has some ideas for what parameters to
include. In general I think the goal should be to include the stuff
which is in pg_conifg.
No I had not! Thank you for pointing me to that thread, it didn't seem
related when I was looking for threads about this. That patch seems much
more complete and I should probably just port it to make and include
both patches here.
It's reassuring that that patch also add it to backends build file, I
was very unsure about that.
Will look at the actual patch later.
References
1.
/messages/by-id/CAN55FZ138OBEehyxD1FKySMxKFteqf_VOR8LBkz-055YGU12rg@mail.gmail.comAndreas
--
Anders Åstrand
Percona
On 05.01.26 10:41, Anders Åstrand wrote:
On 2026-01-03 01:24, Andreas Karlsson wrote:
On 12/17/25 3:17 PM, Anders Åstrand wrote:
I'm not entirely sure about what parameters we should include in the
pkg-config
file, but what I have in the attached patch is inspired by PGXS and the
pkg-config files we already generate for shared libraries.Have you looked at Nazir's work in progress for generating pkg-config
files in Meson[1]? Maybe he has some ideas for what parameters to
include. In general I think the goal should be to include the stuff
which is in pg_conifg.No I had not! Thank you for pointing me to that thread, it didn't seem
related when I was looking for threads about this. That patch seems much
more complete and I should probably just port it to make and include
both patches here.It's reassuring that that patch also add it to backends build file, I
was very unsure about that.Will look at the actual patch later.
References
1. https://www.postgresql.org/message-id/
CAN55FZ138OBEehyxD1FKySMxKFteqf_VOR8LBkz-055YGU12rg%40mail.gmail.com
I'm changing this CF entry to "Withdrawn". Let's collaborate on the
other thread.