From 1b18a8964a15fe42f8c8d1ef7f828cbce2a51573 Mon Sep 17 00:00:00 2001 From: xfangfang <2553041586@qq.com> Date: Wed, 8 Nov 2023 21:12:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DmacOS=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E9=80=9F=E5=BA=A6=E5=A4=AA=E6=85=A2=20(#227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * workflow: Change to macOS 12 * Show webp and boost version * Disable libpsl * Update webp to 1.3.2; boost to 1.83.0 * Add version check when merging dylibs --- .github/workflows/build.yaml | 7 ++++--- cmake/macos.cmake | 2 +- scripts/macos_dylib_downloader.sh | 2 +- scripts/macos_dylib_merge.sh | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5ff8b98..5e47db22 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -295,7 +295,7 @@ jobs: build-macos: needs: [ version ] - runs-on: macos-11 + runs-on: macos-12 strategy: matrix: arch: [ IntelChip, AppleSilicon, Universal ] @@ -311,7 +311,8 @@ jobs: - name: install deps if: matrix.arch != 'Universal' || ( matrix.arch == 'Universal' && github.event.inputs.universal_macos == 'true') run: | - brew install create-dmg dylibbundler webp boost + brew install create-dmg dylibbundler boost + brew list webp boost brew tap xfangfang/wiliwili brew install -v mpv-wiliwili @@ -333,7 +334,7 @@ jobs: if: matrix.arch != 'Universal' || ( matrix.arch == 'Universal' && github.event.inputs.universal_macos == 'true') id: compile run: | - cmake -B build -DPLATFORM_DESKTOP=ON -DCMAKE_BUILD_TYPE=Release -DMAC_${{ matrix.arch }}=ON -DMAC_DOWNLOAD_DYLIB=ON + cmake -B build -DPLATFORM_DESKTOP=ON -DCMAKE_BUILD_TYPE=Release -DMAC_${{ matrix.arch }}=ON -DMAC_DOWNLOAD_DYLIB=ON -DCURL_USE_LIBPSL=OFF make -C build wiliwili.app -j$(sysctl -n hw.ncpu) - name: Name diff --git a/cmake/macos.cmake b/cmake/macos.cmake index 80602024..d09d094e 100644 --- a/cmake/macos.cmake +++ b/cmake/macos.cmake @@ -18,7 +18,7 @@ if (APPLE) if (MAC_DOWNLOAD_DYLIB) set(APP_PLATFORM_LIB ${CMAKE_BINARY_DIR}/deps/${MAC_OS_ARCH}/libmpv.2.dylib - ${CMAKE_BINARY_DIR}/deps/${MAC_OS_ARCH}/libwebp.7.1.7.dylib + ${CMAKE_BINARY_DIR}/deps/${MAC_OS_ARCH}/libwebp.7.1.8.dylib ${CMAKE_BINARY_DIR}/deps/${MAC_OS_ARCH}/libboost_filesystem-mt.dylib) if (NOT USE_SYSTEM_CURL) list(APPEND APP_PLATFORM_LIB diff --git a/scripts/macos_dylib_downloader.sh b/scripts/macos_dylib_downloader.sh index a198319e..1d98cd75 100755 --- a/scripts/macos_dylib_downloader.sh +++ b/scripts/macos_dylib_downloader.sh @@ -6,7 +6,7 @@ set -e mkdir -p deps BASEURL="https://github.com/xfangfang/wiliwili/releases/download/v0.1.0" -PACKAGE="macos_dylib_ffmpeg6_mpv36_$1.tar.gz" +PACKAGE="macos_dylib_ffmpeg6_mpv36_r2_$1.tar.gz" DOWNLOAD_FLAG="${PACKAGE}.done" if [ ! -f "${DOWNLOAD_FLAG}" ];then diff --git a/scripts/macos_dylib_merge.sh b/scripts/macos_dylib_merge.sh index de0bd8d0..98e20c3d 100755 --- a/scripts/macos_dylib_merge.sh +++ b/scripts/macos_dylib_merge.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash set -e files=(libass.9.dylib @@ -33,9 +34,22 @@ files=(libass.9.dylib libtasn1.6.dylib libunibreak.5.dylib libunistring.5.dylib - libwebp.7.1.7.dylib) + libwebp.7.1.8.dylib) +i=1 for file in "${files[@]}"; do - echo "$file" + echo $i "$file" + arm64_ret=$(otool -l ./arm64/"$file" | { grep minos || true;} | { grep 11.0 || true;}) + x86_ret=$(otool -l ./x86_64/"$file" | { grep 10.11 || true;}) + + if [ -z "$arm64_ret" ]; then + echo -e "\t\033[31m arm64 不满足 11.0 \033[0m" + fi + + if [ -z "$x86_ret" ]; then + echo -e "\t\033[31m x86_64 不满足 10.11 \033[0m" + fi + lipo -create -output ./universal/"$file" ./x86_64/"$file" ./arm64/"$file" + ((i++)) done