Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/actions/setup-vcpkg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ runs:
run: |
. <(curl https://aka.ms/vcpkg-init.sh -L)
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
# osx dynamic fix, bandaid until next vcpkg tool release
wget https://raw.githubusercontent.com/microsoft/vcpkg/9558037875497b9db8cf38fcd7db68ec661bffe7/scripts/cmake/z_vcpkg_fixup_rpath_macho.cmake -O ${VCPKG_ROOT}/scripts/cmake/z_vcpkg_fixup_rpath_macho.cmake

- name: Setup vcpkg
if: runner.os == 'Windows'
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/macos-dynamic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
name: 🍎 MacOS Dynamic
on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-osx-dynamic:
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- os: macos-13
triplet: x64-osx-dynamic
- os: macos-14
triplet: arm64-osx-dynamic
env:
buildtrees: /Users/runner/vcpkg-build
name: build (macos)
runs-on: ${{ matrix.os }}

steps:
- name: 🐣 Checkout
uses: actions/checkout@v4

- name: 🐩 Install CMake and Ninja
uses: lukka/get-cmake@latest

- name: 🧽 Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1

- name: 🔨 Prepare build env
run: |
brew install autoconf automake autoconf-archive libtool

- name: 🐕 Checkout vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: e60236ee051183f1122066bee8c54a0b47c43a60 # TODO: can we have a canonical baseline for tests?
path: vcpkg
fetch-depth: 1

- name: 🐾 Bootstrap vcpkg
shell: bash
run: |
wget https://raw.githubusercontent.com/microsoft/vcpkg/f9dfb066d02fa62015e5c27acb4801cb482d5890/scripts/cmake/z_vcpkg_fixup_rpath_macho.cmake -O vcpkg/scripts/cmake/z_vcpkg_fixup_rpath_macho.cmake
PKG_SOURCE_USER=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1)
./vcpkg/bootstrap-vcpkg.sh
NUGET_EXE=$(./vcpkg/vcpkg fetch nuget | grep '^\/.*nuget.exe$')
echo "Downloaded $NUGET_EXE"
mono $NUGET_EXE sources add -Name ghpkg -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" -UserName "$PKG_SOURCE_USER" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
mono $NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV
VCPKG_ROOT=$(pwd)/vcpkg
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV

- name: 🌋 Build
run: |
VCPKG_OPTIONS="--overlay-ports="${{ github.workspace }}/ports" --host-triplet=${{ matrix.triplet }} --triplet=${{ matrix.triplet }} --x-buildtrees-root=${{ env.buildtrees }}"
./vcpkg/vcpkg install $VCPKG_OPTIONS py-pip \
py-sip \
py-numpy \
py-psycopg2 \
py-urllib3 \
py-markupsafe \
py-matplotlib \
py-requests \
py-isort \
py-autopep8 \
py-pyqt6

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs-${{ matrix.triplet }}
path: ${{ env.buildtrees }}/**/*.log
24 changes: 12 additions & 12 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ jobs:
- name: 🌋 Build
run: |
VCPKG_OPTIONS="--overlay-ports="${{ github.workspace }}/ports" --host-triplet=${{ matrix.triplet }} --triplet=${{ matrix.triplet }} --x-buildtrees-root=${{ env.buildtrees }}"
./vcpkg/vcpkg install $VCPKG_OPTIONS py-pip
./vcpkg/vcpkg install $VCPKG_OPTIONS py-sip
./vcpkg/vcpkg install $VCPKG_OPTIONS py-numpy
./vcpkg/vcpkg install $VCPKG_OPTIONS py-psycopg2
./vcpkg/vcpkg install $VCPKG_OPTIONS py-urllib3
./vcpkg/vcpkg install $VCPKG_OPTIONS py-markupsafe
# ./vcpkg/vcpkg install $VCPKG_OPTIONS py-matplotlib
./vcpkg/vcpkg install $VCPKG_OPTIONS py-requests
./vcpkg/vcpkg install $VCPKG_OPTIONS py-isort
./vcpkg/vcpkg install $VCPKG_OPTIONS py-autopep8
./vcpkg/vcpkg install $VCPKG_OPTIONS py-flask
# ./vcpkg/vcpkg install $VCPKG_OPTIONS py-pyqt6
./vcpkg/vcpkg install $VCPKG_OPTIONS py-pip \
py-sip \
py-numpy \
py-psycopg2 \
py-urllib3 \
py-markupsafe \
py-matplotlib \
py-requests \
py-isort \
py-autopep8 \
py-flask \
py-pyqt6

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:

