Skip to content

Commit

Permalink
Add dll search path on windows via dedicated port
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored Mar 13, 2024
1 parent 719f4a4 commit c51fee2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 142 deletions.
3 changes: 3 additions & 0 deletions ports/py-add-vcpkg-dll-path/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file(COPY "${SOURCE_PATH}/sitecustomize.py" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}")

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
8 changes: 8 additions & 0 deletions ports/py-add-vcpkg-dll-path/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os
import sys
from pathlib import Path

vcpkg_bin_path = Path(sys.prefix) / '/../../bin'
if not vcpkg_bin_path.is_dir():
raise RuntimeError('Could not add "{vcpkg_bin_path}" to dll paths because it does not exist.')
os.add_dll_directory(vcpkg_bin_path)
10 changes: 10 additions & 0 deletions ports/py-add-vcpkg-dll-path/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "py-add-vcpkg-dll-path",
"version-date": "2024-03-13",
"description": "Adds the vcpkg dll path to python",
"license": "MIT",
"supports": "windows",
"dependencies": [
"vcpkg-python.scripts"
]
}
8 changes: 0 additions & 8 deletions ports/py-build/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pypa/build
REF cd06da25481b9a610f846fa60cb67b5a5fa9a051
SHA512 02e7021ec3ddd2fa3d5aa3b34193e858ba35d04d36244f1db2e84efbc37fc1f0e118d8ecd32d54ee1feb276e79d753f69979f430ebec7b3e0a0e85e144d1b692
HEAD_REF main
)

file(COPY "${SOURCE_PATH}/src/build" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
Expand Down
8 changes: 3 additions & 5 deletions ports/py-build/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"name": "py-build",
"version": "0.10.0",
"port-version": 1,
"description": "A simple, correct Python build frontend ",
"homepage": "https://python-build.readthedocs.io",
"version-date": "2024-03-13",
"description": "Add the path to vcpkg dll directory",
"license": "MIT",
"dependencies": [
"python3"
"vcpkg-python-scripts"
]
}
6 changes: 5 additions & 1 deletion ports/py-sip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "py-sip",
"version": "6.7.12",
"port-version": 3,
"port-version": 4,
"description": "A tool that makes it easy to create Python bindings for C and C++ libraries",
"homepage": "https://www.riverbankcomputing.com/software/sip",
"dependencies": [
Expand All @@ -12,6 +12,10 @@
{
"name": "vcpkg-python-scripts",
"host": true
},
{
"name": "py-add-vcpkg-dll-path",
"platform": "windows"
}
]
}
126 changes: 0 additions & 126 deletions ports/python3/add-vcpkg-search-path.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/python3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(PATCHES
0014-fix-get-python-inc-output.patch
0015-dont-use-WINDOWS-def.patch
0018-fix-sysconfig-include.patch
add-vcpkg-search-path.patch
# add-vcpkg-search-path.patch
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down
2 changes: 1 addition & 1 deletion ports/python3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "python3",
"version": "3.11.5",
"port-version": 5,
"port-version": 6,
"description": "The Python programming language",
"homepage": "https://github.com/python/cpython",
"license": "Python-2.0",
Expand Down

0 comments on commit c51fee2

Please sign in to comment.