From 30b3472460a4e8b09409ce0f4da27a67cd9ad315 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 15 Apr 2023 11:58:49 +0100 Subject: [PATCH] [build] Fix macOS CI, use pre-installed OpenSSL --- .github/workflows/build.yml | 12 ------------ mirai-core/src/nativeMain/cinterop/OpenSSL.def | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a44c91b4c..869f122db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,18 +196,6 @@ jobs: - if: ${{ env.isUnix == 'true' }} run: chmod -R 777 * - # Prepare environment for linking for macOS - - - if: ${{ env.isMac == 'true' }} - name: Install OpenSSL - run: > - git clone https://github.com/openssl/openssl.git --recursive && - cd openssl && - git checkout tags/openssl-3.0.3 && - ./Configure --prefix=/opt/openssl --openssldir=/usr/local/ssl && - make && - sudo make install - - name: Clean and download dependencies run: ./gradlew clean ${{ env.gradleArgs }} diff --git a/mirai-core/src/nativeMain/cinterop/OpenSSL.def b/mirai-core/src/nativeMain/cinterop/OpenSSL.def index 18152f81e..1294c1b8e 100644 --- a/mirai-core/src/nativeMain/cinterop/OpenSSL.def +++ b/mirai-core/src/nativeMain/cinterop/OpenSSL.def @@ -2,15 +2,26 @@ headers = openssl/ec.h openssl/ecdh.h openssl/evp.h # -L/usr/local/opt/openssl@1.1/1.1.1o/lib is for GitHub actions. See https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md +# For GitHub Actions macos-12 20223-4-15: +#find: /Library/Application Support/Apple/ParentalControls/Users: Permission denied +#/usr/local/Cellar/openssl@3/3.1.0/include/openssl/ecdh.h +#find: /Library/Application Support/Apple/AssetCache/Data: Permission denied +#/usr/local/Cellar/openssl@1.1/1.1.1t/include/openssl/ecdh.h +##find: /Library/Application Support/Apple/Remote Desktop/Task Server: Permission denied +#/usr/local/miniconda/include/openssl/ecdh.h +#/usr/local/miniconda/pkgs/openssl-1.1.1s-hca72f7f_0/include/openssl/ecdh.h + linkerOpts = -lcrypto \ -lssl \ -L/opt/openssl/lib64 \ -L/opt/openssl/lib \ -L/usr/local/opt/openssl@1.1/1.1.1o/lib \ + -L/usr/local/Cellar/openssl@3/3.1.0/lib \ -L/usr/lib/openssl@1.1/1.1.1o/lib \ -L/opt/homebrew/Cellar/openssl@1.1/1.1.1o/lib \ -L/opt/homebrew/Cellar/openssl@3/3.0.3/lib \ -L/opt/homebrew/opt/openssl@3/lib \ + -L/usr/local/miniconda/lib \ -L/usr/lib/ \ -LC:/openssl/lib \ -LC:/vcpkg/installed/x64-windows/lib \ @@ -24,10 +35,12 @@ linkerOpts = -lcrypto \ compilerOpts = -I/opt/openssl/include \ -I/usr/local/include/openssl@3 \ -I/usr/local/opt/openssl@1.1/1.1.1o/include \ + -I/usr/local/Cellar/openssl@3/3.1.0/include \ -I/opt/homebrew/Cellar/openssl@1.1/1.1.1o/include \ -I/opt/homebrew/Cellar/openssl@3/3.0.3/include \ -I/usr/include/openssl@3 \ -I/opt/homebrew/opt/openssl@3/include \ + -I/usr/local/miniconda/include \ -I/usr/include/ \ -I/usr/include/x86_64-linux-gnu/ \ -I/usr/local/include/ \