Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dll search path on windows via dedicated port #23

Merged
merged 13 commits into from
May 13, 2024
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"
m-kuhn marked this conversation as resolved.
Show resolved Hide resolved
]
}
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
m-kuhn marked this conversation as resolved.
Show resolved Hide resolved
)

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
Loading