Skip to content

Commit 536b54d

Browse files
committed
Fix loader_path
1 parent 8be1a7b commit 536b54d

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

Diff for: binding.gyp

+1-16
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,7 @@
1010
"libraries": [ "<(module_root_dir)/libchdb.so" ],
1111
"cflags!": [ "-fno-exceptions" ],
1212
"cflags_cc!": [ "-fno-exceptions" ],
13-
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
14-
"conditions": [
15-
["OS=='mac'", {
16-
"actions": [
17-
{
18-
"action_name": "postbuild",
19-
"inputs": [],
20-
"outputs": ["<(module_root_dir)/build/Release/postbuild_dummy"],
21-
"action": [
22-
"sh", "-c",
23-
"install_name_tool -change libchdb.so @loader_path/../../libchdb.so <(module_root_dir)/build/Release/chdb_node.node"
24-
]
25-
}
26-
]
27-
}]
28-
]
13+
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
2914
}
3015
]
3116
}

Diff for: fix_loader_path.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname "$0")"
4+
5+
if [[ $(uname -s) == "Darwin" ]]; then
6+
install_name_tool -change libchdb.so @loader_path/../../libchdb.so build/Release/chdb_node.node
7+
otool -L build/Release/chdb_node.node
8+
fi

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"install": "npm run libchdb && npm run build",
1212
"test": "node example.js",
1313
"libchdb": "./update_libchdb.sh",
14-
"build": "node-gyp configure build --verbose"
14+
"fixloaderpath": "./fix_loader_path.sh",
15+
"build": "node-gyp configure build --verbose && npm run fixloaderpath"
1516
},
1617
"author": {
1718
"name": "chdb",

0 commit comments

Comments
 (0)