Skip to content

Commit

Permalink
⚔️ Add notes about cross-compiling (macOS only)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Jan 4, 2024
1 parent 5ddbd48 commit 104fc0d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ For more information on using Hugo and its command-line interface, please refer
| Platform | Architecture | Supported |
| -------- | ------------ | ---------------- |
| macOS | x86_64 ||
| macOS | arm64 | Coming soon |
| macOS | arm64 | |
| Linux | amd64 ||
| Linux | arm64 | Coming soon |
| Windows | x86_64 ||
Expand Down Expand Up @@ -88,6 +88,27 @@ pip install -e . # editable installation
pip install . # regular installation
```

### Cross-compiling for different architectures

> [!NOTE]
> This functionality is implemented just for macOS at the moment, but it can be extended to other platforms as well in the near future.
This package is capable of cross-compiling Hugo binaries for the same platform but different architectures and it can be used as follows.

Say, on an Intel-based (x86_64) macOS machine:

```bash
export GOARCH="arm64"
pip install . # or pip install -e .
```

This will build a macOS arm64 binary distribution of Hugo that can be used on Apple Silicon-based (arm64) macOS machines. To build a binary distribution for the _target_ Intel-based (x86_64) macOS platform on the _host_ Apple Silicon-based (arm64) macOS machine, you can use the following command:

```bash
export GOARCH="amd64"
pip install . # or pip install -e .
```

## Background

Binaries for the Hugo static site generator are available for download from the [Hugo releases page](https://github.com/gohugoio/hugo/releases). These binaries have to be downloaded and placed in an appropriate location on the system manually and the PATH environment variable has to be updated to include said location.
Expand Down

0 comments on commit 104fc0d

Please sign in to comment.