Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit462f16d

Browse files
committed
Use non sudo update_libchdb.sh
1 parentdbda562 commit462f16d

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"scripts": {
1111
"install":"npm run libchdb && npm run build",
1212
"test":"mocha --timeout 15000",
13-
"libchdb":"curl -sL https://lib.chdb.io |bash&& cp -a /usr/local/lib/libchdb.so ./ && cp -a /usr/local/include/chdb.h ./",
14-
"fixloaderpath":"./fix_loader_path.sh",
13+
"libchdb":"bash./update_libchdb.sh",
14+
"fixloaderpath":"bash./fix_loader_path.sh",
1515
"build":"node-gyp configure build --verbose && npm run fixloaderpath"
1616
},
1717
"author": {

‎update_libchdb.sh‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# This script will download the latest libchdb release from GitHub and extract
4+
# the libchdb.so file to the current directory. This script is intended to be
5+
# used by the build process to ensure that the latest version of libchdb is
6+
# used.
7+
8+
# Change directory to the script's directory
9+
cd"$(dirname"$0")"
10+
11+
# Get the newest release version
12+
LATEST_RELEASE=$(curl --silent"https://api.github.com/repos/chdb-io/chdb/releases/latest"| grep'"tag_name":'| sed -E's/.*"([^"]+)".*/\1/')
13+
# LATEST_RELEASE=v2.0.0b0
14+
15+
# Download the correct version based on the platform
16+
case"$(uname -s)"in
17+
Linux)
18+
if [[$(uname -m)=="aarch64" ]];then
19+
PLATFORM="linux-aarch64-libchdb.tar.gz"
20+
else
21+
PLATFORM="linux-x86_64-libchdb.tar.gz"
22+
fi
23+
;;
24+
Darwin)
25+
if [[$(uname -m)=="arm64" ]];then
26+
PLATFORM="macos-arm64-libchdb.tar.gz"
27+
else
28+
PLATFORM="macos-x86_64-libchdb.tar.gz"
29+
fi
30+
;;
31+
*)
32+
echo"Unsupported platform"
33+
exit 1
34+
;;
35+
esac
36+
37+
DOWNLOAD_URL="https://github.com/chdb-io/chdb/releases/download/$LATEST_RELEASE/$PLATFORM"
38+
39+
echo"Downloading$PLATFORM from$DOWNLOAD_URL"
40+
41+
# Download the file
42+
curl -L -o libchdb.tar.gz$DOWNLOAD_URL
43+
44+
# Untar the file
45+
tar -xzf libchdb.tar.gz
46+
47+
# Set execute permission for libchdb.so
48+
chmod +x libchdb.so
49+
50+
# Clean up
51+
rm -f libchdb.tar.gz

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp