-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into py-add-vcpkg-dll-path
- Loading branch information
Showing
28 changed files
with
313 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO cython/cython | ||
REF ${VERSION} | ||
SHA512 585d3fe810ace55278fcc6ea4508b3b5259320f92998cd688da787cd5f88ac5fc2467025f20da6d968969eb3296ae9c517136d24a4dbb475441271227968f6be | ||
HEAD_REF main | ||
) | ||
|
||
vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") | ||
|
||
if(NOT VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_copy_tools(TOOL_NAMES cygdb cython cythonize DESTINATION "${CURRENT_PACKAGES_DIR}/${VCPKG_PYTHON3_SCRIPTS}" AUTO_CLEAN) | ||
endif() | ||
|
||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) | ||
set(VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "py-cython", | ||
"version": "3.0.5", | ||
"description": "Cython is a Python compiler that makes writing C extensions for Python as easy as Python itself. Cython is based on Pyrex, but supports more cutting edge functionality and optimizations.", | ||
"homepage": "https://cython.org/", | ||
"license": "Apache-2.0", | ||
"dependencies": [ | ||
"py-setuptools", | ||
"python3", | ||
{ | ||
"name": "vcpkg-python-scripts", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) # Numpy includes are stored in the module itself | ||
set(VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled) | ||
set(VCPKG_BUILD_TYPE release) # No debug builds required for pure python modules since vcpkg does not install a debug python executable. | ||
|
||
#TODO: Fix E:\vcpkg_folders\numpy\installed\x64-windows-release\tools\python3\Lib\site-packages\numpy\testing\_private\extbuild.py | ||
|
||
set(VCPKG_PYTHON3_BASEDIR "${CURRENT_HOST_INSTALLED_DIR}/tools/python3") | ||
find_program(VCPKG_PYTHON3 NAMES python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR} python${PYTHON3_VERSION_MAJOR} python PATHS "${VCPKG_PYTHON3_BASEDIR}" NO_DEFAULT_PATH) | ||
find_program(VCPKG_CYTHON NAMES cython PATHS "${VCPKG_PYTHON3_BASEDIR}" "${VCPKG_PYTHON3_BASEDIR}/Scripts" NO_DEFAULT_PATH) | ||
|
||
set(ENV{PYTHON3} "${VCPKG_PYTHON3}") | ||
set(PYTHON3 "${VCPKG_PYTHON3}") | ||
|
||
vcpkg_add_to_path(PREPEND "${VCPKG_PYTHON3_BASEDIR}") | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_add_to_path(PREPEND "${VCPKG_PYTHON3_BASEDIR}/Scripts") | ||
endif() | ||
|
||
cmake_path(GET SCRIPT_MESON PARENT_PATH MESON_DIR) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO numpy/numpy | ||
REF v${VERSION} | ||
SHA512 01b6a124c72d082f1dafdd98cdaaa84ab57f2bf0112d89d9355fa458a04deb8309c7e78449767429049971793c040e51412060681218a51c671ac6086dba2fa4 | ||
HEAD_REF main | ||
) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH_SIMD | ||
REPO intel/x86-simd-sort | ||
REF 0631a88763a4a0a4c9e84d5eeb0ec5d36053730b | ||
SHA512 cd44796fc10e13004932be05d5bee46070e061bcc429c7ee8d9e11520e18c45bdec2f4fcd3555d9769891a763e151b0a0a4c00385ea30f24c99da1c65d736e39 | ||
HEAD_REF main | ||
) | ||
|
||
file(COPY "${SOURCE_PATH_SIMD}/" DESTINATION "${SOURCE_PATH}/numpy/core/src/npysort/x86-simd-sort") | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH_MESON_NUMPY | ||
REPO numpy/meson | ||
REF 4e370ca8ab73c07f7b84abe8a4b937caace050a4 | ||
SHA512 dec6e3b9428f95790f85a863778227a73e4f432f8f54e87d61fd6499b5a0723c59a334fcaf880afd59ae50c924d8f2cfa340a143f752cb39f976c731ca0ea123 | ||
HEAD_REF main | ||
) | ||
|
||
file(COPY "${SOURCE_PATH_MESON_NUMPY}/mesonbuild/modules/features" DESTINATION "${MESON_DIR}/mesonbuild/modules") | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH_SVML | ||
REPO numpy/SVML | ||
REF 1b21e453f6b1ba6a6aca392b1d810d9d41576123 | ||
SHA512 c9ea7bf9effbf5750750ddfdfc7db3d95614ed176bd4540d68eddb90a15f819510e9564c9454ef34be02dd6a8e48a7f292a70cb5b63c25c3d1c450a8e3b77d35 | ||
HEAD_REF main | ||
) | ||
|
||
file(COPY "${SOURCE_PATH_SVML}/" DESTINATION "${SOURCE_PATH}/numpy/core/src/umath/svml") | ||
|
||
vcpkg_replace_string("${SOURCE_PATH}/meson.build" "py.dependency()" "dependency('python-3.${PYTHON3_VERSION_MINOR}', method : 'pkg-config')") | ||
|
||
#debug replacement | ||
vcpkg_replace_string("${SOURCE_PATH}/numpy/_build_utils/tempita.py" "import argparse" "import argparse\nprint(sys.executable)\nimport os\n | ||
print(os.environ['PATH'])") | ||
|
||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CROSSCOMPILING AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") | ||
set(opts | ||
ADDITIONAL_PROPERTIES | ||
"longdouble_format = 'IEEE_DOUBLE_LE'" | ||
) | ||
endif() | ||
|
||
message(STATUS "PATH is: '$ENV{PATH}'") | ||
vcpkg_configure_meson( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-Dblas=blas | ||
-Dlapack=lapack | ||
#-Duse-ilp64=true | ||
ADDITIONAL_BINARIES | ||
cython=['${VCPKG_CYTHON}'] | ||
python3=['${VCPKG_PYTHON3}'] | ||
# python=['${VCPKG_PYTHON3}'] | ||
${opts} | ||
) | ||
message(STATUS "PATH is: '$ENV{PATH}'") | ||
vcpkg_install_meson() | ||
message(STATUS "PATH is: '$ENV{PATH}'") | ||
vcpkg_fixup_pkgconfig() | ||
|
||
#E:\vcpkg_folders\numpy\packages\numpy_arm64-windows-release\tools\python3\Lib\site-packages\numpy\__config__.py | ||
# "path": r"E:/vcpkg_folders/numpy/installed/x64-windows-release/tools/python3/python.exe", and full paths to compilers | ||
#"commands": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/arm64/cl.exe, -DWIN32, -D_WINDOWS, -W3, -utf-8, -MP, -MD, -O2, -Oi, -Gy, -DNDEBUG, -Z7", | ||
|
||
set(subdir "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/") | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
set(subdir "${CURRENT_PACKAGES_DIR}/lib/site-packages/") | ||
endif() | ||
set(pyfile "${subdir}/numpy/__config__.py") | ||
file(READ "${pyfile}" contents) | ||
string(REPLACE "${CURRENT_INSTALLED_DIR}" "$(prefix)" contents "${contents}") | ||
string(REPLACE "r\"${VCPKG_PYTHON3}\"" "sys.executable" contents "${contents}") | ||
file(WRITE "${pyfile}" "${contents}") | ||
|
||
|
||
if(VCPKG_TARGET_IS_WINDOWS) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}") | ||
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/site-packages/numpy" "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/numpy") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") | ||
endif() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
) | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") | ||
|
||
# Add required Metadata for some python build plugins | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/numpy-${VERSION}.dist-info/METADATA" | ||
"Metadata-Version: 2.1\n\ | ||
Name: numpy\n\ | ||
Version: ${VERSION}" | ||
) | ||
|
||
vcpkg_python_test_import(MODULE "numpy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "py-numpy", | ||
"version": "1.26.4", | ||
"description": "The fundamental package for scientific computing with Python.", | ||
"homepage": "https://www.numpy.org/", | ||
"license": "BSD-3-Clause", | ||
"dependencies": [ | ||
"blas", | ||
"lapack", | ||
{ | ||
"name": "py-cython", | ||
"host": true | ||
}, | ||
"python3", | ||
{ | ||
"name": "python3", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-python-scripts", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-tool-meson", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
vcpkg_from_pythonhosted( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
PACKAGE_NAME PyYAML | ||
VERSION ${VERSION} | ||
SHA512 94a29924484f557c0966d485c2b70232909253f27fcea9b89e1db1462abf61f2f85d55fbae0177b2bed70eb5daa75813551e868df4df4cddfdee9a87bd08485f | ||
) | ||
|
||
vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x) | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||
|
||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "py-pyyaml", | ||
"version": "6.0.1", | ||
"description": "YAML parser and emitter for Python", | ||
"homepage": "https://pyyaml.org/", | ||
"dependencies": [ | ||
{ | ||
"name": "py-setuptools", | ||
"host": true | ||
}, | ||
"python3", | ||
{ | ||
"name": "vcpkg-python-scripts", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.