diff --git a/ports/libpq/config.pl b/ports/libpq/config.pl index cbe605ef03ac7b..5538aae22132a2 100644 --- a/ports/libpq/config.pl +++ b/ports/libpq/config.pl @@ -11,6 +11,7 @@ extraver => undef, # --with-extra-version= gss => undef, # --with-gssapi= icu => undef, # --with-icu= + lz4 => undef, # --with-lz4= nls => undef, # --enable-nls= tap_tests => undef, # --enable-tap-tests tcl => undef, # --with-tcl= diff --git a/ports/libpq/patches/fix-configure.patch b/ports/libpq/patches/fix-configure.patch new file mode 100644 index 00000000000000..c0187466bc6b1c --- /dev/null +++ b/ports/libpq/patches/fix-configure.patch @@ -0,0 +1,63 @@ +diff --git a/configure.ac b/configure.ac +index fba79ee36..4563fa9f7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -18,15 +18,15 @@ dnl + m4_pattern_forbid(^PGAC_)dnl to catch undefined macros + + AC_INIT([PostgreSQL], [14.1], [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. +-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.])]) ++# m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([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.])]) + AC_COPYRIGHT([Copyright (c) 1996-2021, PostgreSQL Global Development Group]) + AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) + AC_CONFIG_AUX_DIR(config) + AC_PREFIX_DEFAULT(/usr/local/pgsql) + AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure]) + + [PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`] +@@ -1194,7 +1195,7 @@ Use --without-readline to disable readline support.]) + fi + + if test "$with_zlib" = yes; then +- AC_CHECK_LIB(z, inflate, [], ++ AC_SEARCH_LIBS(inflate, [z zlib zlibd], [AC_DEFINE(HAVE_LIBZ,1,[Define to 1 if with zlib])], + [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. +@@ -1247,8 +1248,8 @@ if test "$with_ssl" = openssl ; 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])]) + else +- 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])]) ++ AC_SEARCH_LIBS(CRYPTO_new_ex_data, [libcrypto eay32 crypto], [AC_DEFINE(HAVE_LIBCRYPTO, 1, [Defined to 1 if libcrypto is found])], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])]) ++ AC_SEARCH_LIBS(SSL_new, [libssl ssleay32 ssl], [AC_DEFINE(HAVE_LIBSSL, 1, [Defined to 1 if libssl is found])], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])]) + fi + # Function introduced in OpenSSL 1.0.2. + AC_CHECK_FUNCS([X509_get_signature_nid]) +@@ -1273,15 +1274,15 @@ 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])]) ++ AC_SEARCH_LIBS(xmlSaveToBuffer, [xml2 libxml2], [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])]) + fi + + if test "$with_libxslt" = yes ; then +- AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])]) ++ AC_SEARCH_LIBS(xsltCleanupGlobals, [xslt libxslt], [AC_DEFINE(HAVE_LIBXSLT,1,[Define to 1 if with xslt])], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])]) + fi + + if test "$with_lz4" = yes ; then +- AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])]) ++ AC_SEARCH_LIBS(LZ4_compress_default, [lz4 lz4d], [AC_DEFINE(HAVE_LIBLZ4,1,[Define to 1 if with lz4])], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])]) + fi + + # Note: We can test for libldap_r only after we know PTHREAD_LIBS; diff --git a/ports/libpq/patches/mingw/additional-zlib-names.patch b/ports/libpq/patches/mingw/additional-zlib-names.patch deleted file mode 100644 index e8ab7b06589ddd..00000000000000 --- a/ports/libpq/patches/mingw/additional-zlib-names.patch +++ /dev/null @@ -1,186 +0,0 @@ -diff --git a/configure b/configure -index c22d3de..75210f0 100755 ---- a/configure -+++ b/configure -@@ -11777,13 +11789,13 @@ Use --without-readline to disable readline support." "$LINENO" 5 - fi - - if test "$with_zlib" = yes; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 --$as_echo_n "checking for inflate in -lz... " >&6; } --if ${ac_cv_lib_z_inflate+:} false; then : -+ if test "$enable_debug" = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflate" >&5 -+$as_echo_n "checking for library containing inflate... " >&6; } -+if ${ac_cv_search_inflate+:} false; then : - $as_echo_n "(cached) " >&6 - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lz $LIBS" -+ ac_func_search_save_LIBS=$LIBS - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -11802,23 +11814,101 @@ return inflate (); - return 0; - } - _ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_lib_z_inflate=yes --else -- ac_cv_lib_z_inflate=no -+for ac_lib in '' zd zlibd zlib1d z zlib zlib1; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_inflate=$ac_res - fi - rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS -+ conftest$ac_exeext -+ if ${ac_cv_search_inflate+:} false; then : -+ break - fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 --$as_echo "$ac_cv_lib_z_inflate" >&6; } --if test "x$ac_cv_lib_z_inflate" = xyes; then : -- cat >>confdefs.h <<_ACEOF --#define HAVE_LIBZ 1 -+done -+if ${ac_cv_search_inflate+:} false; then : -+ -+else -+ ac_cv_search_inflate=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflate" >&5 -+$as_echo "$ac_cv_search_inflate" >&6; } -+ac_res=$ac_cv_search_inflate -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h -+ -+else -+ as_fn_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. -+Use --without-zlib to disable zlib support." "$LINENO" 5 -+fi -+ -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflate" >&5 -+$as_echo_n "checking for library containing inflate... " >&6; } -+if ${ac_cv_search_inflate+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char inflate (); -+int -+main () -+{ -+return inflate (); -+ ; -+ return 0; -+} - _ACEOF -+for ac_lib in '' z zlib zlib1; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_inflate=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_inflate+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_inflate+:} false; then : - -- LIBS="-lz $LIBS" -+else -+ ac_cv_search_inflate=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflate" >&5 -+$as_echo "$ac_cv_search_inflate" >&6; } -+ac_res=$ac_cv_search_inflate -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h - - else - as_fn_error $? "zlib library not found -@@ -11827,6 +11917,7 @@ failure. It is possible the compiler isn't looking in the proper directory. - Use --without-zlib to disable zlib support." "$LINENO" 5 - fi - -+ fi - fi - - if test "$enable_spinlocks" = yes; then -diff --git a/configure.in b/configure.in -index 976f90d..e3cd80b 100644 ---- a/configure.in -+++ b/configure.in -@@ -1170,11 +1170,21 @@ Use --without-readline to disable readline support.]) - fi - - if test "$with_zlib" = yes; then -- AC_CHECK_LIB(z, inflate, [], -- [AC_MSG_ERROR([zlib library not found -+ if test "$enable_debug" = yes; then -+ AC_SEARCH_LIBS(inflate, [zd zlibd zlib1d z zlib zlib1], -+ [AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have the `z' library.])], -+ [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. - Use --without-zlib to disable zlib support.])]) -+ else -+ AC_SEARCH_LIBS(inflate, [z zlib zlib1], -+ [AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have the `z' library.])], -+ [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. -+Use --without-zlib to disable zlib support.])]) -+ fi - fi - - if test "$enable_spinlocks" = yes; then -diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in -index 244886a..29dd35b 100644 ---- a/src/include/pg_config.h.in -+++ b/src/include/pg_config.h.in -@@ -374,7 +374,7 @@ - /* Define to 1 if you have the `xslt' library (-lxslt). */ - #undef HAVE_LIBXSLT - --/* Define to 1 if you have the `z' library (-lz). */ -+/* Define to 1 if you have the `z' library. */ - #undef HAVE_LIBZ - - /* Define to 1 if the system has the type `locale_t'. */ diff --git a/ports/libpq/patches/windows/Solution.patch b/ports/libpq/patches/windows/Solution.patch index 2259e3e8abdf84..3aedd337e3164f 100644 --- a/ports/libpq/patches/windows/Solution.patch +++ b/ports/libpq/patches/windows/Solution.patch @@ -2,23 +2,29 @@ diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 51711c2bf..d33fdc3b0 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm -@@ -69,9 +69,15 @@ sub DeterminePlatform - my $self = shift; +@@ -61,17 +61,21 @@ sub DeterminePlatform + my $self = shift; - # Examine CL help output to determine if we are in 32 or 64-bit mode. -- my $output = `cl /? 2>&1`; -+ my $output = `cl 2>&1`; - $? >> 8 == 0 or die "cl command not found"; -- $self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; -+ if ($output =~ m/x64\n/) { $self->{platform} = 'x64'; -+ } elsif ($output =~ m/x86\n/) { $self->{platform} = 'Win32'; -+ } elsif ($output =~ m/ARM64\n/) { $self->{platform} = 'ARM64'; -+ } elsif ($output =~ m/ARM\n/) { $self->{platform} = 'ARM'; -+ } else { $self->{platform} = 'Unknown' -+ } -+ print "cl output $output."; - print "Detected hardware platform: $self->{platform}\n"; - return; + if ($^O eq "MSWin32") + { + # Examine CL help output to determine if we are in 32 or 64-bit mode. + my $output = `cl /help 2>&1`; + $? >> 8 == 0 or die "cl command not found"; +- $self->{platform} = +- ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; ++ if ($output =~ m/x64\n/) { $self->{platform} = 'x64'; ++ } elsif ($output =~ m/x86\n/) { $self->{platform} = 'Win32'; ++ } elsif ($output =~ m/ARM64\n/) { $self->{platform} = 'ARM64'; ++ } elsif ($output =~ m/ARM\n/) { $self->{platform} = 'ARM'; ++ } else { $self->{platform} = 'Unknown' ++ } + } + else + { + $self->{platform} = 'FAKE'; + } + print "Detected hardware platform: $self->{platform}\n"; + return; } @@ -526,14 +526,14 @@ EOF || confess "Could not open pg_config_paths.h"; diff --git a/ports/libpq/patches/windows/Solution_DEBUG.patch b/ports/libpq/patches/windows/Solution_DEBUG.patch index 7b8914e3ac052e..4878dc474618e9 100644 --- a/ports/libpq/patches/windows/Solution_DEBUG.patch +++ b/ports/libpq/patches/windows/Solution_DEBUG.patch @@ -1,8 +1,8 @@ diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm -index 51711c2bf..d33fdc3b0 100644 ---- a/src/tools/msvc/Solution.pm +index 2820ace22..7fddbf0fb 100644 +--- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm -@@ -658,7 +658,7 @@ sub AddProject +@@ -948,7 +948,7 @@ sub AddProject if ($self->{options}->{zlib}) { $proj->AddIncludeDir($self->{options}->{zlib} . '\include'); @@ -11,43 +11,36 @@ index 51711c2bf..d33fdc3b0 100644 } if ($self->{options}->{openssl}) { -@@ -698,8 +698,8 @@ sub AddProject +@@ -989,8 +989,11 @@ sub AddProject # On both Win32 and Win64 the same library # names are used without a debugging context. $dbgsuffix = 0; - $libsslpath = '\lib\libssl.lib'; - $libcryptopath = '\lib\libcrypto.lib'; -+ $libsslpath = '\debug\lib\libssl.lib'; -+ $libcryptopath = '\debug\lib\libcrypto.lib'; ++ $libsslpath = '\debug\lib\libssl.lib'; # ++ $libcryptopath = '\debug\lib\libcrypto.lib'; # ++ $proj->AddLibrary('crypt32.lib'); ++ $proj->AddLibrary('ws2_32.lib'); ++ $proj->AddLibrary('secur32.lib'); } $proj->AddLibrary($self->{options}->{openssl} . $libsslpath, -@@ -715,16 +715,16 @@ sub AddProject - # to be here, so don't ask for it in last - # parameter. - $proj->AddLibrary( -- $self->{options}->{openssl} . '\lib\ssleay32.lib', 0); -+ $self->{options}->{openssl} . '\debug\lib\ssleay32.lib', 0); - $proj->AddLibrary( -- $self->{options}->{openssl} . '\lib\libeay32.lib', 0); -+ $self->{options}->{openssl} . '\debug\lib\libeay32.lib', 0); - } - } - } +@@ -1024,7 +1024,7 @@ sub AddProject if ($self->{options}->{nls}) { $proj->AddIncludeDir($self->{options}->{nls} . '\include'); - $proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib'); -+ $proj->AddLibrary($self->{options}->{nls} . '\debug\lib\intl.lib'); ++ $proj->AddLibrary($self->{options}->{nls} . '\debug\lib\intl.lib'); # } if ($self->{options}->{gss}) { -@@ -752,39 +752,39 @@ sub AddProject +@@ -1051,21 +1051,21 @@ sub AddProject + } if ($self->{options}->{iconv}) { $proj->AddIncludeDir($self->{options}->{iconv} . '\include'); - $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); -+ $proj->AddLibrary($self->{options}->{iconv} . '\debug\lib\iconv.lib'); ++ $proj->AddLibrary($self->{options}->{iconv} . '\debug\lib\iconv.lib'); # } if ($self->{options}->{icu}) { @@ -57,38 +50,43 @@ index 51711c2bf..d33fdc3b0 100644 - $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuind.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuucd.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icudtd.lib'); ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuind.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuucd.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icudtd.lib'); # } else { - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icuin.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icuuc.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icudt.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuind.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuucd.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icudtd.lib'); ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuind.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icuucd.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\debug\lib\icudtd.lib'); # } - } - if ($self->{options}->{xml}) +@@ -1074,22 +1074,22 @@ sub AddProject { $proj->AddIncludeDir($self->{options}->{xml} . '\include'); $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); - $proj->AddLibrary($self->{options}->{xml} . '\lib\libxml2.lib'); -+ $proj->AddLibrary($self->{options}->{xml} . '\debug\lib\libxml2.lib'); ++ $proj->AddLibrary($self->{options}->{xml} . '\debug\lib\libxml2.lib'); # } if ($self->{options}->{xslt}) { $proj->AddIncludeDir($self->{options}->{xslt} . '\include'); - $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); -+ $proj->AddLibrary($self->{options}->{xslt} . '\debug\lib\libxslt.lib'); ++ $proj->AddLibrary($self->{options}->{xslt} . '\debug\lib\libxslt.lib'); # + } + if ($self->{options}->{lz4}) + { + $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}->{uuid}) { $proj->AddIncludeDir($self->{options}->{uuid} . '\include'); - $proj->AddLibrary($self->{options}->{uuid} . '\lib\uuid.lib'); -+ $proj->AddLibrary($self->{options}->{uuid} . '\debug\lib\uuid.lib'); ++ $proj->AddLibrary($self->{options}->{uuid} . '\debug\lib\uuid.lib'); # } return $proj; } diff --git a/ports/libpq/patches/windows/Solution_RELEASE.patch b/ports/libpq/patches/windows/Solution_RELEASE.patch index b690c18710c23c..8270645ef1a2ec 100644 --- a/ports/libpq/patches/windows/Solution_RELEASE.patch +++ b/ports/libpq/patches/windows/Solution_RELEASE.patch @@ -1,8 +1,8 @@ diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm -index 51711c2bf..d33fdc3b0 100644 ---- a/src/tools/msvc/Solution.pm +index 2820ace22..7fddbf0fb 100644 +--- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm -@@ -658,7 +658,7 @@ sub AddProject +@@ -948,7 +948,7 @@ sub AddProject if ($self->{options}->{zlib}) { $proj->AddIncludeDir($self->{options}->{zlib} . '\include'); @@ -11,25 +11,82 @@ index 51711c2bf..d33fdc3b0 100644 } if ($self->{options}->{openssl}) { -@@ -724,7 +724,7 @@ sub AddProject +@@ -989,8 +989,11 @@ sub AddProject + # On both Win32 and Win64 the same library + # names are used without a debugging context. + $dbgsuffix = 0; +- $libsslpath = '\lib\libssl.lib'; +- $libcryptopath = '\lib\libcrypto.lib'; ++ $libsslpath = '\lib\libssl.lib'; # ++ $libcryptopath = '\lib\libcrypto.lib'; # ++ $proj->AddLibrary('crypt32.lib'); ++ $proj->AddLibrary('ws2_32.lib'); ++ $proj->AddLibrary('secur32.lib'); + } + + $proj->AddLibrary($self->{options}->{openssl} . $libsslpath, +@@ -1024,7 +1024,7 @@ sub AddProject if ($self->{options}->{nls}) { $proj->AddIncludeDir($self->{options}->{nls} . '\include'); - $proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib'); -+ $proj->AddLibrary($self->{options}->{nls} . '\lib\intl.lib'); ++ $proj->AddLibrary($self->{options}->{nls} . '\lib\intl.lib'); # } if ($self->{options}->{gss}) { -@@ -765,9 +765,9 @@ sub AddProject +@@ -1051,21 +1051,21 @@ sub AddProject + } + if ($self->{options}->{iconv}) + { + $proj->AddIncludeDir($self->{options}->{iconv} . '\include'); +- $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); ++ $proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib'); # + } + if ($self->{options}->{icu}) + { + $proj->AddIncludeDir($self->{options}->{icu} . '\include'); + if ($self->{platform} eq 'Win32') + { +- $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); +- $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); +- $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); # } else { - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icuin.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icuuc.lib'); - $proj->AddLibrary($self->{options}->{icu} . '\lib64\icudt.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); -+ $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib'); # ++ $proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib'); # } +@@ -1074,22 +1074,22 @@ sub AddProject + { + $proj->AddIncludeDir($self->{options}->{xml} . '\include'); + $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); +- $proj->AddLibrary($self->{options}->{xml} . '\lib\libxml2.lib'); ++ $proj->AddLibrary($self->{options}->{xml} . '\lib\libxml2.lib'); # + } + if ($self->{options}->{xslt}) + { + $proj->AddIncludeDir($self->{options}->{xslt} . '\include'); +- $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); ++ $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); # + } + if ($self->{options}->{lz4}) + { + $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}->{uuid}) + { + $proj->AddIncludeDir($self->{options}->{uuid} . '\include'); +- $proj->AddLibrary($self->{options}->{uuid} . '\lib\uuid.lib'); ++ $proj->AddLibrary($self->{options}->{uuid} . '\lib\uuid.lib'); # } - if ($self->{options}->{xml}) + return $proj; + } diff --git a/ports/libpq/patches/windows/install.patch b/ports/libpq/patches/windows/install.patch index ecc14ac7bf2b6e..dd98e02c6feb24 100644 --- a/ports/libpq/patches/windows/install.patch +++ b/ports/libpq/patches/windows/install.patch @@ -144,13 +144,11 @@ index d109b2c90..75c7446e6 100644 || croak "Could not copy $pf.pdb\n"; print "."; } -@@ -366,7 +366,7 @@ sub GenerateTimezoneFiles +@@ -372,5 +372,5 @@ sub GenerateTimezoneFiles print "Generating timezone files..."; - my @args = -- ("$conf/zic/zic", '-d', "$target/share/timezone", -+ ("$conf/zic/zic", '-d', "$target/share/libpq/timezone", - '-p', "$posixrules", '-b', 'fat'); +- my @args = ("$conf/zic/zic", '-d', "$target/share/timezone"); ++ my @args = ("$conf/zic/zic", '-d', "$target/share/libpq/timezone"); foreach (@tzfiles) { @@ -391,7 +391,7 @@ sub GenerateTsearchFiles diff --git a/ports/libpq/patches/windows/minimize_install.patch b/ports/libpq/patches/windows/minimize_install.patch index 1d1eb2b5769885..086128e6fabe81 100644 --- a/ports/libpq/patches/windows/minimize_install.patch +++ b/ports/libpq/patches/windows/minimize_install.patch @@ -7,19 +7,19 @@ index d109b2c90..75c7446e6 100644 my $insttype; my @client_contribs = ('oid2name', 'pgbench', 'vacuumlo'); -my @client_program_files = ( -- 'clusterdb', 'createdb', 'createuser', 'dropdb', -- 'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', -- 'libpgtypes', 'libpq', 'pg_basebackup', 'pg_config', -- 'pg_dump', 'pg_dumpall', 'pg_isready', 'pg_receivewal', -- 'pg_recvlogical', 'pg_restore', 'psql', 'reindexdb', -- 'vacuumdb', @client_contribs); +- 'clusterdb', 'createdb', 'createuser', 'dropdb', +- 'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', +- 'libpgtypes', 'libpq', 'pg_amcheck', 'pg_basebackup', +- 'pg_config', 'pg_dump', 'pg_dumpall', 'pg_isready', +- 'pg_receivewal', 'pg_recvlogical', 'pg_restore', 'psql', +- 'reindexdb', 'vacuumdb', @client_contribs); +my @client_program_files = ( 'libecpg','libecpg_compat', 'libpgtypes', 'libpq' ); -+ # 'clusterdb', 'createdb', 'createuser', 'dropdb', -+ # 'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', -+ #'libpgtypes', 'libpq', 'pg_basebackup', 'pg_config', -+ #'pg_dump', 'pg_dumpall', 'pg_isready', 'pg_receivewal', -+ #'pg_recvlogical', 'pg_restore', 'psql', 'reindexdb', -+ #'vacuumdb', @client_contribs); ++ #'clusterdb', 'createdb', 'createuser', 'dropdb', ++ #'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', ++ #'libpgtypes', 'libpq', 'pg_amcheck', 'pg_basebackup', ++ #'pg_config', 'pg_dump', 'pg_dumpall', 'pg_isready', ++ #'pg_receivewal', 'pg_recvlogical', 'pg_restore', 'psql', ++ #'reindexdb', 'vacuumdb', @client_contribs); sub lcopy { diff --git a/ports/libpq/patches/windows/python3_build_DEBUG.patch b/ports/libpq/patches/windows/python3_build_DEBUG.patch index 0a261038638931..f6124d8ec27c11 100644 --- a/ports/libpq/patches/windows/python3_build_DEBUG.patch +++ b/ports/libpq/patches/windows/python3_build_DEBUG.patch @@ -22,7 +22,7 @@ index 99f39caa5..21b5559d6 100644 + #die "Could not query for python version!\n" if $?; + #my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); + my $pyprefix = $solution->{options}->{python}; -+ my $pyver = 39; ++ my $pyver = 310; # 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" @@ -32,7 +32,7 @@ index 99f39caa5..21b5559d6 100644 'dll', 'PLs', 'src/pl/plpython'); - $plpython->AddIncludeDir($pyprefix . '/include'); - $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib"); -+ $plpython->AddIncludeDir($pyprefix . '/include/python3.9'); ++ $plpython->AddIncludeDir($pyprefix . '/include/python3.10'); + $plpython->AddDefine('_DEBUG'); # required for python autolink linking correctly! + $plpython->AddLibrary($pyprefix . "/debug/lib/python$pyver" . "_d.lib"); $plpython->AddReference($postgres); diff --git a/ports/libpq/patches/windows/python3_build_RELEASE.patch b/ports/libpq/patches/windows/python3_build_RELEASE.patch index 5631d55e09d48a..f559e9af4964f2 100644 --- a/ports/libpq/patches/windows/python3_build_RELEASE.patch +++ b/ports/libpq/patches/windows/python3_build_RELEASE.patch @@ -22,7 +22,7 @@ index 99f39caa5..21b5559d6 100644 + #die "Could not query for python version!\n" if $?; + #my ($pyprefix, $pyver) = split(/\r?\n/, $pyout); + my $pyprefix = $solution->{options}->{python}; -+ my $pyver = 39; ++ my $pyver = 310; # 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" @@ -32,7 +32,7 @@ index 99f39caa5..21b5559d6 100644 'dll', 'PLs', 'src/pl/plpython'); - $plpython->AddIncludeDir($pyprefix . '/include'); - $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib"); -+ $plpython->AddIncludeDir($pyprefix . '/include/python3.9'); ++ $plpython->AddIncludeDir($pyprefix . '/include/python3.10'); + $plpython->AddLibrary($pyprefix . "/lib/python$pyver.lib"); $plpython->AddReference($postgres); diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 8d44094eebcb90..b1843b27aa9500 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -1,4 +1,4 @@ -set(PORT_VERSION 12.9) +set(PORT_VERSION 14.1) # NOTE: the python patches must be regenerated on version update macro(feature_unsupported) @@ -32,7 +32,7 @@ endif() 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 11697d8283f5df5a9c74c2406e94d1b6da6df8358ad48f3b773825aab98e8395f9fd4e3fc8b1e6ebad3743c3dadbda8b795d4fe84a447d7913223e136cf2b88f + SHA512 4a0bec157d5464bb9e5f5c0eb0efdede55526e03f6f4d660b87d161a47705eb152fa0878960b1581bce42a5ed28a1f457825ea54e8d22e34b5b8eb36473ceefd ) set(PATCHES @@ -43,10 +43,11 @@ set(PATCHES patches/windows/MSBuildProject_fix_gendef_perl.patch patches/windows/msgfmt.patch patches/windows/python_lib.patch - patches/windows/fix-compile-flag-Zi.patch) + patches/windows/fix-compile-flag-Zi.patch + patches/fix-configure.patch + ) if(VCPKG_TARGET_IS_MINGW) - list(APPEND PATCHES patches/mingw/additional-zlib-names.patch) list(APPEND PATCHES patches/mingw/link-with-crypt32.patch) endif() if(VCPKG_TARGET_IS_LINUX) @@ -70,7 +71,7 @@ else() endif() vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE "${ARCHIVE}" PATCHES ${PATCHES} ) unset(buildenv_contents) @@ -106,12 +107,12 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg set(INSTALL_PATH_SUFFIX_${_buildtype} "/debug") set(BUILDPATH_${_buildtype} "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${_short}") file(REMOVE_RECURSE "${BUILDPATH_${_buildtype}}") #Clean old builds - set(PACKAGE_DIR_${_buildtype} ${CURRENT_PACKAGES_DIR}${INSTALL_PATH_SUFFIX_${_buildtype}}) + set(PACKAGE_DIR_${_buildtype} "${CURRENT_PACKAGES_DIR}${INSTALL_PATH_SUFFIX_${_buildtype}}") unset(_short) unset(_buildtype) endif() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") ## Do the build if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) @@ -184,14 +185,15 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) string(REPLACE "xml => undef" "xml => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") string(REPLACE "iconv => undef" "iconv => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() - if("${FEATURES}" MATCHES "xslt") string(REPLACE "xslt => undef" "xslt => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() - if("${FEATURES}" MATCHES "zlib") string(REPLACE "zlib => undef" "zlib => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") endif() + if("${FEATURES}" MATCHES "lz4") + string(REPLACE "lz4 => undef" "lz4 => \"${CURRENT_INSTALLED_DIR}\"" _contents "${_contents}") + endif() file(WRITE "${CONFIG_FILE}" "${_contents}") file(WRITE "${BUILDPATH_${_buildtype}}/src/tools/msvc/buildenv.pl" "${buildenv_contents}") @@ -212,8 +214,8 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) message(STATUS "Building libpq ${TARGET_TRIPLET}-${_buildtype}...") vcpkg_execute_required_process( COMMAND ${PERL} build.pl ${_buildtype} - WORKING_DIRECTORY ${BUILDPATH_${_buildtype}}/src/tools/msvc - LOGNAME build-${TARGET_TRIPLET}-${_buildtype} + WORKING_DIRECTORY "${BUILDPATH_${_buildtype}}/src/tools/msvc" + LOGNAME "build-${TARGET_TRIPLET}-${_buildtype}" ) message(STATUS "Building libpq ${TARGET_TRIPLET}-${_buildtype}... done") else() @@ -222,8 +224,8 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) message(STATUS "Building ${build_lib} ${TARGET_TRIPLET}-${_buildtype}...") vcpkg_execute_required_process( COMMAND ${PERL} build.pl ${_buildtype} ${build_lib} - WORKING_DIRECTORY ${BUILDPATH_${_buildtype}}/src/tools/msvc - LOGNAME build-${build_lib}-${TARGET_TRIPLET}-${_buildtype} + WORKING_DIRECTORY "${BUILDPATH_${_buildtype}}/src/tools/msvc" + LOGNAME "build-${build_lib}-${TARGET_TRIPLET}-${_buildtype}" ) message(STATUS "Building ${build_lib} ${TARGET_TRIPLET}-${_buildtype}... done") endforeach() @@ -231,9 +233,9 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) message(STATUS "Installing libpq ${TARGET_TRIPLET}-${_buildtype}...") vcpkg_execute_required_process( - COMMAND ${PERL} install.pl ${CURRENT_PACKAGES_DIR}${INSTALL_PATH_SUFFIX_${_buildtype}} client - WORKING_DIRECTORY ${BUILDPATH_${_buildtype}}/src/tools/msvc - LOGNAME install-${TARGET_TRIPLET}-${_buildtype} + COMMAND ${PERL} install.pl "${CURRENT_PACKAGES_DIR}${INSTALL_PATH_SUFFIX_${_buildtype}}" client + WORKING_DIRECTORY "${BUILDPATH_${_buildtype}}/src/tools/msvc" + LOGNAME "install-${TARGET_TRIPLET}-${_buildtype}" ) message(STATUS "Installing libpq ${TARGET_TRIPLET}-${_buildtype}... done") endforeach() @@ -241,28 +243,32 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) message(STATUS "Cleanup libpq ${TARGET_TRIPLET}...") #Cleanup - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/symbols) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/symbols) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/doc") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/symbols") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/symbols") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() if(NOT HAS_TOOLS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools") else() - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") endif() message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done") set(USE_DL OFF) else() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/Makefile DESTINATION ${SOURCE_PATH}) - + if("nls" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --enable-nls) + set(ENV{MSGFMT} "${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin/msgfmt${VCPKG_HOST_EXECUTABLE_SUFFIX}") + else() + list(APPEND BUILD_OPTS --disable-nls) + endif() if("openssl" IN_LIST FEATURES) list(APPEND BUILD_OPTS --with-openssl) else() @@ -273,11 +279,36 @@ else() else() list(APPEND BUILD_OPTS --without-zlib) endif() + if("icu" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-icu) + else() + list(APPEND BUILD_OPTS --without-icu) + endif() + if("lz4" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-lz4) + else() + list(APPEND BUILD_OPTS --without-lz4) + endif() if("readline" IN_LIST FEATURES) list(APPEND BUILD_OPTS --with-readline) else() list(APPEND BUILD_OPTS --without-readline) endif() + if("xml" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-libxml) + else() + list(APPEND BUILD_OPTS --without-libxml) + endif() + if("xslt" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-libxslt) + else() + list(APPEND BUILD_OPTS --without-libxslt) + endif() + if("python" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-python) + else() + list(APPEND BUILD_OPTS --without-python) + endif() if(VCPKG_TARGET_IS_ANDROID) # AND CMAKE_SYSTEM_VERSION LESS 26) list(APPEND BUILD_OPTS ac_cv_header_langinfo_h=no) endif() @@ -285,13 +316,11 @@ else() list(APPEND BUILD_OPTS "PG_SYSROOT=${VCPKG_OSX_SYSROOT}") endif() vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + SOURCE_PATH "${SOURCE_PATH}" COPY_SOURCE - DETERMINE_BUILD_TRIPLET OPTIONS ${BUILD_OPTS} - OPTIONS_DEBUG - --enable-debug ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -302,27 +331,28 @@ else() if(VCPKG_TARGET_IS_MINGW) set(ENV{USING_MINGW} yes) endif() + file(COPY "${CMAKE_CURRENT_LIST_DIR}/Makefile" DESTINATION "${SOURCE_PATH}") vcpkg_install_make() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") if(NOT HAS_TOOLS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") else() - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug) + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug") endif() if(VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpq.a ${CURRENT_PACKAGES_DIR}/lib/libpq.dll.a) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpq.dll ${CURRENT_PACKAGES_DIR}/bin/libpq.dll) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libpq.a" "${CURRENT_PACKAGES_DIR}/lib/libpq.dll.a") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libpq.dll" "${CURRENT_PACKAGES_DIR}/bin/libpq.dll") endif() if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpq.a ${CURRENT_PACKAGES_DIR}/debug/lib/libpq.dll.a) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpq.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libpq.dll) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.a" "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.dll.a") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/libpq.dll") endif() endif() if(VCPKG_TARGET_IS_MINGW) diff --git a/ports/libpq/vcpkg.json b/ports/libpq/vcpkg.json index dc7adc983ce160..c2df6c268d06e4 100644 --- a/ports/libpq/vcpkg.json +++ b/ports/libpq/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libpq", - "version": "12.9", - "port-version": 1, + "version": "14.1", "description": "The official database access API of postgresql", "homepage": "https://www.postgresql.org/", "supports": "!uwp", @@ -16,6 +15,7 @@ } ], "default-features": [ + "lz4", "openssl", "zlib" ], @@ -44,10 +44,23 @@ "llvm" ] }, + "lz4": { + "description": "Use lz4 (else --without-lz4)", + "dependencies": [ + "lz4" + ] + }, "nls": { "description": "Native Language Support (--enable-nls[=LANGUAGES])", "dependencies": [ - "gettext" + "gettext", + { + "name": "gettext", + "host": true, + "features": [ + "tools" + ] + } ] }, "openssl": { diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 787471e19d145c..7f306c30cc0bfc 100755 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -122,6 +122,12 @@ function(vcpkg_build_make) # Since includes are buildtype independent those are setup by vcpkg_configure_make vcpkg_backup_env_variables(VARS LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_backup_env_variables(VARS SDKROOT MACOSX_DEPLOYMENT_TARGET) + + if(VCPKG_TARGET_IS_OSX) + set(ENV{SDKROOT} "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}") + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET}") + endif() foreach(buildtype IN ITEMS "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "${buildtype}") @@ -238,5 +244,5 @@ function(vcpkg_build_make) set(ENV{PATH} "${path_backup}") endif() - vcpkg_restore_env_variables(VARS LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_restore_env_variables(VARS LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH SDKROOT MACOSX_DEPLOYMENT_TARGET) endfunction() diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index aa054222c7dedc..69fa359bf0e0c4 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -292,6 +292,9 @@ function(vcpkg_configure_make) #Used by cl vcpkg_backup_env_variables(VARS INCLUDE LIB LIBPATH) + #used on osx + vcpkg_backup_env_variables(VARS SDKROOT MACOSX_DEPLOYMENT_TARGET) + set(vcm_paths_with_spaces OFF) if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ") # Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)! @@ -415,7 +418,6 @@ function(vcpkg_configure_make) foreach(_env IN LISTS arg_CONFIGURE_ENVIRONMENT_VARIABLES) z_vcpkg_append_to_configure_environment(configure_env ${_env} "${${_env}}") endforeach() - debug_message("configure_env: '${configure_env}'") # Other maybe interesting variables to control # COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line. # LINK This is the command used to actually link a C program. @@ -434,8 +436,41 @@ function(vcpkg_configure_make) # Currently needed for arm because objdump yields: "unrecognised machine type (0x1c4) in Import Library Format archive" list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all) endif() + else() + z_vcpkg_append_to_configure_environment(configure_env CPP "${VCPKG_DETECTED_CMAKE_C_COMPILER} -E") + z_vcpkg_append_to_configure_environment(configure_env CC "${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CXX "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}") + if(VCPKG_DETECTED_CMAKE_RC_COMPILER) + z_vcpkg_append_to_configure_environment(configure_env RC "${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env WINDRES "${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + endif() + if(VCPKG_DETECTED_CMAKE_AR) + z_vcpkg_append_to_configure_environment(configure_env AR "${VCPKG_DETECTED_CMAKE_AR}") + endif() + if(VCPKG_DETECTED_CMAKE_LINKER) + z_vcpkg_append_to_configure_environment(configure_env LD "${VCPKG_DETECTED_CMAKE_LINKER}") + endif() + if(VCPKG_DETECTED_CMAKE_RANLIB) + z_vcpkg_append_to_configure_environment(configure_env RANLIB "${VCPKG_DETECTED_CMAKE_RANLIB}") + endif() + if(VCPKG_DETECTED_CMAKE_OBJDUMP) + z_vcpkg_append_to_configure_environment(configure_env OBJDUMP "${VCPKG_DETECTED_CMAKE_OBJDUMP}") + endif() + if(VCPKG_DETECTED_CMAKE_STRIP) + z_vcpkg_append_to_configure_environment(configure_env STRIP "${VCPKG_DETECTED_CMAKE_STRIP}") + endif() + if(VCPKG_DETECTED_CMAKE_NM) + z_vcpkg_append_to_configure_environment(configure_env NM "${VCPKG_DETECTED_CMAKE_NM}") + endif() + if(VCPKG_DETECTED_CMAKE_DLLTOOL) + z_vcpkg_append_to_configure_environment(configure_env DLLTOOL "${VCPKG_DETECTED_CMAKE_DLLTOOL}") + endif() + foreach(_env IN LISTS arg_CONFIGURE_ENVIRONMENT_VARIABLES) + z_vcpkg_append_to_configure_environment(configure_env ${_env} "${${_env}}") + endforeach() endif() - + debug_message("configure_env: '${configure_env}'") # Some PATH handling for dealing with spaces....some tools will still fail with that! # In particular, the libtool install command is unable to install correctly to paths with spaces. # CURRENT_INSTALLED_DIR: Pristine native path (unprotected spaces, Windows drive letters) @@ -450,6 +485,8 @@ function(vcpkg_configure_make) # macOS - cross-compiling support if(VCPKG_TARGET_IS_OSX) + set(ENV{SDKROOT} "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}") + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET}") if (requires_autoconfig AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET) z_vcpkg_determine_autotools_host_arch_mac(BUILD_ARCH) # machine you are building on => --build= z_vcpkg_determine_autotools_target_arch_mac(TARGET_ARCH) @@ -458,7 +495,7 @@ function(vcpkg_configure_make) # --target: the machine that CC will produce binaries for # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host - if(NOT "${TARGET_ARCH}" STREQUAL "${BUILD_ARCH}") # we don't need to specify the additional flags if we build natively. + if(VCPKG_CROSSCOMPILING) # we don't need to specify the additional flags if we build natively. set(arg_BUILD_TRIPLET "--host=${TARGET_ARCH}-apple-darwin") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target) endif() debug_message("Using make triplet: ${arg_BUILD_TRIPLET}") @@ -516,7 +553,7 @@ function(vcpkg_configure_make) file(RELATIVE_PATH relative_build_path "${CURRENT_BUILDTREES_DIR}" "${arg_SOURCE_PATH}/${arg_PROJECT_SUBPATH}") - set(base_cmd) + unset(base_cmd) if(CMAKE_HOST_WIN32) set(base_cmd ${bash_executable} --noprofile --norc --debug) else() @@ -808,7 +845,7 @@ function(vcpkg_configure_make) endif() if(EXISTS "${target_dir}/config.log") - file(RENAME "${target_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${short_name_${current_buildtype}}.log") + file(COPY_FILE "${target_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${short_name_${current_buildtype}}.log") endif() endif() @@ -847,7 +884,7 @@ function(vcpkg_configure_make) endif() # Restore environment - vcpkg_restore_env_variables(VARS ${cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_restore_env_variables(VARS ${cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH SDKROOT MACOSX_DEPLOYMENT_TARGET) set(_VCPKG_PROJECT_SOURCE_PATH ${arg_SOURCE_PATH} PARENT_SCOPE) set(_VCPKG_PROJECT_SUBPATH ${arg_PROJECT_SUBPATH} PARENT_SCOPE) diff --git a/scripts/get_cmake_vars/CMakeLists.txt b/scripts/get_cmake_vars/CMakeLists.txt index b6d5f0e4154d46..84c6b339abe0fd 100644 --- a/scripts/get_cmake_vars/CMakeLists.txt +++ b/scripts/get_cmake_vars/CMakeLists.txt @@ -97,11 +97,9 @@ macro(_vcpkg_adjust_flags flag_var) if("${flag_var}" IN_LIST VCPKG_LANG_FLAGS) # macOS - append arch and isysroot if cross-compiling if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") - foreach(arch IN LISTS CMAKE_OSX_ARCHITECTURES) string(APPEND ${flag_var} " -arch ${arch}") endforeach() - string(APPEND ${flag_var} " -isysroot ${CMAKE_OSX_SYSROOT}") endif() endif() endif() diff --git a/versions/baseline.json b/versions/baseline.json index 0bb0018440b2c1..6eaed505300d35 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3805,8 +3805,8 @@ "port-version": 14 }, "libpq": { - "baseline": "12.9", - "port-version": 1 + "baseline": "14.1", + "port-version": 0 }, "libpqxx": { "baseline": "7.6.0", diff --git a/versions/l-/libpq.json b/versions/l-/libpq.json index bdad019f865a81..6258d71b8107f5 100644 --- a/versions/l-/libpq.json +++ b/versions/l-/libpq.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "66a003d29be3090df8d9683b9a19010caa681283", + "version": "14.1", + "port-version": 0 + }, { "git-tree": "099cade84111279ffa4a909061cb8f4f36137842", "version": "12.9",