Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format cleanup #66

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 80 additions & 80 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,88 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
platform: linux
- os: macos-latest
platform: macos
preset: release-macos
cpack: true
- os: windows-latest
platform: windows-msvc
preset: release-msvc
cpack: true
useQtAction: true
- os: windows-latest
platform: windows-mingw
preset: release-ninja
- os: ubuntu-22.04
platform: linux
- os: macos-latest
platform: macos
preset: release-macos
cpack: true
- os: windows-latest
platform: windows-msvc
preset: release-msvc
cpack: true
useQtAction: true
- os: windows-latest
platform: windows-mingw
preset: release-ninja
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
shell: bash
run: |
setupScript='ci/${{ matrix.platform }}/setup.sh'
[ ! -f "$setupScript" ] || "$setupScript"
env:
MACOS_ASC_API_KEY: ${{ secrets.MACOS_ASC_API_KEY }}
MACOS_CODE_SIGN_KEY_BASE64: ${{ secrets.MACOS_CODE_SIGN_KEY_BASE64 }}
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Setup
shell: bash
run: |
setupScript='ci/${{ matrix.platform }}/setup.sh'
[ ! -f "$setupScript" ] || "$setupScript"
env:
MACOS_ASC_API_KEY: ${{ secrets.MACOS_ASC_API_KEY }}
MACOS_CODE_SIGN_KEY_BASE64: ${{ secrets.MACOS_CODE_SIGN_KEY_BASE64 }}
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}

- name: Install Qt
uses: jurplel/install-qt-action@v3
if: ${{ matrix.useQtAction }}
with:
version: '6.6.2'
arch: 'win64_msvc2019_64'
archives: 'qtbase qttools opengl32sw d3dcompiler_47'
extra: '--external 7z'
cache: true
setup-python: false
- name: Prepare MSVC environment
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.platform == 'windows-msvc' }}
with:
arch: x64
toolset: 14.29
- name: Install Qt
uses: jurplel/install-qt-action@v3
if: ${{ matrix.useQtAction }}
with:
version: "6.6.2"
arch: "win64_msvc2019_64"
archives: "qtbase qttools opengl32sw d3dcompiler_47"
extra: "--external 7z"
Comment on lines +42 to +45
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess quotes can be omitted completely

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes/no, it will likely work without quotes too but in general quotes are wanted - also shown at the official GHA examples etc so won't hurt doing proper gha/yml

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, we don't use them in other places. Either they should be used everywhere or nowhere at all.

cache: true
setup-python: false
- name: Prepare MSVC environment
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.platform == 'windows-msvc' }}
with:
arch: x64
toolset: 14.29

- name: Setup msys2
uses: msys2/setup-msys2@v2
if: ${{ matrix.platform == 'windows-mingw' }}
with:
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-tools
- name: Put MSYS2_MinGW64 on PATH
if: ${{ matrix.platform == 'windows-mingw' }}
run: |
echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Setup msys2
uses: msys2/setup-msys2@v2
if: ${{ matrix.platform == 'windows-mingw' }}
with:
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-tools
- name: Put MSYS2_MinGW64 on PATH
if: ${{ matrix.platform == 'windows-mingw' }}
run: |
echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Configure
run: |
cmake --preset ${{ matrix.preset || 'release' }}
- name: Build
run: |
cmake --build --preset release
- name: Configure
run: |
cmake --preset ${{ matrix.preset || 'release' }}
- name: Build
run: |
cmake --build --preset release

- name: Pack
if: ${{ matrix.cpack }}
run: |
cpack --preset release
env:
ASC_API_KEY_ID: ${{ secrets.MACOS_ASC_API_KEY_ID }}
ASC_API_KEY_ISSUER: ${{ secrets.MACOS_ASC_API_KEY_ISSUER }}
ASC_TEAM_ID: ${{ secrets.MACOS_ASC_TEAM_ID }}
- name: Pack zip
if: ${{ matrix.platform == 'windows-msvc' }}
run: |
cpack --preset release -G ZIP
- name: Artifact
uses: actions/upload-artifact@v4
with:
path: build/cpack/LibreELEC.USB-SD.Creator.*
name: ${{ matrix.platform }}
compression-level: 0
- name: Pack
if: ${{ matrix.cpack }}
run: |
cpack --preset release
env:
ASC_API_KEY_ID: ${{ secrets.MACOS_ASC_API_KEY_ID }}
ASC_API_KEY_ISSUER: ${{ secrets.MACOS_ASC_API_KEY_ISSUER }}
ASC_TEAM_ID: ${{ secrets.MACOS_ASC_TEAM_ID }}
- name: Pack zip
if: ${{ matrix.platform == 'windows-msvc' }}
run: |
cpack --preset release -G ZIP
- name: Artifact
uses: actions/upload-artifact@v4
with:
path: build/cpack/LibreELEC.USB-SD.Creator.*
name: ${{ matrix.platform }}
compression-level: 0
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,66 @@ This is a lightweight image writing app with a simple four-step GUI for creating

