diff --git a/ports/onnx/fix-cmake-protobuf.patch b/ports/onnx/fix-cmake-protobuf.patch new file mode 100644 index 00000000..e60d4f74 --- /dev/null +++ b/ports/onnx/fix-cmake-protobuf.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a815ac1..bdc787f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -151,10 +151,10 @@ else() + # to resolve PREFIX. + if(Protobuf_PROTOC_EXECUTABLE) + set(ONNX_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE}) +- get_filename_component(_PROTOBUF_INSTALL_PREFIX +- ${Protobuf_PROTOC_EXECUTABLE} DIRECTORY) +- get_filename_component(_PROTOBUF_INSTALL_PREFIX +- ${_PROTOBUF_INSTALL_PREFIX}/.. REALPATH) ++ if(NOT DEFINED _PROTOBUF_INSTALL_PREFIX) ++ get_filename_component(_PROTOBUF_INSTALL_PREFIX ${Protobuf_PROTOC_EXECUTABLE} DIRECTORY) ++ get_filename_component(_PROTOBUF_INSTALL_PREFIX ${_PROTOBUF_INSTALL_PREFIX}/.. REALPATH) ++ endif() + find_library(Protobuf_PROTOC_LIBRARY + NAMES protoc + PATHS ${_PROTOBUF_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} +@@ -173,12 +173,12 @@ else() + find_path(Protobuf_INCLUDE_DIR google/protobuf/service.h + PATHS ${_PROTOBUF_INSTALL_PREFIX}/include + NO_DEFAULT_PATH) +- find_package(Protobuf) ++ find_package(Protobuf REQUIRED) + if (Protobuf_FOUND) + set(PROTOBUF_DIR "${_PROTOBUF_INSTALL_PREFIX}") + set(PROTOBUF_INCLUDE_DIR "${_PROTOBUF_INSTALL_PREFIX}/include") + set(Build_Protobuf OFF) +- if ("${Protobuf_VERSION}" VERSION_GREATER_EQUAL "4.22.0") ++ if (FALSE) + # There are extra dependencies for protobuf. + find_package(absl REQUIRED) + find_package(utf8_range REQUIRED) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index f96b5116..e21200a1 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( SHA512 7a9a8493b9c007429629484156487395044506f34e72253640e626351cb623b390750b36af78a290786131e3dcac35f4eb269e8693b594b7ce7cb105bcf9318d PATCHES fix-cmake.patch + fix-cmake-protobuf.patch support-test.patch ) @@ -43,9 +44,10 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} - -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON3} - -DProtobuf_PROTOC_EXECUTABLE=${PROTOC} - -DONNX_CUSTOM_PROTOC_EXECUTABLE=${PROTOC} + "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON3}" + "-D_PROTOBUF_INSTALL_PREFIX=${CURRENT_INSTALLED_DIR}" + "-DProtobuf_PROTOC_EXECUTABLE:FILEPATH=${PROTOC}" + "-DONNX_CUSTOM_PROTOC_EXECUTABLE=${PROTOC}" -DONNX_VERIFY_PROTO3=ON # --protoc_path for gen_proto.py -DONNX_ML=ON -DONNX_GEN_PB_TYPE_STUBS=ON @@ -54,6 +56,7 @@ vcpkg_cmake_configure( MAYBE_UNUSED_VARIABLES ONNX_USE_MSVC_STATIC_RUNTIME ONNX_CUSTOM_PROTOC_EXECUTABLE + PROTOBUF_SEARCH_DIRS ) vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX PACKAGE_NAME ONNX) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index d7ab9bf4..8027f75d 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -1,6 +1,7 @@ { "name": "onnx", "version-semver": "1.16.2", + "port-version": 1, "description": "Open standard for machine learning interoperability", "homepage": "https://onnx.ai", "license": "Apache-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index b089fa0a..1e53ca56 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -134,7 +134,7 @@ }, "onnx": { "baseline": "1.16.2", - "port-version": 0 + "port-version": 1 }, "onnxruntime": { "baseline": "1.18.1", diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 8d607592..47cd05d1 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "801e9d2fecd40f26b85b845c940a342510b83713", + "version-semver": "1.16.2", + "port-version": 1 + }, { "git-tree": "39cd4efb2f7e3c014a8a8657aa266bf9d10f7a89", "version-semver": "1.16.2",