Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/vcpkg-baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e99d87dcf02926bfd629560e11e156329d5720c1
7 changes: 6 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ jobs:
sudo mkdir -p /usr/local/gfortran
sudo ln -sf $HOMEBREW_PREFIX/Cellar/gcc@${GCC_VERSION}/*/lib/gcc/${GCC_VERSION} /usr/local/gfortran/lib

- name: 🔖 Read vcpkg baseline
id: vcpkg-baseline
shell: bash
run: echo "ref=$(cat .github/vcpkg-baseline.txt)" >> "$GITHUB_OUTPUT"

- name: 🐕 Checkout vcpkg
uses: actions/checkout@v7
with:
repository: microsoft/vcpkg
ref: 9e593bb18ea69cc5095e012465dcd675a822ed0d # 2026.07.29 - TODO: can we have a canonical baseline for tests?
ref: ${{ steps.vcpkg-baseline.outputs.ref }}
path: vcpkg
fetch-depth: 1

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ jobs:
with:
arch: ${{ matrix.arch }}

- name: 🔖 Read vcpkg baseline
id: vcpkg-baseline
shell: bash
run: echo "ref=$(cat .github/vcpkg-baseline.txt)" >> "$GITHUB_OUTPUT"

- name: 🐕 Checkout vcpkg
uses: actions/checkout@v7
with:
repository: microsoft/vcpkg
ref: 9e593bb18ea69cc5095e012465dcd675a822ed0d # 2026.07.29 - TODO: can we have a canonical baseline for tests?
ref: ${{ steps.vcpkg-baseline.outputs.ref }}
path: vcpkg
fetch-depth: 1

Expand Down
23 changes: 23 additions & 0 deletions ports/arrow/0008-pyarrow-relative-rpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 3024945..8d5835b 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -298,8 +298,16 @@ find_package(Arrow REQUIRED)
if(APPLE
AND NOT PYARROW_BUNDLE_ARROW_CPP
AND ARROW_SHARED_LIB)
- get_filename_component(_arrow_lib_dir "${ARROW_SHARED_LIB}" DIRECTORY)
- list(APPEND CMAKE_INSTALL_RPATH "${_arrow_lib_dir}")
+ if(PYARROW_INSTALL_RPATH)
+ # vcpkg stages the install tree and then moves it, so the location of
+ # libarrow is only stable relative to the extension modules. Let the
+ # caller supply that relative RPATH instead of baking in the absolute
+ # directory the libraries happen to sit in at build time.
+ list(APPEND CMAKE_INSTALL_RPATH "${PYARROW_INSTALL_RPATH}")
+ else()
+ get_filename_component(_arrow_lib_dir "${ARROW_SHARED_LIB}" DIRECTORY)
+ list(APPEND CMAKE_INSTALL_RPATH "${_arrow_lib_dir}")
+ endif()
endif()

macro(define_option name description arrow_option)
69 changes: 62 additions & 7 deletions ports/arrow/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# AUTO_UPDATE
# GITHUB_REPO apache/arrow
# GITHUB_REF apache-arrow-${VERSION}
vcpkg_download_distfile(
ARCHIVE_PATH
URLS "https://archive.apache.org/dist/arrow/arrow-${VERSION}/apache-arrow-${VERSION}.tar.gz"
FILENAME apache-arrow-${VERSION}.tar.gz
SHA512 c687e50dfcdbf7e0e39710224360d35d9aa734452b3a47adc8c101f3019b6b4116310c05b9f3cd0a5ed4ad9b7bd8fb88edb70e79b3cbd413a57e5e35e4554a6c
SHA512 e75d384b4fdbdee29eb8ad29800c731843e7c43d90a43995dcc77390008723537791e212333178625345c718bdab15e0f3d8c12aa86b336918598c7d3fefc6e5
)
vcpkg_extract_source_archive(
SOURCE_PATH
Expand All @@ -13,6 +16,7 @@ vcpkg_extract_source_archive(
0004-android-datetime.patch
0005-cmake-msvcruntime.patch
0007-use-vcpkg-mimalloc.patch
0008-pyarrow-relative-rpath.patch
)

# Check cpp/cmake_modules/DefineOptions.cmake for option dependencies -
Expand Down Expand Up @@ -199,16 +203,67 @@ if("python" IN_LIST FEATURES)
set(ENV{SETUPTOOLS_SCM_PRETEND_VERSION} "${VERSION}")
set(ENV{PDM_BUILD_SCM_VERSION} "${VERSION}")

if (NOT "${VCPKG_BUILD_TYPE}" STREQUAL "")
set(build_opts "--build-type=${VCPKG_BUILD_TYPE}")
# Since 24.0.0 pyarrow has no setup.py and builds with scikit-build-core,
# which shells out to cmake and ninja. When it cannot find them on PATH it
# asks pip for them as wheels instead, which --no-index forbids, so hand it
# the ones vcpkg already has. The generator has no config-setting; CMake
# picks it up from the environment.
vcpkg_find_acquire_program(NINJA)
get_filename_component(ninja_dir "${NINJA}" DIRECTORY)
get_filename_component(cmake_dir "${CMAKE_COMMAND}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${ninja_dir}")
vcpkg_add_to_path(PREPEND "${cmake_dir}")
set(ENV{CMAKE_GENERATOR} "Ninja")

if(VCPKG_BUILD_TYPE STREQUAL "debug")
set(py_build_type "Debug")
else()
set(build_opts "--build-type=release")
set(py_build_type "Release")
endif()

# pyarrow's find_package(Python3Alt) asks CMake for Development.Module and
# NumPy. CMake derives the header and library locations from the
# interpreter's prefix, but the python3 port moves them: headers go to
# include/python<X.Y> and, on Windows, the import library is lib/pythonXY.lib.
# Left alone this fails with
# Could NOT find Python3 (missing: Development.Module NumPy)
# so point CMake straight at them.
execute_process(
COMMAND "${PYTHON3_VENV}" -c "import sys; print('%d.%d' % sys.version_info[:2])"
OUTPUT_VARIABLE py_version
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)
execute_process(
COMMAND "${PYTHON3_VENV}" -c "import numpy; print(numpy.get_include())"
OUTPUT_VARIABLE py_numpy_include
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)

set(py_hints
"--config-settings=cmake.define.Python3_EXECUTABLE=${PYTHON3_VENV}"
"--config-settings=cmake.define.Python3_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/python${py_version}"
"--config-settings=cmake.define.Python3_NumPy_INCLUDE_DIR=${py_numpy_include}"
)
if(VCPKG_TARGET_IS_WINDOWS)
# Extension modules must link the import library on Windows
string(REPLACE "." "" py_version_nodot "${py_version}")
list(APPEND py_hints
"--config-settings=cmake.define.Python3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python${py_version_nodot}.lib")
endif()

# The extensions land in <prefix>/lib/python3.X/site-packages/pyarrow, so
# libarrow in <prefix>/lib is three directories up. Only a relative RPATH
# survives vcpkg moving the staged tree into the installed one
# (see 0008-pyarrow-relative-rpath.patch).
vcpkg_execute_required_process(
COMMAND "${PYTHON3_VENV}" "setup.py"
"build_ext" ${build_opts} "--cmake-generator" "Ninja" "--rpath" "@loader_path/../../../"
"install" "--prefix" "${CURRENT_PACKAGES_DIR}"
COMMAND "${PYTHON3_VENV}" -m pip install "${SOURCE_PATH}/python"
--no-build-isolation --no-deps --no-index
--prefix "${CURRENT_PACKAGES_DIR}"
"--config-settings=cmake.build-type=${py_build_type}"
"--config-settings=cmake.define.PYARROW_INSTALL_RPATH=@loader_path/../../../"
${py_hints}
LOGNAME "python-build-${TARGET_TRIPLET}"
WORKING_DIRECTORY "${SOURCE_PATH}/python"
)
Expand Down
3 changes: 1 addition & 2 deletions ports/arrow/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "arrow",
"version": "23.0.1",
"port-version": 1,
"version": "25.0.1",
"description": "Cross-language development platform for in-memory analytics",
"homepage": "https://arrow.apache.org",
"license": "Apache-2.0",
Expand Down
3 changes: 2 additions & 1 deletion ports/gdal/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# AUTO_UPDATE
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OSGeo/gdal
REF "v${VERSION}"
SHA512 3b915c38cc7c9eb139df9335a90a2f6fd123c54e19ecb1f22670400eac76e317c5334f95dff5875c9c3fde8a0ef0f7aea86fa58ad42afaee823a46c6616e9c17
SHA512 57e371c02557ed0db210a6f992648602d9a7344679069a5101b3e25a49503683487009e96ad0707c780bac15cbd78415894096728d058304ea7f305b90628f69
HEAD_REF master
PATCHES
find-link-libraries.patch
Expand Down
21 changes: 11 additions & 10 deletions ports/gdal/sqlite3.diff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/cmake/modules/packages/FindSQLite3.cmake b/cmake/modules/packages/FindSQLite3.cmake
index 903465b3c9..5d3a067e50 100644
index 1dd364f..b9a0963 100644
--- a/cmake/modules/packages/FindSQLite3.cmake
+++ b/cmake/modules/packages/FindSQLite3.cmake
@@ -77,7 +77,7 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY)
@@ -79,7 +79,7 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY)
cmake_push_check_state(RESET)
# check column metadata
set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIR})
Expand All @@ -11,7 +11,7 @@ index 903465b3c9..5d3a067e50 100644
if(PC_SQLITE3_STATIC_LDFLAGS)
set(CMAKE_REQUIRED_LIBRARIES ${PC_SQLITE3_STATIC_LDFLAGS})
else()
@@ -111,15 +111,10 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY)
@@ -113,15 +113,10 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY)
endif()
else()
set(CMAKE_REQUIRED_LIBRARIES ${SQLite3_LIBRARY})
Expand All @@ -29,21 +29,22 @@ index 903465b3c9..5d3a067e50 100644
# Invalidate cached variables if SQLite3_LIBRARY changes
file(TIMESTAMP "${SQLite3_LIBRARY}" SQLite3_LIBRARY_TIMESTAMP)
if( SQLite3_LIBRARY_TIMESTAMP_OLD_VAL AND
@@ -179,6 +174,7 @@ if(SQLite3_FOUND)
@@ -181,6 +176,7 @@ if(SQLite3_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${SQLite3_LIBRARY}")
+ endif()
if(SQLite3_HAS_COLUMN_METADATA)
set_property(TARGET SQLite::SQLite3 APPEND PROPERTY
set_property(TARGET SQLite3::SQLite3 APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "SQLite3_HAS_COLUMN_METADATA")
@@ -187,5 +183,9 @@ if(SQLite3_FOUND)
set_property(TARGET SQLite::SQLite3 APPEND PROPERTY
@@ -189,6 +185,10 @@ if(SQLite3_FOUND)
set_property(TARGET SQLite3::SQLite3 APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "SQLite3_HAS_RTREE")
endif()
+ get_target_property(definitions SQLite::SQLite3 INTERFACE_COMPILE_DEFINITIONS)
+ get_target_property(definitions SQLite3::SQLite3 INTERFACE_COMPILE_DEFINITIONS)
+ if(definitions)
+ list(REMOVE_DUPLICATES definitions)
+ set_target_properties(SQLite::SQLite3 PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${definitions}")
+ set_target_properties(SQLite3::SQLite3 PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${definitions}")
endif()
endif()

# Alias SQLite3::SQLite3 to SQLite::SQLite3 since that's what PROJ will
2 changes: 1 addition & 1 deletion ports/gdal/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gdal",
"version-semver": "3.12.4",
"version-semver": "3.13.3",
"description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data",
"homepage": "https://gdal.org",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion ports/py-isort/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ vcpkg_from_pythonhosted(
OUT_SOURCE_PATH SOURCE_PATH
PACKAGE_NAME isort
VERSION ${VERSION}
SHA512 6ea1a3cd6ca4cc489e332f7d7c7e0d8138a734ecc0cf305a0324fe42c8ea0af9f6e28bd5b3cd7108d260fa93bf89a844b59589baf75c04d82e7112c54b7d305f
SHA512 edf386ec3497c1b9e540015dea76f8328593f43d2aa391acad459f175fe1b3a552d4ca0e75187bc92ef1319cb4c77bb774cb22ef9b46cf89daacc754bb454f93
)

vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}")
Expand Down
3 changes: 2 additions & 1 deletion ports/py-isort/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "py-isort",
"version": "8.0.1",
"version": "9.0.1",
"description": "A Python utility / library to sort Python imports.",
"homepage": "https://pycqa.github.io/isort/",
"dependencies": [
"py-hatchling",
"py-mypy-extensions",
{
"name": "py-poetry-core",
"host": true
Expand Down
17 changes: 17 additions & 0 deletions ports/py-mypy-extensions/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set(VCPKG_BUILD_TYPE release)

vcpkg_from_pythonhosted(
OUT_SOURCE_PATH SOURCE_PATH
PACKAGE_NAME mypy-extensions
VERSION ${VERSION}
SHA512 b946d48ff85a2c384049058a3bd822942a91114f818374764722962869e47ae0b86efee4b58b3c14a974e6711a8c1651ca6a1c0a448fa4ea03f9190c63b3dae0
FILENAME mypy_extensions
)

vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

vcpkg_python_test_import(MODULE "mypy_extensions")

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
22 changes: 22 additions & 0 deletions ports/py-mypy-extensions/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "py-mypy-extensions",
"version": "1.1.0",
"description": "Experimental type system extensions for programs checked with mypy",
"homepage": "https://github.com/python/mypy_extensions",
"license": "MIT",
"dependencies": [
{
"name": "py-flit-core",
"host": true
},
{
"name": "py-setuptools",
"host": true
},
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
}
]
}
Loading
Loading