Skip to content

Commit

Permalink
[ fix ] Use @rpath for icu4c on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Aug 18, 2021
1 parent 6b855b2 commit 644b227
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/test-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,34 @@ jobs:
# artifacts:

- name: 📦 Install & Gather executables
id: exes
- name: 📦 Install the executable
id: install
run: |
stack install
cp ~/.local/bin/als .
- name: 📦 Some linker shit
id: link
env:
ICU_VER: '69'
ICU_DIR: '/usr/local/opt/icu4c/lib'
run: |
# Change the path to the dynamic library icu4c to the run-time search path:
#
# 1. the same directory of executable, i.e. @executable_path
# 2. @executable_path/../lib
# 3. the default location of system-wide icu4c installed by homebrew, ie. /usr/local/opt/icu4c/lib
#
mkdir lib
cp ${ICU_DIR}/libicuuc.${ICU_VER}.dylib ${ICU_DIR}/libicui18n.${ICU_VER}.dylib ${ICU_DIR}/libicudata.${ICU_VER}.dylib lib
install_name_tool -change ${ICU_DIR}/libicuuc.${ICU_VER}.dylib @rpath/libicuuc.${ICU_VER}.dylib als
install_name_tool -change ${ICU_DIR}/libicui18n.${ICU_VER}.dylib @rpath/libicui18n.${ICU_VER}.dylib als
install_name_tool -add_rpath @executable_path -add_rpath @executable_path/../lib -add_rpath ${ICU_DIR} als
otool -L als
- name: 📦 Zip the executable
id: zip
run: |
zip -r als als
mv als.zip als-macos.zip
Expand Down

0 comments on commit 644b227

Please sign in to comment.