Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to get macos prebuild to pass on arm64 local machine #1

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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