Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
use prebuilt lua; ensure no homebrew deps (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Jan 7, 2024
1 parent 9447626 commit 35594e3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,25 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64, arm64]
include:
- { arch: x86_64, homebrew_prefix: /usr/local }
- { arch: arm64, homebrew_prefix: /opt/homebrew }

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies (x86)
if: ${{ matrix.arch == 'x86_64' }}
run: |
brew install \
extra-cmake-modules \
lua \
ninja
- name: Setup arm homebrew
if: ${{ matrix.arch == 'arm64' }}
uses: fcitx-contrib/macos-cross@master

- name: Install dependencies (arm)
if: ${{ matrix.arch == 'arm64' }}
- name: Install dependencies
run: |
brew install \
extra-cmake-modules \
ninja
arm-brew-install \
gettext \
lua
cp -f /usr/local/bin/msgfmt /opt/homebrew/bin
wget https://github.com/fcitx-contrib/fcitx5-macos-prebuilder/releases/download/latest/marisa-x86_64.tar.bz2
tar xjvf marisa-x86_64.tar.bz2 -C /usr/local bin/marisa-build
- name: Download and install Fcitx5.app
run: |
wget https://github.com/fcitx-contrib/fcitx5-macos/releases/download/latest/Fcitx5-${{ matrix.arch }}.dmg
hdiutil attach Fcitx5-${{ matrix.arch }}.dmg
sudo cp -r /Volumes/Fcitx5/{Fcitx5.app,"Input Methods"}
wget https://github.com/fcitx-contrib/fcitx5-macos-prebuilder/releases/download/latest/marisa-x86_64.tar.bz2
tar xjvf marisa-x86_64.tar.bz2 -C /usr/local bin/marisa-build
- name: Build all
run: ./all.sh ${{ matrix.arch }}
Expand All @@ -63,6 +43,10 @@ jobs:
path: |
build/*.tar.bz2
- name: Check validity
if: ${{ matrix.arch == 'x86_64' }}
run: ./check-validity.sh

release:
needs: build
if: ${{ github.ref == 'refs/heads/master' }}
Expand Down
12 changes: 12 additions & 0 deletions check-validity.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -e

has_homebrew_deps=0

for lib in $(find build -name '*.so'); do
if otool -L $lib | grep /usr/local; then
otool -L $lib
has_homebrew_deps=1
fi
done

exit $has_homebrew_deps
2 changes: 2 additions & 0 deletions scripts/lua.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set -e
. ./common.sh lua $1

install_deps lua

# Turning on dlopen produces wrong config.h,
# and even fixed it will hard-code lua dylib path in code.
f5m_configure -DENABLE_TEST=OFF -DUSE_DLOPEN=OFF
Expand Down
2 changes: 1 addition & 1 deletion scripts/rime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rime_data_dir=$INSTALL_PREFIX/share/rime-data

git reset --hard
git apply ../patches/rime.patch
install_deps yaml-cpp leveldb marisa opencc glog librime
install_deps yaml-cpp leveldb marisa opencc glog librime lua

# This value is only used to install fcitx5.yaml
# and not used in rimeengine.cpp after patching
Expand Down

0 comments on commit 35594e3

Please sign in to comment.