From 3ae8cc15f6d066f301a4a7659207d04c599c6284 Mon Sep 17 00:00:00 2001 From: CvH <1355173+CvH@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:58:04 +0100 Subject: [PATCH 1/4] [ci]: less verbose dep install --- ci/linux/setup.sh | 4 ++-- ci/macos/setup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/linux/setup.sh b/ci/linux/setup.sh index 16da6c5..fadaac5 100755 --- a/ci/linux/setup.sh +++ b/ci/linux/setup.sh @@ -1,8 +1,8 @@ #!/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 \ diff --git a/ci/macos/setup.sh b/ci/macos/setup.sh index 2b4774c..66c36e3 100755 --- a/ci/macos/setup.sh +++ b/ci/macos/setup.sh @@ -5,7 +5,7 @@ brew install ninja cd .. 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 From e1dc0d383b30a84b7dcd646bd105e59db3f94cb6 Mon Sep 17 00:00:00 2001 From: CvH <1355173+CvH@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:58:38 +0100 Subject: [PATCH 2/4] [ci] bash format fixes --- ci/linux/setup.sh | 6 +++--- ci/macos/setup.sh | 12 ++++++------ dmg_osx/codesign.sh | 7 +++---- dmg_osx/notarize.sh | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ci/linux/setup.sh b/ci/linux/setup.sh index fadaac5..a207f92 100755 --- a/ci/linux/setup.sh +++ b/ci/linux/setup.sh @@ -10,7 +10,7 @@ sudo apt-get install -y -qq cmake \ qt6-l10n-tools \ qt6-tools-dev \ qt6-tools-dev-tools \ - qt6-wayland-dev \ + qt6-wayland-dev -echo "CC=gcc" >> $GITHUB_ENV -echo "CXX=g++" >> $GITHUB_ENV +echo "CC=gcc" >>$GITHUB_ENV +echo "CXX=g++" >>$GITHUB_ENV diff --git a/ci/macos/setup.sh b/ci/macos/setup.sh index 66c36e3..d971475 100755 --- a/ci/macos/setup.sh +++ b/ci/macos/setup.sh @@ -3,23 +3,23 @@ brew install ninja cd .. -for module in base tools ; do +for module in base tools; do archive="$module.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" diff --git a/dmg_osx/codesign.sh b/dmg_osx/codesign.sh index f5f825e..b71c42b 100755 --- a/dmg_osx/codesign.sh +++ b/dmg_osx/codesign.sh @@ -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 @@ -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 diff --git a/dmg_osx/notarize.sh b/dmg_osx/notarize.sh index b2b249e..d4427c4 100755 --- a/dmg_osx/notarize.sh +++ b/dmg_osx/notarize.sh @@ -2,14 +2,14 @@ dmgPath="$1" -if [ -z "$CODE_SIGN_IDENTITY" ] ; then +if [ -z "$CODE_SIGN_IDENTITY" ]; then echo 'skip dmg signing & notarization - no code sign identity provided in CODE_SIGN_IDENTITY' exit 0 fi echo 'sign dmg' codesign --verbose=4 --force --sign "$CODE_SIGN_IDENTITY" "$dmgPath" -if [[ -z "$ASC_API_KEY_PATH" || -z "$ASC_API_KEY_ID" || -z "$ASC_API_KEY_ISSUER" || -z "$ASC_TEAM_ID" ]] ; then +if [[ -z "$ASC_API_KEY_PATH" || -z "$ASC_API_KEY_ID" || -z "$ASC_API_KEY_ISSUER" || -z "$ASC_TEAM_ID" ]]; then echo 'skip dmg notarization - ASC_API_KEY_PATH / ASC_API_KEY_ID / ASC_API_KEY_ISSUER / ASC_TEAM_ID not provided' exit 0 fi From 182e109a2b600178fbf806cb8c247d1a558ab066 Mon Sep 17 00:00:00 2001 From: CvH <1355173+CvH@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:01:17 +0100 Subject: [PATCH 3/4] [ci] gha format fixes --- .github/workflows/build.yaml | 160 +++++++++++++++++------------------ 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7c4a8af..d3fd0a6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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" + 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 From 7e9f79eb8404d78b9964b9aa19a13147aa3a614e Mon Sep 17 00:00:00 2001 From: CvH <1355173+CvH@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:38:06 +0100 Subject: [PATCH 4/4] markdown format fixes --- README.md | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index ba113d3..1eb67c6 100644 --- a/README.md +++ b/README.md @@ -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: 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. 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: # **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 + + ### 3. Install Git -https://git-scm.com/download/win + + ### 4. Install Ruby -https://rubyinstaller.org/downloads/ select "WITHOUT DEVKIT" for download + + 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 + (needs registration) or + + ### 6. Install Python -https://www.python.org/downloads/windows/ select Windows installer (64-bit) for download + + 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` @@ -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 @@ -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 @@ -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 ``` @@ -124,7 +132,8 @@ 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 ``` @@ -132,6 +141,6 @@ Run the app from the command line, that will prompt for a password: Run the app from the command line using sudo -``` +```shell sudo ./LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator ```