Skip to content

Commit 644b227

Browse files
committed
[ fix ] Use @rpath for icu4c on Mac
1 parent 6b855b2 commit 644b227

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.github/workflows/test-mac.yaml

+25-2
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,34 @@ jobs:
6969
7070
# artifacts:
7171

72-
- name: 📦 Install & Gather executables
73-
id: exes
72+
- name: 📦 Install the executable
73+
id: install
7474
run: |
7575
stack install
7676
cp ~/.local/bin/als .
77+
78+
- name: 📦 Some linker shit
79+
id: link
80+
env:
81+
ICU_VER: '69'
82+
ICU_DIR: '/usr/local/opt/icu4c/lib'
83+
run: |
84+
# Change the path to the dynamic library icu4c to the run-time search path:
85+
#
86+
# 1. the same directory of executable, i.e. @executable_path
87+
# 2. @executable_path/../lib
88+
# 3. the default location of system-wide icu4c installed by homebrew, ie. /usr/local/opt/icu4c/lib
89+
#
90+
mkdir lib
91+
cp ${ICU_DIR}/libicuuc.${ICU_VER}.dylib ${ICU_DIR}/libicui18n.${ICU_VER}.dylib ${ICU_DIR}/libicudata.${ICU_VER}.dylib lib
92+
install_name_tool -change ${ICU_DIR}/libicuuc.${ICU_VER}.dylib @rpath/libicuuc.${ICU_VER}.dylib als
93+
install_name_tool -change ${ICU_DIR}/libicui18n.${ICU_VER}.dylib @rpath/libicui18n.${ICU_VER}.dylib als
94+
install_name_tool -add_rpath @executable_path -add_rpath @executable_path/../lib -add_rpath ${ICU_DIR} als
95+
otool -L als
96+
97+
- name: 📦 Zip the executable
98+
id: zip
99+
run: |
77100
zip -r als als
78101
mv als.zip als-macos.zip
79102

0 commit comments

Comments
 (0)