packages/libs/postgresql/patches/300-fix-pc-file.patch
Sebastian Kemper 00882ebb36 postgresql: fix pkg-config file
Currently the pc file has includedir hard coded to "/usr/include" and
libdir to "/usr/lib". This commit changes this so they can be controlled
via the "prefix" variable.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-03-05 22:41:21 +01:00

33 lines
1.2 KiB
Diff

--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -396,14 +396,27 @@ endif # PORTNAME == cygwin || PORTNAME =
%.pc: $(MAKEFILE_LIST)
- echo 'Name: lib$(NAME)' >$@
+ echo 'prefix=$(prefix)' >$@
+ echo 'exec_prefix=$(exec_prefix)' >>$@
+ifeq ($(patsubst $(prefix)/%,,$(includedir)),)
+ echo 'includedir=$${prefix}/$(patsubst $(prefix)/%,%,$(includedir))' >>$@
+else
+ echo 'includedir=$(includedir)' >>$@
+endif
+ifeq ($(patsubst $(exec_prefix)/%,,$(libdir)),)
+ echo 'libdir=$${exec_prefix}/$(patsubst $(exec_prefix)/%,%,$(libdir))' >>$@
+else
+ echo 'libdir=$(libdir)' >>$@
+endif
+ echo >>$@
+ echo 'Name: lib$(NAME)' >>$@
echo 'Description: PostgreSQL lib$(NAME) library' >>$@
echo 'Url: http://www.postgresql.org/' >>$@
echo 'Version: $(VERSION)' >>$@
echo 'Requires: ' >>$@
echo 'Requires.private: $(PKG_CONFIG_REQUIRES_PRIVATE)' >>$@
- echo 'Cflags: -I$(includedir)' >>$@
- echo 'Libs: -L$(libdir) -l$(NAME)' >>$@
+ echo 'Cflags: -I$${includedir}' >>$@
+ echo 'Libs: -L$${libdir} -l$(NAME)' >>$@
# Record -L flags that the user might have passed in to the PostgreSQL
# build to locate third-party libraries (e.g., ldap, ssl). Filter out
# those that point inside the build or source tree. Use sort to