## Translation Changes

Changes to master language (en_GB) strings can be submitted via pull request to this GitHub repo. English strings are periodically synchronised to a Transifex project: https://www.transifex.com/libreelec/libreelec-usb-sd-creator allowing contributors to translate them into other languages. Translated strings are periodically synchronised from Transifex back to this repo for inclusion in the next release.
Changes to master language (en_GB) strings can be submitted via pull request to this GitHub repo. English strings are periodically synchronised to a Transifex project: <https://www.transifex.com/libreelec/libreelec-usb-sd-creator> allowing contributors to translate them into other languages. Translated strings are periodically synchronised from Transifex back to this repo for inclusion in the next release.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better place link on text

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<http...> is valid markdown for just links, current formatting is not

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, link embedded in text would be more readable in this case

FYI for GFMD angle brackets aren't needed: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#urls


Pull requests for all other languages will be rejected. You will be asked to submit changes via Transifex.

## Translation Languages

Requests for new languages should be made on Transifex. Once a new language has been approved it will be added to the translation project where you can conribute translated strings.
Requests for new languages should be made on Transifex. Once a new language has been approved it will be added to the translation project where you can contribute translated strings.

Please note: languages are translated by people (you) not magic!

## Issues and Support

Issues should be reported via the forum here: https://forum.libreelec.tv/board/41-usb-sd-creator-support
Issues should be reported via the forum here: <https://forum.libreelec.tv/board/41-usb-sd-creator-support>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not clear why the angle brackets are needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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

# Windows
## Windows

### 1. install "Qt Online Installer"

select: Custom install -> select QT 6.6.2 -> disable all besides MinGW
Install to `C:\QT`

### 2. Install 7zip
https://www.7-zip.org/download.html

<https://www.7-zip.org/download.html>
CvH marked this conversation as resolved.
Show resolved Hide resolved

### 3. Install Git
https://git-scm.com/download/win

<https://git-scm.com/download/win>

### 4. Install Ruby
https://rubyinstaller.org/downloads/ select "WITHOUT DEVKIT" for download

<https://rubyinstaller.org/downloads/> select "WITHOUT DEVKIT" for download

### 5. Install Perl
https://www.activestate.com/products/perl/ (needs registration) or

https://www.softpedia.com/get/Programming/Coding-languages-Compilers/ActivePerl.shtml
<https://www.activestate.com/products/perl/> (needs registration) or

<https://www.softpedia.com/get/Programming/Coding-languages-Compilers/ActivePerl.shtml>

### 6. Install Python
https://www.python.org/downloads/windows/ select Windows installer (64-bit) for download

<https://www.python.org/downloads/windows/> select Windows installer (64-bit) for download
at install select "Add Python to PATH"

### 7. Add programs to PATH variable

`C:\Qt\Tools\Ninja`
`C:\Qt\Tools\Ninja`
`C:\Qt\Tools\CMake_64\bin`

reboot Windows

### 8. Clone Git Repo
Clone the repository to `C:\usb-sd-creator`

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

### 9. Enable powershell script execution

Open cmd with admin rights
`powershell Set-ExecutionPolicy RemoteSigned`

Expand All @@ -69,12 +77,11 @@ Open powershell at C:\usb-sd-creator
After the compiling is finished the files are located at `C:\Qt\static\$version` .

### 11. Build USB-SD-Creator
Open a cmd at `C:\usb-sd-creator` and run `windows_build.bat`.
The finished executable is located at `C:\usb-sd-creator\releases`.

# MacOS
Open a cmd at `C:\usb-sd-creator` and run `windows_build.bat`.
The finished executable is located at `C:\usb-sd-creator\releases`.

### Building for MacOS
## MacOS

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

Expand All @@ -84,7 +91,7 @@ The finished executable is located at `C:\usb-sd-creator\releases`.

