2024-05-18 12:19:13 +02:00
# Build Instructions
Instructions for building this repository on Linux.
2024-05-18 12:22:15 +02:00
## Table of Contents
2024-05-18 12:19:13 +02:00
- [Build Instructions ](#build-instructions )
2024-05-18 12:22:15 +02:00
- [Table of Contents ](#table-of-contents )
2024-05-18 12:19:13 +02:00
- [Contributing to the Repository ](#contributing-to-the-repository )
2024-05-18 12:22:15 +02:00
- [Repository Content ](#repository-content )
- [Building on Linux ](#building-on-linux )
2024-05-18 12:19:13 +02:00
- [Linux Development Environment Requirements ](#linux-development-environment-requirements )
- [Required Package List ](#required-package-list )
2024-05-18 12:22:15 +02:00
- [Install and Prepare Required Rust Version ](#install-and-prepare-required-rust-version )
- [Required macOS SDK ](#required-macos-sdk )
- [Build and Use macOS SDK from Xcode ](#build-and-use-macos-sdk-from-xcode )
2024-05-18 12:19:13 +02:00
- [Build the Project ](#build-the-project )
## Contributing to the Repository
2024-05-18 12:22:15 +02:00
If you intend to contribute, the preferred workflow is for you to develop your contribution in a fork of this repository in your GitHub account and then submit a pull request.
2024-05-18 12:19:13 +02:00
## Repository Content
2024-05-18 12:22:15 +02:00
This repository contains the source code necessary to build warp-packer for different platforms and architectures.
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
## Building on Linux
2024-05-18 12:19:13 +02:00
### Linux Development Environment Requirements
This repository has been built and tested on Debian 12.5 (Bookworm) on an AMD64 architecture.
#### Required Package List
2024-05-18 12:22:15 +02:00
```bash
2024-05-21 00:11:50 +02:00
apt install curl maven clang cmake libssl-dev zlib1g-dev liblzma-dev libbz2-dev gcc-aarch64-linux-gnu gcc-mingw-w64-x86-64-win32 git
2024-05-18 12:22:15 +02:00
```
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
#### Install and Prepare Required Rust Version
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
This repository has been built and tested with Rust version 1.78.
2024-05-18 12:19:13 +02:00
To install the newest version, run the following command:
2024-05-18 12:22:15 +02:00
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
If a newer version doesn't work, a specific version can be installed with the following command:
```bash
2024-05-21 00:11:50 +02:00
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.78.0
2024-05-18 12:22:15 +02:00
```
2024-05-18 12:19:13 +02:00
2024-05-21 07:55:04 +02:00
For more information see this [GitHub Issue ](https://github.com/rust-lang/rustup/issues/2882 ) and the [official installation instructions ](https://rust-lang.github.io/rustup/installation/other.html ).
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
After installing, run the following commands to get the necessary targets:
```bash
rustup target add x86_64-apple-darwin
rustup target add aarch64-unknown-linux-gnu
rustup target add x86_64-pc-windows-gnu
```
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
#### Required macOS SDK
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
To build warp-packer for the target x86_64-apple-darwin, a macOS SDK is needed. The repository has been built and tested with MacOSX10.12 SDK.
There are several GitHub repositories available that contain different SDK versions, but they all seem to miss the header files. So it is recommended to download it from Apple's website.
The macOS SDK is integrated into Xcode, and this repository has been built and tested with Xcode version 8.3.3.
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
##### Build and Use macOS SDK from Xcode
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
To build and use the macOS SDK from Xcode, [osxcross ](https://github.com/tpoechtrager/osxcross ) will be used.
2024-05-18 12:19:13 +02:00
Download osxcross:
2024-05-18 12:22:15 +02:00
```bash
git clone https://github.com/tpoechtrager/osxcross.git
```
2024-05-18 12:19:13 +02:00
2024-05-18 12:22:15 +02:00
Extract macOS SDK from Xcode (see [here ](https://github.com/tpoechtrager/osxcross?tab=readme-ov-file#packing-the-sdk-on-linux---method-1-xcode--80 )):
```bash
< path / to > /osxcross/tools/gen_sdk_package_pbzx.sh < path / to > /Xcode_8.3.3.xip
```
Hint: This method may require up to 45 GB of free disk space. An SSD is recommended for this method.
2024-05-18 12:19:13 +02:00
Copy or move the SDK into the `<path/to>/osxcross/tarballs/` directory.
Run:
2024-05-18 12:22:15 +02:00
```bash
2024-05-21 00:11:50 +02:00
UNATTENDED=yes OSX_VERSION_MIN=10.12 < path / to > /osxcross/build.sh
2024-05-18 12:22:15 +02:00
```
to create the macOS cross toolchain.
2024-05-18 12:19:13 +02:00
Add the target/bin folder to your PATH environment variable:
2024-05-18 12:22:15 +02:00
```bash
PATH="< path / to > /osxcross/target/bin:$PATH"
```
2024-05-18 12:19:13 +02:00
#### Build the Project
2024-05-18 12:22:15 +02:00
Clone the project and within the project directory, run:
```bash
make
```
2024-05-18 12:19:13 +02:00
to start the build.
The compiled warp-packer files are in the folder:
2024-05-18 12:22:15 +02:00
```bash
< path / to > /warp/target/< target > /release/warp-packer
```
2024-05-18 12:19:13 +02:00
e.g.
2024-05-18 12:22:15 +02:00
```bash
warp/target/aarch64-unknown-linux-gnu/release/warp-packer
```