mirror of https://git.tuxpa.in/a/code-server.git
Properly bundle in libstdc++
This commit is contained in:
parent
f117475970
commit
ac9b57c07e
|
@ -16,8 +16,11 @@ main() {
|
||||||
|
|
||||||
mkdir -p "$RELEASE_PATH/bin"
|
mkdir -p "$RELEASE_PATH/bin"
|
||||||
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
||||||
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
||||||
g++ -Wl,--allow-multiple-definition "$node_path" -static-libstdc++ -static-libgcc -o "$RELEASE_PATH/lib/node"
|
if [[ $OS == "linux" ]]; then
|
||||||
|
bundle_dynamic_lib libstdc++
|
||||||
|
bundle_dynamic_lib libgcc_s
|
||||||
|
fi
|
||||||
|
|
||||||
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
||||||
ln -s "./lib/node" "$RELEASE_PATH/node"
|
ln -s "./lib/node" "$RELEASE_PATH/node"
|
||||||
|
@ -26,4 +29,11 @@ main() {
|
||||||
yarn --production --frozen-lockfile
|
yarn --production --frozen-lockfile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bundle_dynamic_lib() {
|
||||||
|
lib_name="$1"
|
||||||
|
lib_path="$(ldd "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $3 }')"
|
||||||
|
|
||||||
|
cp "$lib_path" "$RELEASE_PATH/lib/"
|
||||||
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
@ -17,4 +17,5 @@ bin_dir() {
|
||||||
}
|
}
|
||||||
|
|
||||||
BIN_DIR=$(bin_dir)
|
BIN_DIR=$(bin_dir)
|
||||||
|
export LD_LIBRARY_PATH="$BIN_DIR/../lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
|
||||||
exec "$BIN_DIR/../lib/node" "$BIN_DIR/.." "$@"
|
exec "$BIN_DIR/../lib/node" "$BIN_DIR/.." "$@"
|
||||||
|
|
Loading…
Reference in New Issue