From 3ef04339ea9850a45019f11bbd5e427f3778bc52 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 20 Oct 2023 10:01:05 +0700 Subject: [PATCH 1/2] docs: macos build update --- docs/build/macos.md | 130 +++++++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 56 deletions(-) diff --git a/docs/build/macos.md b/docs/build/macos.md index f5ff0409640..20ac70a6276 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -1,6 +1,8 @@ # Setup your Keyman build environment on macOS -This document describes prerequisites and tools required for building various Keyman projects on macOS. Each project will also have additional notes linked below. +This document describes prerequisites and tools required for building various +Keyman projects on macOS. Each project will also have additional notes linked +below. ## Target Projects @@ -10,6 +12,7 @@ On macOS, you can build the following projects: * Keyman for iOS ([additional details](../../ios/README.md)) * Keyman for macOS ([additional details](../../mac/README.md)) * KeymanWeb ([additional details](../../web/README.md)) +* Keyman Developer Command Line Tools (kmc) The following libraries can also be built: @@ -20,19 +23,24 @@ The following projects **cannot** be built on macOS: * Keyman for Linux * Keyman for Windows -* Keyman Developer +* Keyman Developer (IDE component) ## System Requirements * Minimum macOS version: macOS Catalina 10.15 or Big Sur 11.0 -**Note:** to make a fully M1-compatible release build of Keyman for macOS (for the setup Applescript), Big Sur 11.0 is required, as osacompile on earlier versions does not build for arm64 (M1). The build will still work on earlier versions, but the installer won't be able to run on M1 Macs that do not have Rosetta 2 installed. +**Note:** to make a fully M1-compatible release build of Keyman for macOS (for +the setup Applescript), Big Sur 11.0 is required, as osacompile on earlier +versions does not build for arm64 (M1). The build will still work on earlier +versions, but the installer won't be able to run on M1 Macs that do not have +Rosetta 2 installed. ## Prerequisites Many dependencies are only required for specific projects. -* XCode (iOS, macOS) 12.4 or later +* XCode (iOS, macOS) 12.4 or later is needed only for Keyman for Mac and Keyman + for iOS. * Install from App Store * Accept the Xcode license: `sudo xcodebuild -license accept` @@ -48,73 +56,83 @@ These dependencies are also listed below if you'd prefer to install manually. ## Shared Dependencies -* Shared: HomeBrew, Bash 5.0+, jq, Python 2.7, Python 3, Meson, Ninja, coreutils, Pandoc +* HomeBrew, Bash 5.0+, jq, Python 2.7, Python 3, Meson, Ninja, coreutils, Pandoc - ```shell - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew install bash jq python3 meson ninja coreutils pandoc pyenv - # Python 2.7 required for DeviceKit (among others?) at present - pyenv install 2.7.18 - pyenv global 2.7.18 - echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile - ``` +```shell +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +brew install bash jq python3 meson ninja coreutils pandoc pyenv +# Python 2.7 required for DeviceKit (among others?) at present +pyenv install 2.7.18 +pyenv global 2.7.18 +echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile +``` - On macOS, you will need to adjust your PATH so that coreutils’ `realpath` takes precedence over the BSD one: +On macOS, you will need to adjust your PATH so that coreutils’ `realpath` takes +precedence over the BSD one: - ```shell - # Credit: brew info coreutils - PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" - ``` +```shell +# Credit: brew info coreutils +PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" +``` -* Web: node.js 18+, emscripten, openjdk 8 +## KeymanWeb Dependencies - ```shell - brew install node emscripten openjdk@8 - ``` +* node.js 18+, emscripten, openjdk 8 - Note: if you install emscripten with brew on macOS, only emscripten binaries - are added to the path via symlinks. This makes it reasonably safe to have - emscripten on the path, unlike on other platforms where emscripten also ends - up adding its versions of node, python, and other binaries to the path. +```shell +brew install node emscripten openjdk@8 +``` -* iOS: swiftlint, carthage +Note: if you install emscripten with brew on macOS, only emscripten binaries are +added to the path via symlinks. This makes it reasonably safe to have emscripten +on the path, unlike on other platforms where emscripten also ends up adding its +versions of node, python, and other binaries to the path. - ```shell - brew install swiftlint carthage - ``` +## Keyman for iOS Dependencies -* macOS: carthage, cocoapods +* XCode, swiftlint, carthage - ```shell - brew install carthage cocoapods - ``` +```shell +brew install swiftlint carthage +``` -* Android: openjdk 8, Android SDK, Android Studio, Ant, Gradle, Maven +## Keyman for Mac Dependencies - ```shell - brew install openjdk@8 android-sdk android-studio ant gradle maven - # update path - source ../resources/devbox/macos/keyman.macos.env.sh - # optionally install sdk images - sdkmanager "system-images;android-30;google_apis;armeabi-v7a" - sdkmanager --update - sdkmanager --licenses - ``` +* XCode, carthage, cocoapods -* kmc (optional): node - - Required to build keyboards using kmc +```shell +brew install carthage cocoapods +``` - ```bash - brew tap homebrew/cask-versions - brew install --cask --no-quarantine wine-stable - ``` +## Keyman for Android Dependencies -* sentry-cli (optional) - - Uploading symbols for Sentry-based error reporting +* openjdk 8, Android SDK, Android Studio, Ant, Gradle, Maven - ``` +```shell +brew install openjdk@8 android-sdk android-studio ant gradle maven +# update path +source ../resources/devbox/macos/keyman.macos.env.sh +# optionally install sdk images +sdkmanager "system-images;android-30;google_apis;armeabi-v7a" +sdkmanager --update +sdkmanager --licenses +``` + +* Note: Run Android Studio once after installation to install additional +components such as emulator images and SDK updates. + +## Keyman Developer Command Line (kmc) + +* node.js, emscripten + +```shell +brew install node emscripten +``` + +## Optional Tools + +* sentry-cli: Uploading symbols for Sentry-based error reporting + + ```shell brew install getsentry/tools/sentry-cli ``` - -* Run Android Studio once after installation to install additional components - such as emulator images and SDK updates. From 14e78558f28135f3585800bb31245bd336c06f1b Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 20 Oct 2023 15:03:18 +1100 Subject: [PATCH 2/2] chore: Apply suggestions from code review Co-authored-by: Darcy Wong --- docs/build/macos.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build/macos.md b/docs/build/macos.md index 20ac70a6276..aa1eea34bfd 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -39,7 +39,7 @@ Rosetta 2 installed. Many dependencies are only required for specific projects. -* XCode (iOS, macOS) 12.4 or later is needed only for Keyman for Mac and Keyman +* XCode (iOS, macOS) 12.4 or later is needed only for Keyman for macOS and Keyman for iOS. * Install from App Store * Accept the Xcode license: `sudo xcodebuild -license accept` @@ -106,10 +106,10 @@ brew install carthage cocoapods ## Keyman for Android Dependencies -* openjdk 8, Android SDK, Android Studio, Ant, Gradle, Maven +* openjdk 11, Android SDK, Android Studio, Ant, Gradle, Maven ```shell -brew install openjdk@8 android-sdk android-studio ant gradle maven +brew install openjdk@11 android-sdk android-studio ant gradle maven # update path source ../resources/devbox/macos/keyman.macos.env.sh # optionally install sdk images