Open a command prompt and type the following in the console:

```
```shell
mkdir -p ~/Downloads ~/Qt
cd ~/Downloads

Expand All @@ -104,14 +111,15 @@ TODO

Assuming the repo is in your home directory

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

./osx_build.sh
```

If building again cleanup using:
```

```shell
./osx_clean.sh
```

Expand All @@ -124,14 +132,15 @@ Simply double click the app from a finder window in the root of the repo: `Libre
#### Command line

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

```shell
./LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
```

**Or:**

Run the app from the command line using sudo

```
```shell
sudo ./LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
```
10 changes: 5 additions & 5 deletions ci/linux/setup.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh

sudo add-apt-repository universe -y
sudo apt update -y
sudo apt install -y cmake \
sudo apt-get update -y -qq
sudo apt-get install -y -qq cmake \
gcc \
g++ \
libgl1-mesa-dev \
qt6-base-dev \
qt6-l10n-tools \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-wayland-dev \
qt6-wayland-dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the backslash intentionally :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this achieve ? from bash perspective its just adding a useless space character at the end of the command

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add another line (package) below this one in the future, you won't have to modify this line. JSON format from such issue for example - you can't add comma after last element in object/array.


echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
echo "CC=gcc" >>$GITHUB_ENV
echo "CXX=g++" >>$GITHUB_ENV
14 changes: 7 additions & 7 deletions ci/macos/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
brew install ninja

cd ..
for module in base tools ; do
for module in base tools; do
archive="$module.7z"
curl -L -o "$archive" "https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt6_662/qt.qt6.662.clang_64/6.6.2-0-202402121131qt$module-MacOS-MacOS_13-Clang-MacOS-MacOS_13-X86_64-ARM64.7z"
curl -sS -L -o "$archive" "https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt6_662/qt.qt6.662.clang_64/6.6.2-0-202402121131qt$module-MacOS-MacOS_13-Clang-MacOS-MacOS_13-X86_64-ARM64.7z"
7z x "$archive" '-xr!*.dSYM'
done
echo "CMAKE_PREFIX_PATH=$PWD/$(ls -1 | fgrep 6.)/macos" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$PWD/$(ls -1 | fgrep 6.)/macos" >>$GITHUB_ENV

if [ "$MACOS_ASC_API_KEY" ]; then
ascApiKey='ascApiKey.p8'
echo "$MACOS_ASC_API_KEY" > "$ascApiKey"
echo "ASC_API_KEY_PATH=$PWD/$ascApiKey" >> $GITHUB_ENV
echo "$MACOS_ASC_API_KEY" >"$ascApiKey"
echo "ASC_API_KEY_PATH=$PWD/$ascApiKey" >>$GITHUB_ENV
fi

if [[ "$MACOS_CODE_SIGN_KEY_BASE64" && "$MACOS_KEYCHAIN_PASSWORD" ]]; then
codesignKey='codesign.p12'
echo "$MACOS_CODE_SIGN_KEY_BASE64" | base64 --decode > "$codesignKey"
echo "CODE_SIGN_IDENTITY=Developer ID Application: Kodi Foundation" >> $GITHUB_ENV
echo "$MACOS_CODE_SIGN_KEY_BASE64" | base64 --decode >"$codesignKey"
echo "CODE_SIGN_IDENTITY=Developer ID Application: Kodi Foundation" >>$GITHUB_ENV

keychainPath='build.keychain'
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" "$keychainPath"
Expand Down
7 changes: 3 additions & 4 deletions dmg_osx/codesign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# working directory - .app/Contents

if [ -z "$CODE_SIGN_IDENTITY" ] ; then
if [ -z "$CODE_SIGN_IDENTITY" ]; then
echo 'skip signing - no code sign identity provided in CODE_SIGN_IDENTITY'
exit 0
fi
Expand All @@ -11,14 +11,13 @@ function sign {
codesign --verbose=4 --force --timestamp --options=runtime --sign "$CODE_SIGN_IDENTITY" "$1"
}


echo 'sign frameworks'
for framework in Frameworks/*.framework ; do
for framework in Frameworks/*.framework; do
sign "$framework"
done

echo 'sign dylibs'
for lib in $(find PlugIns -type f -iname '*.dylib') ; do
for lib in $(find PlugIns -type f -iname '*.dylib'); do
sign "$lib"
done

Expand Down
Loading
Loading