- name: 🌋 Build
run: |
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} --x-buildtrees-root=C:/vcpkg-build py-pyqt6 py-pyyaml py-numpy gdal[python] py-qscintilla py-psycopg2 py-urllib3 py-markupsafe py-requests py-isort py-autopep8 py-flask
# py-matplotlib
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} --x-buildtrees-root=C:/vcpkg-build py-pyqt6 py-pyyaml py-numpy gdal[python] py-qscintilla py-psycopg2 py-urllib3 py-markupsafe py-requests py-isort py-autopep8 py-flask py-matplotlib

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.orig
6 changes: 5 additions & 1 deletion ports/py-matplotlib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ vcpkg_from_github(
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig;${CURRENT_INSTALLED_DIR}/share/pkgconfig")
set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")

set(PYTHON3 "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${VCPKG_HOST_EXECUTABLE_SUFFIX}")
if(VCPKG_TARGET_IS_WINDOWS)
set(PYTHON3 "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python.exe")
else()
set(PYTHON3 "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}")
endif()
vcpkg_mesonpy_prepare_build_options(OUTPUT meson_opts)

z_vcpkg_setup_pkgconfig_path(CONFIG "RELEASE")
Expand Down
2 changes: 1 addition & 1 deletion ports/py-matplotlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "py-matplotlib",
"version": "3.9.2",
"port-version": 1,
"port-version": 2,
"description": "Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.",
"homepage": "https://matplotlib.org/stable/",
"license": null,
Expand Down
9 changes: 6 additions & 3 deletions ports/py-meson/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/python3/Lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/Lib/site-packages/" "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/Lib")
if(VCPKG_TARGET_IS_WINDOWS)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/python3/Lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/Lib/site-packages/" "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/Lib")
endif()


vcpkg_python_test_import(MODULE "mesonpy")

Expand Down
1 change: 1 addition & 0 deletions ports/py-meson/vcpkg-port-config.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Overwrite builtin scripts
include("${CMAKE_CURRENT_LIST_DIR}/../vcpkg-tool-meson/vcpkg-port-config.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/../vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_mesonpy_prepare_build_options.cmake")
1 change: 1 addition & 0 deletions ports/py-meson/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "py-meson",
"version": "0.15.0",
"port-version": 1,
"description": "Meson PEP 517 Python build backend",
"homepage": "https://github.com/mesonbuild/meson-python",
"license": "MIT",
Expand Down
8 changes: 7 additions & 1 deletion ports/py-meson/vcpkg_mesonpy_prepare_build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function(vcpkg_mesonpy_prepare_build_options)
vcpkg_add_to_path(PREPEND "${NINJA_PATH}") # Prepend to use the correct ninja.

vcpkg_find_acquire_program(PYTHON3)
x_vcpkg_get_python_packages(
PYTHON_VERSION 3
PYTHON_EXECUTABLE ${PYTHON3}
PACKAGES gpep517 setuptools-scm
OUT_PYTHON_VAR PYTHON3
)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${PYTHON3_DIR}")

Expand Down Expand Up @@ -118,4 +124,4 @@ function(vcpkg_mesonpy_prepare_build_options)
endforeach()

set("${arg_OUTPUT}" ${arg_OPTIONS} ${arg_OPTIONS_RELEASE} PARENT_SCOPE)
endfunction()
endfunction()
4 changes: 2 additions & 2 deletions ports/py-tomli/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO hukkin/tomli
REF 36ef51d6a5a55e0eca077b58695390d041061bd4
SHA512 fe47a06dddad298dd64975f7618e7c8d03de83a8f4b44da868abd78e062138ad9df18fbc810e55e4cb240fac2c3c023b18ee4e87cab5e93cd776b34fac497bdf
REF ${VERSION}
SHA512 3eeea334d6d225590a9e074685c65d052e2f5d5286ca895ff7e9532d7289f0daa31ae67b5076d803e5adad4f20a9831058a0c4599715f049079904934d3d9c25
HEAD_REF main
)

