Skip to content

Commit b0c9060

Browse files
jamesbvaughanchearon
authored andcommitted
Run prebuilds on Apple Silicon Macs
changes to get macos prebuild to pass on arm64 local machine Add packages to the uninstall list Restore changes in prebuild.yaml Restore changes to tarball.sh Set a temporary canvas_tag Revert temporary canvas tag Update runners Remove unnecessary changes Add a code signing step Remove explicit `--arch` argument
1 parent acf33d0 commit b0c9060

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/prebuild.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,13 @@ jobs:
144144
matrix:
145145
node: [21]
146146
canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
147-
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS
148-
runs-on: macos-12 # macos-14+ is M1
147+
os:
148+
- runner: macos-12
149+
arch: x64
150+
- runner: macos-14
151+
arch: arm64
152+
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS ${{ matrix.os.arch }}
153+
runs-on: ${{ matrix.os.runner }}
149154
env:
150155
CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
151156
steps:
@@ -177,6 +182,11 @@ jobs:
177182
brew uninstall --force --ignore-dependencies cairo pango librsvg giflib harfbuzz
178183
npm test
179184
185+
- name: Sign the executable
186+
uses: indygreg/apple-code-sign-action@v1
187+
with:
188+
input_path: build/Release/canvas.node
189+
180190
- name: Make bundle
181191
id: make_bundle
182192
run: . prebuild/tarball.sh

prebuild/macOS/binding.gyp

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'<!@(pkg-config pangocairo --libs)',
3535
'<!@(pkg-config freetype2 --libs)',
3636
'<!@(pkg-config librsvg-2.0 --libs)',
37+
'-L/opt/homebrew/lib',
3738
'-ljpeg',
3839
'-lgif'
3940
],
@@ -43,7 +44,8 @@
4344
'<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
4445
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',
4546
'<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)',
46-
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'
47+
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)',
48+
'/opt/homebrew/include'
4749
],
4850
'cflags+': ['-fvisibility=hidden'],
4951
'xcode_settings': {

0 commit comments

Comments
 (0)