From 47d87f408cab84dc45fb072b539433dc292b1d1f Mon Sep 17 00:00:00 2001 From: Frederic Laing Date: Mon, 14 Nov 2022 18:18:21 +0100 Subject: [PATCH] update readme with build instructions Signed-off-by: Frederic Laing --- README.md | 38 ++++++++++++++++++++++++++++++++++---- build.sh | 9 +++++++++ src/main.py | 5 +++-- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 802cb83..29243dc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,37 @@ The Asahi Linux installer is distributed under the MIT license. See LICENSE for This installer vendors [python-asn1](https://github.com/andrivet/python-asn1), which is distributed under the same license. -## Building - -`./build.sh` - +## Building on macOS +### Build Requirements +Install and setup `Xcode Command Line Tools` from Apple +```bash +xcode-select --install +``` +Install and setup [`Homebrew`](https://brew.sh/), "The Missing Package Manager for macOS" +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` +Install [Rust and Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html): +```bash +# follow the installer instructions +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +# afterwards initialize +source "$HOME/.cargo/env" +``` + +### Build Asahi Installer locally +```bash +git clone --recursive https://github.com/AsahiLinux/asahi-installer.git +cd ./asahi-installer +./build.sh +``` + +### FAQ Errors +```bash +# Error: Rust dependency not found +error: failed to load source for dependency `bitflags` +# Solution: download rust cargo dependencies for m1n1 +cd m1n1 +git submodule init +git submodule update +``` diff --git a/build.sh b/build.sh index 85ed6a9..c29c384 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,15 @@ rm -rf "$PACKAGE" mkdir -p "$DL" "$PACKAGE" "$RELEASES" "$RELEASES_DEV" mkdir -p "$PACKAGE/bin" +echo "Install brew dependencies..." +for BREW_DEPENDENCY in "wget" "make" "llvm"; do + echo "Brew install $BREW_DEPENDENCY..." + if brew ls --versions "$BREW_DEPENDENCY" + then brew upgrade "$BREW_DEPENDENCY" + else brew install "$BREW_DEPENDENCY" + fi +done + echo "Determining version..." VER=$(git describe --always --dirty --tags) diff --git a/src/main.py b/src/main.py index 470f624..5e3ab83 100644 --- a/src/main.py +++ b/src/main.py @@ -807,8 +807,9 @@ def main(self): self.input() print() p_message("By default, this installer will hide certain advanced options that") - p_message("are only useful for developers. You can enable expert mode to show them.") - p_message("Do not enable this unless you know what you are doing.") + p_message("are only useful for Asahi Linux developers. You can enable expert mode") + p_message("to show them. Do not enable this unless you know what you are doing.") + p_message("Please do not file bugs if things go wrong in expert mode.") self.expert = self.yesno("Enable expert mode?") print()