Building from sources
Building the extended + withdeploy edition of Hugo from source requires the following dependencies:
Windows users can use the Chocolatey package manager in order to use the MinGW compiler. After installing Chocolatey, run the following command in an elevated terminal prompt:
choco install mingwThen, clone the repository and run the build script:
git clone --recurse-submodules https://github.com/agriyakhetarpal/hugo-python-distributions@main
python -m venv venv
source venv/bin/activateand then install the package in the current directory:
pip install .or perform an editable installation via the following command:
pip install -e .Cross-compiling for different architectures
This project is capable of cross-compiling Hugo binaries for various platforms and architectures. Cross-compilation is provided for the following platforms:
- macOS; for the
arm64andamd64architectures via the Xcode toolchain, - Linux; for the
arm64,amd64,s390x, andppc64learchitectures via the Zig toolchain, and - Windows; for the
amd64,arm64, andx86architectures via the Zig toolchain.
Say, on an Intel-based (x86_64) macOS machine:
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:
export GOARCH="amd64"
pip install . # or pip install -e .For a list of supported distributions for Go, please run the go tool dist list command on your system. For a list of supported targets for Zig, please refer to the Zig documentation for more information or run the zig targets command on your system.