Browse Source

[build] Fix macOS CI, use pre-installed OpenSSL

Him188 2 năm trước cách đây
mục cha
commit
30b3472460
2 tập tin đã thay đổi với 13 bổ sung12 xóa
  1. 0 12
      .github/workflows/build.yml
  2. 13 0
      mirai-core/src/nativeMain/cinterop/OpenSSL.def

+ 0 - 12
.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 }}
 

+ 13 - 0
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/[email protected]/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/[email protected]/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/[email protected]/1.1.1o/lib \
+                             -L/usr/local/Cellar/openssl@3/3.1.0/lib \
                              -L/usr/lib/[email protected]/1.1.1o/lib \
                              -L/opt/homebrew/Cellar/[email protected]/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/[email protected]/1.1.1o/include \
+                             -I/usr/local/Cellar/openssl@3/3.1.0/include \
                              -I/opt/homebrew/Cellar/[email protected]/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/ \