Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to pkg-config to find out the information about libpq #1001

Open
darix opened this issue Oct 23, 2019 · 8 comments
Open

switch to pkg-config to find out the information about libpq #1001

darix opened this issue Oct 23, 2019 · 8 comments

Comments

@darix
Copy link

darix commented Oct 23, 2019

pg_config was meant for building server extensions.

@dvarrazzo
Copy link
Member

Patch?

@dvarrazzo
Copy link
Member

AFAICS pkg-config only deals with the system package. On my ubuntu laptop I have PG 11 installed but libpq.pg declares to be PG 12 (it belongs to the libpq-dev package). I don't think this can be used.

@darix
Copy link
Author

darix commented Oct 27, 2019

this is not true. pkg-config support is there since pg 8 or so. in doubt you need to set PKG_CONFIG_PATH to find the .pc files for your local installation. pg_config is not meant for client bindings.

So I would kindly ask to reopen this bug.

@darix
Copy link
Author

darix commented Oct 27, 2019

@dvarrazzo
Copy link
Member

I can keep it open as a feature request but I'm not keen to dedicate personal time to this change.

@donaldguy
Copy link

pkg-config would also save some pain for building on macOS with homebrew openssl

I have export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" in my dotfiles

but that was no dice here.

I had to set an explicit

export CPPFLAGS="-I/usr/local/opt/openssl/include"

to get psycopg2 to build when everything else has been able to find it

@darix
Copy link
Author

darix commented Nov 22, 2019

Does pkg-config --libs --cflags openssl give you the correct data?

@dvarrazzo
Copy link
Member

#1315 shows how less maintainable a pkg-config solution is compared to pg_config.

ldv-klever-admin pushed a commit to ldv-klever/klever that referenced this issue Jan 13, 2022
In addition, elimanate unnecessary dependency (development package for
PostgreSQL).

This helps to avoid issues on some new disctibutions like openSUSE 15.3
that misses the pg_config utility necessary to install psycopg2 from
sources (psycopg/psycopg2#1001). Probably
there will be some performance degradation, but it is not crucial for
our use cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants