Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ports/libpq/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ else()
if(VCPKG_DETECTED_CMAKE_OSX_SYSROOT)
list(APPEND BUILD_OPTS "PG_SYSROOT=${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}")
endif()
if(NOT VCPKG_TARGET_IS_WINDOWS)
# Pass the location of timezone data. This is necessary, because
# fix-configure.patch sets cross_compiling=yes to avoid conftest issues.
set(TZDATA_PATH "/usr/share/zoneinfo")

# Allow override from triplet for non-standard system configurations
if(DEFINED VCPKG_SYSTEM_TZDATA_PATH)
set(TZDATA_PATH "${VCPKG_SYSTEM_TZDATA_PATH}")
endif()

if(EXISTS "${TZDATA_PATH}")
list(APPEND BUILD_OPTS --with-system-tzdata=${TZDATA_PATH})
endif()
endif()
Comment on lines 109 to 122
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having hardcoded paths in a portfile feels incorrect, perhaps this should be set by a triplet variable or the build modified so this is not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the patch such that the path is overridable with a triplet variable.

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
COPY_SOURCE
Expand Down
3 changes: 3 additions & 0 deletions ports/libpq/usage
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ The package libpq provides CMake integration:

find_package(PostgreSQL REQUIRED)
target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL)

For custom timezone data locations on Unix-like systems, set VCPKG_SYSTEM_TZDATA_PATH
in your triplet file. Default is /usr/share/zoneinfo.
2 changes: 1 addition & 1 deletion ports/libpq/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libpq",
"version": "16.9",
"port-version": 2,
"port-version": 3,
"description": "The official database access API of postgresql",
"homepage": "https://www.postgresql.org/",
"license": "PostgreSQL",
Expand Down
Loading