Skip to content

Commit

Permalink
Merge pull request #1 from adamcin/adamcin/mac-arm64-prebuild
Browse files Browse the repository at this point in the history
changes to get macos prebuild to pass on arm64 local machine
  • Loading branch information
jamesbvaughan authored Feb 28, 2024
2 parents 0988555 + d857c7a commit 8244ab6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
npm install nan
. prebuild/macOS/preinstall.sh
cp prebuild/macOS/binding.gyp binding.gyp
node-gyp rebuild -j 2 --arch=${{ runner.arch }}
node-gyp rebuild -j 2 --arch=${{ matrix.os.arch }}
. prebuild/macOS/bundle.sh
- name: Test binary
Expand Down
14 changes: 10 additions & 4 deletions prebuild/macOS/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
'defines': [
'HAVE_GIF',
'HAVE_JPEG',
'HAVE_RSVG'
'HAVE_RSVG',
'NAPI_DISABLE_CPP_EXCEPTIONS',
'NODE_ADDON_API_ENABLE_MAYBE'
],
'libraries': [
'<!@(pkg-config pixman-1 --libs)',
Expand All @@ -32,18 +34,22 @@
'<!@(pkg-config pangocairo --libs)',
'<!@(pkg-config freetype2 --libs)',
'<!@(pkg-config librsvg-2.0 --libs)',
'-ljpeg',
'<!@(pkg-config libjpeg --libs)',
'-L/opt/homebrew/lib',
'-lgif'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")',
'<!(node -p "require(\'node-addon-api\').include_dir")',
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
'<!@(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': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
}
}
Expand Down
2 changes: 1 addition & 1 deletion prebuild/macOS/preinstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
brew update
brew install pkg-config cairo pango librsvg python3 giflib # python3 is for macpack
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman python3 # python3 is for macpack
brew upgrade python # activates python 3
pip3 install --break-system-packages --user macpack

0 comments on commit 8244ab6

Please sign in to comment.