Browse Source

Add macOS ARM64 CI and fix FFMpeg package for macOS ARM64 (#3052)

Jérôme Leclercq 1 year ago
parent
commit
5e77d9a3ff
2 changed files with 7 additions and 1 deletions
  1. 2 1
      .github/workflows/macos.yml
  2. 5 0
      packages/f/ffmpeg/xmake.lua

+ 2 - 1
.github/workflows/macos.yml

@@ -10,6 +10,7 @@ jobs:
     strategy:
       matrix:
         os: [macOS-latest]
+        arch: [x86_64, arm64]
         kind: [static, shared]
 
     runs-on: ${{ matrix.os }}
@@ -28,5 +29,5 @@ jobs:
         run: |
           wget https://curl.haxx.se/ca/cacert.pem -O /tmp/cacert.pem
           export CURL_CA_BUNDLE=/tmp/cacert.pem
-          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
+          xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }}
 

+ 5 - 0
packages/f/ffmpeg/xmake.lua

@@ -219,6 +219,11 @@ package("ffmpeg")
             os.vrunv("make", argv)
             os.vrun("make install")
         else
+            if package:is_cross() then
+                table.insert(configs, "--enable-cross-compile")
+                table.insert(configs, "--arch=" .. package:targetarch())
+                configs.host = "" -- prevents xmake to add a --host=xx parameter
+            end
             import("package.tools.autoconf").install(package, configs)
         end
         package:addenv("PATH", "bin")