aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/wasmedge
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/wasmedge')
-rw-r--r--vcpkg/ports/wasmedge/fix-build-error-with-fmt11.patch13
-rw-r--r--vcpkg/ports/wasmedge/fix_find_zstd.patch19
-rw-r--r--vcpkg/ports/wasmedge/portfile.cmake68
-rw-r--r--vcpkg/ports/wasmedge/vcpkg.json53
4 files changed, 153 insertions, 0 deletions
diff --git a/vcpkg/ports/wasmedge/fix-build-error-with-fmt11.patch b/vcpkg/ports/wasmedge/fix-build-error-with-fmt11.patch
new file mode 100644
index 0000000..3c584d1
--- /dev/null
+++ b/vcpkg/ports/wasmedge/fix-build-error-with-fmt11.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/common/errinfo.cpp b/lib/common/errinfo.cpp
+index 69aa666..b7b0857 100644
+--- a/lib/common/errinfo.cpp
++++ b/lib/common/errinfo.cpp
+@@ -5,6 +5,8 @@
+ #include "common/errcode.h"
+ #include "common/hexstr.h"
+
++#include <fmt/ranges.h>
++
+ using namespace std::literals;
+
+ fmt::format_context::iterator
diff --git a/vcpkg/ports/wasmedge/fix_find_zstd.patch b/vcpkg/ports/wasmedge/fix_find_zstd.patch
new file mode 100644
index 0000000..f2be2c6
--- /dev/null
+++ b/vcpkg/ports/wasmedge/fix_find_zstd.patch
@@ -0,0 +1,19 @@
+diff --git a/cmake/Helper.cmake b/cmake/Helper.cmake
+index f9cdcf2..a270b05 100644
+--- a/cmake/Helper.cmake
++++ b/cmake/Helper.cmake
+@@ -221,8 +221,12 @@ if((WASMEDGE_LINK_LLVM_STATIC OR WASMEDGE_BUILD_STATIC_LIB) AND WASMEDGE_BUILD_A
+ endif()
+ if (APPLE AND LLVM_VERSION_MAJOR GREATER_EQUAL 15)
+ # For LLVM 15 or greater on MacOS
+- find_package(zstd REQUIRED)
+- get_filename_component(ZSTD_PATH "${zstd_LIBRARY}" DIRECTORY)
++ find_package(zstd CONFIG REQUIRED)
++ if(CMAKE_BUILD_TYPE STREQUAL Debug)
++ set(ZSTD_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib")
++ else()
++ set(ZSTD_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
++ endif()
+ list(APPEND WASMEDGE_LLVM_LINK_STATIC_COMPONENTS
+ ${ZSTD_PATH}/libzstd.a
+ )
diff --git a/vcpkg/ports/wasmedge/portfile.cmake b/vcpkg/ports/wasmedge/portfile.cmake
new file mode 100644
index 0000000..fec240c
--- /dev/null
+++ b/vcpkg/ports/wasmedge/portfile.cmake
@@ -0,0 +1,68 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO WasmEdge/WasmEdge
+ REF "${VERSION}"
+ SHA512 fcd6b804876a5899ec8c21aa349b7ec3e8e0b87537e93d237cb14da2ecb162410ae9ad39212c5ab01e4408191768b806d84e55934616de094a696bf6f02fe1de
+ HEAD_REF master
+ PATCHES fix-build-error-with-fmt11.patch
+)
+
+set(WASMEDGE_CMAKE_OPTIONS "")
+
+list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_AOT_RUNTIME=OFF")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_STATIC_LIB=OFF")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_SHARED_LIB=ON")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_LINK_LLVM_STATIC=OFF")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_LINK_TOOLS_STATIC=OFF")
+else()
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_STATIC_LIB=ON")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_SHARED_LIB=OFF")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_LINK_LLVM_STATIC=ON")
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_LINK_TOOLS_STATIC=ON")
+endif()
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools WASMEDGE_BUILD_TOOLS
+ aot WASMEDGE_BUILD_AOT_RUNTIME
+ plugins WASMEDGE_BUILD_PLUGINS
+)
+
+# disabled due to build failure
+list(APPEND WASMEDGE_CMAKE_OPTIONS "-DWASMEDGE_BUILD_EXAMPLE=OFF")
+
+set(WASMEDGE_PLUGIN_WASI_NN_BACKEND "")
+
+if("plugin-wasi-nn-backend-openvino" IN_LIST FEATURES)
+ list(APPEND WASMEDGE_PLUGIN_WASI_NN_BACKEND "OpenVINO")
+endif()
+if("plugin-wasi-nn-backend-pytorch" IN_LIST FEATURES)
+ list(APPEND WASMEDGE_PLUGIN_WASI_NN_BACKEND "PyTorch")
+endif()
+if("plugin-wasi-nn-backend-tensorflow-lite" IN_LIST FEATURES)
+ list(APPEND WASMEDGE_PLUGIN_WASI_NN_BACKEND "TensorflowLite")
+endif()
+
+if(NOT WASMEDGE_PLUGIN_WASI_NN_BACKEND STREQUAL "")
+ list(JOIN WASMEDGE_PLUGIN_WASI_NN_BACKEND "," WASMEDGE_PLUGIN_WASI_NN_BACKEND)
+ list(APPEND WASMEDGE_CMAKE_OPTIONS "-WASMEDGE_PLUGIN_WASI_NN_BACKEND=${WASMEDGE_PLUGIN_WASI_NN_BACKEND}")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${WASMEDGE_CMAKE_OPTIONS}
+ ${FEATURE_OPTIONS}
+ OPTIONS_RELEASE
+ -DCMAKE_INSTALL_BINDIR=${CURRENT_PACKAGES_DIR}/tools
+ OPTIONS_DEBUG
+ -DCMAKE_INSTALL_BINDIR=${CURRENT_PACKAGES_DIR}/debug/tools
+)
+
+vcpkg_cmake_install()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
diff --git a/vcpkg/ports/wasmedge/vcpkg.json b/vcpkg/ports/wasmedge/vcpkg.json
new file mode 100644
index 0000000..5bdb72d
--- /dev/null
+++ b/vcpkg/ports/wasmedge/vcpkg.json
@@ -0,0 +1,53 @@
+{
+ "name": "wasmedge",
+ "version": "0.13.5",
+ "port-version": 2,
+ "description": "WasmEdge is a high-performance WebAssembly runtime for edge computing.",
+ "homepage": "https://WasmEdge.org",
+ "license": "Apache-2.0",
+ "supports": "!windows",
+ "dependencies": [
+ "boost-algorithm",
+ "boost-align",
+ "boost-predef",
+ "spdlog",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "tools"
+ ],
+ "features": {
+ "aot": {
+ "description": "Build with the Ahead-of-Time compiler supporting",
+ "dependencies": [
+ "llvm"
+ ]
+ },
+ "plugin-wasi-nn-backend-openvino": {
+ "description": "Build the OpenVINO backend plugin for the WasmEdge WASI-NN extension",
+ "supports": "linux & !static"
+ },
+ "plugin-wasi-nn-backend-pytorch": {
+ "description": "Build the PyTorch backend plugin for the WasmEdge WASI-NN extension",
+ "supports": "linux & !static"
+ },
+ "plugin-wasi-nn-backend-tensorflowlite": {
+ "description": "Build the TensorFlow Lite backend plugin for the WasmEdge WASI-NN extension",
+ "supports": "linux & !static"
+ },
+ "plugins": {
+ "description": "Build plugins",
+ "supports": "!static"
+ },
+ "tools": {
+ "description": "Build tools"
+ }
+ }
+}