Skip to content

Commit

Permalink
Merge pull request #71 from phunkyfish/update-readme-linux
Browse files Browse the repository at this point in the history
Build instructions for Linux
  • Loading branch information
chewitt authored Aug 11, 2024
2 parents d961c40 + 0988efe commit aa616f9
Showing 1 changed file with 149 additions and 7 deletions.
156 changes: 149 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ Issues should be reported via the forum here: https://forum.libreelec.tv/board/4

# **How to compile the USB/SD Creator**

Build instructions are supplied for Windows x64 (Installer and Portable) and MacOS (Intel and Apple Silicon). Instructions tested locally on Mac Sonoma and Windows 11.
Build instructions are supplied for Windows x64 (Installer and Portable), macOS (Intel and Apple Silicon) and Ubuntu Linux (x86_64). Instructions have been tested locally on Windows 11, macOS Sonoma and Ubuntu 24.04.

It is possible to build for Linux, but for now instructions are TBD.
- [Windows](#Windows)
- [macOS](#macOS)
- [Linux](#Linux)

# Windows

Note: the offical release for Windows is built using Visual Studio

## Install pre-requisites

### 1. Install 7zip
Expand Down Expand Up @@ -66,6 +70,7 @@ Add msys2 to PATH: `C:\msys64\mingw64\bin`. Then do a restart of windows.
Note: you must use a standard commnd prompt when using mingw for the build.

### 2. Clone Git Repo

Clone the repository to `%UserProfile%/usb-sd-creator`
`git clone https://github.com/LibreELEC/usb-sd-creator.git`

Expand Down Expand Up @@ -127,11 +132,17 @@ To see the available Qt versions run:
aqt list-qt windows desktop
```

To see the available compiler versions run:

```
aqt list-qt linux desktop --arch 6.7.2
```

Install the required packages:

```
aqt install-qt --outputdir ~/Qt windows desktop 6.7.2 win64_msvc2019_64 --archives qtbase qttools opengl32sw d3dcompiler_47 --external 7z.exe
aqt install-qt --outputdir ~/Qt windows desktop 6.7.2 win64_msvc2019_64 --modules debug_info --external 7z.exe
aqt install-qt --outputdir %UserProfile%/Qt windows desktop 6.7.2 win64_msvc2019_64 --archives qtbase qttools opengl32sw d3dcompiler_47 --external 7z.exe
aqt install-qt --outputdir %UserProfile%/Qt windows desktop 6.7.2 win64_msvc2019_64 --modules debug_info --external 7z.exe
```

#### Install Visual Studio Community 2022
Expand All @@ -141,6 +152,7 @@ Install Visual Studio Community 2022 from: https://visualstudio.microsoft.com/vs
Note that the command prompt is to be used thoughtout the MSVC build must be started from a standard command prompt for `x64` as follows: `"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VsDevCmd.bat" -arch=x64 -host_arch=x64`.

### 2. Clone Git Repo

Clone the repository to `%UserProfile%/usb-sd-creator`
`git clone https://github.com/LibreELEC/usb-sd-creator.git`

Expand Down Expand Up @@ -191,9 +203,9 @@ cpack --preset release -G ZIP

Run the installer in `build/cpack`. Then run the app from Start Menu: `LibreELEC USB-SD Creator x64`.

# MacOS
# macOS

### Building for MacOS
## Building for macOS

### 1. Install XCode with Command-line tools

Expand All @@ -205,13 +217,17 @@ The build requires both `python3` and `cmake`. If you don't have them installed,

```
brew install python
brew install pipx
brew install cmake
```

Make sure that `/opt/homebrew/bin` is in your `PATH`.

Now install `aqt`, a command line package manager for `Qt`:

```
pip3 install aqtinstall --break-system-packages
pipx install aqtinstall
pipx ensurepath
```

#### Install required Qt packages
Expand All @@ -222,12 +238,22 @@ To see the available Qt versions run:
aqt list-qt mac desktop
```

To see the available compiler versions run:

```
aqt list-qt linux desktop --arch 6.7.2
```

Install the required packages:

```
aqt install-qt --outputdir ~/Qt mac desktop 6.7.2 --archives qtbase qttools
```

### 3. Clone Git Repo
Clone the repository to `~/usb-sd-creator`
`git clone https://github.com/LibreELEC/usb-sd-creator.git`

### 4. Build USB-SD-Creator

Assuming the repo is in your home directory
Expand All @@ -237,11 +263,13 @@ cd ~/usb-sd-creator
```

#### Debug build

```
cmake -S . -B build -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
```

#### Release build

```
cmake --preset release -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build --preset release
```
Expand Down Expand Up @@ -286,5 +314,119 @@ Build the xcode project, and open the project file in Xcode, located in the buil
```
cmake -S . -B build -G Xcode -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
```
### 7. Build Install .dmg

If you wish to build the install `.dmg` (not required for development), you can create it using the following command. Note that code signing cannot be done locally (unless you have your own certs).

#### Debug build

```
cd build
cpack -C Debug
```

#### Release build

```
cpack --preset release
```


# Linux

### 1. Install build tools

```
sudo apt install build-essential
sudo apt install libgl-dev
sudo apt install cmake
sudo apt install git
```

### 2. Setup Qt 6.7.2

#### Install pre-requisites (Pip and Pipx)

```
sudo apt install python3-pip pipx
pipx ensurepath
```

Now install `aqt`, a command line package manager for `Qt`:

```
pipx install aqtinstall
```

#### Install required Qt packages

To see the available Qt versions run:

```
aqt list-qt linux desktop
```

To see the available compiler versions run:

```
aqt list-qt linux desktop --arch 6.7.2
```

Install the required packages:

```
aqt install-qt --outputdir ~/Qt linux desktop 6.7.2 linux_gcc_64 --archives qtbase qttools
aqt install-qt --outputdir ~/Qt linux desktop 6.7.2 linux_gcc_64 --modules debug_info
```

### 3. Clone Git Repo

Clone the repository to `~/usb-sd-creator`
`git clone https://github.com/LibreELEC/usb-sd-creator.git`

### 4. Build USB-SD-Creator

Assuming the repo is in your home directory

```
cd ~/usb-sd-creator
```

#### Debug build

```
cmake -S . -B build -D CMAKE_PREFIX_PATH="~/Qt/6.7.2/gcc_64" && cmake --build build
```

#### Release build

```
cmake --preset release -D CMAKE_PREFIX_PATH="~/Qt/6.7.2/gcc_64" && cmake --build --preset release
```

### 5. Run USB-SD-Creator

#### Command line

Run the app from the command line, that will prompt for a password:

```
./build/LibreELEC.USB-SD.Creator.Linux.bin
```

### 6. Build Install Package

If you wish to build the install package (not required for development), you can create tarballs using:

#### Debug build

```
cd build
cpack -C Debug
```

#### Release build

```
cpack --preset release
```

0 comments on commit aa616f9

Please sign in to comment.