From 9461525d1c806d3357de79c16b084000c7c0d008 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 9 Oct 2024 22:34:28 +0200 Subject: [PATCH] matplotlib and requests --- .github/workflows/macos.yml | 2 ++ .github/workflows/windows.yml | 2 +- ports/py-charset-normalizer/portfile.cmake | 16 +++++++++ ports/py-charset-normalizer/vcpkg.json | 17 ++++++++++ ports/py-idna/portfile.cmake | 16 +++++++++ ports/py-idna/vcpkg.json | 17 ++++++++++ ports/py-matplotlib/vcpkg.json | 3 +- ports/py-requests/portfile.cmake | 16 +++++++++ ports/py-requests/vcpkg.json | 20 ++++++++++++ ports/pybind11/TODO.txt | 1 + ports/pybind11/fix-debug-link.patch | 12 +++++++ ports/pybind11/portfile.cmake | 38 ++++++++++++++++++++++ ports/pybind11/usage | 23 +++++++++++++ ports/pybind11/vcpkg.json | 31 ++++++++++++++++++ versions/baseline.json | 18 +++++++++- versions/p-/py-charset-normalizer.json | 9 +++++ versions/p-/py-idna.json | 9 +++++ versions/p-/py-matplotlib.json | 5 +++ versions/p-/py-requests.json | 9 +++++ versions/p-/pybind11.json | 9 +++++ 20 files changed, 270 insertions(+), 3 deletions(-) create mode 100755 ports/py-charset-normalizer/portfile.cmake create mode 100755 ports/py-charset-normalizer/vcpkg.json create mode 100755 ports/py-idna/portfile.cmake create mode 100755 ports/py-idna/vcpkg.json create mode 100755 ports/py-requests/portfile.cmake create mode 100755 ports/py-requests/vcpkg.json create mode 100644 ports/pybind11/TODO.txt create mode 100644 ports/pybind11/fix-debug-link.patch create mode 100644 ports/pybind11/portfile.cmake create mode 100644 ports/pybind11/usage create mode 100644 ports/pybind11/vcpkg.json create mode 100644 versions/p-/py-charset-normalizer.json create mode 100644 versions/p-/py-idna.json create mode 100644 versions/p-/py-requests.json create mode 100644 versions/p-/pybind11.json diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 72961bd..8e7c95b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -72,6 +72,8 @@ jobs: ./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-pyqt6 - name: 📑 Upload logs diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 729a3a9..2b67244 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -57,7 +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 + .\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-matplotlib py-requests - name: 📑 Upload logs uses: actions/upload-artifact@v4 diff --git a/ports/py-charset-normalizer/portfile.cmake b/ports/py-charset-normalizer/portfile.cmake new file mode 100755 index 0000000..0528388 --- /dev/null +++ b/ports/py-charset-normalizer/portfile.cmake @@ -0,0 +1,16 @@ +set(VCPKG_BUILD_TYPE release) + +vcpkg_from_pythonhosted( + OUT_SOURCE_PATH SOURCE_PATH + PACKAGE_NAME charset_normalizer + VERSION ${VERSION} + SHA512 7b7098d389bf4b181bd26037fa439abb44811ee68b01b78bfd399b4213cca7309d4878e90a0983d6aa2c550c3b9b355c8b5157fae731981f3e6e4028a911d143 +) + +vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +vcpkg_python_test_import(MODULE "charset_normalizer") + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/py-charset-normalizer/vcpkg.json b/ports/py-charset-normalizer/vcpkg.json new file mode 100755 index 0000000..d77399d --- /dev/null +++ b/ports/py-charset-normalizer/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "py-charset-normalizer", + "version": "3.4.0", + "description": "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.", + "homepage": "https://github.com/Ousret/charset_normalizer", + "dependencies": [ + { + "name": "py-setuptools", + "host": true + }, + "python3", + { + "name": "vcpkg-python-scripts", + "host": true + } + ] +} diff --git a/ports/py-idna/portfile.cmake b/ports/py-idna/portfile.cmake new file mode 100755 index 0000000..8749838 --- /dev/null +++ b/ports/py-idna/portfile.cmake @@ -0,0 +1,16 @@ +set(VCPKG_BUILD_TYPE release) + +vcpkg_from_pythonhosted( + OUT_SOURCE_PATH SOURCE_PATH + PACKAGE_NAME idna + VERSION ${VERSION} + SHA512 bdc00fb42c48a34ec3df91b0592fe41785061f891a252ce82f168d99089a52e8e5bc7a823794f61e7915c0f691d911ed8b3bf7aecf3e2aeb3fc85da4ef35f47e +) + +vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") + +vcpkg_python_test_import(MODULE "idna") + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/py-idna/vcpkg.json b/ports/py-idna/vcpkg.json new file mode 100755 index 0000000..40f2a9c --- /dev/null +++ b/ports/py-idna/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "py-idna", + "version": "3.10", + "description": "Internationalized Domain Names in Applications (IDNA)", + "homepage": "https://github.com/kjd/idna", + "dependencies": [ + { + "name": "py-setuptools", + "host": true + }, + "python3", + { + "name": "vcpkg-python-scripts", + "host": true + } + ] +} diff --git a/ports/py-matplotlib/vcpkg.json b/ports/py-matplotlib/vcpkg.json index 305d9ac..f8688ba 100755 --- a/ports/py-matplotlib/vcpkg.json +++ b/ports/py-matplotlib/vcpkg.json @@ -1,12 +1,12 @@ { "name": "py-matplotlib", "version": "3.9.2", + "port-version": 1, "description": "Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.", "homepage": "https://matplotlib.org/stable/", "license": null, "dependencies": [ "freetype", - "numpy", "py-certifi", "py-cycler", "py-dateutil", @@ -16,6 +16,7 @@ "name": "py-meson", "host": true }, + "py-numpy", "py-pillow", "py-pyparsing", { diff --git a/ports/py-requests/portfile.cmake b/ports/py-requests/portfile.cmake new file mode 100755 index 0000000..3d79aa1 --- /dev/null +++ b/ports/py-requests/portfile.cmake @@ -0,0 +1,16 @@ +set(VCPKG_BUILD_TYPE release) + +vcpkg_from_pythonhosted( + OUT_SOURCE_PATH SOURCE_PATH + PACKAGE_NAME requests + VERSION ${VERSION} + SHA512 20d413597ff4803a62156ada25ef2e8a5edd0d4dbf7d79cc7fcd88d51a76e019a7dacf41d7c3d546306f37c506ede68f16b9afea57c918db64e702382b1ae420 +) + +vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +vcpkg_python_test_import(MODULE "requests") + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/py-requests/vcpkg.json b/ports/py-requests/vcpkg.json new file mode 100755 index 0000000..ff87f54 --- /dev/null +++ b/ports/py-requests/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "py-requests", + "version": "2.32.3", + "description": "Python HTTP for Humans.", + "homepage": "https://requests.readthedocs.io/", + "dependencies": [ + "py-certifi", + "py-charset-normalizer", + "py-idna", + { + "name": "py-setuptools", + "host": true + }, + "python3", + { + "name": "vcpkg-python-scripts", + "host": true + } + ] +} diff --git a/ports/pybind11/TODO.txt b/ports/pybind11/TODO.txt new file mode 100644 index 0000000..db55454 --- /dev/null +++ b/ports/pybind11/TODO.txt @@ -0,0 +1 @@ +fix config file not finding python \ No newline at end of file diff --git a/ports/pybind11/fix-debug-link.patch b/ports/pybind11/fix-debug-link.patch new file mode 100644 index 0000000..fc68274 --- /dev/null +++ b/ports/pybind11/fix-debug-link.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d93203..031088a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -196,6 +196,7 @@ if(NOT TARGET pybind11_headers) + + target_compile_features(pybind11_headers INTERFACE cxx_inheriting_constructors cxx_user_literals + cxx_right_angle_brackets) ++ target_compile_definitions (pybind11_headers INTERFACE $<$:Py_DEBUG>) + if(NOT "${PYBIND11_INTERNALS_VERSION}" STREQUAL "") + target_compile_definitions( + pybind11_headers INTERFACE "PYBIND11_INTERNALS_VERSION=${PYBIND11_INTERNALS_VERSION}") diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake new file mode 100644 index 0000000..86b38c8 --- /dev/null +++ b/ports/pybind11/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pybind/pybind11 + REF "v${VERSION}" + SHA512 ed1512ff0bca3bc0a45edc2eb8c77f8286ab9389f6ff1d5cb309be24bc608abbe0df6a7f5cb18c8f80a3bfa509058547c13551c3cd6a759af708fd0cdcdd9e95 + HEAD_REF master + PATCHES + fix-debug-link.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DPYBIND11_TEST=OFF + # Disable all Python searching, Python required only for tests + -DPYBIND11_NOPYTHON=ON +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "share/cmake/pybind11") +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +if("scripts" IN_LIST FEATURES) + set(ENV{SETUPTOOLS_SCM_PRETEND_VERSION} "${VERSION}") + + vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") + + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/pybind11/include" + "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/pybind11/share" + ) + +endif() diff --git a/ports/pybind11/usage b/ports/pybind11/usage new file mode 100644 index 0000000..83162ad --- /dev/null +++ b/ports/pybind11/usage @@ -0,0 +1,23 @@ +pybind11 provides CMake targets. There are two modes provided; classic, which is built on the old Python +discovery packages in CMake, or the new FindPython mode, which uses FindPython +from 3.12+ forward (3.15+ _highly_ recommended). + +New FindPython mode: + + find_package(Python COMPONENTS Interpreter Development) + find_package(pybind11 CONFIG) + + # pybind11 method: + pybind11_add_module(MyModule1 src1.cpp) + + # Python method: + Python_add_library(MyModule2 src2.cpp) + target_link_libraries(MyModule2 pybind11::headers) + set_target_properties(MyModule2 PROPERTIES + INTERPROCEDURAL_OPTIMIZATION ON + CXX_VISIBILITY_PRESET ON + VISIBILITY_INLINES_HIDDEN ON + ) + +For more information see here: + https://pybind11.readthedocs.io/en/latest/compiling.html#building-with-cmake \ No newline at end of file diff --git a/ports/pybind11/vcpkg.json b/ports/pybind11/vcpkg.json new file mode 100644 index 0000000..1c57fac --- /dev/null +++ b/ports/pybind11/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "pybind11", + "version": "2.11.1", + "description": "pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code", + "homepage": "https://github.com/pybind/pybind11", + "license": "BSD-3-Clause", + "supports": "!(arm & windows)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "scripts": { + "description": "Install pybind python scripts", + "dependencies": [ + "py-setuptools", + "python3", + { + "name": "vcpkg-python-scripts", + "host": true + } + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index e4742f8..57d5e1f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -16,6 +16,10 @@ "baseline": "2024-02-02", "port-version": 0 }, + "py-charset-normalizer": { + "baseline": "3.4.0", + "port-version": 0 + }, "py-contourpy": { "baseline": "1.3.0", "port-version": 0 @@ -56,6 +60,10 @@ "baseline": "1.25.0", "port-version": 0 }, + "py-idna": { + "baseline": "3.10", + "port-version": 0 + }, "py-installer": { "baseline": "0.7.0", "port-version": 1 @@ -70,7 +78,7 @@ }, "py-matplotlib": { "baseline": "3.9.2", - "port-version": 0 + "port-version": 1 }, "py-meson": { "baseline": "0.15.0", @@ -140,6 +148,10 @@ "baseline": "2.14.1", "port-version": 2 }, + "py-requests": { + "baseline": "2.32.3", + "port-version": 0 + }, "py-semantic-version": { "baseline": "2.10.0", "port-version": 0 @@ -180,6 +192,10 @@ "baseline": "0.43.0", "port-version": 0 }, + "pybind11": { + "baseline": "2.11.1", + "port-version": 0 + }, "python3": { "baseline": "3.11.10", "port-version": 0 diff --git a/versions/p-/py-charset-normalizer.json b/versions/p-/py-charset-normalizer.json new file mode 100644 index 0000000..072f3bc --- /dev/null +++ b/versions/p-/py-charset-normalizer.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e01ac0dd36f0d344a6c7ae761336aad75196aff0", + "version": "3.4.0", + "port-version": 0 + } + ] +} diff --git a/versions/p-/py-idna.json b/versions/p-/py-idna.json new file mode 100644 index 0000000..c9158d3 --- /dev/null +++ b/versions/p-/py-idna.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "85d7271b6cabc6337cefe0e1564c47e747b6a577", + "version": "3.10", + "port-version": 0 + } + ] +} diff --git a/versions/p-/py-matplotlib.json b/versions/p-/py-matplotlib.json index b992832..a24a61d 100644 --- a/versions/p-/py-matplotlib.json +++ b/versions/p-/py-matplotlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "68ebff1cccff9cea5155674352969b92bf0e7098", + "version": "3.9.2", + "port-version": 1 + }, { "git-tree": "f3192febdadd86034af1079e4d8bdbbe64c1d9cd", "version": "3.9.2", diff --git a/versions/p-/py-requests.json b/versions/p-/py-requests.json new file mode 100644 index 0000000..ea79c04 --- /dev/null +++ b/versions/p-/py-requests.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "a36593ab715b6938b59297caece63b83e9787446", + "version": "2.32.3", + "port-version": 0 + } + ] +} diff --git a/versions/p-/pybind11.json b/versions/p-/pybind11.json new file mode 100644 index 0000000..fae0db4 --- /dev/null +++ b/versions/p-/pybind11.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "1769f6654a2deb82dd7dfe3a3ae67e31100e7515", + "version": "2.11.1", + "port-version": 0 + } + ] +}