From 0988efe3571a1c4d633cfffbc6641fbceedb9d97 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Sat, 10 Aug 2024 07:02:58 +0100 Subject: [PATCH] Update build instrcutions and add Linux instructions --- README.md | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 149 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7ba9590..7021a81 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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` @@ -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 @@ -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` @@ -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 @@ -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 @@ -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 @@ -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 ``` @@ -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 +```