Skip to content

Commit b9ee5e1

Browse files
authored
Merge pull request #66 from duckdb/jray/mac-x64
support mac x64
2 parents df797f6 + 8188d8c commit b9ee5e1

File tree

10 files changed

+104
-2
lines changed

10 files changed

+104
-2
lines changed

.github/workflows/DuckDBNodeBindingsAndAPI.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ on:
5353
# type: boolean
5454
# required: true
5555
# default: false
56+
macos_x64:
57+
description: 'Run on Mac OS X x64'
58+
type: boolean
59+
required: true
60+
default: false
5661
windows_x64:
5762
description: 'Run on Windows x64'
5863
type: boolean
@@ -202,6 +207,47 @@ jobs:
202207
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
203208
env:
204209
NPM_AUTH_TOKEN: ${{ secrets.DUCKDB_NPM_TOKEN }}
210+
211+
macos_x64:
212+
name: Mac OS X x64
213+
runs-on: macos-13
214+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos_x64 }}
215+
steps:
216+
- uses: actions/checkout@v4
217+
218+
- uses: pnpm/action-setup@v3
219+
with:
220+
version: 9
221+
222+
- name: Workspace - Install
223+
run: pnpm install --ignore-scripts
224+
225+
- name: Bindings - Build
226+
working-directory: bindings
227+
run: pnpm run build
228+
229+
- name: Bindings - Test
230+
working-directory: bindings
231+
run: pnpm test
232+
233+
- name: API - Build
234+
working-directory: api
235+
run: pnpm run build
236+
237+
- name: API - Test
238+
working-directory: api
239+
run: pnpm test
240+
241+
- name: Git Status
242+
if: ${{ inputs.publish }}
243+
run: git status
244+
245+
- name: Publish - Bindings - Darwin x64
246+
if: ${{ inputs.publish }}
247+
working-directory: bindings/pkgs/@duckdb/node-bindings-darwin-x64
248+
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
249+
env:
250+
NPM_AUTH_TOKEN: ${{ secrets.DUCKDB_NPM_TOKEN }}
205251

206252
windows_x64:
207253
name: Windows x64

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Change version in:
4848
- `api/pkgs/@duckdb/node-api/package.json`
4949
- `bindings/pkgs/@duckdb/node-bindings/package.json`
5050
- `bindings/pkgs/@duckdb/node-bindings-darwin-arm64/package.json`
51+
- `bindings/pkgs/@duckdb/node-bindings-darwin-x64/package.json`
5152
- `bindings/pkgs/@duckdb/node-bindings-linux-arm64/package.json`
5253
- `bindings/pkgs/@duckdb/node-bindings-linux-x64/package.json`
5354
- `bindings/pkgs/@duckdb/node-bindings-win32-x64/package.json`

api/pkgs/@duckdb/node-api/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Some features are not yet complete:
3030
- Linux arm64 (experimental)
3131
- Linux x64
3232
- Mac OS X (Darwin) arm64 (Apple Silicon)
33+
- Mac OS X (Darwin) x64 (Intel)
3334
- Windows (Win32) x64
3435

3536
## Examples

bindings/binding.gyp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
],
7676
}],
77-
['OS=="mac"', {
77+
['OS=="mac" and target_arch=="arm64"', {
7878
'cflags+': ['-fvisibility=hidden'],
7979
'xcode_settings': {
8080
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
@@ -93,6 +93,25 @@
9393
},
9494
],
9595
}],
96+
['OS=="mac" and target_arch=="x64"', {
97+
'cflags+': ['-fvisibility=hidden'],
98+
'xcode_settings': {
99+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
100+
},
101+
'link_settings': {
102+
'libraries': [
103+
'-lduckdb',
104+
'-L<(module_root_dir)/libduckdb',
105+
'-Wl,-rpath,@loader_path',
106+
],
107+
},
108+
'copies': [
109+
{
110+
'files': ['<(module_root_dir)/libduckdb/libduckdb.dylib'],
111+
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-x64',
112+
},
113+
],
114+
}],
96115
['OS=="win" and target_arch=="x64"', {
97116
'link_settings': {
98117
'libraries': [
@@ -129,14 +148,22 @@
129148
},
130149
],
131150
}],
132-
['OS=="mac"', {
151+
['OS=="mac" and target_arch=="arm64"', {
133152
'copies': [
134153
{
135154
'files': ['<(module_root_dir)/build/Release/duckdb.node'],
136155
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-arm64',
137156
},
138157
],
139158
}],
159+
['OS=="mac" and target_arch=="x64"', {
160+
'copies': [
161+
{
162+
'files': ['<(module_root_dir)/build/Release/duckdb.node'],
163+
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-x64',
164+
},
165+
],
166+
}],
140167
['OS=="win" and target_arch=="x64"', {
141168
'copies': [
142169
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DuckDB Node Bindings: Darwin x64
2+
3+
Binaries supporting [Node](https://nodejs.org/) bindings to the [DuckDB C API](https://duckdb.org/docs/api/c/overview) for Mac OS X (Darwin) x64.
4+
5+
See [@duckdb/node-bindings](https://www.npmjs.com/package/@duckdb/node-bindings) for a low-level API that uses these binaries, or [@duckdb/node-api](https://www.npmjs.com/package/@duckdb/node-api) for a high-level API built on those bindings.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@duckdb/node-bindings-darwin-x64",
3+
"version": "1.1.3-alpha.6",
4+
"os": [
5+
"darwin"
6+
],
7+
"cpu": [
8+
"x64"
9+
],
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/duckdb/duckdb-node-neo.git"
13+
}
14+
}

bindings/pkgs/@duckdb/node-bindings/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ See [@duckdb/node-api](https://www.npmjs.com/package/@duckdb/node-api) for a hig
99
- Linux arm64 (experimental)
1010
- Linux x64
1111
- Mac OS X (Darwin) arm64 (Apple Silicon)
12+
- Mac OS X (Darwin) x64 (Intel)
1213
- Windows (Win32) x64

bindings/pkgs/@duckdb/node-bindings/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"types": "./duckdb.d.ts",
66
"optionalDependencies": {
77
"@duckdb/node-bindings-darwin-arm64": "workspace:*",
8+
"@duckdb/node-bindings-darwin-x64": "workspace:*",
89
"@duckdb/node-bindings-linux-arm64": "workspace:*",
910
"@duckdb/node-bindings-linux-x64": "workspace:*",
1011
"@duckdb/node-bindings-win32-x64": "workspace:*"

pnpm-lock.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)