Skip to content

Commit

Permalink
Update Readme and Install instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed May 17, 2024
1 parent c72926d commit e48a010
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 24 deletions.
51 changes: 37 additions & 14 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

### Prerequisites

Install **Xcode 12.2** or above from App Store, to build Squirrel as a Universal
app. The minimum required version is *Xcode 10* to build for `x86_64` only.
Install **Xcode 14.0** or above from App Store, to build Squirrel as a Universal
app.

Install **cmake**.

Expand Down Expand Up @@ -39,7 +39,7 @@ Optionally, checkout Rime plugins (a list of GitHub repo slugs):
bash librime/install-plugins.sh rime/librime-sample # ...
```

Popular plugins include [librime-lua](https://github.com/hchunhui/librime-lua) and [librime-octagram](https://github.com/lotem/librime-octagram)
Popular plugins include [librime-lua](https://github.com/hchunhui/librime-lua), [librime-octagram](https://github.com/lotem/librime-octagram) and [librime-predict](https://github.com/rime/librime-predict)

### Shortcut: get the latest librime release

Expand Down Expand Up @@ -100,33 +100,41 @@ port install boost -no_static
git submodule update --init --recursive
```

* There are a few environmental variables that you can define. Here's a list and possible values they may take:

``` sh
export BOOST_ROOT="path_to_boost" # required
export DEV_ID="Your Apple ID name" # include this to codesign, optional
export BUILD_UNIVERSAL=1 # set to build universal binary
export PLUM_TAG=":preset” # or ":extra", optional, build with a set of plum formulae
export ARCHS='arm64 x86_64' # optional, if not defined, only active arch is used
export MACOSX_DEPLOYMENT_TARGET='13.0' # optional, lower version than 13.0 is not tested and may not work properly
```
* With all dependencies ready, build `Squirrel.app`:
``` sh
make
```
To build only for the native architecture, and/or specify the lowest supported macOS version, pass variable `ARCHS` and/or `MACOSX_DEPLOYMENT_TARGET` to `make`:
* You can either define the environment variables in your shell/terminal, or append them as arguments to the make command. For example:
``` sh
# for Universal macOS App
make ARCHS='arm64 x86_64'

# for ARM macOS App
make ARCHS='arm64'
make ARCHS='arm64 x86_64' BUILD_UNIVERSAL=1
```
## Install it on your Mac
## Make Package
### Make Package
Just add `package` after `make`
```
make package ARCHS='arm64'
```
Define or echo `DEV_ID` to automatically handle code signing and [notarization](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) (Apple Developer ID needed)
Define `DEV_ID` to automatically handle code signing and [notarization](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) (Apple Developer ID needed)
To make this work, you need a `Developer ID Installer: (your name/org)` and set your name/org as `DEV_ID` env variable.
Expand All @@ -138,7 +146,7 @@ xcrun notarytool store-credentials 'your name/org'
You **don't** need to define `DEV_ID` if you don't intend to distribute the package.
## Directly Install
### Directly Install
**You might need to precede with sudo, and without a logout, the App might not work properly. Direct install is not very recommended.**
Expand All @@ -147,9 +155,24 @@ Once built, you can install and try it live on your Mac computer:
``` sh
# Squirrel as a Universal app
make install
```
## Clean Up Artifacts
After installation or after a failed attempt, you may want to start over. Before you do so, **make sure you have cleaned up artifacts from previous build.**
# for Intel-based Mac only
make ARCHS='x86_64' install
To clean **Squirrel** artifacts, without touching dependencies, run:
``` sh
make clean
```
That's it, a verbal journal. Thanks for riming with Squirrel.
To clean up **dependencies**, including librime, librime plugins, plum and sparkle, run:
``` sh
make clean-deps
```
If you want to clean both, do both.
That's it, a verbal journal. Thanks for riming with Squirrel.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ copy-plum-data:
copy-opencc-data:
mkdir -p data/opencc
cp $(OPENCC_DATA_OUTPUT) data/opencc/
cp $(PLUM_OPENCC_OUTPUT) data/opencc/ || true
cp $(PLUM_OPENCC_OUTPUT) data/opencc/ > /dev/null 2>&1 || true

deps: librime data

Expand Down Expand Up @@ -129,7 +129,7 @@ clean-sparkle:
rm -rf Frameworks/* > /dev/null 2>&1 || true
rm -rf Sparkle/build > /dev/null 2>&1 || true

.PHONY: package archive sign-archive
.PHONY: package archive

package: release
ifdef DEV_ID
Expand All @@ -147,10 +147,6 @@ endif
archive: package
bash package/make_archive

sign-archive:
[ -n "${checksum}" ] || (echo >&2 'ERROR: $$checksum not specified.'; false)
sign_key=sign/dsa_priv.pem bash package/make_archive

DSTROOT = /Library/Input Methods
SQUIRREL_APP_ROOT = $(DSTROOT)/Squirrel.app

Expand Down Expand Up @@ -183,4 +179,5 @@ clean:
clean-deps:
$(MAKE) -C plum clean
$(MAKE) -C librime clean
rm -rf librime/dist > /dev/null 2>&1 || true
$(MAKE) clean-sparkle
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
【鼠鬚管】輸入法
===
[![Download](https://img.shields.io/github/v/release/rime/squirrel)](https://github.com/rime/squirrel/releases/latest)
[![Build Status](https://travis-ci.org/rime/squirrel.svg)](https://travis-ci.org/rime/squirrel)
[![Build Status](https://github.com/rime/squirrel/actions/workflows/commit-ci.yml/badge.svg)](https://github.com/rime/squirrel/actions/workflows)
[![GitHub Tag](https://img.shields.io/github/tag/rime/squirrel.svg)](https://github.com/rime/squirrel)

式恕堂 版權所無
Expand All @@ -22,7 +22,7 @@

您可能還需要 Rime 用於其他操作系統的發行版:

* ibus-rimefcitx-rime 用於 Linux
* 【中州韻】(ibus-rimefcitx-rime用於 Linux
* 【小狼毫】用於 Windows

安裝輸入法
Expand Down Expand Up @@ -99,8 +99,7 @@
問題與反饋
---

發現程序有 BUG,或建議,或感想,請反饋到
https://github.com/rime/home/issues
發現程序有 BUG,或建議,或感想,請反饋到 [Rime 代碼之家討論區](https://github.com/rime/home/discussions)

聯繫方式
---
Expand Down

0 comments on commit e48a010

Please sign in to comment.