diff --git a/.github/workflows/Release-all.yml b/.github/workflows/Release-all.yml index 19b1bf94..0b45f548 100644 --- a/.github/workflows/Release-all.yml +++ b/.github/workflows/Release-all.yml @@ -39,11 +39,11 @@ jobs: libogg \ libvorbis \ libzim \ + icu4c \ lzip \ ninja \ opencc \ - xapian - brew install icu4c --force + xapian - name: Install eb run: | git clone https://github.com/xiaoyifang/eb.git diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index ee81572e..40aaa66f 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -79,15 +79,13 @@ endif () if (WITH_ZIM) if (APPLE) - # 执行 brew list 命令并捕获输出 - execute_process( - COMMAND brew --prefix libzim - OUTPUT_VARIABLE LIBZIM_PATH - - ) - message(STATUS "zim path:${LIBZIM_PATH}") - # ICU from homebrew is "key-only", we need to manually prioritize it -> see `brew info icu4c` - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBZIM_PATH}/lib/pkgconfig") + if (EXISTS /opt/homebrew) + set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") + endif() + + if (EXISTS /usr/local) + set(ENV{PKG_CONFIG_PATH} "/usr/local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") + endif() endif () pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim) target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)