Expand Down
4 changes: 2 additions & 2 deletions ports/py-tomli/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "py-tomli",
"version": "2.0.1",
"version": "2.0.2",
"description": "A simple, correct Python build frontend ",
"homepage": "py-build.readthedocs.io/en/stable/",
"homepage": "https://github.com/hukkin/tomli",
"license": "MIT",
"dependencies": [
"vcpkg-python-scripts"
Expand Down
1 change: 1 addition & 0 deletions ports/vcpkg-python-scripts/vcpkg-port-config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include_guard(GLOBAL)

include("${CMAKE_CURRENT_LIST_DIR}/../python3/vcpkg-port-config.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/../vcpkg-cmake-get-vars/vcpkg-port-config.cmake")

set(PYTHON3_BASEDIR "${CURRENT_INSTALLED_DIR}/tools/python3")
find_program(PYTHON3 NAMES python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR} python${PYTHON3_VERSION_MAJOR} python PATHS "${PYTHON3_BASEDIR}" NO_DEFAULT_PATH)
Expand Down
8 changes: 6 additions & 2 deletions ports/vcpkg-python-scripts/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "vcpkg-python-scripts",
"version-date": "2024-05-12",
"port-version": 2,
"port-version": 4,
"documentation": "https://vcpkg.io/en/docs/README.html",
"license": "MIT",
"supports": "native",
"dependencies": [
"python3"
"python3",
{
"name": "vcpkg-cmake-get-vars",
"host": true
}
]
}
16 changes: 11 additions & 5 deletions ports/vcpkg-python-scripts/vcpkg_python_functions.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
set(ENV{SETUPTOOLS_SCM_PRETEND_VERSION} "${VERSION}")
set(ENV{PDM_BUILD_SCM_VERSION} "${VERSION}")

set(z_vcpkg_python_func_python "${PYTHON3}")

function(vcpkg_from_pythonhosted)
cmake_parse_arguments(
PARSE_ARGV 0
Expand Down Expand Up @@ -82,8 +80,16 @@ function(vcpkg_python_build_wheel)
endforeach()
endif()

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

set(ENV{CFLAGS} "${VCPKG_COMBINED_C_FLAGS_RELEASE}")
set(ENV{CXXFLAGS} "${VCPKG_COMBINED_CXX_FLAGS_RELEASE}")
set(ENV{LDFLAGS} "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE}")
set(ENV{ARFLAGS} "${VCPKG_COMBINED_STATIC_LINKER_FLAGS_RELEASE}")

vcpkg_execute_required_process(
COMMAND ${env} "${z_vcpkg_python_func_python}" -m gpep517 build-wheel --wheel-dir "${z_vcpkg_wheeldir}" --output-fd 1 ${build_ops}
COMMAND ${env} "${PYTHON3}" -m gpep517 build-wheel --wheel-dir "${z_vcpkg_wheeldir}" --output-fd 1 ${build_ops}
Comment on lines -86 to +92
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Neumann-A what was your intent with z_vcpkg_python_func_python? Should this be the system python or something provided through vcpkg?

In the current state of this repository, it happens to be system python. In this case I think we'll need to acquire build dependencies (e.g. gpep517) similar to the py-meson approach above
https://github.com/open-vcpkg/python-registry/pull/51/files#diff-84817e4d8adab62c915c43e6a931b961f018d05eca77fc90b42fc62d032e8298R27

Copy link
Member

Choose a reason for hiding this comment

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

The idea was to have a single place which handles which python gets used instead of having to change all vcpkg_execute_required_process calls

Copy link
Contributor Author

Choose a reason for hiding this comment

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

where would this ideally be defined? in vcpkg-python-scripts/vcpkg-port-config.cmake ?

Copy link
Member

Choose a reason for hiding this comment

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

I think it doesn't matter if the port-config or the scripts defined them. Thy will be in close proximity any way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • PYTHON3 is set by vcpkg-tool-meson/vcpkg-port-config.cmake
  • we need a python with build deps installed (e.g. gpep517)
  • if we use x_vcpkg_get_python_packages to acquire missing packages, we need to replace PYTHON3 with a python from the venv with the packages installed
  • build deps are known by the consuming port (py-matplotlib) in this case, but I don't see how this could replace PYTHON3 early enough

Options:

a) Use python from a host vcpkg port and specify build deps in vcpkg.json
b) Make it possible to inject build deps into vcpkg-python-scripts and create a venv in there

