diff --git a/.github/actions/package/linux/action.yml b/.github/actions/package/linux/action.yml index 9a26fde79..22ee9d6f6 100644 --- a/.github/actions/package/linux/action.yml +++ b/.github/actions/package/linux/action.yml @@ -37,14 +37,20 @@ runs: # Fixup architecture naming for AppImages dpkg_arch="$(dpkg-architecture -q DEB_HOST_ARCH_CPU)" case "$dpkg_arch" in - "amd64") + amd64) APPIMAGE_ARCH="x86_64" ;; - "arm64") + arm64) APPIMAGE_ARCH="aarch64" ;; + i386|i686) + APPIMAGE_ARCH="i386" + ;; + armhf|armv7l) + APPIMAGE_ARCH="armhf" + ;; *) - echo "# 🚨 The Debian architecture \"$deb_arch\" is not recognized!" >> "$GITHUB_STEP_SUMMARY" + echo "# 🚨 The Debian architecture \"$dpkg_arch\" is not recognized!" >> "$GITHUB_STEP_SUMMARY" exit 1 ;; esac @@ -67,14 +73,61 @@ runs: mv ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/metainfo/org.sogik.NMCLauncher.metainfo.xml ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/metainfo/org.sogik.NMCLauncher.appdata.xml export "NO_APPSTREAM=1" # we have to skip appstream checking because appstream on ubuntu 20.04 is outdated - export OUTPUT="NMCLauncher-Linux-$APPIMAGE_ARCH.AppImage" - - chmod +x linuxdeploy-*.AppImage + # Use artifact-name to differentiate between build variants (Linux, Linux+LTO, Linux-Clang, etc.) + ARTIFACT_SUFFIX="" + if [ -n "${{ inputs.artifact-name }}" ]; then + ARTIFACT_SUFFIX="-${{ inputs.artifact-name }}" + fi + export OUTPUT="NMCLauncher${ARTIFACT_SUFFIX}-$APPIMAGE_ARCH.AppImage" + + # Ensure linuxdeploy AppImage exists or attempt to download for this arch + LD_FILE="$(ls linuxdeploy-*.AppImage 2>/dev/null | head -n1 || true)" + if [ -z "$LD_FILE" ]; then + echo "::warning::linuxdeploy AppImage not present; attempting to download for $APPIMAGE_ARCH" + case "$APPIMAGE_ARCH" in + x86_64) LD_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage" ;; + aarch64) LD_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-aarch64.AppImage" ;; + i386) LD_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-i386.AppImage" ;; + *) LD_URL="" ;; + esac + if [ -n "$LD_URL" ]; then + curl -L -o linuxdeploy-$APPIMAGE_ARCH.AppImage "$LD_URL" + chmod +x linuxdeploy-$APPIMAGE_ARCH.AppImage + LD_FILE="linuxdeploy-$APPIMAGE_ARCH.AppImage" + else + echo "::error::No linuxdeploy AppImage available for $APPIMAGE_ARCH" + exit 1 + fi + else + chmod +x "$LD_FILE" + fi mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines - cp -r ${{ runner.workspace }}/Qt/${{ inputs.qt-version }}/gcc_*64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines + # Locate installed Qt directory that matches inputs.qt-version (e.g. "6" -> "6.8.1") + QT_BASE="${{ runner.workspace }}/Qt" + QT_DIR="" + # direct match first + if [ -d "$QT_BASE/${{ inputs.qt-version }}" ]; then + QT_DIR="$QT_BASE/${{ inputs.qt-version }}" + else + # try prefix match (6 -> 6.8.1) + QT_DIR=$(find "$QT_BASE" -maxdepth 1 -type d -name "${{ inputs.qt-version }}*" | head -n1 || true) + fi + if [ -z "$QT_DIR" ] || [ ! -d "$QT_DIR" ]; then + echo "# 🚨 Qt directory for version '${{ inputs.qt-version }}' not found under $QT_BASE" >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi + + # find matching compiler dir (gcc_64 or gcc_*64) + PLUGIN_SRC=$(ls -d "$QT_DIR"/gcc_*64/plugins/iconengines 2>/dev/null | head -n1 || true) + if [ -z "$PLUGIN_SRC" ] || [ ! -d "$PLUGIN_SRC" ]; then + echo "# 🚨 Qt iconengines not found in $QT_DIR (looked for $QT_DIR/gcc_*64/plugins/iconengines)" >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi + + cp -r "$PLUGIN_SRC"/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines cp /usr/lib/"$DEB_HOST_MULTIARCH"/libcrypto.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/ cp /usr/lib/"$DEB_HOST_MULTIARCH"/libssl.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/ @@ -83,10 +136,21 @@ runs: LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib" export LD_LIBRARY_PATH - chmod +x AppImageUpdate-"$APPIMAGE_ARCH".AppImage - cp AppImageUpdate-"$APPIMAGE_ARCH".AppImage ${{ env.INSTALL_APPIMAGE_DIR }}/usr/bin + # Make AppImageUpdate optional (copy if present) + if [ -f "AppImageUpdate-$APPIMAGE_ARCH.AppImage" ]; then + chmod +x "AppImageUpdate-$APPIMAGE_ARCH.AppImage" + cp "AppImageUpdate-$APPIMAGE_ARCH.AppImage" "${{ env.INSTALL_APPIMAGE_DIR }}/usr/bin/" || true + echo "✅ Added AppImageUpdate-$APPIMAGE_ARCH.AppImage" + else + echo "::warning::AppImageUpdate-$APPIMAGE_ARCH.AppImage not found; skipping" + fi - export UPDATE_INFORMATION="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|NMCLauncher-Linux-$APPIMAGE_ARCH.AppImage.zsync" + # Update information with variant suffix for zsync + ARTIFACT_SUFFIX="" + if [ -n "${{ inputs.artifact-name }}" ]; then + ARTIFACT_SUFFIX="-${{ inputs.artifact-name }}" + fi + export UPDATE_INFORMATION="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|NMCLauncher${ARTIFACT_SUFFIX}-$APPIMAGE_ARCH.AppImage.zsync" if [ '${{ inputs.gpg-private-key-id }}' != '' ]; then export SIGN=1 @@ -98,9 +162,47 @@ runs: echo ":warning: Skipped code signing for Linux AppImage, as gpg key was not present." >> $GITHUB_STEP_SUMMARY fi - ./linuxdeploy-"$APPIMAGE_ARCH".AppImage --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/icons/hicolor/scalable/apps/org.sogik.NMCLauncher.svg + # Run linuxdeploy and capture exit code + "$LD_FILE" --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/icons/hicolor/scalable/apps/org.sogik.NMCLauncher.svg + linuxdeploy_rc=$? + echo "linuxdeploy exit code: $linuxdeploy_rc" + + if [ $linuxdeploy_rc -ne 0 ]; then + echo "::error::linuxdeploy failed with exit code $linuxdeploy_rc" + echo "Current directory contents:" + ls -la + echo "install-appdir contents:" + ls -la ${{ env.INSTALL_APPIMAGE_DIR }} || true + # Show log if available + if [ -f linuxdeploy.log ]; then + echo "---- linuxdeploy.log (last 200 lines) ----" + tail -n 200 linuxdeploy.log || true + fi + exit $linuxdeploy_rc + fi + + # Find the produced AppImage (exclude tool AppImages) + found=$(ls -1 *.AppImage 2>/dev/null | grep -Ev '(linuxdeploy|AppImageUpdate|plugin-qt)' | head -n1 || true) + + if [ -z "$found" ]; then + echo "::error::AppImage not found. Searching for any NMCLauncher AppImage..." + echo "Current directory contents:" + ls -la + echo "All AppImages found:" + ls -1 *.AppImage 2>/dev/null || echo "No AppImages found" + echo "install-appdir contents:" + ls -la ${{ env.INSTALL_APPIMAGE_DIR }} || true + exit 1 + fi - mv "NMCLauncher-Linux-$APPIMAGE_ARCH.AppImage" "NMCLauncher-Linux-${{ env.VERSION }}-${{ inputs.build-type }}-$APPIMAGE_ARCH.AppImage" + echo "Found AppImage: $found" + + # Rename with artifact-name suffix to match expected output + ARTIFACT_SUFFIX="" + if [ -n "${{ inputs.artifact-name }}" ]; then + ARTIFACT_SUFFIX="-${{ inputs.artifact-name }}" + fi + mv "$found" "NMCLauncher${ARTIFACT_SUFFIX}-${{ env.VERSION }}-${{ inputs.build-type }}-$APPIMAGE_ARCH.AppImage" - name: Package portable tarball shell: bash @@ -127,11 +229,11 @@ runs: - name: Upload AppImage uses: actions/upload-artifact@v4 with: - name: NMCLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage - path: NMCLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage + name: NMCLauncher-${{ inputs.artifact-name }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage + path: NMCLauncher-${{ inputs.artifact-name }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage - name: Upload AppImage Zsync uses: actions/upload-artifact@v4 with: - name: NMCLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync - path: NMCLauncher-${{ runner.os }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync + name: NMCLauncher-${{ inputs.artifact-name }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync + path: NMCLauncher-${{ inputs.artifact-name }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync diff --git a/.github/actions/package/windows/action.yml b/.github/actions/package/windows/action.yml index 8e1d34757..408b1352f 100644 --- a/.github/actions/package/windows/action.yml +++ b/.github/actions/package/windows/action.yml @@ -106,12 +106,58 @@ runs: New-Item -Name NSISPlugins -ItemType Directory Invoke-Webrequest https://github.com/negrutiu/nsis-nscurl/releases/download/"${{ env.NSCURL_VERSION }}"/NScurl.zip -OutFile NSISPlugins\NScurl.zip $nscurl_hash = Get-FileHash NSISPlugins\NScurl.zip -Algorithm Sha256 | Select-Object -ExpandProperty Hash - if ( $nscurl_hash -ne "${{ env.nscurl_sha256 }}") { + if ( $nscurl_hash -ne "${{ env.NSCURL_SHA256 }}") { echo "::error:: NSCurl.zip sha256 mismatch" exit 1 } Expand-Archive -Path NSISPlugins\NScurl.zip -DestinationPath NSISPlugins\NScurl + # Pre-flight check: verify install directory contents + Write-Host "📦 Inspecting install directory: $env:INSTALL_DIR" + Get-ChildItem $env:INSTALL_DIR -Recurse | Select-Object FullName, Length | ForEach-Object { Write-Host $_.FullName } + + # Check for required files (updater may be optional depending on build config) + $updaterPath = Join-Path $env:INSTALL_DIR "nmclauncher_updater.exe" + if (-not (Test-Path $updaterPath)) { + Write-Host "::warning:: nmclauncher_updater.exe not found in $env:INSTALL_DIR" + Write-Host "Checking build directory for updater..." + + # Candidate updater locations (each Join-Path parenthesized to ensure a string result) + $possibleLocations = @( + (Join-Path $env:BUILD_DIR 'Release\nmclauncher_updater.exe'), + (Join-Path $env:BUILD_DIR 'Debug\nmclauncher_updater.exe'), + (Join-Path $env:BUILD_DIR 'nmclauncher_updater.exe') + ) + + Write-Host "Searching for updater in: $($possibleLocations -join ', ')" + + $found = $null + foreach ($p in $possibleLocations) { + if (Test-Path $p) { $found = $p; break } + } + + # Fallback: search build tree if not found in common locations + if (-not $found) { + Write-Host "Updater not found in candidate locations; searching build tree..." + $hit = Get-ChildItem $env:BUILD_DIR -Recurse -Filter 'nmclauncher_updater.exe' -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($hit) { + $found = $hit.FullName + Write-Host "Found updater at: $found" + } + } + + if ($found) { + Copy-Item $found $env:INSTALL_DIR + Write-Host "✅ Copied updater from $found to $env:INSTALL_DIR" + } else { + Write-Host "⚠️ Updater not found in build tree - installer may not include auto-update functionality" + Write-Host "Build tree contents:" + Get-ChildItem $env:BUILD_DIR -Recurse -Filter "*.exe" | ForEach-Object { Write-Host $_.FullName } + } + } else { + Write-Host "✅ Found nmclauncher_updater.exe" + } + cd ${{ env.INSTALL_DIR }} makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi" diff --git a/.github/actions/setup-dependencies/action.yml b/.github/actions/setup-dependencies/action.yml index 405f524c4..7d02a50d8 100644 --- a/.github/actions/setup-dependencies/action.yml +++ b/.github/actions/setup-dependencies/action.yml @@ -53,7 +53,7 @@ runs: # TODO(@getchoo): Get this working on MSYS2! - name: Setup ccache - if: ${{ (runner.os != 'Windows' || inputs.msystem == '') && inputs.build-type == 'Debug' }} + if: ${{ (runner.os != 'Windows' || inputs.msystem != '') && inputs.build-type == 'Debug' }} uses: hendrikmuhs/ccache-action@v1.2.18 with: variant: sccache @@ -61,10 +61,9 @@ runs: key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.artifact-name }}-sccache - name: Use ccache on debug builds - if: ${{ inputs.build-type == 'Debug' }} + if: ${{ (runner.os != 'Windows' || inputs.msystem != '') && inputs.build-type == 'Debug' }} shell: bash env: - # Only use ccache on MSYS2 CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem != '') && 'ccache' || 'sccache' }} run: | echo "CMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66ca987f2..ee79e1763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,52 +73,121 @@ jobs: fail-fast: false matrix: include: + # Linux - GCC (standard) - os: ubuntu-22.04 artifact-name: Linux base-cmake-preset: linux - # NOTE(@getchoo): Yes, we're intentionally using 24.04 here!!! - # - # It's not really documented anywhere AFAICT, but upstream Qt binaries - # *for the same version* are compiled against 24.04 on ARM, and *not* 22.04 like x64 + # Linux - GCC + LTO + - os: ubuntu-22.04 + artifact-name: Linux+LTO + base-cmake-preset: linux + enable-lto: true + + # Linux - Clang + - os: ubuntu-22.04 + artifact-name: Linux-Clang + base-cmake-preset: linux + use-clang: true + + # Linux ARM - os: ubuntu-24.04-arm artifact-name: Linux-aarch64 base-cmake-preset: linux + # Linux ARM + LTO + - os: ubuntu-24.04-arm + artifact-name: Linux-aarch64+LTO + base-cmake-preset: linux + enable-lto: true + + # Windows MinGW (standard) - os: windows-2022 artifact-name: Windows-MinGW-w64 base-cmake-preset: windows_mingw msystem: CLANG64 vcvars-arch: amd64_x86 + # Windows MinGW + LTO + - os: windows-2022 + artifact-name: Windows-MinGW-w64+LTO + base-cmake-preset: windows_mingw + msystem: CLANG64 + vcvars-arch: amd64_x86 + enable-lto: true + + # Windows MinGW ARM - os: windows-11-arm artifact-name: Windows-MinGW-arm64 base-cmake-preset: windows_mingw msystem: CLANGARM64 vcvars-arch: arm64 + # Windows MinGW ARM + LTO + - os: windows-11-arm + artifact-name: Windows-MinGW-arm64+LTO + base-cmake-preset: windows_mingw + msystem: CLANGARM64 + vcvars-arch: arm64 + enable-lto: true + + # Windows MSVC (standard) - os: windows-2022 artifact-name: Windows-MSVC base-cmake-preset: windows_msvc - # TODO(@getchoo): This is the default in setup-dependencies/windows. Why isn't it working?!?! vcvars-arch: amd64 + # Windows MSVC + LTO + - os: windows-2022 + artifact-name: Windows-MSVC+LTO + base-cmake-preset: windows_msvc + vcvars-arch: amd64 + enable-lto: true + + # Windows MSVC ARM64 - os: windows-2022 artifact-name: Windows-MSVC-arm64 base-cmake-preset: windows_msvc_arm64_cross vcvars-arch: amd64_arm64 qt-architecture: win64_msvc2022_arm64_cross_compiled + # Windows MSVC ARM64 + LTO + - os: windows-2022 + artifact-name: Windows-MSVC-arm64+LTO + base-cmake-preset: windows_msvc_arm64_cross + vcvars-arch: amd64_arm64 + qt-architecture: win64_msvc2022_arm64_cross_compiled + enable-lto: true + + # Windows Clang + - os: windows-2022 + artifact-name: Windows-Clang + base-cmake-preset: windows_msvc + vcvars-arch: amd64 + use-clang: true + + # Windows Clang + LTO + - os: windows-2022 + artifact-name: Windows-Clang+LTO + base-cmake-preset: windows_msvc + vcvars-arch: amd64 + use-clang: true + enable-lto: true + + # macOS (standard) - os: macos-14 artifact-name: macOS base-cmake-preset: ${{ (inputs.build-type || 'Debug') == 'Debug' && 'macos_universal' || 'macos' }} macosx-deployment-target: 12.0 - runs-on: ${{ matrix.os }} + # macOS + LTO + - os: macos-14 + artifact-name: macOS+LTO + base-cmake-preset: ${{ (inputs.build-type || 'Debug') == 'Debug' && 'macos_universal' || 'macos' }} + macosx-deployment-target: 12.0 + enable-lto: true - defaults: - run: - shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} + runs-on: ${{ matrix.os }} env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx-deployment-target }} @@ -133,6 +202,14 @@ jobs: with: submodules: true + - name: Install Clang (Linux) + if: ${{ runner.os == 'Linux' && matrix.use-clang }} + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 18 + sudo apt-get install -y lld-18 + - name: Setup dependencies id: setup-dependencies uses: ./.github/actions/setup-dependencies @@ -142,6 +219,9 @@ jobs: msystem: ${{ matrix.msystem }} vcvars-arch: ${{ matrix.vcvars-arch }} qt-architecture: ${{ matrix.qt-architecture }} + env: + CC: ${{ matrix.use-clang && runner.os == 'Linux' && 'clang-18' || '' }} + CXX: ${{ matrix.use-clang && runner.os == 'Linux' && 'clang++-18' || '' }} - name: Export CurseForge API Key run: echo "CURSEFORGE_API_KEY=${{ secrets.CURSEFORGE_API_KEY }}" >> $GITHUB_ENV @@ -155,20 +235,119 @@ jobs: - name: Get CMake preset id: cmake-preset + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} env: BASE_CMAKE_PRESET: ${{ matrix.base-cmake-preset }} PRESET_TYPE: ${{ (inputs.build-type || 'Debug') == 'Debug' && 'debug' || 'ci' }} run: | echo preset="$BASE_CMAKE_PRESET"_"$PRESET_TYPE" >> "$GITHUB_OUTPUT" - - name: Run CMake workflow + - name: Configure CMake with optimizations (Windows MSVC) + if: ${{ runner.os == 'Windows' && (matrix.base-cmake-preset == 'windows_msvc' || matrix.base-cmake-preset == 'windows_msvc_arm64_cross') }} + shell: cmd + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + ENABLE_LTO: ${{ matrix.enable-lto || 'false' }} + USE_CLANG: ${{ matrix.use-clang || 'false' }} + run: | + set "CMAKE_EXTRA_FLAGS=" + if "%ENABLE_LTO%"=="true" set "CMAKE_EXTRA_FLAGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" + if "%USE_CLANG%"=="true" ( + set "CC=clang-cl" + set "CXX=clang-cl" + ) + if defined VSINSTALLDIR ( + call "%VSINSTALLDIR%VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) else ( + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) + cmake --preset "%CMAKE_PRESET%" %CMAKE_EXTRA_FLAGS% + + - name: Configure CMake with optimizations (Linux/macOS/MinGW) + if: ${{ runner.os != 'Windows' || (matrix.base-cmake-preset != 'windows_msvc' && matrix.base-cmake-preset != 'windows_msvc_arm64_cross') }} + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} env: CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + ENABLE_LTO: ${{ matrix.enable-lto || 'false' }} + USE_CLANG: ${{ matrix.use-clang || 'false' }} + run: | + CMAKE_EXTRA_FLAGS="" + + if [ "$ENABLE_LTO" = "true" ]; then + CMAKE_EXTRA_FLAGS="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" + fi + + if [ "$USE_CLANG" = "true" ] && [ "${{ runner.os }}" = "Linux" ]; then + export CC=clang-18 + export CXX=clang++-18 + CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld-18" + fi + cmake --preset "$CMAKE_PRESET" $CMAKE_EXTRA_FLAGS + + - name: Build (Windows MSVC) + if: ${{ runner.os == 'Windows' && (matrix.base-cmake-preset == 'windows_msvc' || matrix.base-cmake-preset == 'windows_msvc_arm64_cross') }} + shell: cmd + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + ARTIFACT_NAME: ${{ matrix.artifact-name }}-Qt6 + BUILD_PLATFORM: official + run: | + if defined VSINSTALLDIR ( + call "%VSINSTALLDIR%VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) else ( + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) + REM Verify compiler is available + cl.exe /? >nul 2>&1 || (echo ERROR: cl.exe not found after vcvars & exit /b 1) + cmake --build --preset "%CMAKE_PRESET%" --target all + + - name: Build (Linux/macOS/MinGW) + if: ${{ runner.os != 'Windows' || (matrix.base-cmake-preset != 'windows_msvc' && matrix.base-cmake-preset != 'windows_msvc_arm64_cross') }} + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} ARTIFACT_NAME: ${{ matrix.artifact-name }}-Qt6 BUILD_PLATFORM: official run: | - cmake --workflow --preset "$CMAKE_PRESET" + cmake --build --preset "$CMAKE_PRESET" --target all + + - name: Test (Windows MSVC) + if: ${{ runner.os == 'Windows' && (matrix.base-cmake-preset == 'windows_msvc' || matrix.base-cmake-preset == 'windows_msvc_arm64_cross') }} + shell: cmd + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + run: | + if defined VSINSTALLDIR ( + call "%VSINSTALLDIR%VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) else ( + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars-arch }} + ) + ctest --preset "%CMAKE_PRESET%" || exit 0 + + - name: Test (Linux/macOS/MinGW) + if: ${{ runner.os != 'Windows' || (matrix.base-cmake-preset != 'windows_msvc' && matrix.base-cmake-preset != 'windows_msvc_arm64_cross') }} + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + run: | + ctest --preset "$CMAKE_PRESET" || true + + - name: Install (Windows MSVC) + if: ${{ runner.os == 'Windows' && (matrix.base-cmake-preset == 'windows_msvc' || matrix.base-cmake-preset == 'windows_msvc_arm64_cross') }} + shell: cmd + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + run: | + cmake --install build --prefix install + + - name: Install (Linux/macOS/MinGW) + if: ${{ runner.os != 'Windows' || (matrix.base-cmake-preset != 'windows_msvc' && matrix.base-cmake-preset != 'windows_msvc_arm64_cross') }} + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} + env: + CMAKE_PRESET: ${{ steps.cmake-preset.outputs.preset }} + run: | + cmake --install build --prefix install ## # PACKAGE @@ -176,7 +355,7 @@ jobs: - name: Get short version id: short-version - shell: bash + shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }} run: | echo "version=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 9997d2865..7f9e8832f 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -131,6 +131,10 @@ jobs: run: | nix flake update + - name: Format Nix files + run: | + nix run nixpkgs#nixpkgs-fmt -- nix/wrapper.nix nix/unwrapped.nix + - name: Run Flake checks run: | nix flake check --print-build-logs --show-trace diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 179963229..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Publish - -on: - release: - types: [released] - -permissions: - contents: read - -jobs: - winget: - name: Winget - - runs-on: windows-latest - - steps: - - name: Publish on Winget - uses: vedantmgoyal2009/winget-releaser@v2 - with: - identifier: sogik.NMCLauncher - version: ${{ github.event.release.tag_name }} - installers-regex: 'NMCLauncher-Windows-MSVC(:?-arm64|-Legacy)?-Setup-.+\.exe$' - token: ${{ secrets.WINGET_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a31ab89e6..28f34e082 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,12 +33,31 @@ jobs: - name: Package artifacts properly run: | mv ${{ github.workspace }}/NMCLauncher-source NMCLauncher-${{ env.VERSION }} + + # Linux portable variants mv NMCLauncher-Linux-Qt6-Portable*/NMCLauncher-portable.tar.gz NMCLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz - mv NMCLauncher-*.AppImage/NMCLauncher-*-x86_64.AppImage NMCLauncher-Linux-x86_64.AppImage - mv NMCLauncher-*.AppImage.zsync/NMCLauncher-*-x86_64.AppImage.zsync NMCLauncher-Linux-x86_64.AppImage.zsync - mv NMCLauncher-*.AppImage/NMCLauncher-*-aarch64.AppImage NMCLauncher-Linux-aarch64.AppImage - mv NMCLauncher-*.AppImage.zsync/NMCLauncher-*-aarch64.AppImage.zsync NMCLauncher-Linux-aarch64.AppImage.zsync - mv NMCLauncher-macOS*/NMCLauncher.zip NMCLauncher-macOS-${{ env.VERSION }}.zip + mv NMCLauncher-Linux+LTO-Qt6-Portable*/NMCLauncher-portable.tar.gz NMCLauncher-Linux+LTO-Qt6-Portable-${{ env.VERSION }}.tar.gz + mv NMCLauncher-Linux-Clang-Qt6-Portable*/NMCLauncher-portable.tar.gz NMCLauncher-Linux-Clang-Qt6-Portable-${{ env.VERSION }}.tar.gz + mv NMCLauncher-Linux-aarch64-Qt6-Portable*/NMCLauncher-portable.tar.gz NMCLauncher-Linux-aarch64-Qt6-Portable-${{ env.VERSION }}.tar.gz + mv NMCLauncher-Linux-aarch64+LTO-Qt6-Portable*/NMCLauncher-portable.tar.gz NMCLauncher-Linux-aarch64+LTO-Qt6-Portable-${{ env.VERSION }}.tar.gz + + # Linux AppImages - ahora cada variante tiene su propio AppImage + # x86_64 variants + mv NMCLauncher-Linux-*-Release-x86_64.AppImage/NMCLauncher-Linux-*-Release-x86_64.AppImage NMCLauncher-Linux-x86_64.AppImage + mv NMCLauncher-Linux-*-Release-x86_64.AppImage.zsync/NMCLauncher-Linux-*-x86_64.AppImage.zsync NMCLauncher-Linux-x86_64.AppImage.zsync + mv NMCLauncher-Linux+LTO-*-Release-x86_64.AppImage/NMCLauncher-Linux+LTO-*-Release-x86_64.AppImage NMCLauncher-Linux+LTO-x86_64.AppImage + mv NMCLauncher-Linux+LTO-*-Release-x86_64.AppImage.zsync/NMCLauncher-Linux+LTO-*-x86_64.AppImage.zsync NMCLauncher-Linux+LTO-x86_64.AppImage.zsync + mv NMCLauncher-Linux-Clang-*-Release-x86_64.AppImage/NMCLauncher-Linux-Clang-*-Release-x86_64.AppImage NMCLauncher-Linux-Clang-x86_64.AppImage + mv NMCLauncher-Linux-Clang-*-Release-x86_64.AppImage.zsync/NMCLauncher-Linux-Clang-*-x86_64.AppImage.zsync NMCLauncher-Linux-Clang-x86_64.AppImage.zsync + # aarch64 variants + mv NMCLauncher-Linux-aarch64-*-Release-aarch64.AppImage/NMCLauncher-Linux-aarch64-*-Release-aarch64.AppImage NMCLauncher-Linux-aarch64.AppImage + mv NMCLauncher-Linux-aarch64-*-Release-aarch64.AppImage.zsync/NMCLauncher-Linux-aarch64-*-aarch64.AppImage.zsync NMCLauncher-Linux-aarch64.AppImage.zsync + mv NMCLauncher-Linux-aarch64+LTO-*-Release-aarch64.AppImage/NMCLauncher-Linux-aarch64+LTO-*-Release-aarch64.AppImage NMCLauncher-Linux-aarch64+LTO.AppImage + mv NMCLauncher-Linux-aarch64+LTO-*-Release-aarch64.AppImage.zsync/NMCLauncher-Linux-aarch64+LTO-*-aarch64.AppImage.zsync NMCLauncher-Linux-aarch64+LTO.AppImage.zsync + + # macOS + mv NMCLauncher-macOS-*/NMCLauncher.zip NMCLauncher-macOS-${{ env.VERSION }}.zip + mv NMCLauncher-macOS+LTO-*/NMCLauncher.zip NMCLauncher-macOS+LTO-${{ env.VERSION }}.zip tar --exclude='.git' -czf NMCLauncher-${{ env.VERSION }}.tar.gz NMCLauncher-${{ env.VERSION }} @@ -48,9 +67,11 @@ jobs: ARM64="$(echo -n ${d} | grep -o arm64 || true)" INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" + LTO="$(echo -n ${d} | grep -o LTO || true)" NAME="NMCLauncher-Windows-MSVC" test -z "${LEGACY}" || NAME="${NAME}-Legacy" test -z "${ARM64}" || NAME="${NAME}-arm64" + test -z "${LTO}" || NAME="${NAME}+LTO" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv NMCLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * @@ -61,7 +82,9 @@ jobs: cd "${d}" || continue INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" + LTO="$(echo -n ${d} | grep -o LTO || true)" NAME="NMCLauncher-Windows-MinGW-w64" + test -z "${LTO}" || NAME="${NAME}+LTO" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv NMCLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * @@ -72,14 +95,29 @@ jobs: cd "${d}" || continue INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" + LTO="$(echo -n ${d} | grep -o LTO || true)" NAME="NMCLauncher-Windows-MinGW-arm64" + test -z "${LTO}" || NAME="${NAME}+LTO" + test -z "${PORT}" || NAME="${NAME}-Portable" + test -z "${INST}" || mv NMCLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe + test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * + cd .. + done + + for d in NMCLauncher-Windows-Clang*; do + cd "${d}" || continue + INST="$(echo -n ${d} | grep -o Setup || true)" + PORT="$(echo -n ${d} | grep -o Portable || true)" + LTO="$(echo -n ${d} | grep -o LTO || true)" + NAME="NMCLauncher-Windows-Clang" + test -z "${LTO}" || NAME="${NAME}+LTO" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv NMCLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * cd .. done - - name: Create release + - name: Package for macOS id: create_release uses: softprops/action-gh-release@v2 with: @@ -91,21 +129,49 @@ jobs: files: | NMCLauncher-Linux-x86_64.AppImage NMCLauncher-Linux-x86_64.AppImage.zsync + NMCLauncher-Linux+LTO-x86_64.AppImage + NMCLauncher-Linux+LTO-x86_64.AppImage.zsync + NMCLauncher-Linux-Clang-x86_64.AppImage + NMCLauncher-Linux-Clang-x86_64.AppImage.zsync NMCLauncher-Linux-aarch64.AppImage NMCLauncher-Linux-aarch64.AppImage.zsync + NMCLauncher-Linux-aarch64+LTO.AppImage + NMCLauncher-Linux-aarch64+LTO.AppImage.zsync NMCLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz + NMCLauncher-Linux+LTO-Qt6-Portable-${{ env.VERSION }}.tar.gz + NMCLauncher-Linux-Clang-Qt6-Portable-${{ env.VERSION }}.tar.gz NMCLauncher-Linux-aarch64-Qt6-Portable-${{ env.VERSION }}.tar.gz + NMCLauncher-Linux-aarch64+LTO-Qt6-Portable-${{ env.VERSION }}.tar.gz NMCLauncher-Windows-MinGW-w64-${{ env.VERSION }}.zip NMCLauncher-Windows-MinGW-w64-Portable-${{ env.VERSION }}.zip NMCLauncher-Windows-MinGW-w64-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-MinGW-w64+LTO-${{ env.VERSION }}.zip + NMCLauncher-Windows-MinGW-w64+LTO-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-MinGW-w64+LTO-Setup-${{ env.VERSION }}.exe NMCLauncher-Windows-MinGW-arm64-${{ env.VERSION }}.zip NMCLauncher-Windows-MinGW-arm64-Portable-${{ env.VERSION }}.zip NMCLauncher-Windows-MinGW-arm64-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-MinGW-arm64+LTO-${{ env.VERSION }}.zip + NMCLauncher-Windows-MinGW-arm64+LTO-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-MinGW-arm64+LTO-Setup-${{ env.VERSION }}.exe NMCLauncher-Windows-MSVC-arm64-${{ env.VERSION }}.zip NMCLauncher-Windows-MSVC-arm64-Portable-${{ env.VERSION }}.zip NMCLauncher-Windows-MSVC-arm64-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-MSVC-arm64+LTO-${{ env.VERSION }}.zip + NMCLauncher-Windows-MSVC-arm64+LTO-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-MSVC-arm64+LTO-Setup-${{ env.VERSION }}.exe NMCLauncher-Windows-MSVC-${{ env.VERSION }}.zip NMCLauncher-Windows-MSVC-Portable-${{ env.VERSION }}.zip NMCLauncher-Windows-MSVC-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-MSVC+LTO-${{ env.VERSION }}.zip + NMCLauncher-Windows-MSVC+LTO-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-MSVC+LTO-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-Clang-${{ env.VERSION }}.zip + NMCLauncher-Windows-Clang-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-Clang-Setup-${{ env.VERSION }}.exe + NMCLauncher-Windows-Clang+LTO-${{ env.VERSION }}.zip + NMCLauncher-Windows-Clang+LTO-Portable-${{ env.VERSION }}.zip + NMCLauncher-Windows-Clang+LTO-Setup-${{ env.VERSION }}.exe NMCLauncher-macOS-${{ env.VERSION }}.zip + NMCLauncher-macOS+LTO-${{ env.VERSION }}.zip NMCLauncher-${{ env.VERSION }}.tar.gz diff --git a/CMakeLists.txt b/CMakeLists.txt index 773046731..127223536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,48 @@ cmake_minimum_required(VERSION 3.15) # minimum version required by QuaZip project(Launcher) +# Force rebuild for PR testing string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD) if(IS_IN_SOURCE_BUILD) message(FATAL_ERROR "You are building the Launcher in-source. Please separate the build tree from the source tree.") endif() +##################################### Performance Optimizations ##################################### +# Enable LTO/IPO for Release builds (5-10% performance gain, smaller binaries) +include(CheckIPOSupported) +check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error) + +if(ipo_supported) + message(STATUS "✓ LTO/IPO enabled for Release builds") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON) +else() + message(WARNING "✗ LTO/IPO not supported: ${ipo_error}") +endif() + +# Platform-specific optimizations +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # GCC-specific optimizations + add_compile_options( + $<$:-O2> + $<$:-pipe> + $<$:-fno-plt> + ) + message(STATUS "✓ GCC optimizations enabled") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Clang-specific optimizations + add_compile_options( + $<$:-O2> + $<$:-pipe> + $<$:-fno-plt> + ) + message(STATUS "✓ Clang optimizations enabled") +elseif(MSVC) + # MSVC-specific optimizations (handled below in existing MSVC section) + message(STATUS "✓ MSVC optimizations will be configured") +endif() + ##################################### Set CMake options ##################################### set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -389,8 +426,8 @@ if(UNIX AND APPLE) set(RESOURCES_DEST_DIR "${Launcher_Name}.app/Contents/Resources") set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/MacOS/jars") - # Apps to bundle - set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app") + # Apps to bundle - must point to the actual executable inside the bundle + set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app/Contents/MacOS/${Launcher_APP_BINARY_NAME}") # Mac bundle settings set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_DisplayName}") diff --git a/README.md b/README.md index ac5a65742..2afd1fbf4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ NMC Launcher is a custom launcher for Minecraft that allows you to easily manage ## Warning and support -- If you have a problem with the launcher, **open an issue** [here](https://github.com/sogik/NMCLauncher/issues). +- If you have a problem with the launcher, **open an issue** in the [issue tracker](https://github.com/sogik/NMCLauncher/issues). - For questions or discussions, **use** [this discussion forum](https://github.com/sogik/NMCLauncher/discussions). - **Do not** request support from the Prism Launcher team for this fork. diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 982ff7b6b..15af6f57e 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1408,7 +1408,23 @@ if(WIN32 OR (DEFINED Launcher_BUILD_FILELINKER AND Launcher_BUILD_FILELINKER)) add_executable("${Launcher_Name}_filelink" WIN32 filelink/filelink_main.cpp) - target_sources("${Launcher_Name}_filelink" PRIVATE filelink/filelink.exe.manifest) + # Embed manifest through resource file to avoid mt.exe merge conflicts + # The .rc file references filelink.exe.manifest which has level="requireAdministrator" + if(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") + set(FILELINK_RC "${CMAKE_CURRENT_SOURCE_DIR}/filelink/filelink.rc") + set_source_files_properties(${FILELINK_RC} PROPERTIES LANGUAGE RC) + target_sources("${Launcher_Name}_filelink" PRIVATE ${FILELINK_RC}) + + # Also force linker to use our manifest settings and embed it + message(STATUS "Embedding manifest for ${Launcher_Name}_filelink via RC file to avoid mt.exe merge conflicts") + target_link_options("${Launcher_Name}_filelink" PRIVATE + "/MANIFESTUAC:level='requireAdministrator' uiAccess='false'" + "/MANIFEST:EMBED" + ) + else() + # Non-MSVC platforms: add manifest directly (won't cause issues) + target_sources("${Launcher_Name}_filelink" PRIVATE filelink/filelink.exe.manifest) + endif() target_link_libraries("${Launcher_Name}_filelink" filelink_logic) diff --git a/launcher/filelink/filelink.rc b/launcher/filelink/filelink.rc new file mode 100644 index 000000000..f1c76f36e --- /dev/null +++ b/launcher/filelink/filelink.rc @@ -0,0 +1,4 @@ +// Resource file for filelink executable +// Embeds the manifest to avoid mt.exe merge conflicts + +1 RT_MANIFEST "filelink.exe.manifest" diff --git a/launcher/install_prereqs.cmake.in b/launcher/install_prereqs.cmake.in index acbce9650..95631fa33 100644 --- a/launcher/install_prereqs.cmake.in +++ b/launcher/install_prereqs.cmake.in @@ -22,5 +22,11 @@ set(gp_cmd_paths ${gp_cmd_paths} ) include(BundleUtilities) + +# Verify the executable exists before running fixup_bundle +if(NOT EXISTS "@APPS@") + message(FATAL_ERROR "Cannot find executable to fix up: @APPS@") +endif() + fixup_bundle("@APPS@" "${QTPLUGINS}" "@DIRS@") diff --git a/nix/unwrapped.nix b/nix/unwrapped.nix index 3fd71db29..a18b66ecb 100644 --- a/nix/unwrapped.nix +++ b/nix/unwrapped.nix @@ -85,7 +85,9 @@ stdenv.mkDerivation { tomlplusplus zlib ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.Cocoa + ] ++ lib.optional gamemodeSupport gamemode; hardeningEnable = lib.optionals stdenv.hostPlatform.isLinux [ "pie" ]; diff --git a/nix/wrapper.nix b/nix/wrapper.nix index 95827b230..a96317b19 100644 --- a/nix/wrapper.nix +++ b/nix/wrapper.nix @@ -61,14 +61,10 @@ symlinkJoin { nativeBuildInputs = [ kdePackages.wrapQtAppsHook ]; - buildInputs = - [ - kdePackages.qtbase - kdePackages.qtsvg - ] - ++ lib.optional ( - lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.hostPlatform.isLinux - ) kdePackages.qtwayland; + buildInputs = [ + kdePackages.qtbase + kdePackages.qtsvg + ] ++ lib.optional (lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.hostPlatform.isLinux) kdePackages.qtwayland; postBuild = '' wrapQtAppsHook @@ -113,14 +109,17 @@ symlinkJoin { ] ++ additionalPrograms; in - [ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ] + [ + "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--set LD_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}" "--prefix PATH : ${lib.makeBinPath runtimePrograms}" ]; meta = { - inherit (nmclauncher'.meta) + inherit + (nmclauncher'.meta) description longDescription homepage