@@ -36,18 +36,40 @@ The build produced does have some limitations:
3636
3737## Requirements
3838
39+ Required with both Nix and Homebrew approaches:
40+
3941- [ Xcode] ( https://apps.apple.com/gb/app/xcode/id497799835?mt=12 )
40- - [ Homebrew] ( https://brew.sh/ )
41- - Ruby 2.3.0 or later is needed to execute the build script itself. macOS comes
42- with Ruby, check your version with ` ruby --version ` . If it's too old, you can
43- install a newer version with:
44- ```
45- brew install ruby
46- ```
47- - All dependencies can all easily be installed by running:
48- ```
49- make bootstrap
50- ```
42+
43+ ### Nix
44+
45+ The [ Nix] ( https://nixos.org/ ) package manager is the preferred and most reliable
46+ way to install all dependencies required to build Emacs, by way of a Nix flake
47+ included in the project root.
48+
49+ To install all required dependencies within the nix shell, run:
50+
51+ ```
52+ nix develop --command make bootstrap
53+ ```
54+
55+ ### Homebrew
56+
57+ If you do not have Nix installed, then the alternative way to manage and install
58+ build-time dependencies is via [ Homebrew] ( https://brew.sh/ ) .
59+
60+ Ruby 3.3.x or later is also needed to execute the build script. Earlier versions
61+ may work, but are untested. Simplest way to install a recent Ruby version is via
62+ Homebrew:
63+
64+ ```
65+ brew install ruby
66+ ```
67+
68+ And finally, to install all built-time dependencies, run:
69+
70+ ```
71+ make bootstrap
72+ ```
5173
5274## Status
5375
@@ -71,17 +93,38 @@ Nightly builds are built with GitHub Actions on GitHub-hosted runners, using
7193
7294## Usage
7395
96+ ### Nix
97+
98+ Ensure [ Flakes] ( https://nixos.wiki/wiki/Flakes ) are enabled, and enter the flake
99+ development environment with ` nix develop ` . Within this environment, you can
100+ execute the ` ./build-emacs-for-macos --help ` to get started.
101+
102+ Or you can run the build script via ` nix develop ` :
103+
104+ ```
105+ nix develop --command ./build-emacs-for-macos --help
106+ ```
107+
108+ ### Homebrew
109+
110+ Run ` make boostrap ` to ensure all Ruby and Homebrew dependencies are installed.
111+
112+ ### Build Script
113+
74114```
75115Usage: ./build-emacs-for-macos [options] <branch/tag/sha>
76116
77117Branch, tag, and SHA are from the emacs-mirror/emacs/emacs Github repo,
78118available here: https://github.com/emacs-mirror/emacs
79119
80120Options:
121+ --info Print environment info and detected library paths, then exit
122+ --preview Print preview details about build and exit.
81123 -j, --parallel COUNT Compile using COUNT parallel processes (detected: 16)
82124 --git-sha SHA Override detected git SHA of specified branch allowing builds of old commits
125+ --[no-]use-nix Use Nix instead of Homebrew to find dependencies (default: enabled if EMACS_BUILD_USE_NIX is set to truthy value)
83126 --[no-]xwidgets Enable/disable XWidgets if supported (default: enabled)
84- --[no-]tree-sitter Enable/disable tree-sitter if supported (default: enabled)
127+ --[no-]tree-sitter Enable/disable tree-sitter if supported(default: enabled)
85128 --[no-]native-comp Enable/disable native-comp (default: enabled if supported)
86129 --[no-]native-march Enable/disable -march=native CFLAG(default: disabled)
87130 --[no-]native-full-aot Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation (default: disabled)
0 commit comments