LOGNAME "python-build-${TARGET_TRIPLET}"
WORKING_DIRECTORY "${arg_SOURCE_PATH}"
)
Expand Down Expand Up @@ -120,7 +126,7 @@ function(vcpkg_python_install_wheel)
endif()

message(STATUS "Installing python wheel:'${arg_WHEEL}'")
vcpkg_execute_required_process(COMMAND "${z_vcpkg_python_func_python}" -m installer
vcpkg_execute_required_process(COMMAND "${PYTHON3}" -m installer
--prefix "${install_prefix}"
--destdir "${CURRENT_PACKAGES_DIR}" "${arg_WHEEL}"
LOGNAME "python-installer-${TARGET_TRIPLET}"
Expand Down Expand Up @@ -182,7 +188,7 @@ function(vcpkg_python_test_import)
set(PACKAGE_SITE_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}/${RELATIVE_SITE_PACKAGES_DIR}")
configure_file("${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-python-scripts/import_test.py.in" "${CURRENT_BUILDTREES_DIR}/import_test.py" @ONLY)

vcpkg_execute_required_process(COMMAND "${z_vcpkg_python_func_python}" "${CURRENT_BUILDTREES_DIR}/import_test.py"
vcpkg_execute_required_process(COMMAND "${PYTHON3}" "${CURRENT_BUILDTREES_DIR}/import_test.py"
LOGNAME "python-test-import-${TARGET_TRIPLET}"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
)
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@
},
"py-matplotlib": {
"baseline": "3.9.2",
"port-version": 1
"port-version": 2
},
"py-meson": {
"baseline": "0.15.0",
"port-version": 0
"port-version": 1
},
"py-numpy": {
"baseline": "1.26.4",
Expand Down Expand Up @@ -221,7 +221,7 @@
"port-version": 0
},
"py-tomli": {
"baseline": "2.0.1",
"baseline": "2.0.2",
"port-version": 0
},
"py-trove-classifiers": {
Expand Down Expand Up @@ -258,7 +258,7 @@
},
"vcpkg-python-scripts": {
"baseline": "2024-05-12",
"port-version": 2
"port-version": 4
},
"vcpkg-tool-mercurial": {
"baseline": "2023-06-27",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-matplotlib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4cefbf5ed25506114385052ed64fb927b88daaeb",
"version": "3.9.2",
"port-version": 2
},
{
"git-tree": "68ebff1cccff9cea5155674352969b92bf0e7098",
"version": "3.9.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-meson.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5e75d7c8be60987fe672073dabcfed3dfa27d5f7",
"version": "0.15.0",
"port-version": 1
},
{
"git-tree": "492c2cf2e21e3339e428c8ac609d556f87847d27",
"version": "0.15.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-tomli.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "06070c900ac80a4563e56f72648b093c601b97a5",
"version": "2.0.2",
"port-version": 0
},
{
"git-tree": "60151223a49632b9d2513f0fc8e09fc49eaecf17",
"version": "2.0.1",
Expand Down
10 changes: 10 additions & 0 deletions versions/v-/vcpkg-python-scripts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"versions": [
{
"git-tree": "32e165aee4edfa6dca2488a99ac0848fcf8b1664",
"version-date": "2024-05-12",
"port-version": 4
},
{
"git-tree": "fbb437d04db9dba8d06fe8d57c0fcbc6f538af75",
"version-date": "2024-05-12",
"port-version": 3
},
{
"git-tree": "affc5263ff69b940637952d599d1f08cc36b4949",
"version-date": "2024-05-12",
Expand Down