aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libpq/unix
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libpq/unix')
-rw-r--r--vcpkg/ports/libpq/unix/fix-configure.patch79
-rw-r--r--vcpkg/ports/libpq/unix/installdirs.patch48
-rw-r--r--vcpkg/ports/libpq/unix/mingw-install.patch36
-rw-r--r--vcpkg/ports/libpq/unix/no-server-tools.patch37
-rw-r--r--vcpkg/ports/libpq/unix/python.patch35
-rw-r--r--vcpkg/ports/libpq/unix/single-linkage.patch56
6 files changed, 291 insertions, 0 deletions
diff --git a/vcpkg/ports/libpq/unix/fix-configure.patch b/vcpkg/ports/libpq/unix/fix-configure.patch
new file mode 100644
index 0000000..34ceb36
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/fix-configure.patch
@@ -0,0 +1,79 @@
+diff --git a/configure.ac b/configure.ac
+index 7f97248..48ff1a1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -19,7 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
+
+ AC_INIT([PostgreSQL], [16.9], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
+
+-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
++cross_compiling=yes # Avoid conftest loading shared objects
++m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_warn([unsupported],[Autoconf version 2.69 is required.
+ Untested combinations of 'autoconf' and PostgreSQL versions are not
+ recommended. You can remove the check from 'configure.ac' but it is then
+ your responsibility whether the result works or not.])])
+@@ -1311,7 +1312,8 @@ if test "$enable_thread_safety" = yes; then
+ fi
+
+ if test "$with_readline" = yes; then
+- PGAC_CHECK_READLINE
++ PKG_CHECK_MODULES([READLINE], [readline], [HAVE_LIBREADLINE=1], [pgac_cv_check_readline=no])
++ LIBS="$READLINE_LIBS $LIBS"
+ if test x"$pgac_cv_check_readline" = x"no"; then
+ AC_MSG_ERROR([readline library not found
+ If you have readline already installed, see config.log for details on the
+@@ -1321,7 +1323,7 @@ Use --without-readline to disable readline support.])
+ fi
+
+ if test "$with_zlib" = yes; then
+- AC_CHECK_LIB(z, inflate, [],
++ PKG_CHECK_MODULES([ZLIB], [zlib], [LIBS="$ZLIB_LIBS $LIBS"],
+ [AC_MSG_ERROR([zlib library not found
+ If you have zlib already installed, see config.log for details on the
+ failure. It is possible the compiler isn't looking in the proper directory.
+@@ -1370,6 +1372,9 @@ if test "$with_ssl" = openssl ; then
+ # Minimum required OpenSSL version is 1.0.1
+ AC_DEFINE(OPENSSL_API_COMPAT, [0x10001000L],
+ [Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.])
++ PKG_CHECK_MODULES([CRYPTO_new_ex_data], [libcrypto], [LIBS="$CRYPTO_new_ex_data_LIBS $LIBS"], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
++ PKG_CHECK_MODULES([SSL_new], [libssl], [LIBS="$SSL_new_LIBS $LIBS"], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
++ if false ; then
+ if test "$PORTNAME" != "win32"; then
+ AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
+ AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
+@@ -1377,6 +1382,7 @@ if test "$with_ssl" = openssl ; then
+ AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
+ AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
+ fi
++ fi
+ # Functions introduced in OpenSSL 1.0.2. LibreSSL does not have
+ # SSL_CTX_set_cert_cb().
+ AC_CHECK_FUNCS([X509_get_signature_nid SSL_CTX_set_cert_cb])
+@@ -1403,19 +1409,23 @@ if test "$with_pam" = yes ; then
+ fi
+
+ if test "$with_libxml" = yes ; then
+- AC_CHECK_LIB(xml2, xmlSaveToBuffer, [], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])])
++ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.23], [AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if with xml2])], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])])
++ LIBS="$LIBXML2_LIBS $LIBS"
+ fi
+
+ if test "$with_libxslt" = yes ; then
+- AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
++ PKG_CHECK_MODULES([LIBXSLT], [libxslt], [AC_DEFINE(HAVE_LIBXSLT,1,[Define to 1 if with xslt])], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
++ LIBS="$LIBXSLT_LIBS $LIBS"
+ fi
+
+ if test "$with_lz4" = yes ; then
+- AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
++ PKG_CHECK_MODULES([LZ4], [liblz4], [AC_DEFINE(HAVE_LIBLZ4,1,[Define to 1 if with lz4])], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
++ LIBS="$LZ4_LIBS $LIBS"
+ fi
+
+ if test "$with_zstd" = yes ; then
+- AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
++ PKG_CHECK_MODULES([ZSTD], [libzstd], [AC_DEFINE(HAVE_LIBZSTD,1,[Define to 1 if with zstd])], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
++ LIBS="$ZSTD_LIBS $LIBS"
+ fi
+
+ # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
diff --git a/vcpkg/ports/libpq/unix/installdirs.patch b/vcpkg/ports/libpq/unix/installdirs.patch
new file mode 100644
index 0000000..ae6653f
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/installdirs.patch
@@ -0,0 +1,48 @@
+diff --git a/src/Makefile.global.in b/src/Makefile.global.in
+index 5dacc4d..a9a797e 100644
+--- a/src/Makefile.global.in
++++ b/src/Makefile.global.in
+@@ -100,14 +100,14 @@ datarootdir := @datarootdir@
+
+ bindir := @bindir@
+
+-datadir := @datadir@
++datadir := @datadir@/postgresql
+ ifeq "$(findstring pgsql, $(datadir))" ""
+ ifeq "$(findstring postgres, $(datadir))" ""
+ override datadir := $(datadir)/postgresql
+ endif
+ endif
+
+-sysconfdir := @sysconfdir@
++sysconfdir := @sysconfdir@/postgresql
+ ifeq "$(findstring pgsql, $(sysconfdir))" ""
+ ifeq "$(findstring postgres, $(sysconfdir))" ""
+ override sysconfdir := $(sysconfdir)/postgresql
+@@ -116,7 +116,7 @@ endif
+
+ libdir := @libdir@
+
+-pkglibdir = $(libdir)
++pkglibdir = $(libdir)/postgresql
+ ifeq "$(findstring pgsql, $(pkglibdir))" ""
+ ifeq "$(findstring postgres, $(pkglibdir))" ""
+ override pkglibdir := $(pkglibdir)/postgresql
+@@ -125,7 +125,7 @@ endif
+
+ includedir := @includedir@
+
+-pkgincludedir = $(includedir)
++pkgincludedir = $(includedir)/postgresql
+ ifeq "$(findstring pgsql, $(pkgincludedir))" ""
+ ifeq "$(findstring postgres, $(pkgincludedir))" ""
+ override pkgincludedir := $(pkgincludedir)/postgresql
+@@ -134,7 +134,7 @@ endif
+
+ mandir := @mandir@
+
+-docdir := @docdir@
++docdir := @docdir@/postgresql
+ ifeq "$(findstring pgsql, $(docdir))" ""
+ ifeq "$(findstring postgres, $(docdir))" ""
+ override docdir := $(docdir)/postgresql
diff --git a/vcpkg/ports/libpq/unix/mingw-install.patch b/vcpkg/ports/libpq/unix/mingw-install.patch
new file mode 100644
index 0000000..ffeea02
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/mingw-install.patch
@@ -0,0 +1,36 @@
+diff --git a/src/Makefile.shlib b/src/Makefile.shlib
+index 16255d7..51e9ed2 100644
+--- a/src/Makefile.shlib
++++ b/src/Makefile.shlib
+@@ -85,7 +85,11 @@ else
+ # Naming convention for dynamically loadable modules
+ shlib = $(NAME)$(DLSUFFIX)
+ endif
++ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared)
++stlib = lib$(NAME).dll.a
++else
+ stlib = lib$(NAME).a
++endif
+
+ ifndef soname
+ # additional flags for backend modules
+@@ -468,6 +472,9 @@ endif
+ else # no soname
+ $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)'
+ endif
++ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared)
++ mv '$(DESTDIR)$(libdir)/$(shlib)' '$(DESTDIR)$(libdir)/../bin/$(shlib)'
++endif
+
+
+ installdirs-lib:
+@@ -476,6 +483,9 @@ ifdef soname
+ else
+ $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'
+ endif
++ifeq ($(PORTNAME)-$(LIBPQ_LIBRARY_TYPE), win32-shared)
++ $(MKDIR_P) '$(DESTDIR)$(libdir)/../bin'
++endif
+
+
+ ##
diff --git a/vcpkg/ports/libpq/unix/no-server-tools.patch b/vcpkg/ports/libpq/unix/no-server-tools.patch
new file mode 100644
index 0000000..f83682a
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/no-server-tools.patch
@@ -0,0 +1,37 @@
+diff --git a/src/bin/Makefile b/src/bin/Makefile
+index 7f9dde9..bc6d835 100644
+--- a/src/bin/Makefile
++++ b/src/bin/Makefile
+@@ -13,29 +13,20 @@ subdir = src/bin
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
++.NOTPARALLEL:
++# incl. https://www.postgresql.org/docs/current/reference-client.html
++# excl. https://www.postgresql.org/docs/current/reference-server.html
+ SUBDIRS = \
+- initdb \
+ pg_amcheck \
+- pg_archivecleanup \
+ pg_basebackup \
+- pg_checksums \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetwal \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+ pg_verifybackup \
+- pg_waldump \
+ pgbench \
+ psql \
+ scripts
+
+ ifeq ($(PORTNAME), win32)
+-SUBDIRS += pgevent
+ else
+ ALWAYS_SUBDIRS += pgevent
+ endif
diff --git a/vcpkg/ports/libpq/unix/python.patch b/vcpkg/ports/libpq/unix/python.patch
new file mode 100644
index 0000000..7d8f58d
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/python.patch
@@ -0,0 +1,35 @@
+diff --git a/configure.ac b/configure.ac
+index 7f97248992..33b6c84fc4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -891,7 +891,9 @@ AC_SUBST(with_perl)
+ # Optionally build Python modules (PL/Python)
+ #
+ AC_MSG_CHECKING([whether to build Python modules])
+-PGAC_ARG_BOOL(with, python, no, [build Python modules (PL/Python)])
++PGAC_ARG_OPTARG(with, python, [PYTHON_VERSION], [build Python modules (PL/Python)],
++ [],
++ [python_version=$withval])
+ AC_MSG_RESULT([$with_python])
+ AC_SUBST(with_python)
+
+@@ -1214,7 +1216,18 @@ fi
+
+ if test "$with_python" = yes; then
+ PGAC_PATH_PYTHON
+- PGAC_CHECK_PYTHON_EMBED_SETUP
++ python_majorversion=3
++ PKG_CHECK_MODULES(PYTHON_EMBED, python-${python_version}-embed)
++ python_includespec="${PYTHON_EMBED_CFLAGS}"
++ python_libdir=[$(echo " ${PYTHON_EMBED_LIBS}" | sed -e 's/\( -L[^ ]*\).*/\1/' -e 's/^.* -L//')]
++ python_libspec="${PYTHON_EMBED_LIBS}"
++ python_additional_libs=""
++ AC_SUBST(python_majorversion)
++ AC_SUBST(python_version)
++ AC_SUBST(python_includespec)
++ AC_SUBST(python_libdir)
++ AC_SUBST(python_libspec)
++ AC_SUBST(python_additional_libs)
+ fi
+
+ if test x"$cross_compiling" = x"yes" && test -z "$with_system_tzdata"; then
diff --git a/vcpkg/ports/libpq/unix/single-linkage.patch b/vcpkg/ports/libpq/unix/single-linkage.patch
new file mode 100644
index 0000000..dd149c7
--- /dev/null
+++ b/vcpkg/ports/libpq/unix/single-linkage.patch
@@ -0,0 +1,56 @@
+diff --git a/src/Makefile.shlib b/src/Makefile.shlib
+index 551023c..16255d7 100644
+--- a/src/Makefile.shlib
++++ b/src/Makefile.shlib
+@@ -260,10 +260,14 @@ endif
+
+ .PHONY: all-lib all-static-lib all-shared-lib
+
++ifndef LIBPQ_LIBRARY_TYPE
+ all-lib: all-shared-lib
+ ifdef soname
+ # no static library when building a dynamically loadable module
+ all-lib: all-static-lib
++endif
++else
++all-lib: all-$(LIBPQ_LIBRARY_TYPE)-lib
+ all-lib: lib$(NAME).pc
+ endif
+
+@@ -417,9 +421,13 @@ endif # PORTNAME == cygwin || PORTNAME == win32
+ ##
+
+ .PHONY: install-lib install-lib-static install-lib-shared installdirs-lib
++ifndef LIBPQ_LIBRARY_TYPE
+ install-lib: install-lib-shared
+ ifdef soname
+ install-lib: install-lib-static
++endif
++else
++install-lib: install-lib-$(LIBPQ_LIBRARY_TYPE)
+ install-lib: install-lib-pc
+ endif
+
+diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
+index 8abdb09..185461e 100644
+--- a/src/interfaces/libpq/Makefile
++++ b/src/interfaces/libpq/Makefile
+@@ -115,6 +115,7 @@ backend_src = $(top_srcdir)/src/backend
+ # Also skip the test on platforms where libpq infrastructure may be provided
+ # by statically-linked libraries, as we can't expect them to honor this
+ # coding rule.
++ifeq ($(LIBPQ_LIBRARY_TYPE), shared)
+ libpq-refs-stamp: $(shlib)
+ ifneq ($(enable_coverage), yes)
+ ifeq (,$(filter aix solaris,$(PORTNAME)))
+@@ -124,6 +125,10 @@ ifeq (,$(filter aix solaris,$(PORTNAME)))
+ endif
+ endif
+ touch $@
++else
++.PHONY: libpq-refs-stamp
++libpq-refs-stamp:
++endif
+
+ # Make dependencies on pg_config_paths.h visible in all builds.
+ fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h