diff options
Diffstat (limited to 'vcpkg/ports/whisper-cpp')
| -rw-r--r-- | vcpkg/ports/whisper-cpp/cmake-config.diff | 36 | ||||
| -rw-r--r-- | vcpkg/ports/whisper-cpp/pkgconfig.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/whisper-cpp/portfile.cmake | 35 | ||||
| -rw-r--r-- | vcpkg/ports/whisper-cpp/vcpkg.json | 57 |
4 files changed, 140 insertions, 0 deletions
diff --git a/vcpkg/ports/whisper-cpp/cmake-config.diff b/vcpkg/ports/whisper-cpp/cmake-config.diff new file mode 100644 index 0000000..4d88e08 --- /dev/null +++ b/vcpkg/ports/whisper-cpp/cmake-config.diff @@ -0,0 +1,36 @@ +diff --git a/cmake/whisper-config.cmake.in b/cmake/whisper-config.cmake.in +index 6a3fa227..f4f4162a 100644 +--- a/cmake/whisper-config.cmake.in ++++ b/cmake/whisper-config.cmake.in +@@ -12,8 +12,9 @@ set(GGML_ACCELERATE @GGML_ACCELERATE@) + @PACKAGE_INIT@ + + set_and_check(WHISPER_INCLUDE_DIR "@PACKAGE_WHISPER_INCLUDE_INSTALL_DIR@") +-set_and_check(WHISPER_LIB_DIR "@PACKAGE_WHISPER_LIB_INSTALL_DIR@") +-set_and_check(WHISPER_BIN_DIR "@PACKAGE_WHISPER_BIN_INSTALL_DIR@") ++# In vcpkg, the following would be subject to vcpkg build type. ++# set_and_check(WHISPER_LIB_DIR "@PACKAGE_WHISPER_LIB_INSTALL_DIR@") ++# set_and_check(WHISPER_BIN_DIR "@PACKAGE_WHISPER_BIN_INSTALL_DIR@") + + # Ensure transient dependencies satisfied + +@@ -50,6 +51,12 @@ find_library(whisper_LIBRARY whisper + set(_whisper_link_deps "Threads::Threads" "@WHISPER_EXTRA_LIBS@") + set(_whisper_transient_defines "@WHISPER_TRANSIENT_DEFINES@") + ++if(NOT TARGET whisper) ++if(NOT "@BUILD_SHARED_LIBS@") ++ include(CMakeFindDependencyMacro) ++ find_dependency(ggml) ++ list(APPEND _whisper_link_deps ggml::ggml) ++endif() + add_library(whisper UNKNOWN IMPORTED) + + set_target_properties(whisper +@@ -61,5 +68,6 @@ set_target_properties(whisper + IMPORTED_LOCATION "${whisper_LIBRARY}" + INTERFACE_COMPILE_FEATURES cxx_std_11 + POSITION_INDEPENDENT_CODE ON ) ++endif() + + check_required_components(whisper) diff --git a/vcpkg/ports/whisper-cpp/pkgconfig.diff b/vcpkg/ports/whisper-cpp/pkgconfig.diff new file mode 100644 index 0000000..2d24ee8 --- /dev/null +++ b/vcpkg/ports/whisper-cpp/pkgconfig.diff @@ -0,0 +1,12 @@ +diff --git a/cmake/whisper.pc.in b/cmake/whisper.pc.in +index 00ec7912..ccc2efbb 100644 +--- a/cmake/whisper.pc.in ++++ b/cmake/whisper.pc.in +@@ -6,5 +6,6 @@ includedir=${prefix}/include + Name: whisper + Description: Port of OpenAI's Whisper model in C/C++ + Version: @PROJECT_VERSION@ +-Libs: -L${libdir} -lggml -lggml-base -lwhisper ++Libs: -L${libdir} -lwhisper ++Requires.private: ggml + Cflags: -I${includedir} diff --git a/vcpkg/ports/whisper-cpp/portfile.cmake b/vcpkg/ports/whisper-cpp/portfile.cmake new file mode 100644 index 0000000..55b29e0 --- /dev/null +++ b/vcpkg/ports/whisper-cpp/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ggml-org/whisper.cpp
+ REF v${VERSION}
+ SHA512 d858509b22183b885735415959fc996f0f5ca315aaf40b8640593c4ce881c88fec3fcd16e9a3adda8d1177feed01947fb4c1beaf32d7e4385c5f35a024329ef5
+ HEAD_REF master
+ PATCHES
+ cmake-config.diff
+ pkgconfig.diff
+)
+file(REMOVE_RECURSE "${SOURCE_PATH}/ggml")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE # updating bindings/javascript/package.json
+ OPTIONS
+ -DWHISPER_ALL_WARNINGS=OFF
+ -DWHISPER_BUILD_EXAMPLES=OFF
+ -DWHISPER_BUILD_SERVER=OFF
+ -DWHISPER_BUILD_TESTS=OFF
+ -DWHISPER_CCACHE=OFF
+ -DWHISPER_USE_SYSTEM_GGML=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/whisper")
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${SOURCE_PATH}/models/convert-pt-to-ggml.py" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/whisper-cpp/vcpkg.json b/vcpkg/ports/whisper-cpp/vcpkg.json new file mode 100644 index 0000000..36b9837 --- /dev/null +++ b/vcpkg/ports/whisper-cpp/vcpkg.json @@ -0,0 +1,57 @@ +{ + "name": "whisper-cpp", + "version": "1.8.2", + "description": "Port of OpenAI's Whisper model in C/C++", + "homepage": "https://github.com/ggml-org/whisper.cpp", + "license": "MIT", + "dependencies": [ + "ggml", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "cuda": { + "description": "Enable CUDA support for GPU acceleration", + "dependencies": [ + "cuda", + { + "name": "ggml", + "features": [ + "cuda" + ] + } + ] + }, + "metal": { + "description": "Enable Metal support for GPU acceleration on macOS", + "supports": "osx", + "dependencies": [ + { + "name": "ggml", + "features": [ + "metal" + ] + } + ] + }, + "vulkan": { + "description": "Enable Vulkan support for GPU acceleration", + "dependencies": [ + { + "name": "ggml", + "features": [ + "vulkan" + ] + }, + "vulkan", + "vulkan-headers" + ] + } + } +} |