Skip to content

Commit 5aeb949

Browse files
committed
Bundle in libicu on macOS
Closes #1710 Also reported in #1640
1 parent 867e52b commit 5aeb949

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

ci/build/build-static-release.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ main() {
2020
if [[ $OS == "linux" ]]; then
2121
bundle_dynamic_lib libstdc++
2222
bundle_dynamic_lib libgcc_s
23+
elif [[ $OS == "macos" ]]; then
24+
bundle_dynamic_lib libicui18n
25+
bundle_dynamic_lib libicuuc
26+
bundle_dynamic_lib libicudata
2327
fi
2428

2529
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
@@ -31,9 +35,14 @@ main() {
3135

3236
bundle_dynamic_lib() {
3337
lib_name="$1"
34-
lib_path="$(ldd "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $3 }')"
3538

36-
cp "$lib_path" "$RELEASE_PATH/lib/"
39+
if [[ $OS == "linux" ]]; then
40+
lib_path="$(ldd "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $3 }')"
41+
elif [[ $OS == "macos" ]]; then
42+
lib_path="$(otool -L "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $1 }')"
43+
fi
44+
45+
cp "$lib_path" "$RELEASE_PATH/lib"
3746
}
3847

3948
main "$@"

ci/build/code-server.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env sh
1+
#!/bin/sh
22

33
# This script is intended to be bundled into the static releases.
44
# Runs code-server with the bundled Node binary.
@@ -17,5 +17,9 @@ bin_dir() {
1717
}
1818

1919
BIN_DIR=$(bin_dir)
20-
export LD_LIBRARY_PATH="$BIN_DIR/../lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
20+
if [ "$(uname)" = "Linux"]; then
21+
export LD_LIBRARY_PATH="$BIN_DIR/../lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
22+
else
23+
export DYLD_LIBRARY_PATH="$BIN_DIR/../lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
24+
fi
2125
exec "$BIN_DIR/../lib/node" "$BIN_DIR/.." "$@"

0 commit comments

Comments
 (0)