2016-11-11 13:55:55 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-06-01 10:55:03 +08:00
|
|
|
URLS "https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.bz2"
|
2024-08-20 00:54:25 +08:00
|
|
|
"https://www.mirrorservice.org/sites/ftp.postgresql.org/source/v${VERSION}/postgresql-${VERSION}.tar.bz2"
|
2023-06-01 10:55:03 +08:00
|
|
|
FILENAME "postgresql-${VERSION}.tar.bz2"
|
2024-08-20 00:54:25 +08:00
|
|
|
SHA512 f2070299f0857a270317ac984f8393374cf00d4f32a082fe3c5481e36c560595ea711fed95e40d1bc90c5089edf8f165649d443d8b9c68614e1c83fc91268e96
|
2016-11-11 13:55:55 +08:00
|
|
|
)
|
2019-05-29 07:58:00 +08:00
|
|
|
|
2023-03-02 03:04:27 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2022-03-24 07:41:00 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2023-06-01 10:55:03 +08:00
|
|
|
PATCHES
|
2023-09-07 07:51:54 +08:00
|
|
|
unix/installdirs.patch
|
2023-06-01 10:55:03 +08:00
|
|
|
unix/fix-configure.patch
|
|
|
|
unix/single-linkage.patch
|
|
|
|
unix/no-server-tools.patch
|
|
|
|
unix/mingw-install.patch
|
|
|
|
unix/python.patch
|
|
|
|
windows/macro-def.patch
|
|
|
|
windows/win_bison_flex.patch
|
|
|
|
windows/msbuild.patch
|
|
|
|
windows/spin_delay.patch
|
[libpq] Update to 16.2 (#36849)
Fixes #36168.
* Update `libpq` to 16.2.
* Removed outdated patch `python_lib.patch`.
* Feature `client` has an error on `x86-windows`:
https://github.com/microsoft/vcpkg/issues/36693, but it is not caused by
this update and will be solved in another PR.
- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [ ] ~The "supports" clause reflects platforms that may be fixed by
this new version.~
- [ ] ~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.
Features `client,icu,lz4,nls,openssl,python,tcl,xml,xslt,zlib,zstd` are
tested successfully in the following triplet:
```
x64-windows
x64-windows-static
```
Features `icu,lz4,nls,openssl,xml,xslt,zlib,zstd` are tested
successfully in the following triplet:
```
x86-windows
```
Features `readline,bonjour` are tested successfully in the following
triplet:
```
x64-osx
```
Feature `readline` are tested successfully in the following triplet:
```
x64-linux
```
The usage test passed on `x64-windows` (header files found):
```
The package libpq provides CMake integration:
find_package(PostgreSQL REQUIRED)
target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL)
```
---------
Co-authored-by: Monica <v-liumonica@microsoft.com>
2024-02-22 13:54:14 +08:00
|
|
|
android/unversioned_so.patch
|
2019-05-29 07:58:00 +08:00
|
|
|
)
|
2023-06-01 10:55:03 +08:00
|
|
|
|
2023-08-08 04:19:53 +08:00
|
|
|
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
|
|
|
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp "${_py3_include_path}")
|
|
|
|
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
|
|
|
|
2023-06-01 10:55:03 +08:00
|
|
|
if("client" IN_LIST FEATURES)
|
|
|
|
set(HAS_TOOLS TRUE)
|
|
|
|
else()
|
|
|
|
set(HAS_TOOLS FALSE)
|
|
|
|
endif()
|
|
|
|
|
2024-08-07 05:41:10 +08:00
|
|
|
vcpkg_cmake_get_vars(cmake_vars_file)
|
|
|
|
include("${cmake_vars_file}")
|
|
|
|
|
|
|
|
set(required_programs BISON FLEX)
|
|
|
|
if(VCPKG_DETECTED_MSVC OR NOT VCPKG_HOST_IS_WINDOWS)
|
|
|
|
list(APPEND required_programs PERL)
|
2020-08-06 05:01:13 +08:00
|
|
|
endif()
|
2023-06-01 10:55:03 +08:00
|
|
|
foreach(program_name IN LISTS required_programs)
|
2020-01-14 07:43:36 +08:00
|
|
|
vcpkg_find_acquire_program(${program_name})
|
2023-06-01 10:55:03 +08:00
|
|
|
get_filename_component(program_dir ${${program_name}} DIRECTORY)
|
|
|
|
vcpkg_add_to_path(PREPEND "${program_dir}")
|
2020-01-14 07:43:36 +08:00
|
|
|
endforeach()
|
2018-03-13 22:32:27 +08:00
|
|
|
|
2023-06-01 10:55:03 +08:00
|
|
|
if(VCPKG_DETECTED_MSVC)
|
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
vcpkg_acquire_msys(MSYS_ROOT PACKAGES gettext)
|
|
|
|
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
|
2023-03-15 05:11:06 +08:00
|
|
|
endif()
|
2023-06-01 10:55:03 +08:00
|
|
|
if("xml" IN_LIST FEATURES)
|
|
|
|
x_vcpkg_pkgconfig_get_modules(
|
|
|
|
PREFIX PC_LIBXML2
|
|
|
|
MODULES --msvc-syntax libxml-2.0
|
|
|
|
LIBS
|
2020-01-14 07:43:36 +08:00
|
|
|
)
|
2023-06-01 10:55:03 +08:00
|
|
|
separate_arguments(LIBXML2_LIBS_DEBUG NATIVE_COMMAND "${PC_LIBXML2_LIBS_DEBUG}")
|
|
|
|
separate_arguments(LIBXML2_LIBS_RELEASE NATIVE_COMMAND "${PC_LIBXML2_LIBS_RELEASE}")
|
|
|
|
endif()
|
|
|
|
if("xslt" IN_LIST FEATURES)
|
|
|
|
x_vcpkg_pkgconfig_get_modules(
|
|
|
|
PREFIX PC_LIBXSLT
|
|
|
|
MODULES --msvc-syntax libxslt
|
|
|
|
LIBS
|
2020-01-14 07:43:36 +08:00
|
|
|
)
|
2023-06-01 10:55:03 +08:00
|
|
|
separate_arguments(LIBXSLT_LIBS_DEBUG NATIVE_COMMAND "${PC_LIBXSLT_LIBS_DEBUG}")
|
|
|
|
separate_arguments(LIBXSLT_LIBS_RELEASE NATIVE_COMMAND "${PC_LIBXSLT_LIBS_RELEASE}")
|
|
|
|
endif()
|
2020-03-19 00:45:41 +08:00
|
|
|
|
2023-06-01 10:55:03 +08:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/build-msvc.cmake")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
build_msvc(DEBUG "${SOURCE_PATH}")
|
|
|
|
endif()
|
|
|
|
build_msvc(RELEASE "${SOURCE_PATH}")
|
2020-01-14 07:43:36 +08:00
|
|
|
|
2020-10-23 12:56:51 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2022-03-24 07:41:00 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2020-01-14 07:43:36 +08:00
|
|
|
endif()
|
2020-06-04 10:31:28 +08:00
|
|
|
|
2023-06-01 10:55:03 +08:00
|
|
|
if(HAS_TOOLS)
|
2022-03-24 07:41:00 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
2023-06-01 10:55:03 +08:00
|
|
|
else()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")
|
2020-01-14 07:43:36 +08:00
|
|
|
endif()
|
|
|
|
else()
|
2022-03-24 07:41:00 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/Makefile" DESTINATION "${SOURCE_PATH}")
|
2023-06-01 10:55:03 +08:00
|
|
|
|
|
|
|
vcpkg_list(SET BUILD_OPTS)
|
2023-10-28 09:00:49 +08:00
|
|
|
foreach(option IN ITEMS icu lz4 nls openssl readline xml xslt zlib zstd)
|
2023-06-01 10:55:03 +08:00
|
|
|
if(option IN_LIST FEATURES)
|
|
|
|
list(APPEND BUILD_OPTS --with-${option})
|
|
|
|
else()
|
|
|
|
list(APPEND BUILD_OPTS --without-${option})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2022-03-24 07:41:00 +08:00
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
set(ENV{MSGFMT} "${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin/msgfmt${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
2023-06-01 10:55:03 +08:00
|
|
|
if(VCPKG_TARGET_IS_ANDROID)
|
|
|
|
list(APPEND BUILD_OPTS [[LIBS=$LIBS -liconv]])
|
|
|
|
endif()
|
2022-03-24 07:41:00 +08:00
|
|
|
endif()
|
|
|
|
if("python" IN_LIST FEATURES)
|
2023-10-28 09:00:49 +08:00
|
|
|
list(APPEND BUILD_OPTS --with-python=3.${PYTHON_VERSION_MINOR})
|
2023-06-01 10:55:03 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
list(APPEND BUILD_OPTS "PYTHON=${PYTHON3}")
|
2022-03-24 07:41:00 +08:00
|
|
|
endif()
|
2021-11-09 13:31:08 +08:00
|
|
|
if(VCPKG_TARGET_IS_ANDROID) # AND CMAKE_SYSTEM_VERSION LESS 26)
|
|
|
|
list(APPEND BUILD_OPTS ac_cv_header_langinfo_h=no)
|
|
|
|
endif()
|
2022-09-27 05:50:08 +08:00
|
|
|
if(VCPKG_DETECTED_CMAKE_OSX_SYSROOT)
|
|
|
|
list(APPEND BUILD_OPTS "PG_SYSROOT=${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}")
|
2021-12-15 02:59:38 +08:00
|
|
|
endif()
|
2020-01-14 07:43:36 +08:00
|
|
|
vcpkg_configure_make(
|
2022-03-24 07:41:00 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-05-22 01:46:07 +08:00
|
|
|
COPY_SOURCE
|
2023-06-01 10:55:03 +08:00
|
|
|
AUTOCONFIG
|
|
|
|
ADDITIONAL_MSYS_PACKAGES autoconf-archive
|
|
|
|
DIRECT_PACKAGES
|
|
|
|
"https://mirror.msys2.org/msys/x86_64/tzcode-2023c-1-x86_64.pkg.tar.zst"
|
|
|
|
7550b843964744607f736a7138f10c6cd92489406a1b84ac71d9a9d8aa16bc69048aa1b24e1f49291b010347047008194c334ca9c632e17fa8245e85549e3c7a
|
2020-01-14 07:43:36 +08:00
|
|
|
OPTIONS
|
|
|
|
${BUILD_OPTS}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
--enable-debug
|
|
|
|
)
|
2020-03-19 00:45:41 +08:00
|
|
|
|
2020-10-23 12:56:51 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2023-06-01 10:55:03 +08:00
|
|
|
set(ENV{LIBPQ_LIBRARY_TYPE} shared)
|
2020-09-25 03:29:13 +08:00
|
|
|
else()
|
2023-06-01 10:55:03 +08:00
|
|
|
set(ENV{LIBPQ_LIBRARY_TYPE} static)
|
2020-09-25 03:29:13 +08:00
|
|
|
endif()
|
2021-04-20 08:19:44 +08:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
2023-06-01 10:55:03 +08:00
|
|
|
set(ENV{LIBPQ_USING_MINGW} yes)
|
2021-04-20 08:19:44 +08:00
|
|
|
endif()
|
2023-06-01 10:55:03 +08:00
|
|
|
if(HAS_TOOLS)
|
|
|
|
set(ENV{LIBPQ_ENABLE_TOOLS} yes)
|
2021-04-20 08:19:44 +08:00
|
|
|
endif()
|
2023-06-01 10:55:03 +08:00
|
|
|
vcpkg_install_make()
|
2022-04-01 01:56:04 +08:00
|
|
|
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/postgresql/server/pg_config.h" "#define CONFIGURE_ARGS" "// #define CONFIGURE_ARGS")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/pg_config.h" "#define CONFIGURE_ARGS" "// #define CONFIGURE_ARGS")
|
2020-01-14 07:43:36 +08:00
|
|
|
endif()
|
2016-11-11 13:55:55 +08:00
|
|
|
|
2023-06-01 10:55:03 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-05-01 02:10:51 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/postgresql/vcpkg-cmake-wrapper.cmake" @ONLY)
|
2023-06-01 10:55:03 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/doc"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/symbols"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/tools"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/symbols"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug"
|
|
|
|
)
|
|
|
|
|
2021-05-01 02:10:51 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-06-01 10:55:03 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYRIGHT")
|