Skip to content

Commit

Permalink
Run prebuilds on Apple Silicon Macs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jamesbvaughan authored and chearon committed Dec 7, 2024
1 parent acf33d0 commit b0c9060
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ jobs:
matrix:
node: [21]
canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS
runs-on: macos-12 # macos-14+ is M1
os:
- runner: macos-12
arch: x64
- runner: macos-14
arch: arm64
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS ${{ matrix.os.arch }}
runs-on: ${{ matrix.os.runner }}
env:
CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
steps:
Expand Down Expand Up @@ -177,6 +182,11 @@ jobs:
brew uninstall --force --ignore-dependencies cairo pango librsvg giflib harfbuzz
npm test
- name: Sign the executable
uses: indygreg/apple-code-sign-action@v1
with:
input_path: build/Release/canvas.node

- name: Make bundle
id: make_bundle
run: . prebuild/tarball.sh
Expand Down
4 changes: 3 additions & 1 deletion prebuild/macOS/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'<!@(pkg-config pangocairo --libs)',
'<!@(pkg-config freetype2 --libs)',
'<!@(pkg-config librsvg-2.0 --libs)',
'-L/opt/homebrew/lib',
'-ljpeg',
'-lgif'
],
Expand All @@ -43,7 +44,8 @@
'<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)',
'/opt/homebrew/include'
],
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
Expand Down

0 comments on commit b0c9060

Please sign in to comment.