Skip to content

Commit aa616f9

Browse files
authored
Merge pull request #71 from phunkyfish/update-readme-linux
Build instructions for Linux
2 parents d961c40 + 0988efe commit aa616f9

File tree

1 file changed

+149
-7
lines changed

1 file changed

+149
-7
lines changed

README.md

Lines changed: 149 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ Issues should be reported via the forum here: https://forum.libreelec.tv/board/4
2020

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

23-
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.
23+
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.
2424

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

2729
# Windows
2830

31+
Note: the offical release for Windows is built using Visual Studio
32+
2933
## Install pre-requisites
3034

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

6872
### 2. Clone Git Repo
73+
6974
Clone the repository to `%UserProfile%/usb-sd-creator`
7075
`git clone https://github.com/LibreELEC/usb-sd-creator.git`
7176

@@ -127,11 +132,17 @@ To see the available Qt versions run:
127132
aqt list-qt windows desktop
128133
```
129134

135+
To see the available compiler versions run:
136+
137+
```
138+
aqt list-qt linux desktop --arch 6.7.2
139+
```
140+
130141
Install the required packages:
131142

132143
```
133-
aqt install-qt --outputdir ~/Qt windows desktop 6.7.2 win64_msvc2019_64 --archives qtbase qttools opengl32sw d3dcompiler_47 --external 7z.exe
134-
aqt install-qt --outputdir ~/Qt windows desktop 6.7.2 win64_msvc2019_64 --modules debug_info --external 7z.exe
144+
aqt install-qt --outputdir %UserProfile%/Qt windows desktop 6.7.2 win64_msvc2019_64 --archives qtbase qttools opengl32sw d3dcompiler_47 --external 7z.exe
145+
aqt install-qt --outputdir %UserProfile%/Qt windows desktop 6.7.2 win64_msvc2019_64 --modules debug_info --external 7z.exe
135146
```
136147

137148
#### Install Visual Studio Community 2022
@@ -141,6 +152,7 @@ Install Visual Studio Community 2022 from: https://visualstudio.microsoft.com/vs
141152
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`.
142153

143154
### 2. Clone Git Repo
155+
144156
Clone the repository to `%UserProfile%/usb-sd-creator`
145157
`git clone https://github.com/LibreELEC/usb-sd-creator.git`
146158

@@ -191,9 +203,9 @@ cpack --preset release -G ZIP
191203

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

194-
# MacOS
206+
# macOS
195207

196-
### Building for MacOS
208+
## Building for macOS
197209

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

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

206218
```
207219
brew install python
220+
brew install pipx
208221
brew install cmake
209222
```
210223

224+
Make sure that `/opt/homebrew/bin` is in your `PATH`.
225+
211226
Now install `aqt`, a command line package manager for `Qt`:
212227

213228
```
214-
pip3 install aqtinstall --break-system-packages
229+
pipx install aqtinstall
230+
pipx ensurepath
215231
```
216232

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

241+
To see the available compiler versions run:
242+
243+
```
244+
aqt list-qt linux desktop --arch 6.7.2
245+
```
246+
225247
Install the required packages:
226248

227249
```
228250
aqt install-qt --outputdir ~/Qt mac desktop 6.7.2 --archives qtbase qttools
229251
```
230252

253+
### 3. Clone Git Repo
254+
Clone the repository to `~/usb-sd-creator`
255+
`git clone https://github.com/LibreELEC/usb-sd-creator.git`
256+
231257
### 4. Build USB-SD-Creator
232258

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

239265
#### Debug build
266+
240267
```
241268
cmake -S . -B build -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
242269
```
243270

244271
#### Release build
272+
245273
```
246274
cmake --preset release -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build --preset release
247275
```
@@ -286,5 +314,119 @@ Build the xcode project, and open the project file in Xcode, located in the buil
286314
```
287315
cmake -S . -B build -G Xcode -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
288316
```
317+
### 7. Build Install .dmg
318+
319+
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).
320+
321+
#### Debug build
322+
323+
```
324+
cd build
325+
cpack -C Debug
326+
```
327+
328+
#### Release build
329+
330+
```
331+
cpack --preset release
332+
```
333+
334+
335+
# Linux
336+
337+
### 1. Install build tools
338+
339+
```
340+
sudo apt install build-essential
341+
sudo apt install libgl-dev
342+
sudo apt install cmake
343+
sudo apt install git
344+
```
345+
346+
### 2. Setup Qt 6.7.2
347+
348+
#### Install pre-requisites (Pip and Pipx)
349+
350+
```
351+
sudo apt install python3-pip pipx
352+
pipx ensurepath
353+
```
354+
355+
Now install `aqt`, a command line package manager for `Qt`:
356+
357+
```
358+
pipx install aqtinstall
359+
```
360+
361+
#### Install required Qt packages
362+
363+
To see the available Qt versions run:
364+
365+
```
366+
aqt list-qt linux desktop
367+
```
368+
369+
To see the available compiler versions run:
370+
371+
```
372+
aqt list-qt linux desktop --arch 6.7.2
373+
```
374+
375+
Install the required packages:
289376

377+
```
378+
aqt install-qt --outputdir ~/Qt linux desktop 6.7.2 linux_gcc_64 --archives qtbase qttools
379+
aqt install-qt --outputdir ~/Qt linux desktop 6.7.2 linux_gcc_64 --modules debug_info
380+
```
381+
382+
### 3. Clone Git Repo
383+
384+
Clone the repository to `~/usb-sd-creator`
385+
`git clone https://github.com/LibreELEC/usb-sd-creator.git`
386+
387+
### 4. Build USB-SD-Creator
388+
389+
Assuming the repo is in your home directory
390+
391+
```
392+
cd ~/usb-sd-creator
393+
```
394+
395+
#### Debug build
396+
397+
```
398+
cmake -S . -B build -D CMAKE_PREFIX_PATH="~/Qt/6.7.2/gcc_64" && cmake --build build
399+
```
400+
401+
#### Release build
290402

403+
```
404+
cmake --preset release -D CMAKE_PREFIX_PATH="~/Qt/6.7.2/gcc_64" && cmake --build --preset release
405+
```
406+
407+
### 5. Run USB-SD-Creator
408+
409+
#### Command line
410+
411+
Run the app from the command line, that will prompt for a password:
412+
413+
```
414+
./build/LibreELEC.USB-SD.Creator.Linux.bin
415+
```
416+
417+
### 6. Build Install Package
418+
419+
If you wish to build the install package (not required for development), you can create tarballs using:
420+
421+
#### Debug build
422+
423+
```
424+
cd build
425+
cpack -C Debug
426+
```
427+
428+
#### Release build
429+
430+
```
431+
cpack --preset release
432+
```

0 commit comments

Comments
 (0)