diff --git a/ports/libpq/config.pl b/ports/libpq/config.pl index 5538aae221..412eb09c48 100644 --- a/ports/libpq/config.pl +++ b/ports/libpq/config.pl @@ -7,18 +7,19 @@ our $config = { # blocksize => 8, # --with-blocksize, 8kB by default # wal_blocksize => 8, # --with-wal-blocksize, 8kB by default - ldap => undef, # --with-ldap + ldap => 1, # --with-ldap extraver => undef, # --with-extra-version= gss => undef, # --with-gssapi= icu => undef, # --with-icu= lz4 => undef, # --with-lz4= + zstd => undef, # --with-zstd= nls => undef, # --enable-nls= tap_tests => undef, # --enable-tap-tests tcl => undef, # --with-tcl= - perl => undef, # --with-perl + perl => undef, # --with-perl= python => undef, # --with-python= - openssl => undef, # --with-openssl= - uuid => undef, # --with-ossp-uuid + openssl => undef, # --with-ssl=openssl with + uuid => undef, # --with-uuid= xml => undef, # --with-libxml= xslt => undef, # --with-libxslt= iconv => undef, # (not in configure, path to iconv) diff --git a/ports/libpq/patches/fix-configure.patch b/ports/libpq/patches/fix-configure.patch index 716e7a0a9b..6fd28899cd 100644 --- a/ports/libpq/patches/fix-configure.patch +++ b/ports/libpq/patches/fix-configure.patch @@ -4,7 +4,7 @@ index fba79ee..4fadb94 100644 +++ b/configure.ac @@ -19,7 +19,7 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - AC_INIT([PostgreSQL], [14.4], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/]) + AC_INIT([PostgreSQL], [15.2], [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. +m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_warn([unsupported],[Autoconf version 2.69 is required. @@ -48,7 +48,7 @@ index fba79ee..4fadb94 100644 # Function introduced in OpenSSL 1.0.2. AC_CHECK_FUNCS([X509_get_signature_nid]) # Functions introduced in OpenSSL 1.1.0. We used to check for -@@ -1273,15 +1278,18 @@ if test "$with_pam" = yes ; then +@@ -1365,15 +1365,18 @@ if test "$with_pam" = yes ; then fi if test "$with_libxml" = yes ; then @@ -69,4 +69,10 @@ index fba79ee..4fadb94 100644 + 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], [zstd], [AC_DEFINE(HAVE_LIBZSTD,1,[Define to 1 if with lz4])], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])]) ++ LIBS="$LZ4_LIBS $LIBS" + fi + # Note: We can test for libldap_r only after we know PTHREAD_LIBS; diff --git a/ports/libpq/patches/windows/Solution_DEBUG.patch b/ports/libpq/patches/windows/Solution_DEBUG.patch index 4878dc4746..67c00e7a69 100644 --- a/ports/libpq/patches/windows/Solution_DEBUG.patch +++ b/ports/libpq/patches/windows/Solution_DEBUG.patch @@ -63,7 +63,7 @@ index 2820ace22..7fddbf0fb 100644 + $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuucd.lib'); # + $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icudtd.lib'); # } -@@ -1074,22 +1074,22 @@ sub AddProject +@@ -1074,27 +1074,27 @@ sub AddProject { $proj->AddIncludeDir($self->{options}->{xml} . '\include'); $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); @@ -81,6 +81,12 @@ index 2820ace22..7fddbf0fb 100644 $proj->AddIncludeDir($self->{options}->{lz4} . '\include'); - $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib'); + $proj->AddLibrary($self->{options}->{lz4} . '\debug\lib\lz4d.lib'); # + } + if ($self->{options}->{zstd}) + { + $proj->AddIncludeDir($self->{options}->{zstd} . '\include'); +- $proj->AddLibrary($self->{options}->{zstd} . '\lib\libzstd.lib'); ++ $proj->AddLibrary($self->{options}->{zstd} . '\debug\lib\zstd.lib'); } if ($self->{options}->{uuid}) { diff --git a/ports/libpq/patches/windows/Solution_RELEASE.patch b/ports/libpq/patches/windows/Solution_RELEASE.patch index 8270645ef1..d0bb480413 100644 --- a/ports/libpq/patches/windows/Solution_RELEASE.patch +++ b/ports/libpq/patches/windows/Solution_RELEASE.patch @@ -63,7 +63,7 @@ index 2820ace22..7fddbf0fb 100644 + $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); # + $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); # } -@@ -1074,22 +1074,22 @@ sub AddProject +@@ -1074,27 +1074,27 @@ sub AddProject { $proj->AddIncludeDir($self->{options}->{xml} . '\include'); $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); @@ -81,6 +81,12 @@ index 2820ace22..7fddbf0fb 100644 $proj->AddIncludeDir($self->{options}->{lz4} . '\include'); - $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib'); + $proj->AddLibrary($self->{options}->{lz4} . '\lib\lz4.lib'); # + } + if ($self->{options}->{zstd}) + { + $proj->AddIncludeDir($self->{options}->{zstd} . '\include'); +- $proj->AddLibrary($self->{options}->{zstd} . '\lib\libzstd.lib'); ++ $proj->AddLibrary($self->{options}->{zstd} . '\lib\zstd.lib'); } if ($self->{options}->{uuid}) { diff --git a/ports/libpq/patches/windows/arm.patch b/ports/libpq/patches/windows/arm.patch index 0e47c34b9d..c6329b14e5 100644 --- a/ports/libpq/patches/windows/arm.patch +++ b/ports/libpq/patches/windows/arm.patch @@ -17,7 +17,7 @@ diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index 823357c02..625f32bf8 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm -@@ -307,9 +307,8 @@ sub WriteItemDefinitionGroup +@@ -307,7 +307,6 @@ sub WriteItemDefinitionGroup : ($self->{type} eq "dll" ? 'DynamicLibrary' : 'StaticLibrary'); my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';'); @@ -26,9 +26,7 @@ index 823357c02..625f32bf8 100644 - + my $targetmachine = $self->{platform} eq 'ARM64' ? 'MachineARM64' : 'MachineARM'; + - my $includes = $self->{includes}; - unless ($includes eq '' or $includes =~ /;$/) - { + my $includes = join ';', @{ $self->{includes} }, ""; @@ -347,7 +349,6 @@ sub WriteItemDefinitionGroup .\\$cfgname\\$self->{name}\\$self->{name}.pdb false diff --git a/ports/libpq/patches/windows/python3_build_DEBUG.patch b/ports/libpq/patches/windows/python3_build_DEBUG.patch index f6124d8ec2..532a066f9b 100644 --- a/ports/libpq/patches/windows/python3_build_DEBUG.patch +++ b/ports/libpq/patches/windows/python3_build_DEBUG.patch @@ -26,8 +26,11 @@ index 99f39caa5..21b5559d6 100644 # Sometimes (always?) if python is not present, the execution # appears to work, but gives no data... die "Failed to query python for version information\n" -@@ -510,8 +511,9 @@ sub mkvcbuild - my $pymajorver = substr($pyver, 0, 1); +@@ -510,11 +511,12 @@ sub mkvcbuild + die + "Python version $pyver is too old (version 3 or later is required)" + if int($pymajorver) < 3; + my $plpython = $solution->AddProject('plpython' . $pymajorver, 'dll', 'PLs', 'src/pl/plpython'); - $plpython->AddIncludeDir($pyprefix . '/include'); @@ -38,3 +41,4 @@ index 99f39caa5..21b5559d6 100644 $plpython->AddReference($postgres); # Add transform modules dependent on plpython + \ No newline at end of file diff --git a/ports/libpq/patches/windows/python3_build_RELEASE.patch b/ports/libpq/patches/windows/python3_build_RELEASE.patch index f559e9af49..5a11378942 100644 --- a/ports/libpq/patches/windows/python3_build_RELEASE.patch +++ b/ports/libpq/patches/windows/python3_build_RELEASE.patch @@ -26,8 +26,11 @@ index 99f39caa5..21b5559d6 100644 # Sometimes (always?) if python is not present, the execution # appears to work, but gives no data... die "Failed to query python for version information\n" -@@ -510,8 +511,8 @@ sub mkvcbuild - my $pymajorver = substr($pyver, 0, 1); +@@ -510,11 +511,11 @@ sub mkvcbuild + die + "Python version $pyver is too old (version 3 or later is required)" + if int($pymajorver) < 3; + my $plpython = $solution->AddProject('plpython' . $pymajorver, 'dll', 'PLs', 'src/pl/plpython'); - $plpython->AddIncludeDir($pyprefix . '/include'); diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 378d41109e..c47f70159d 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -1,11 +1,11 @@ -set(PORT_VERSION 14.4) +set(PORT_VERSION ${VERSION}) # NOTE: the python patches must be regenerated on version update ## Download and extract sources vcpkg_download_distfile(ARCHIVE URLS "https://ftp.postgresql.org/pub/source/v${PORT_VERSION}/postgresql-${PORT_VERSION}.tar.bz2" FILENAME "postgresql-${PORT_VERSION}.tar.bz2" - SHA512 dd2f80248684e331d2ffb1e26cd2a285df1fb18710807a0c31aedabf917912ce9267f8ca26318e5371d916c6fe476f8a17886d82d3ff86a974e6f24c19a6aafb + SHA512 115a8a4234791bba4e6dcc4617e9dd77abedcf767894ce9472c59cce9d5d4ef2d4e1746f3a0c7a99de4fc4385fb716652b70dce9f48be45a9db5a682517db7e8 ) set(PATCHES @@ -38,8 +38,8 @@ if(NOT "${FEATURES}" MATCHES "client") else() set(HAS_TOOLS TRUE) endif() -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH +vcpkg_extract_source_archive( + SOURCE_PATH ARCHIVE "${ARCHIVE}" PATCHES ${PATCHES} ) @@ -166,6 +166,9 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) if("${FEATURES}" MATCHES "lz4") string(REPLACE "lz4 => undef" "lz4 => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() + if("${FEATURES}" MATCHES "zstd") + string(REPLACE "zstd => undef" "zstd => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + endif() file(WRITE "${CONFIG_FILE}" "${_contents}") file(WRITE "${BUILDPATH_${_buildtype}}/src/tools/msvc/buildenv.pl" "${buildenv_contents}") @@ -254,6 +257,11 @@ else() else() list(APPEND BUILD_OPTS --without-zlib) endif() + if("zstd" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-zstd) + else() + list(APPEND BUILD_OPTS --without-zstd) + endif() if("icu" IN_LIST FEATURES) list(APPEND BUILD_OPTS --with-icu) else() diff --git a/ports/libpq/vcpkg-cmake-wrapper.cmake b/ports/libpq/vcpkg-cmake-wrapper.cmake index 200b10d489..311f3bb9d5 100644 --- a/ports/libpq/vcpkg-cmake-wrapper.cmake +++ b/ports/libpq/vcpkg-cmake-wrapper.cmake @@ -61,6 +61,12 @@ if(PostgreSQL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") endif() list(APPEND PostgreSQL_LIBRARIES OpenSSL::SSL) endif() + if(WIN32) + if(TARGET PostgreSQL::PostgreSQL) + set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Wldap32.lib") + endif() + list(APPEND PostgreSQL_LIBRARIES Wldap32.lib) + endif() unset(Z_VCPKG_PORT_FEATURES) cmake_policy(POP) endif() diff --git a/ports/libpq/vcpkg.json b/ports/libpq/vcpkg.json index a1556a09c9..395bbfbb6c 100644 --- a/ports/libpq/vcpkg.json +++ b/ports/libpq/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libpq", - "version": "14.4", - "port-version": 3, + "version": "15.2", "description": "The official database access API of postgresql", "homepage": "https://www.postgresql.org/", "license": "PostgreSQL", @@ -124,6 +123,12 @@ "dependencies": [ "zlib" ] + }, + "zstd": { + "description": "Use zstd (else --without-zstd)", + "dependencies": [ + "zstd" + ] } } } diff --git a/versions/baseline.json b/versions/baseline.json index 79b35875e0..ec00c26105 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4269,8 +4269,8 @@ "port-version": 14 }, "libpq": { - "baseline": "14.4", - "port-version": 3 + "baseline": "15.2", + "port-version": 0 }, "libpqxx": { "baseline": "7.7.4", diff --git a/versions/l-/libpq.json b/versions/l-/libpq.json index f095434195..a93f8ca94f 100644 --- a/versions/l-/libpq.json +++ b/versions/l-/libpq.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "afe52a0d413f6e4dce23ba247692413dd9ff1cce", + "version": "15.2", + "port-version": 0 + }, { "git-tree": "9f0ed34d496ccb005282bd747bafe12a2734a4f7", "version": "14.4",