diff --git a/.github/workflows/linux-appimage-build.yml b/.github/workflows/linux-appimage-build.yml index 5f85bc26f..178a37b27 100644 --- a/.github/workflows/linux-appimage-build.yml +++ b/.github/workflows/linux-appimage-build.yml @@ -31,20 +31,20 @@ jobs: - name: Install Packages run: scripts/appimage/install-packages.sh - - name: Cache Dependencies - id: cache-deps - uses: actions/cache@v5 - with: - path: ~/deps - key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh', 'scripts/deps/build-ffmpeg-linux.sh', 'scripts/deps/versions') }} + - name: Download Dependencies + run: | + DEPS_VERSION=$(cat dep/PREBUILT-VERSION) + cd dep/prebuilt + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/dependencies/releases/download/$DEPS_VERSION/deps-linux-x64.tar.xz" + tar -xf "deps-linux-x64.tar.xz" + rm "deps-linux-x64.tar.xz" - - name: Build Dependencies - if: steps.cache-deps.outputs.cache-hit != 'true' - run: scripts/deps/build-dependencies-linux.sh "$HOME/deps" - - - name: Build FFmpeg - if: steps.cache-deps.outputs.cache-hit != 'true' - run: scripts/deps/build-ffmpeg-linux.sh "$HOME/deps" + - name: Download Patch Archives + shell: bash + run: | + cd data/resources + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" - name: Tag as Preview Release if: github.ref == 'refs/heads/master' @@ -60,22 +60,15 @@ jobs: echo '#define UPDATER_RELEASE_CHANNEL "latest"' >> src/scmversion/tag.h echo '#define UPDATER_RELEASE_IS_OFFICIAL 1' >> src/scmversion/tag.h - - name: Download Patch Archives - shell: bash - run: | - cd data/resources - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" - - name: Compile Build shell: bash run: | mkdir build cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmakeoptions }} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" .. + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmakeoptions }} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" .. cmake --build . --parallel cd .. - scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps "${{ matrix.asset }}" + scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) "${{ matrix.asset }}" - name: Upload AppImage uses: actions/upload-artifact@v6 diff --git a/.github/workflows/linux-cross-appimage-build.yml b/.github/workflows/linux-cross-appimage-build.yml index 75de9cd1c..864af9b02 100644 --- a/.github/workflows/linux-cross-appimage-build.yml +++ b/.github/workflows/linux-cross-appimage-build.yml @@ -25,18 +25,22 @@ jobs: with: fetch-depth: 0 - - name: Cache Dependencies - id: cache-deps - uses: actions/cache@v5 - with: - path: ~/deps - key: deps-cross ${{ matrix.arch }} ${{ hashFiles('scripts/deps/build-dependencies-linux.sh', 'scripts/deps/build-dependencies-linux-cross.sh', 'scripts/deps/versions') }} - - - name: Build Dependencies - if: steps.cache-deps.outputs.cache-hit != 'true' + - name: Download Dependencies run: | - scripts/deps/build-dependencies-linux.sh -skip-cleanup "$HOME/deps/host" - scripts/deps/build-dependencies-linux-cross.sh -skip-download "$HOME/deps/host" "${{ matrix.arch }}" "/${{ matrix.arch }}-chroot" "$HOME/deps/cross" + DEPS_VERSION=$(cat dep/PREBUILT-VERSION) + cd dep/prebuilt + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/dependencies/releases/download/$DEPS_VERSION/deps-linux-x64.tar.xz" + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/dependencies/releases/download/$DEPS_VERSION/deps-linux-cross-${{matrix.arch}}.tar.xz" + tar -xf "deps-linux-x64.tar.xz" + tar -xf "deps-linux-cross-${{matrix.arch}}.tar.xz" + rm "deps-linux-x64.tar.xz" "deps-linux-cross-${{matrix.arch}}.tar.xz" + + - name: Download Patch Archives + shell: bash + run: | + cd data/resources + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" # Work around container ownership issue - name: Set Safe Directory @@ -49,16 +53,19 @@ jobs: - name: Set Up Toolchain File run: | - cp "$HOME/deps/cross/toolchain.cmake" "$HOME/toolchain.cmake" - echo 'set(CMAKE_C_COMPILER clang-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_C_COMPILER_AR llvm-ar-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_C_COMPILER_RANLIB llvm-ranlib-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_CXX_COMPILER clang++-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_CXX_COMPILER_AR llvm-ar-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_CXX_COMPILER_RANLIB llvm-ranlib-19)' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")' >> "$HOME/toolchain.cmake" - echo 'set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")' >> "$HOME/toolchain.cmake" + cp "dep/prebuilt/linux-cross-${{matrix.arch}}/toolchain.cmake" "$HOME/toolchain.cmake" + echo "set(CMAKE_FIND_ROOT_PATH \"$PWD/dep/prebuilt/linux-cross-${{matrix.arch}};/${{matrix.arch}}-chroot\")" >> "$HOME/toolchain.cmake" + echo "set(QT_HOST_PATH \"$PWD/dep/prebuilt/linux-x64\")" >> "$HOME/toolchain.cmake" + echo "set(LCONVERT_EXE \"$PWD/dep/prebuilt/linux-x64/bin/lconvert\")" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_C_COMPILER clang-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_C_COMPILER_AR llvm-ar-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_C_COMPILER_RANLIB llvm-ranlib-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_CXX_COMPILER clang++-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_CXX_COMPILER_AR llvm-ar-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_CXX_COMPILER_RANLIB llvm-ranlib-19)" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")" >> "$HOME/toolchain.cmake" + echo "set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")" >> "$HOME/toolchain.cmake" - name: Tag as Preview Release if: github.ref == 'refs/heads/master' @@ -74,24 +81,17 @@ jobs: echo '#define UPDATER_RELEASE_CHANNEL "latest"' >> src/scmversion/tag.h echo '#define UPDATER_RELEASE_IS_OFFICIAL 1' >> src/scmversion/tag.h - - name: Download Patch Archives - shell: bash - run: | - cd data/resources - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" - - name: Generate CMake shell: bash run: | - cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE="$HOME/toolchain.cmake" -DCMAKE_PREFIX_PATH="$HOME/deps/cross" -DLCONVERT_EXE="$HOME/deps/host/bin/lconvert" -DHOST_MIN_PAGE_SIZE=4096 -DHOST_MAX_PAGE_SIZE=16384 -DHOST_CACHE_LINE_SIZE=64 -DBUILD_QT_FRONTEND=ON -DBUILD_MINI_FRONTEND=ON + cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE="$HOME/toolchain.cmake" -DHOST_MIN_PAGE_SIZE=4096 -DHOST_MAX_PAGE_SIZE=16384 -DHOST_CACHE_LINE_SIZE=64 -DBUILD_QT_FRONTEND=ON -DBUILD_MINI_FRONTEND=ON - name: Compile Build shell: bash run: | cmake --build build --parallel - scripts/appimage/make-cross-appimage.sh duckstation-qt ${{ matrix.arch }} "$(realpath build)" "$HOME/deps/cross" "/${{ matrix.arch }}-chroot" - scripts/appimage/make-cross-appimage.sh -inject-libc duckstation-mini ${{ matrix.arch }} "$(realpath build)" "$HOME/deps/cross" "/${{ matrix.arch }}-chroot" + scripts/appimage/make-cross-appimage.sh duckstation-qt ${{ matrix.arch }} "$(realpath build)" "/${{ matrix.arch }}-chroot" + scripts/appimage/make-cross-appimage.sh -inject-libc duckstation-mini ${{ matrix.arch }} "$(realpath build)" "/${{ matrix.arch }}-chroot" - name: Upload AppImages uses: actions/upload-artifact@v6 diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 9f6e5223a..80258ba41 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -23,16 +23,20 @@ jobs: - name: Download Metal Toolchain run: xcodebuild -downloadComponent MetalToolchain - - name: Cache Dependencies - id: cache-deps-mac - uses: actions/cache@v5 - with: - path: ~/deps - key: deps-mac ${{ hashFiles('scripts/deps/build-dependencies-mac.sh', 'scripts/deps/versions') }} + - name: Download Dependencies + run: | + DEPS_VERSION=$(cat dep/PREBUILT-VERSION) + cd dep/prebuilt + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/dependencies/releases/download/$DEPS_VERSION/deps-macos-universal.tar.xz" + tar -xf "deps-macos-universal.tar.xz" + rm "deps-macos-universal.tar.xz" - - name: Build Dependencies - if: steps.cache-deps-mac.outputs.cache-hit != 'true' - run: scripts/deps/build-dependencies-mac.sh "$HOME/deps" + - name: Download Patch Archives + shell: bash + run: | + cd data/resources + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" + curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" - name: Tag as Preview Release if: github.ref == 'refs/heads/master' @@ -48,13 +52,6 @@ jobs: echo '#define UPDATER_RELEASE_CHANNEL "latest"' >> src/scmversion/tag.h echo '#define UPDATER_RELEASE_IS_OFFICIAL 1' >> src/scmversion/tag.h - - name: Download Patch Archives - shell: bash - run: | - cd data/resources - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip" - curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip" - - name: Compile and Zip .app shell: bash run: | diff --git a/.github/workflows/upload-caches.yml b/.github/workflows/upload-caches.yml deleted file mode 100644 index 0d099a62e..000000000 --- a/.github/workflows/upload-caches.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Upload Caches - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - upload-windows-cache: - runs-on: windows-2022 - timeout-minutes: 120 - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Cache Dependencies - id: cache-deps - uses: actions/cache@v5 - with: - path: | - dep/msvc/deps-arm64 - dep/msvc/deps-x64 - key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat', 'scripts/deps/versions') }} - - - name: Zip Cache Files - if: steps.cache-deps.outputs.cache-hit == 'true' - shell: cmd - run: | - "C:\Program Files\7-Zip\7z.exe" a -r deps-x64.zip ./dep/msvc/deps-x64 - "C:\Program Files\7-Zip\7z.exe" a -r deps-arm64.zip ./dep/msvc/deps-arm64 - - - name: Upload Cache Files - if: steps.cache-deps.outputs.cache-hit == 'true' - uses: actions/upload-artifact@v6 - with: - name: "windows" - path: "deps-*.zip" diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 066609be9..c683e28e8 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -53,26 +53,27 @@ jobs: with: fetch-depth: 0 - - name: Cache Dependencies - id: cache-deps - uses: actions/cache@v5 - with: - path: | - dep/msvc/deps-arm64 - dep/msvc/deps-x64 - key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat', 'scripts/deps/versions') }} + - name: Download x64 Dependencies + shell: cmd + run: | + set /p DEPS_VERSION= +# SPDX-License-Identifier: CC-BY-NC-ND-4.0 + Packaging Restriction + +# Get prebuilt dependencies for the current platform and architecture. +if(WIN32) + if (CPU_ARCH_X64) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/windows-x64") + elseif(CPU_ARCH_ARM64) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/windows-arm64") + else() + message(FATAL_ERROR "Unsupported architecture") + endif() +elseif(APPLE) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/macos-universal") +elseif(LINUX) + if(CMAKE_CROSSCOMPILING) + set(DEPS_CROSS_PREFIX "-cross") + else() + set(DEPS_CROSS_PREFIX "") + endif() + + if (CPU_ARCH_X64) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/linux-x64") + elseif(CPU_ARCH_ARM32) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/linux${DEPS_CROSS_PREFIX}-armhf") + elseif(CPU_ARCH_ARM64) + set(DEPS_PATH "${CMAKE_SOURCE_DIR}/dep/prebuilt/linux${DEPS_CROSS_PREFIX}-arm64") + else() + message(FATAL_ERROR "Unsupported architecture") + endif() +else() + message(FATAL_ERROR "Unsupported platform") endif() +if(NOT EXISTS "${DEPS_PATH}") + message(FATAL_ERROR "Prebuilt dependencies not found for the current platform and architecture.") +endif() +set(CMAKE_PREFIX_PATH "${DEPS_PATH}") # Enable threads everywhere. set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -12,78 +43,73 @@ find_package(Threads REQUIRED) # pkg-config gets pulled transitively on some platforms. if(NOT WIN32 AND NOT APPLE) find_package(PkgConfig REQUIRED) + find_package(Libbacktrace REQUIRED) endif() # libpng relies on zlib, which we need the system version for on Mac. if(APPLE OR CPU_ARCH_ARM32 OR CPU_ARCH_ARM64) find_package(ZLIB REQUIRED) +else() + find_package(ZLIB 1.3.1 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/ZLIB") endif() # Enforce use of bundled dependencies to avoid conflicts with system libraries. -set(FIND_ROOT_PATH_BACKUP ${CMAKE_FIND_ROOT_PATH}) -set(FIND_ROOT_PATH_MODE_INCLUDE_BACKUP ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}) -set(FIND_ROOT_PATH_MODE_LIBRARY_BACKUP ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY}) -set(FIND_ROOT_PATH_MODE_PACKAGE_BACKUP ${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) -set(FIND_ROOT_PATH_MODE_PROGRAM_BACKUP ${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM}) -set(CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH}) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +find_package(zstd 1.5.7 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/zstd") +find_package(WebP 1.6.0 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/share/WebP/cmake") +find_package(PNG 1.6.55 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/PNG") +find_package(libjpeg-turbo 3.1.3 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/libjpeg-turbo") +find_package(freetype 2.14.1 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/freetype") +find_package(harfbuzz REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/harfbuzz") +find_package(plutosvg 0.0.7 REQUIRED + PATHS "${DEPS_PATH}/lib/cmake/plutosvg") +find_package(cpuinfo REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/cpuinfo") +find_package(DiscordRPC 3.4.0 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/DiscordRPC") +find_package(SoundTouch 2.3.3 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/SoundTouch") +find_package(libzip 1.11.4 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/libzip") +find_package(Shaderc 2026.1 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/Shaderc") +find_package(spirv_cross_c_shared REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/share/spirv_cross_c_shared/cmake") +find_package(SDL3 3.4.2 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/SDL3") -# Search for local zlib version outside of Mac. -if(NOT APPLE AND NOT CPU_ARCH_ARM32 AND NOT CPU_ARCH_ARM64) - find_package(ZLIB 1.3.1 REQUIRED) -endif() +# Verify dependency paths. +foreach(dep zstd WebP PNG libjpeg-turbo freetype harfbuzz plutosvg cpuinfo + DiscordRPC SoundTouch libzip Shaderc spirv_cross_c_shared SDL3) + if((${dep}_LIBRARY AND NOT "${${dep}_LIBRARY}" MATCHES "^${DEPS_PATH}") OR + (${dep}_DIR AND NOT "${${dep}_DIR}" MATCHES "^${DEPS_PATH}")) + message(FATAL_ERROR "Using incorrect ${dep} library. Check your dependencies.") + endif() +endforeach() -# Bundled dependencies. -find_package(zstd 1.5.7 REQUIRED) -find_package(WebP REQUIRED) # v1.4.0, spews an error on Linux because no pkg-config. -find_package(PNG 1.6.54 REQUIRED) -find_package(JPEG REQUIRED) -find_package(SDL3 3.4.0 REQUIRED) -find_package(Freetype 2.14.1 REQUIRED) -find_package(harfbuzz REQUIRED) -find_package(plutosvg 0.0.6 REQUIRED) -find_package(cpuinfo REQUIRED) -find_package(DiscordRPC 3.4.0 REQUIRED) -find_package(SoundTouch 2.3.3 REQUIRED) -find_package(libzip 1.11.4 REQUIRED) -find_package(Shaderc REQUIRED) -find_package(spirv_cross_c_shared REQUIRED) - -if(NOT WIN32 AND NOT APPLE) - find_package(Libbacktrace REQUIRED) - - # We need to add the rpath for shaderc to the executable. - get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION) - get_filename_component(SHADERC_LIBRARY_DIRECTORY ${SHADERC_LIBRARY} DIRECTORY) - list(APPEND CMAKE_BUILD_RPATH ${SHADERC_LIBRARY_DIRECTORY}) - get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION) - get_filename_component(SPIRV_CROSS_LIBRARY_DIRECTORY ${SPIRV_CROSS_LIBRARY} DIRECTORY) - list(APPEND CMAKE_BUILD_RPATH ${SPIRV_CROSS_LIBRARY_DIRECTORY}) -endif() - -# Restore system package search path. -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${FIND_ROOT_PATH_MODE_INCLUDE_BACKUP}) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${FIND_ROOT_PATH_MODE_LIBRARY_BACKUP}) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${FIND_ROOT_PATH_MODE_PACKAGE_BACKUP}) -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${FIND_ROOT_PATH_MODE_PROGRAM_BACKUP}) -set(CMAKE_FIND_ROOT_PATH ${FIND_ROOT_PATH_BACKUP}) - -# Qt has transitive dependencies on system libs, so do it afterwards. if(BUILD_QT_FRONTEND) # All our builds include Qt, so this is not a problem. set(QT_NO_PRIVATE_MODULE_WARNING ON) + # Should be prebuilt. if(LINUX) - find_package(Qt6 6.10.2 COMPONENTS Core Gui GuiPrivate Widgets LinguistTools DBus REQUIRED) + find_package(Qt6 6.10.2 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/Qt6" + COMPONENTS Core Gui GuiPrivate Widgets LinguistTools DBus) else() - find_package(Qt6 6.10.2 COMPONENTS Core Gui GuiPrivate Widgets LinguistTools REQUIRED) + find_package(Qt6 6.10.2 REQUIRED + NO_DEFAULT_PATH PATHS "${DEPS_PATH}/lib/cmake/Qt6" + COMPONENTS Core Gui GuiPrivate Widgets LinguistTools) endif() # Have to verify it down here, don't want users using unpatched Qt. - if(NOT Qt6_DIR MATCHES "^${CMAKE_PREFIX_PATH}") + if(NOT Qt6_DIR MATCHES "^${DEPS_PATH}") message(FATAL_ERROR "Using incorrect Qt library. Check your dependencies.") endif() endif() diff --git a/CMakeModules/FindLibbacktrace.cmake b/CMakeModules/FindLibbacktrace.cmake index 39f3efddc..09c47c197 100644 --- a/CMakeModules/FindLibbacktrace.cmake +++ b/CMakeModules/FindLibbacktrace.cmake @@ -8,12 +8,14 @@ FIND_PATH( LIBBACKTRACE_INCLUDE_DIR backtrace.h HINTS "${CMAKE_PREFIX_PATH}/include" /usr/include /usr/local/include ${LIBBACKTRACE_PATH_INCLUDES} + NO_CMAKE_FIND_ROOT_PATH ) FIND_LIBRARY( LIBBACKTRACE_LIBRARY NAMES backtrace PATHS "${CMAKE_PREFIX_PATH}/lib" "${CMAKE_PREFIX_PATH}/lib64" ${ADDITIONAL_LIBRARY_PATHS} ${LIBBACKTRACE_PATH_LIB} + NO_CMAKE_FIND_ROOT_PATH ) include(FindPackageHandleStandardArgs) diff --git a/CMakeModules/FindWebP.cmake b/CMakeModules/FindWebP.cmake deleted file mode 100644 index 688419eb8..000000000 --- a/CMakeModules/FindWebP.cmake +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (C) 2020 Sony Interactive Entertainment Inc. -# Copyright (C) 2012 Raphael Kubo da Costa -# Copyright (C) 2013 Igalia S.L. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#[=======================================================================[.rst: -FindWebP --------------- - -Find WebP headers and libraries. - -Imported Targets -^^^^^^^^^^^^^^^^ - -``WebP::libwebp`` - The WebP library, if found. - -``WebP::demux`` - The WebP demux library, if found. - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables in your project: - -``WebP_FOUND`` - true if (the requested version of) WebP is available. -``WebP_VERSION`` - the version of WebP. -``WebP_LIBRARIES`` - the libraries to link against to use WebP. -``WebP_INCLUDE_DIRS`` - where to find the WebP headers. -``WebP_COMPILE_OPTIONS`` - this should be passed to target_compile_options(), if the - target is not used for linking - -#]=======================================================================] - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_WEBP QUIET libwebp) -set(WebP_COMPILE_OPTIONS ${PC_WEBP_CFLAGS_OTHER}) -set(WebP_VERSION ${PC_WEBP_CFLAGS_VERSION}) - -find_path(WebP_INCLUDE_DIR - NAMES webp/decode.h - HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} -) - -find_library(WebP_LIBRARY - NAMES ${WebP_NAMES} webp libwebp - HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} -) - -# There's nothing in the WebP headers that could be used to detect the exact -# WebP version being used so don't attempt to do so. A version can only be found -# through pkg-config -if ("${WebP_FIND_VERSION}" VERSION_GREATER "${WebP_VERSION}") - if (WebP_VERSION) - message(FATAL_ERROR "Required version (" ${WebP_FIND_VERSION} ") is higher than found version (" ${WebP_VERSION} ")") - else () - message(WARNING "Cannot determine WebP version without pkg-config") - endif () -endif () - -# Find components -if (WebP_INCLUDE_DIR AND WebP_LIBRARY) - set(_WebP_REQUIRED_LIBS_FOUND ON) - set(WebP_LIBS_FOUND "WebP (required): ${WebP_LIBRARY}") -else () - set(_WebP_REQUIRED_LIBS_FOUND OFF) - set(WebP_LIBS_NOT_FOUND "WebP (required)") -endif () - -if ("demux" IN_LIST WebP_FIND_COMPONENTS) - find_library(WebP_DEMUX_LIBRARY - NAMES ${WebP_DEMUX_NAMES} webpdemux libwebpdemux - HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} - ) - - if (WebP_DEMUX_LIBRARY) - if (WebP_FIND_REQUIRED_demux) - list(APPEND WebP_LIBS_FOUND "demux (required): ${WebP_DEMUX_LIBRARY}") - else () - list(APPEND WebP_LIBS_FOUND "demux (optional): ${WebP_DEMUX_LIBRARY}") - endif () - else () - if (WebP_FIND_REQUIRED_demux) - set(_WebP_REQUIRED_LIBS_FOUND OFF) - list(APPEND WebP_LIBS_NOT_FOUND "demux (required)") - else () - list(APPEND WebP_LIBS_NOT_FOUND "demux (optional)") - endif () - endif () -endif () - -if (NOT WebP_FIND_QUIETLY) - if (WebP_LIBS_FOUND) - message(STATUS "Found the following WebP libraries:") - foreach (found ${WebP_LIBS_FOUND}) - message(STATUS " ${found}") - endforeach () - endif () - if (WebP_LIBS_NOT_FOUND) - message(STATUS "The following WebP libraries were not found:") - foreach (found ${WebP_LIBS_NOT_FOUND}) - message(STATUS " ${found}") - endforeach () - endif () -endif () - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WebP - FOUND_VAR WebP_FOUND - REQUIRED_VARS WebP_INCLUDE_DIR WebP_LIBRARY _WebP_REQUIRED_LIBS_FOUND - VERSION_VAR WebP_VERSION -) - -if (WebP_LIBRARY AND NOT TARGET WebP::libwebp) - add_library(WebP::libwebp UNKNOWN IMPORTED GLOBAL) - set_target_properties(WebP::libwebp PROPERTIES - IMPORTED_LOCATION "${WebP_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${WebP_COMPILE_OPTIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIR}" - ) -endif () - -if (WebP_DEMUX_LIBRARY AND NOT TARGET WebP::demux) - add_library(WebP::demux UNKNOWN IMPORTED GLOBAL) - set_target_properties(WebP::demux PROPERTIES - IMPORTED_LOCATION "${WebP_DEMUX_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${WebP_COMPILE_OPTIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIR}" - ) -endif () - -mark_as_advanced( - WebP_INCLUDE_DIR - WebP_LIBRARY - WebP_DEMUX_LIBRARY -) - -if (WebP_FOUND) - set(WebP_LIBRARIES ${WebP_LIBRARY} ${WebP_DEMUX_LIBRARY}) - set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIR}) -endif () diff --git a/CMakeModules/Findzstd.cmake b/CMakeModules/Findzstd.cmake deleted file mode 100644 index b389c6b3d..000000000 --- a/CMakeModules/Findzstd.cmake +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (C) 2020 Dieter Baron and Thomas Klausner -# -# The authors can be contacted at -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# 3. The names of the authors may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#[=======================================================================[.rst: -Findzstd -------- - -Finds the Zstandard (zstd) library. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - -``zstd::libzstd_shared`` - The shared Zstandard library -``zstd::libzstd_static`` - The shared Zstandard library - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``zstd_FOUND`` - True if the system has the Zstandard library. -``zstd_VERSION`` - The version of the Zstandard library which was found. - -Cache Variables -^^^^^^^^^^^^^^^ - -The following cache variables may also be set: - -``zstd_INCLUDE_DIR`` - The directory containing ``zstd.h``. -``zstd_STATIC_LIBRARY`` - The path to the Zstandard static library. -``zstd_SHARED_LIBRARY`` - The path to the Zstandard shared library. -``zstd_DLL`` - The path to the Zstandard DLL. - -#]=======================================================================] - -find_package(PkgConfig) -pkg_check_modules(PC_zstd QUIET libzstd) - -find_path(zstd_INCLUDE_DIR - NAMES zstd.h - HINTS ${PC_zstd_INCLUDE_DIRS} -) - -find_file(zstd_DLL - NAMES libzstd.dll zstd.dll - PATH_SUFFIXES bin - HINTS ${PC_zstd_PREFIX} -) - -# On Windows, we manually define the library names to avoid mistaking the -# implib for the static library -if(zstd_DLL) - set(_zstd_win_static_name zstd-static) - set(_zstd_win_shared_name zstd) -else() - # vcpkg removes the -static suffix in static builds - set(_zstd_win_static_name zstd zstd_static) - set(_zstd_win_shared_name) -endif() - -set(_previous_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dylib" ".dll.a" ".lib") -find_library(zstd_SHARED_LIBRARY - NAMES zstd ${_zstd_win_shared_name} - HINTS ${PC_zstd_LIBDIR} -) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib") -find_library(zstd_STATIC_LIBRARY - NAMES zstd ${_zstd_win_static_name} - HINTS ${PC_zstd_LIBDIR} -) -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_previous_suffixes}) - -# Set zstd_LIBRARY to the shared library or fall back to the static library -if(zstd_SHARED_LIBRARY) - set(_zstd_LIBRARY ${zstd_SHARED_LIBRARY}) -else() - set(_zstd_LIBRARY ${zstd_STATIC_LIBRARY}) -endif() - -# Extract version information from the header file -if(zstd_INCLUDE_DIR) - file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_major_line - REGEX "^#define ZSTD_VERSION_MAJOR *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - zstd_MAJOR_VERSION "${_ver_major_line}") - file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_minor_line - REGEX "^#define ZSTD_VERSION_MINOR *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - zstd_MINOR_VERSION "${_ver_minor_line}") - file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_release_line - REGEX "^#define ZSTD_VERSION_RELEASE *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - zstd_RELEASE_VERSION "${_ver_release_line}") - set(Zstd_VERSION "${zstd_MAJOR_VERSION}.${zstd_MINOR_VERSION}.${zstd_RELEASE_VERSION}") - unset(_ver_major_line) - unset(_ver_minor_line) - unset(_ver_release_line) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(zstd - FOUND_VAR zstd_FOUND - REQUIRED_VARS - _zstd_LIBRARY - zstd_INCLUDE_DIR - VERSION_VAR zstd_VERSION -) - -if(zstd_FOUND AND zstd_SHARED_LIBRARY AND NOT TARGET zstd::libzstd_shared) - add_library(zstd::libzstd_shared SHARED IMPORTED) - if(WIN32) - set_target_properties(zstd::libzstd_shared PROPERTIES - IMPORTED_LOCATION "${zstd_DLL}" - IMPORTED_IMPLIB "${zstd_SHARED_LIBRARY}" - ) - else() - set_target_properties(zstd::libzstd_shared PROPERTIES - IMPORTED_LOCATION "${zstd_SHARED_LIBRARY}" - ) - endif() - - set_target_properties(zstd::libzstd_shared PROPERTIES - INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - ) -endif() - -if(zstd_FOUND AND zstd_STATIC_LIBRARY AND NOT TARGET zstd::libzstd_static) - add_library(zstd::libzstd_static STATIC IMPORTED) - set_target_properties(zstd::libzstd_static PROPERTIES - IMPORTED_LOCATION "${zstd_STATIC_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - zstd_INCLUDE_DIR - zstd_DLL - zstd_SHARED_LIBRARY - zstd_STATIC_LIBRARY -) diff --git a/dep/.gitignore b/dep/.gitignore new file mode 100644 index 000000000..033dbfb93 --- /dev/null +++ b/dep/.gitignore @@ -0,0 +1,4 @@ +prebuilt/ + +# Old Windows prebuilt directory, can be removed at some point in the future +msvc/ \ No newline at end of file diff --git a/dep/PREBUILT-VERSION b/dep/PREBUILT-VERSION new file mode 100644 index 000000000..57ba9313d --- /dev/null +++ b/dep/PREBUILT-VERSION @@ -0,0 +1 @@ +release-20260224 diff --git a/dep/cubeb/cubeb.vcxproj b/dep/cubeb/cubeb.vcxproj index cbf5b6efb..0751bdd73 100644 --- a/dep/cubeb/cubeb.vcxproj +++ b/dep/cubeb/cubeb.vcxproj @@ -1,6 +1,6 @@  - + @@ -40,7 +40,7 @@ {72F9423C-91EE-4487-AAC6-555ED6F61AA1} - + TurnOffAllWarnings @@ -55,5 +55,5 @@ ksuser.lib;%(AdditionalDependencies) - + \ No newline at end of file diff --git a/dep/d3d12ma/d3d12ma.vcxproj b/dep/d3d12ma/d3d12ma.vcxproj index 4abeb46b6..7dba92b23 100644 --- a/dep/d3d12ma/d3d12ma.vcxproj +++ b/dep/d3d12ma/d3d12ma.vcxproj @@ -1,6 +1,6 @@  - + {F351C4D8-594A-4850-B77B-3C1249812CCE} @@ -10,12 +10,12 @@ - + TurnOffAllWarnings $(ProjectDir)include;%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/fmt/fmt.vcxproj b/dep/fmt/fmt.vcxproj index bcd0fa536..c7b36fb25 100644 --- a/dep/fmt/fmt.vcxproj +++ b/dep/fmt/fmt.vcxproj @@ -1,6 +1,6 @@  - + {8BE398E6-B882-4248-9065-FECC8728E038} @@ -24,7 +24,7 @@ - + TurnOffAllWarnings @@ -32,5 +32,5 @@ %(PreprocessorDefinitions);FMT_EXCEPTIONS=0;FMT_USE_RTTI=0;FMT_CPP_LIB_FILESYSTEM=0 - + diff --git a/dep/glad/glad.vcxproj b/dep/glad/glad.vcxproj index a60f2eb9f..346693729 100644 --- a/dep/glad/glad.vcxproj +++ b/dep/glad/glad.vcxproj @@ -1,6 +1,6 @@  - + {43540154-9E1E-409C-834F-B84BE5621388} @@ -22,12 +22,12 @@ - + TurnOffAllWarnings $(ProjectDir)include;%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/googletest/googletest.vcxproj b/dep/googletest/googletest.vcxproj index 72a9f167f..9ee4adf91 100644 --- a/dep/googletest/googletest.vcxproj +++ b/dep/googletest/googletest.vcxproj @@ -1,6 +1,6 @@  - + @@ -33,7 +33,7 @@ {49953E1B-2EF7-46A4-B88B-1BF9E099093B} - + @@ -42,5 +42,5 @@ - + \ No newline at end of file diff --git a/dep/imgui/imgui.vcxproj b/dep/imgui/imgui.vcxproj index 0c1d27c5d..80c431854 100644 --- a/dep/imgui/imgui.vcxproj +++ b/dep/imgui/imgui.vcxproj @@ -1,6 +1,6 @@  - + @@ -26,12 +26,12 @@ {BB08260F-6FBC-46AF-8924-090EE71360C6} - + TurnOffAllWarnings $(ProjectDir)include;$(ProjectDir)src;$(DepsIncludeDir)freetype2;$(DepsIncludeDir)plutosvg;$(DepsIncludeDir);%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/libchdr/libchdr.vcxproj b/dep/libchdr/libchdr.vcxproj index 3d7540b44..90b6c5bfa 100644 --- a/dep/libchdr/libchdr.vcxproj +++ b/dep/libchdr/libchdr.vcxproj @@ -1,6 +1,6 @@  - + {dd944834-7899-4c1c-a4c1-064b5009d239} @@ -26,12 +26,12 @@ {425D6C99-D1C8-43C2-B8AC-4D7B1D941017} - + TurnOffAllWarnings $(ProjectDir)include;%(AdditionalIncludeDirectories);$(SolutionDir)dep\lzma\include - + diff --git a/dep/lzma/lzma.vcxproj b/dep/lzma/lzma.vcxproj index 510431262..71875c3ed 100644 --- a/dep/lzma/lzma.vcxproj +++ b/dep/lzma/lzma.vcxproj @@ -1,6 +1,6 @@  - + @@ -77,7 +77,7 @@ {DD944834-7899-4C1C-A4C1-064B5009D239} - + TurnOffAllWarnings @@ -85,5 +85,5 @@ $(ProjectDir)include;%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/minizip/minizip.vcxproj b/dep/minizip/minizip.vcxproj index c5aea5ede..3b4e2be57 100644 --- a/dep/minizip/minizip.vcxproj +++ b/dep/minizip/minizip.vcxproj @@ -1,6 +1,6 @@  - + @@ -19,12 +19,12 @@ {8BDA439C-6358-45FB-9994-2FF083BABE06} - + TurnOffAllWarnings $(ProjectDir)include;$(SolutionDir)dep\zlib\include;%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/msvc/.gitignore b/dep/msvc/.gitignore deleted file mode 100644 index 79371b695..000000000 --- a/dep/msvc/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -deps-arm64/ -deps-x64/ - diff --git a/dep/prebuilt/README.md b/dep/prebuilt/README.md new file mode 100644 index 000000000..267a76ca2 --- /dev/null +++ b/dep/prebuilt/README.md @@ -0,0 +1,3 @@ +Prebuilt dependencies pack should be extracted here for the platform you are building for. The build system will look for the dependencies in this directory and link them to the final executable. + +Download the dependencies pack from https://github.com/duckstation/dependencies diff --git a/dep/rapidyaml/rapidyaml.vcxproj b/dep/rapidyaml/rapidyaml.vcxproj index 085245b94..0093ee927 100644 --- a/dep/rapidyaml/rapidyaml.vcxproj +++ b/dep/rapidyaml/rapidyaml.vcxproj @@ -1,6 +1,6 @@  - + {1AD23A8A-4C20-434C-AE6B-0E07759EEB1E} @@ -73,7 +73,7 @@ - + TurnOffAllWarnings @@ -81,5 +81,5 @@ C4_NO_DEBUG_BREAK;%(PreprocessorDefinitions) - + diff --git a/dep/rcheevos/rcheevos.vcxproj b/dep/rcheevos/rcheevos.vcxproj index 3ba2903fa..d136a28b4 100644 --- a/dep/rcheevos/rcheevos.vcxproj +++ b/dep/rcheevos/rcheevos.vcxproj @@ -1,6 +1,6 @@  - + @@ -68,7 +68,7 @@ {4BA0A6D4-3AE1-42B2-9347-096FD023FF64} - + TurnOffAllWarnings @@ -77,5 +77,5 @@ $(ProjectDir)include;%(AdditionalIncludeDirectories) - + \ No newline at end of file diff --git a/dep/reshadefx/reshadefx.vcxproj b/dep/reshadefx/reshadefx.vcxproj index db1e288fa..7cfa5e567 100644 --- a/dep/reshadefx/reshadefx.vcxproj +++ b/dep/reshadefx/reshadefx.vcxproj @@ -1,6 +1,6 @@  - + {27B8D4BB-4F01-4432-BC14-9BF6CA458EEE} @@ -28,7 +28,7 @@ - + TurnOffAllWarnings @@ -36,5 +36,5 @@ stdcpp17 - + \ No newline at end of file diff --git a/dep/simpleini/simpleini.vcxproj b/dep/simpleini/simpleini.vcxproj index 41d61babb..0201016ab 100644 --- a/dep/simpleini/simpleini.vcxproj +++ b/dep/simpleini/simpleini.vcxproj @@ -1,6 +1,6 @@  - + @@ -14,7 +14,7 @@ {3773F4CC-614E-4028-8595-22E08CA649E3} - + @@ -23,5 +23,5 @@ - + \ No newline at end of file diff --git a/dep/vixl/vixl.vcxproj b/dep/vixl/vixl.vcxproj index 83aacc80c..b1d9a6966 100644 --- a/dep/vixl/vixl.vcxproj +++ b/dep/vixl/vixl.vcxproj @@ -1,6 +1,6 @@  - + true @@ -150,7 +150,7 @@ {8906836E-F06E-46E8-B11A-74E5E8C7B8FB} - + VIXL_INCLUDE_TARGET_AARCH64;VIXL_CODE_BUFFER_MALLOC $(ProjectDir)include\vixl\aarch64 @@ -163,5 +163,5 @@ -Wno-deprecated-enum-enum-conversion %(AdditionalOptions) - + \ No newline at end of file diff --git a/dep/msvc/vsprops/Base.props b/dep/vsprops/Base.props similarity index 98% rename from dep/msvc/vsprops/Base.props rename to dep/vsprops/Base.props index bcaf6ed2e..edc3712c8 100644 --- a/dep/msvc/vsprops/Base.props +++ b/dep/vsprops/Base.props @@ -2,8 +2,8 @@ - $(SolutionDir)dep\msvc\deps-x64\ - $(SolutionDir)dep\msvc\deps-arm64\ + $(SolutionDir)dep\prebuilt\windows-x64\ + $(SolutionDir)dep\prebuilt\windows-arm64\ $(DepsRootDir)bin\ $(DepsRootDir)lib\ $(DepsRootDir)include\ diff --git a/dep/msvc/vsprops/BaseApplication.props b/dep/vsprops/BaseApplication.props similarity index 100% rename from dep/msvc/vsprops/BaseApplication.props rename to dep/vsprops/BaseApplication.props diff --git a/dep/msvc/vsprops/Configurations.props b/dep/vsprops/Configurations.props similarity index 100% rename from dep/msvc/vsprops/Configurations.props rename to dep/vsprops/Configurations.props diff --git a/dep/msvc/vsprops/ConsoleApplication.props b/dep/vsprops/ConsoleApplication.props similarity index 100% rename from dep/msvc/vsprops/ConsoleApplication.props rename to dep/vsprops/ConsoleApplication.props diff --git a/dep/msvc/vsprops/DynamicLibrary.props b/dep/vsprops/DynamicLibrary.props similarity index 100% rename from dep/msvc/vsprops/DynamicLibrary.props rename to dep/vsprops/DynamicLibrary.props diff --git a/dep/msvc/vsprops/QtCompile.props b/dep/vsprops/QtCompile.props similarity index 98% rename from dep/msvc/vsprops/QtCompile.props rename to dep/vsprops/QtCompile.props index 76a55896c..cb2d1a69c 100644 --- a/dep/msvc/vsprops/QtCompile.props +++ b/dep/vsprops/QtCompile.props @@ -2,11 +2,11 @@ $(SolutionDir)bin\$(Platform)\ - $(SolutionDir)dep\msvc\deps-x64\ - $(SolutionDir)dep\msvc\deps-arm64\ + $(SolutionDir)dep\prebuilt\windows-x64\ + $(SolutionDir)dep\prebuilt\windows-arm64\ $(DSQTDIRDefault) $(DSQTDIR)\ - $(SolutionDir)dep\msvc\deps-x64\ + $(SolutionDir)dep\prebuilt\windows-x64\ false true $(DSQTDIR)include\ diff --git a/dep/msvc/vsprops/QtCompile.targets b/dep/vsprops/QtCompile.targets similarity index 100% rename from dep/msvc/vsprops/QtCompile.targets rename to dep/vsprops/QtCompile.targets diff --git a/dep/msvc/vsprops/QtCompile.xml b/dep/vsprops/QtCompile.xml similarity index 100% rename from dep/msvc/vsprops/QtCompile.xml rename to dep/vsprops/QtCompile.xml diff --git a/dep/msvc/vsprops/StaticLibrary.props b/dep/vsprops/StaticLibrary.props similarity index 100% rename from dep/msvc/vsprops/StaticLibrary.props rename to dep/vsprops/StaticLibrary.props diff --git a/dep/msvc/vsprops/Targets.props b/dep/vsprops/Targets.props similarity index 100% rename from dep/msvc/vsprops/Targets.props rename to dep/vsprops/Targets.props diff --git a/dep/msvc/vsprops/Toolkit.props b/dep/vsprops/Toolkit.props similarity index 100% rename from dep/msvc/vsprops/Toolkit.props rename to dep/vsprops/Toolkit.props diff --git a/dep/msvc/vsprops/Win32Application.props b/dep/vsprops/Win32Application.props similarity index 100% rename from dep/msvc/vsprops/Win32Application.props rename to dep/vsprops/Win32Application.props diff --git a/dep/xxhash/xxhash.vcxproj b/dep/xxhash/xxhash.vcxproj index 5cba5a0ed..1b9e9aae9 100644 --- a/dep/xxhash/xxhash.vcxproj +++ b/dep/xxhash/xxhash.vcxproj @@ -1,6 +1,6 @@  - + @@ -19,7 +19,7 @@ {09553C96-9F39-49BF-8AE6-7ACBD07C410C} - + @@ -28,5 +28,5 @@ - + \ No newline at end of file diff --git a/dep/zydis/zydis.vcxproj b/dep/zydis/zydis.vcxproj index f47e031d8..2473a4f5e 100644 --- a/dep/zydis/zydis.vcxproj +++ b/dep/zydis/zydis.vcxproj @@ -1,6 +1,6 @@  - + {C51A346A-86B2-46DF-9BB3-D0AA7E5D8699} @@ -80,7 +80,7 @@ - + TurnOffAllWarnings @@ -90,5 +90,5 @@ $(IntDir)%(RelativeDir) - + \ No newline at end of file diff --git a/scripts/appimage/make-appimage.sh b/scripts/appimage/make-appimage.sh index 4b74f1fb1..523a0ed28 100755 --- a/scripts/appimage/make-appimage.sh +++ b/scripts/appimage/make-appimage.sh @@ -19,15 +19,14 @@ function retry_command { done } -if [ "$#" -ne 4 ]; then - echo "Syntax: $0 " +if [ "$#" -ne 3 ]; then + echo "Syntax: $0 " exit 1 fi ROOTDIR=$1 BUILDDIR=$2 -DEPSDIR=$3 -ASSETNAME=$4 +ASSETNAME=$3 BINARY=duckstation-qt APPDIRNAME=DuckStation.AppDir @@ -43,7 +42,7 @@ declare -a MANUAL_LIBS=( "libdiscord-rpc.so" "libharfbuzz.so" "libfreetype.so.6" - "libshaderc_ds.so" + "libshaderc_shared.so" "libspirv-cross-c-shared.so.0" ) @@ -61,6 +60,7 @@ declare -a REMOVE_LIBS=( set -e +DEPSDIR=$(realpath "$SCRIPTDIR/../../dep/prebuilt/linux-x64") LINUXDEPLOY=./linuxdeploy-x86_64 LINUXDEPLOY_PLUGIN_QT=./linuxdeploy-plugin-qt-x86_64 APPIMAGETOOL=./appimagetool-x86_64 diff --git a/scripts/appimage/make-cross-appimage.sh b/scripts/appimage/make-cross-appimage.sh index 02c257433..e23fd9c44 100755 --- a/scripts/appimage/make-cross-appimage.sh +++ b/scripts/appimage/make-cross-appimage.sh @@ -25,16 +25,15 @@ if [ "$1" == "-inject-libc" ]; then shift fi -if [ "$#" -ne 5 ]; then - echo "Syntax: $0 [-inject-libc] " +if [ "$#" -ne 4 ]; then + echo "Syntax: $0 [-inject-libc] " exit 1 fi BINARY=$1 ARCH=$2 BUILDDIR=$3 -DEPSDIR=$4 -CHROOTDIR=$5 +CHROOTDIR=$4 STRIP=llvm-strip @@ -114,7 +113,7 @@ declare -a DEPLIBS=( "libcpuinfo.so" "libdiscord-rpc.so" "libplutosvg.so.0" - "libshaderc_ds.so" + "libshaderc_shared.so" "libsoundtouch.so.2" "libspirv-cross-c-shared.so.0" @@ -221,6 +220,7 @@ set -e IFS=" " +DEPSDIR=$(realpath "$SCRIPTDIR/../../dep/prebuilt/linux-cross-$ARCH") APPIMAGETOOL=./appimagetool-x86_64 APPIMAGERUNTIME=./runtime-${RUNTIMEARCH} PATCHELF=patchelf diff --git a/scripts/deps/build-dependencies-linux-cross.sh b/scripts/deps/build-dependencies-linux-cross.sh deleted file mode 100755 index ed51e5cf1..000000000 --- a/scripts/deps/build-dependencies-linux-cross.sh +++ /dev/null @@ -1,439 +0,0 @@ -#!/usr/bin/env bash - -# SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin -# SPDX-License-Identifier: CC-BY-NC-ND-4.0 -# -# NOTE: In addition to the terms of CC-BY-NC-ND-4.0, you may not use this file to create -# packages or build recipes without explicit permission from the copyright holder. -# - -set -e - -if [ "$#" -lt 4 ]; then - echo "Syntax: $0 [-skip-download] [-skip-cleanup] [-only-download] " - exit 1 -fi - -for arg in "$@"; do - if [ "$arg" == "-skip-download" ]; then - echo "Not downloading sources." - SKIP_DOWNLOAD=true - shift - elif [ "$arg" == "-skip-cleanup" ]; then - echo "Not removing build directory." - SKIP_CLEANUP=true - shift - elif [ "$arg" == "-only-download" ]; then - echo "Only downloading sources." - ONLY_DOWNLOAD=true - shift - fi -done - -SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) -NPROCS="$(getconf _NPROCESSORS_ONLN)" -HOSTDIR="$1" -if [ "${HOSTDIR:0:1}" != "/" ]; then - HOSTDIR="$PWD/$HOSTDIR" -fi -CROSSARCH="$2" -SYSROOTDIR="$3" -if [ "${SYSROOTDIR:0:1}" != "/" ]; then - SYSROOTDIR="$PWD/$SYSROOTDIR" -fi -INSTALLDIR="$4" -if [ "${INSTALLDIR:0:1}" != "/" ]; then - INSTALLDIR="$PWD/$INSTALLDIR" -fi -TOOLCHAINFILE="$INSTALLDIR/toolchain.cmake" -CMAKE_COMMON=( - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAINFILE" - -DCMAKE_PREFIX_PATH="$INSTALLDIR" - -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -) - -# Determine architecture. -if [ "$CROSSARCH" == "arm64" ]; then - CROSSSYSARCH="aarch64" - CROSSTRIPLET="aarch64-linux-gnu" - CMAKEPROCESSOR="aarch64" -elif [ "$CROSSARCH" == "armhf" ]; then - CROSSSYSARCH="armhf" - CROSSTRIPLET="arm-linux-gnueabihf" - CMAKEPROCESSOR="armv7-a" -else - echo "Unknown cross arch $CROSSARCH" - exit 1 -fi - -source "$SCRIPTDIR/versions" - -mkdir -p "${INSTALLDIR}" -mkdir -p deps-build -cd deps-build - -if [[ "$SKIP_DOWNLOAD" != true && ! -f "libbacktrace-$LIBBACKTRACE_COMMIT.tar.gz" ]]; then - curl -C - -L \ - -o "brotli-$BROTLI.tar.gz" "https://github.com/google/brotli/archive/refs/tags/v$BROTLI.tar.gz" \ - -o "freetype-$FREETYPE.tar.gz" "https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE/freetype-$FREETYPE.tar.gz/download" \ - -o "harfbuzz-$HARFBUZZ.tar.gz" "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$HARFBUZZ.tar.gz" \ - -O "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LIBJPEGTURBO/libjpeg-turbo-$LIBJPEGTURBO.tar.gz" \ - -O "https://downloads.sourceforge.net/project/libpng/libpng16/$LIBPNG/libpng-$LIBPNG.tar.gz" \ - -O "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP.tar.gz" \ - -O "https://github.com/nih-at/libzip/releases/download/v$LIBZIP/libzip-$LIBZIP.tar.gz" \ - -o "zlib-ng-$ZLIBNG.tar.gz" "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/$ZLIBNG.tar.gz" \ - -O "https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtwayland-everywhere-src-$QT.tar.xz" \ - -o "libbacktrace-$LIBBACKTRACE_COMMIT.tar.gz" "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE_COMMIT.tar.gz" \ - -O "https://github.com/libsdl-org/SDL/releases/download/release-$SDL3/SDL3-$SDL3.tar.gz" \ - -o "cpuinfo-$CPUINFO_COMMIT.tar.gz" "https://github.com/stenzek/cpuinfo/archive/$CPUINFO_COMMIT.tar.gz" \ - -o "discord-rpc-$DISCORD_RPC_COMMIT.tar.gz" "https://github.com/stenzek/discord-rpc/archive/$DISCORD_RPC_COMMIT.tar.gz" \ - -o "plutosvg-$PLUTOSVG_COMMIT.tar.gz" "https://github.com/stenzek/plutosvg/archive/$PLUTOSVG_COMMIT.tar.gz" \ - -o "shaderc-$SHADERC_COMMIT.tar.gz" "https://github.com/stenzek/shaderc/archive/$SHADERC_COMMIT.tar.gz" \ - -o "soundtouch-$SOUNDTOUCH_COMMIT.tar.gz" "https://github.com/stenzek/soundtouch/archive/$SOUNDTOUCH_COMMIT.tar.gz" -fi - -cat > SHASUMS < "$TOOLCHAINFILE" << EOF -set(CMAKE_CROSSCOMPILING TRUE) -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR ${CMAKEPROCESSOR}) - -set(CMAKE_C_COMPILER "/usr/bin/${CROSSTRIPLET}-gcc") -set(CMAKE_C_COMPILER_TARGET "${CROSSTRIPLET}") -set(CMAKE_C_COMPILER_AR "/usr/bin/${CROSSTRIPLET}-ar") -set(CMAKE_C_COMPILER_RANLIB "/usr/bin/${CROSSTRIPLET}-ranlib") - -set(CMAKE_CXX_COMPILER "/usr/bin/${CROSSTRIPLET}-g++") -set(CMAKE_CXX_COMPILER_TARGET "${CROSSTRIPLET}") -set(CMAKE_CXX_COMPILER_AR "/usr/bin/${CROSSTRIPLET}-ar") -set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/${CROSSTRIPLET}-ranlib") - -set(CMAKE_FIND_ROOT_PATH "${INSTALLDIR};${SYSROOTDIR}") -set(CMAKE_SYSROOT "${SYSROOTDIR}") - -set(CMAKE_PKG_CONFIG_PC_PATH "${PKG_CONFIG_PATH}") -set(CMAKE_PKG_CONFIG_SYSROOT_DIR "${PKG_CONFIG_SYSROOT_DIR}") - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -EOF - -# Build zlib first because of the things that depend on it. -# Disabled because it currently causes crashes on armhf. -#echo "Building zlib-ng..." -#rm -fr "zlib-ng-$ZLIBNG" -#tar xf "zlib-ng-$ZLIBNG.tar.gz" -#cd "zlib-ng-$ZLIBNG" -#cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DZLIB_COMPAT=ON -DBUILD_TESTING=OFF -DWITH_BENCHMARK_APPS=OFF -DWITH_GTEST=OFF -B build -G Ninja -#cmake --build build --parallel -#ninja -C build install -#cd .. - -# NOTE: Must be a shared library because otherwise aarch64 libgcc symbols are missing when building with clang. -echo "Building libbacktrace..." -rm -fr "libbacktrace-$LIBBACKTRACE_COMMIT" -tar xf "libbacktrace-$LIBBACKTRACE_COMMIT.tar.gz" -cd "libbacktrace-$LIBBACKTRACE_COMMIT" -CFLAGS="-fmacro-prefix-map=\"${PWD}\"=. -ffile-prefix-map=\"${PWD}\"=." ./configure --prefix="$INSTALLDIR" --build=x86_64-linux-gnu --host="${CROSSTRIPLET}" --with-pic --enable-shared --disable-static -make -make install -cd .. -rm -fr "libbacktrace-$LIBBACKTRACE_COMMIT" - -echo "Building libpng..." -rm -fr "libpng-$LIBPNG" -tar xf "libpng-$LIBPNG.tar.gz" -cd "libpng-$LIBPNG" -patch -p1 < "$SCRIPTDIR/libpng-1.6.54-apng.patch" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_STATIC=OFF -DPNG_SHARED=ON -DPNG_TOOLS=OFF -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "libpng-$LIBPNG" - -echo "Building libjpeg..." -rm -fr "libjpeg-turbo-$LIBJPEGTURBO" -tar xf "libjpeg-turbo-$LIBJPEGTURBO.tar.gz" -cd "libjpeg-turbo-$LIBJPEGTURBO" -cmake "${CMAKE_COMMON[@]}" -DENABLE_STATIC=OFF -DENABLE_SHARED=ON -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "libjpeg-turbo-$LIBJPEGTURBO" - -echo "Building Zstandard..." -rm -fr "zstd-$ZSTD" -tar xf "zstd-$ZSTD.tar.gz" -cd "zstd-$ZSTD" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_PROGRAMS=OFF -B build -G Ninja build/cmake -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "zstd-$ZSTD" - -echo "Building Brotli..." -rm -fr "brotli-$BROTLI" -tar xf "brotli-$BROTLI.tar.gz" -cd "brotli-$BROTLI" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=OFF -DBROTLI_BUILD_TOOLS=OFF -DBROTLI_DISABLE_TESTS=ON -B build -G Ninja -ninja -C build install -cd .. -rm -fr "brotli-$BROTLI" - -echo "Building WebP..." -rm -fr "libwebp-$LIBWEBP" -tar xf "libwebp-$LIBWEBP.tar.gz" -cd "libwebp-$LIBWEBP" -cmake "${CMAKE_COMMON[@]}" -B build -G Ninja \ - -DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF \ - -DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "libwebp-$LIBWEBP" - -echo "Building libzip..." -rm -fr "libzip-$LIBZIP" -tar xf "libzip-$LIBZIP.tar.gz" -cd "libzip-$LIBZIP" -cmake "${CMAKE_COMMON[@]}" -B build -G Ninja \ - -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF \ - -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=ON -DBUILD_SHARED_LIBS=ON -DLIBZIP_DO_INSTALL=ON \ - -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_OSSFUZZ=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "libzip-$LIBZIP" - -echo "Building FreeType..." -rm -fr "freetype-$FREETYPE" -tar xf "freetype-$FREETYPE.tar.gz" -cd "freetype-$FREETYPE" -patch -p1 < "$SCRIPTDIR/freetype-harfbuzz-soname.patch" -patch -p1 < "$SCRIPTDIR/freetype-static-brotli.patch" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=ON -DFT_REQUIRE_PNG=ON -DFT_DISABLE_BZIP2=TRUE -DFT_REQUIRE_BROTLI=TRUE -DFT_DYNAMIC_HARFBUZZ=TRUE -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "freetype-$FREETYPE" - -echo "Building HarfBuzz..." -rm -fr "harfbuzz-$HARFBUZZ" -tar xf "harfbuzz-$HARFBUZZ.tar.gz" -cd "harfbuzz-$HARFBUZZ" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DHB_BUILD_UTILS=OFF -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "harfbuzz-$HARFBUZZ" - -echo "Building SDL..." -rm -fr "SDL3-$SDL3" -tar xf "SDL3-$SDL3.tar.gz" -cd "SDL3-$SDL3" -cmake -B build "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TESTS=OFF -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "SDL3-$SDL3" - -# Couple notes: -# -fontconfig is needed otherwise Qt Widgets render only boxes. -# -qt-doubleconversion avoids a dependency on libdouble-conversion. -# ICU avoids pulling in a bunch of large libraries, and hopefully we can get away without it. -# OpenGL is needed to render window decorations in Wayland, apparently. -# dbus-runtime and linked off to avoid a relocation error (different to host.. probably should change that). -# Brotli is disabled as we static link it, and QtNetwork doesn't link with bbrotlicommon. -echo "Building Qt Base..." -rm -fr "qtbase-everywhere-src-$QT" -tar xf "qtbase-everywhere-src-$QT.tar.xz" -cd "qtbase-everywhere-src-$QT" -patch -p1 < "$SCRIPTDIR/qtbase-fusion-style.patch" -mkdir build -cd build -../configure -prefix "$INSTALLDIR" -extprefix "$INSTALLDIR" -qt-host-path "$HOSTDIR" -release -dbus runtime -fontconfig -qt-doubleconversion -ssl -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -xcb -- -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAINFILE" -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -DFEATURE_cups=OFF -DFEATURE_dbus=ON -DFEATURE_dbus_linked=OFF -DFEATURE_icu=OFF -DFEATURE_sql=OFF -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON -DFEATURE_gtk3=OFF -DFEATURE_brotli=OFF -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qtbase-everywhere-src-$QT" - -echo "Building Qt SVG..." -rm -fr "qtsvg-everywhere-src-$QT" -tar xf "qtsvg-everywhere-src-$QT.tar.xz" -cd "qtsvg-everywhere-src-$QT" -mkdir build -cd build -"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qtsvg-everywhere-src-$QT" - -echo "Building Qt Image Formats..." -rm -fr "qtimageformats-everywhere-src-$QT" -tar xf "qtimageformats-everywhere-src-$QT.tar.xz" -cd "qtimageformats-everywhere-src-$QT" -mkdir build -cd build -"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -DFEATURE_system_webp=ON -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qtimageformats-everywhere-src-$QT" - -echo "Building Qt Wayland..." -rm -fr "qtwayland-everywhere-src-$QT" -tar xf "qtwayland-everywhere-src-$QT.tar.xz" -cd "qtwayland-everywhere-src-$QT" -mkdir build -cd build -"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qtwayland-everywhere-src-$QT" - -echo "Installing Qt Tools..." -rm -fr "qttools-everywhere-src-$QT" -tar xf "qttools-everywhere-src-$QT.tar.xz" -cd "qttools-everywhere-src-$QT" -patch -p1 < "$SCRIPTDIR/qttools-linguist-without-quick.patch" -patch -p1 < "$SCRIPTDIR/qttools-disable-clang.patch" -mkdir build -cd build -"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=ON -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qttools-everywhere-src-$QT" - -echo "Installing Qt Translations..." -rm -fr "qttranslations-everywhere-src-$QT" -tar xf "qttranslations-everywhere-src-$QT.tar.xz" -cd "qttranslations-everywhere-src-$QT" -mkdir build -cd build -"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DQT_GENERATE_SBOM=OFF -cmake --build . --parallel -ninja install -cd ../../ -rm -fr "qttranslations-everywhere-src-$QT" - -echo "Building shaderc..." -rm -fr "shaderc-$SHADERC_COMMIT" -tar xf "shaderc-$SHADERC_COMMIT.tar.gz" -cd "shaderc-$SHADERC_COMMIT" -cmake "${CMAKE_COMMON[@]}" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_EXECUTABLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "shaderc-$SHADERC_COMMIT" - -echo "Building SPIRV-Cross..." -cd SPIRV-Cross -rm -fr build -cmake "${CMAKE_COMMON[@]}" -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_STATIC=OFF -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_ENABLE_GLSL=ON -DSPIRV_CROSS_ENABLE_HLSL=OFF -DSPIRV_CROSS_ENABLE_MSL=OFF -DSPIRV_CROSS_ENABLE_CPP=OFF -DSPIRV_CROSS_ENABLE_REFLECT=OFF -DSPIRV_CROSS_ENABLE_C_API=ON -DSPIRV_CROSS_ENABLE_UTIL=ON -B build -G Ninja -cmake --build build --parallel -ninja -C build install -rm -fr build -cd .. - -echo "Building cpuinfo..." -rm -fr "cpuinfo-$CPUINFO_COMMIT" -tar xf "cpuinfo-$CPUINFO_COMMIT.tar.gz" -cd "cpuinfo-$CPUINFO_COMMIT" -cmake "${CMAKE_COMMON[@]}" -DCPUINFO_LIBRARY_TYPE=shared -DCPUINFO_RUNTIME_TYPE=shared -DCPUINFO_LOG_LEVEL=error -DCPUINFO_LOG_TO_STDIO=ON -DCPUINFO_BUILD_TOOLS=OFF -DCPUINFO_BUILD_UNIT_TESTS=OFF -DCPUINFO_BUILD_MOCK_TESTS=OFF -DCPUINFO_BUILD_BENCHMARKS=OFF -DUSE_SYSTEM_LIBS=ON -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "cpuinfo-$CPUINFO_COMMIT" - -echo "Building discord-rpc..." -rm -fr "discord-rpc-$DISCORD_RPC_COMMIT" -tar xf "discord-rpc-$DISCORD_RPC_COMMIT.tar.gz" -cd "discord-rpc-$DISCORD_RPC_COMMIT" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "discord-rpc-$DISCORD_RPC_COMMIT" - -echo "Building plutosvg..." -rm -fr "plutosvg-$PLUTOSVG_COMMIT" -tar xf "plutosvg-$PLUTOSVG_COMMIT.tar.gz" -cd "plutosvg-$PLUTOSVG_COMMIT" -cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DPLUTOSVG_ENABLE_FREETYPE=ON -DPLUTOSVG_BUILD_EXAMPLES=OFF -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "plutosvg-$PLUTOSVG_COMMIT" - -echo "Building soundtouch..." -rm -fr "soundtouch-$SOUNDTOUCH_COMMIT" -tar xf "soundtouch-$SOUNDTOUCH_COMMIT.tar.gz" -cd "soundtouch-$SOUNDTOUCH_COMMIT" -cmake "${CMAKE_COMMON[@]}" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -B build -G Ninja -cmake --build build --parallel -ninja -C build install -cd .. -rm -fr "soundtouch-$SOUNDTOUCH_COMMIT" - -if [ "$SKIP_CLEANUP" != true ]; then - echo "Cleaning up..." - cd .. - rm -fr deps-build -fi diff --git a/scripts/deps/build-dependencies-linux.sh b/scripts/deps/build-dependencies-linux.sh deleted file mode 100755 index 12cddcd3e..000000000 --- a/scripts/deps/build-dependencies-linux.sh +++ /dev/null @@ -1,382 +0,0 @@ -#!/usr/bin/env bash - -# SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin -# SPDX-License-Identifier: CC-BY-NC-ND-4.0 -# -# NOTE: In addition to the terms of CC-BY-NC-ND-4.0, you may not use this file to create -# packages or build recipes without explicit permission from the copyright holder. -# - -set -e - -if [ "$#" -lt 1 ]; then - echo "Syntax: $0 [-skip-download] [-skip-cleanup] [-only-download] " - exit 1 -fi - -for arg in "$@"; do - if [ "$arg" == "-skip-download" ]; then - echo "Not downloading sources." - SKIP_DOWNLOAD=true - shift - elif [ "$arg" == "-skip-cleanup" ]; then - echo "Not removing build directory." - SKIP_CLEANUP=true - shift - elif [ "$arg" == "-only-download" ]; then - echo "Only downloading sources." - ONLY_DOWNLOAD=true - shift - fi -done - -SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) -NPROCS="$(getconf _NPROCESSORS_ONLN)" -INSTALLDIR="$1" -if [ "${INSTALLDIR:0:1}" != "/" ]; then - INSTALLDIR="$PWD/$INSTALLDIR" -fi - -source "$SCRIPTDIR/versions" - -mkdir -p deps-build -cd deps-build - -if [[ "$SKIP_DOWNLOAD" != true && ! -f "libbacktrace-$LIBBACKTRACE_COMMIT.tar.gz" ]]; then - curl -C - -L \ - -o "brotli-$BROTLI.tar.gz" "https://github.com/google/brotli/archive/refs/tags/v$BROTLI.tar.gz" \ - -o "freetype-$FREETYPE.tar.gz" "https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE/freetype-$FREETYPE.tar.gz/download" \ - -o "harfbuzz-$HARFBUZZ.tar.gz" "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$HARFBUZZ.tar.gz" \ - -O "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LIBJPEGTURBO/libjpeg-turbo-$LIBJPEGTURBO.tar.gz" \ - -O "https://downloads.sourceforge.net/project/libpng/libpng16/$LIBPNG/libpng-$LIBPNG.tar.gz" \ - -O "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP.tar.gz" \ - -O "https://github.com/nih-at/libzip/releases/download/v$LIBZIP/libzip-$LIBZIP.tar.gz" \ - -o "zlib-ng-$ZLIBNG.tar.gz" "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/$ZLIBNG.tar.gz" \ - -O "https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \ - -O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtwayland-everywhere-src-$QT.tar.xz" \ - -o "libbacktrace-$LIBBACKTRACE_COMMIT.tar.gz" "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE_COMMIT.tar.gz" \ - -O "https://github.com/libsdl-org/SDL/releases/download/release-$SDL3/SDL3-$SDL3.tar.gz" \ - -o "cpuinfo-$CPUINFO_COMMIT.tar.gz" "https://github.com/stenzek/cpuinfo/archive/$CPUINFO_COMMIT.tar.gz" \ - -o "discord-rpc-$DISCORD_RPC_COMMIT.tar.gz" "https://github.com/stenzek/discord-rpc/archive/$DISCORD_RPC_COMMIT.tar.gz" \ - -o "plutosvg-$PLUTOSVG_COMMIT.tar.gz" "https://github.com/stenzek/plutosvg/archive/$PLUTOSVG_COMMIT.tar.gz" \ - -o "shaderc-$SHADERC_COMMIT.tar.gz" "https://github.com/stenzek/shaderc/archive/$SHADERC_COMMIT.tar.gz" \ - -o "soundtouch-$SOUNDTOUCH_COMMIT.tar.gz" "https://github.com/stenzek/soundtouch/archive/$SOUNDTOUCH_COMMIT.tar.gz" -fi - -cat > SHASUMS </dev/null; then - ARMBIN="${ARMDIR}/${X86BIN}" - echo "Merge $ARMBIN to $X86BIN..." - lipo -create "$X86BIN" "$ARMBIN" -o "$X86BIN" - fi - done - popd -} - -if [ "$#" -ne 1 ]; then - echo "Syntax: $0 " - exit 1 -fi - -export MACOSX_DEPLOYMENT_TARGET=13.3 - -NPROCS="$(getconf _NPROCESSORS_ONLN)" -SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) -INSTALLDIR="$1" -if [ "${INSTALLDIR:0:1}" != "/" ]; then - INSTALLDIR="$PWD/$INSTALLDIR" -fi - -source "$SCRIPTDIR/versions" -MOLTENVK=1.4.0 - -mkdir -p deps-build -cd deps-build - -export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH" -export LDFLAGS="-L$INSTALLDIR/lib $LDFLAGS" -export CFLAGS="-I$INSTALLDIR/include $CFLAGS" -export CXXFLAGS="-I$INSTALLDIR/include $CXXFLAGS" -CMAKE_COMMON=( - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SHARED_LINKER_FLAGS="-dead_strip -dead_strip_dylibs" - -DCMAKE_PREFIX_PATH="$INSTALLDIR" - -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" - -DCMAKE_INSTALL_NAME_DIR='$/lib' -) -CMAKE_ARCH_X64=-DCMAKE_OSX_ARCHITECTURES="x86_64" -CMAKE_ARCH_ARM64=-DCMAKE_OSX_ARCHITECTURES="arm64" -CMAKE_ARCH_UNIVERSAL=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - -# SBOM generation appears to be broken on MacOS, and I can't be arsed to debug it. -CMAKE_COMMON_QT=( - -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - -DQT_GENERATE_SBOM=OFF -) - -cat > SHASUMS < -rem SPDX-License-Identifier: CC-BY-NC-ND-4.0 - -echo Setting environment... -if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" ( - call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" -) else if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" ( - call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" -) else ( - echo Visual Studio 2022 not found. - goto error -) - -set SEVENZIP="C:\Program Files\7-Zip\7z.exe" -set PATCH="C:\Program Files\Git\usr\bin\patch.exe" - -if defined DEBUG ( - echo DEBUG=%DEBUG% -) else ( - set DEBUG=1 -) - -pushd %~dp0 -set "SCRIPTDIR=%CD%" -cd ..\..\dep\msvc -mkdir deps-build -cd deps-build || goto error -set "BUILDDIR=%CD%" -cd .. -mkdir deps-arm64 -cd deps-arm64 || goto error -set "INSTALLDIR=%CD%" -cd .. -cd deps-x64 || goto error -set "X64INSTALLDIR=%CD%" -cd .. -popd - -echo SCRIPTDIR=%SCRIPTDIR% -echo BUILDDIR=%BUILDDIR% -echo INSTALLDIR=%INSTALLDIR% - -cd "%BUILDDIR%" - -REM Read each line from the file and set as environment variable -for /f "usebackq tokens=1,2 delims==" %%a in ("%SCRIPTDIR%\versions") do ( - if not "%%a"=="" if not "%%b"=="" ( - set "%%a=%%b" - rem echo Set %%a=%%b - ) -) - -call :downloadfile "brotli-%BROTLI%.tar.gz" "https://github.com/google/brotli/archive/refs/tags/v%BROTLI%.tar.gz" "%BROTLI_GZ_HASH%" || goto error -call :downloadfile "freetype-%FREETYPE%.tar.gz" "https://download.savannah.gnu.org/releases/freetype/freetype-%FREETYPE%.tar.gz" "%FREETYPE_GZ_HASH%" || goto error -call :downloadfile "harfbuzz-%HARFBUZZ%.tar.gz" "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.tar.gz" "%HARFBUZZ_GZ_HASH%" || goto error -call :downloadfile "libpng-%LIBPNG%.tar.gz" "https://download.sourceforge.net/libpng/libpng-%LIBPNG%.tar.gz" "%LIBPNG_GZ_HASH%" || goto error -call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "%LIBJPEGTURBO_GZ_HASH%" || goto error -call :downloadfile "SDL3-%SDL3%.zip" "https://github.com/libsdl-org/SDL/releases/download/release-%SDL3%/SDL3-%SDL3%.zip" "%SDL3_ZIP_HASH%" || goto error -call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" "%QTBASE_ZIP_HASH%" || goto error -call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" "%QTIMAGEFORMATS_ZIP_HASH%" || goto error -call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" "%QTSVG_ZIP_HASH%" || goto error -call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" "%QTTOOLS_ZIP_HASH%" || goto error -call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" "%QTTRANSLATIONS_ZIP_HASH%" || goto error -call :downloadfile "libwebp-%LIBWEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%LIBWEBP%.tar.gz" "%LIBWEBP_GZ_HASH%" || goto error -call :downloadfile "libzip-%LIBZIP%.tar.gz" "https://github.com/nih-at/libzip/releases/download/v%LIBZIP%/libzip-%LIBZIP%.tar.gz" "%LIBZIP_GZ_HASH%" || goto error -call :downloadfile "zlib-ng-%ZLIBNG%.tar.gz" "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/%ZLIBNG%.tar.gz" "%ZLIBNG_GZ_HASH%" || goto error -call :downloadfile "zstd-%ZSTD%.tar.gz" "https://github.com/facebook/zstd/releases/download/v%ZSTD%/zstd-%ZSTD%.tar.gz" "%ZSTD_GZ_HASH%" || goto error - -call :downloadfile "cpuinfo-%CPUINFO_COMMIT%.tar.gz" "https://github.com/stenzek/cpuinfo/archive/%CPUINFO_COMMIT%.tar.gz" "%CPUINFO_GZ_HASH%" || goto error -call :downloadfile "discord-rpc-%DISCORD_RPC_COMMIT%.tar.gz" "https://github.com/stenzek/discord-rpc/archive/%DISCORD_RPC_COMMIT%.tar.gz" "%DISCORD_RPC_GZ_HASH%" || goto error -call :downloadfile "plutosvg-%PLUTOSVG_COMMIT%.tar.gz" "https://github.com/stenzek/plutosvg/archive/%PLUTOSVG_COMMIT%.tar.gz" "%PLUTOSVG_GZ_HASH%" || goto error -call :downloadfile "shaderc-%SHADERC_COMMIT%.tar.gz" "https://github.com/stenzek/shaderc/archive/%SHADERC_COMMIT%.tar.gz" "%SHADERC_GZ_HASH%" || goto error -call :downloadfile "soundtouch-%SOUNDTOUCH_COMMIT%.tar.gz" "https://github.com/stenzek/soundtouch/archive/%SOUNDTOUCH_COMMIT%.tar.gz" "%SOUNDTOUCH_GZ_HASH%" || goto error -call :downloadfile "dxcompiler-%DXCOMPILER_VERSION%.zip" "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.DXC/%DXCOMPILER_VERSION%" "%DXCOMPILER_ZIP_HASH%" || goto error - -if not exist SPIRV-Cross\ ( - git clone https://github.com/KhronosGroup/SPIRV-Cross/ -b %SPIRV_CROSS_TAG% --depth 1 || goto error - pushd SPIRV-Cross - git reset --hard %SPIRV_CROSS_SHA% || goto error - popd -) - -if %DEBUG%==1 ( - echo Building debug and release libraries... -) else ( - echo Building release libraries... -) - -set FORCEPDB=-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/DEBUG" -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="/DEBUG" -set ARM64TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE="%SCRIPTDIR%\cmake-toolchain-windows-arm64.cmake" - -echo Building zlib-ng... -rmdir /S /Q "zlib-ng-%ZLIBNG%" -tar -xf "zlib-ng-%ZLIBNG%.tar.gz" || goto error -cd "zlib-ng-%ZLIBNG%" || goto error -rem BUILD_SHARED_LIBS deliberately ommitted so that both shared and static libraries are built, we need static for the updater. -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DZLIB_COMPAT=ON -DBUILD_TESTING=OFF -DWITH_BENCHMARK_APPS=OFF -DWITH_GTEST=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "zlib-ng-%ZLIBNG%" - -echo Building libpng... -rmdir /S /Q "libpng-%LIBPNG%" -tar -xf "libpng-%LIBPNG%.tar.gz" || goto error -cd "libpng-%LIBPNG%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\libpng-1.6.54-apng.patch" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_STATIC=OFF -DPNG_SHARED=ON -DPNG_TOOLS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libpng-%LIBPNG%" - -echo Building libjpeg... -rmdir /S /Q "libjpeg-turbo-%LIBJPEGTURBO%" -tar -xf "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" || goto error -cd "libjpeg-turbo-%LIBJPEGTURBO%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DENABLE_STATIC=OFF -DENABLE_SHARED=ON -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libjpeg-turbo-%LIBJPEGTURBO%" - -echo Building Zstandard... -rmdir /S /Q "zstd-%ZSTD%" -tar -xf "zstd-%ZSTD%.tar.gz" --exclude "zstd-%ZSTD%/tests/cli-tests/*" || goto error -cd "zstd-%ZSTD%" -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_PROGRAMS=OFF -B build -G Ninja build/cmake -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "zstd-%ZSTD%" - -echo Building Brotli... -rmdir /S /Q "brotli-%BROTLI%" -tar -xf "brotli-%BROTLI%.tar.gz" || goto error -cd "brotli-%BROTLI%" || goto error -cmake -B build %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=OFF -DBROTLI_BUILD_TOOLS=OFF -DBROTLI_DISABLE_TESTS=ON -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "brotli-%BROTLI%" - -echo Building WebP... -rmdir /S /Q "libwebp-%LIBWEBP%" -tar -xf "libwebp-%LIBWEBP%.tar.gz" || goto error -cd "libwebp-%LIBWEBP%" || goto error -cmake -B build %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF -DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libwebp-%LIBWEBP%" - -echo Building libzip... -rmdir /S /Q "libzip-%LIBZIP%" -tar -xf "libzip-%LIBZIP%.tar.gz" || goto error -cd "libzip-%LIBZIP%" || goto error -cmake -B build %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=ON -DBUILD_SHARED_LIBS=ON -DLIBZIP_DO_INSTALL=ON -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_OSSFUZZ=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libzip-%LIBZIP%" - -echo Building FreeType... -rmdir /S /Q "freetype-%FREETYPE%" -tar -xf "freetype-%FREETYPE%.tar.gz" || goto error -cd "freetype-%FREETYPE%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\freetype-harfbuzz-soname.patch" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\freetype-static-brotli.patch" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=TRUE -DFT_REQUIRE_PNG=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_REQUIRE_BROTLI=TRUE -DFT_DYNAMIC_HARFBUZZ=TRUE -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "freetype-%FREETYPE%" - -echo Building HarfBuzz... -rmdir /S /Q "harfbuzz-%HARFBUZZ%" -tar -xf "harfbuzz-%HARFBUZZ%.tar.gz" || goto error -cd "harfbuzz-%HARFBUZZ%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DHB_BUILD_UTILS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "harfbuzz-%HARFBUZZ%" - -echo Building SDL... -rmdir /S /Q "SDL3-%SDL3%" -%SEVENZIP% x "SDL3-%SDL3%.zip" || goto error -cd "SDL3-%SDL3%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\sdl3-ezfrd64-dll.patch" || goto error -cmake -B build %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release %FORCEPDB% -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TESTS=OFF -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -copy build\SDL3.pdb "%INSTALLDIR%\bin" || goto error -cd .. || goto error -rmdir /S /Q "SDL3-%SDL3%" - -if %DEBUG%==1 ( - set QTBUILDSPEC=-DCMAKE_CONFIGURATION_TYPES="Release;Debug" -G "Ninja Multi-Config" -) else ( - set QTBUILDSPEC=-DCMAKE_BUILD_TYPE=Release -G Ninja -) - -echo Building Qt base... -rmdir /S /Q "qtbase-everywhere-src-%QT%" -%SEVENZIP% x "qtbase-everywhere-src-%QT%.zip" || goto error -cd "qtbase-everywhere-src-%QT%" || goto error - -rem Stop checkboxes in Fusion theme having such bright outlines. -%PATCH% -p1 < "%SCRIPTDIR%\qtbase-fusion-style.patch" || goto error - -cmake -B build %ARM64TOOLCHAIN% -DFEATURE_sql=OFF -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DQT_HOST_PATH="%X64INSTALLDIR%" %FORCEPDB% -DQT_GENERATE_SBOM=OFF -DINPUT_ssl=yes -DINPUT_openssl=no -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON -DFEATURE_brotli=OFF %QTBUILDSPEC% || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "qtbase-everywhere-src-%QT%" - -echo Building Qt SVG... -rmdir /S /Q "qtsvg-everywhere-src-%QT%" -%SEVENZIP% x "qtsvg-everywhere-src-%QT%.zip" || goto error -cd "qtsvg-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qtsvg-everywhere-src-%QT%" - -echo Building Qt Image Formats... -rmdir /S /Q "qtimageformats-everywhere-src-%QT%" -%SEVENZIP% x "qtimageformats-everywhere-src-%QT%.zip" || goto error -cd "qtimageformats-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF -DFEATURE_system_webp=ON || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qtimageformats-everywhere-src-%QT%" - -echo Building Qt Tools... -rmdir /S /Q "qttools-everywhere-src-%QT%" -%SEVENZIP% x "qttools-everywhere-src-%QT%.zip" || goto error -cd "qttools-everywhere-src-%QT%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\qttools-linguist-without-quick.patch" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qttools-everywhere-src-%QT%" - -echo Building Qt Translations... -rmdir /S /Q "qttranslations-everywhere-src-%QT%" -%SEVENZIP% x "qttranslations-everywhere-src-%QT%.zip" || goto error -cd "qttranslations-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qttranslations-everywhere-src-%QT%" - -echo Building shaderc... -rmdir /S /Q "shaderc-%SHADERC_COMMIT%" -tar -xf "shaderc-%SHADERC_COMMIT%.tar.gz" || goto error -cd "shaderc-%SHADERC_COMMIT%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_EXECUTABLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -DSHADERC_ENABLE_SHARED_CRT=ON -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "shaderc-%SHADERC_COMMIT%" - -echo Building SPIRV-Cross... -cd SPIRV-Cross || goto error -rmdir /S /Q "build" -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_STATIC=OFF -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_ENABLE_GLSL=ON -DSPIRV_CROSS_ENABLE_HLSL=ON -DSPIRV_CROSS_ENABLE_MSL=OFF -DSPIRV_CROSS_ENABLE_CPP=OFF -DSPIRV_CROSS_ENABLE_REFLECT=OFF -DSPIRV_CROSS_ENABLE_C_API=ON -DSPIRV_CROSS_ENABLE_UTIL=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -rmdir /S /Q "build" -cd .. || goto error - -echo Building cpuinfo... -rmdir /S /Q "cpuinfo-%CPUINFO_COMMIT%" -tar -xf "cpuinfo-%CPUINFO_COMMIT%.tar.gz" || goto error -cd "cpuinfo-%CPUINFO_COMMIT%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DCPUINFO_LIBRARY_TYPE=shared -DCPUINFO_RUNTIME_TYPE=shared -DCPUINFO_LOG_LEVEL=error -DCPUINFO_LOG_TO_STDIO=ON -DCPUINFO_BUILD_TOOLS=OFF -DCPUINFO_BUILD_UNIT_TESTS=OFF -DCPUINFO_BUILD_MOCK_TESTS=OFF -DCPUINFO_BUILD_BENCHMARKS=OFF -DUSE_SYSTEM_LIBS=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "cpuinfo-%CPUINFO_COMMIT%" - -echo Building discord-rpc... -rmdir /S /Q "discord-rpc-%DISCORD_RPC_COMMIT%" -tar -xf "discord-rpc-%DISCORD_RPC_COMMIT%.tar.gz" || goto error -cd "discord-rpc-%DISCORD_RPC_COMMIT%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "discord-rpc-%DISCORD_RPC_COMMIT%" - -echo Building plutosvg... -rmdir /S /Q "plutosvg-%PLUTOSVG_COMMIT%" -tar -xf "plutosvg-%PLUTOSVG_COMMIT%.tar.gz" || goto error -cd "plutosvg-%PLUTOSVG_COMMIT%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DPLUTOSVG_ENABLE_FREETYPE=ON -DPLUTOSVG_BUILD_EXAMPLES=OFF -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "plutosvg-%PLUTOSVG_COMMIT%" - -rem This currently isn't using clang-cl. It probably should, might be losing a little speed. -echo Building soundtouch... -rmdir /S /Q "soundtouch-%SOUNDTOUCH_COMMIT%" -tar -xf "soundtouch-%SOUNDTOUCH_COMMIT%.tar.gz" || goto error -cd "soundtouch-%SOUNDTOUCH_COMMIT%" || goto error -cmake %ARM64TOOLCHAIN% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "soundtouch-%SOUNDTOUCH_COMMIT%" - -rem These should already exist, but just in case. -mkdir "%INSTALLDIR%\bin" -mkdir "%INSTALLDIR%\include" -mkdir "%INSTALLDIR%\lib" - -echo Extracting DXCompiler... -rmdir /S /Q "dxcompiler-%DXCOMPILER_VERSION%" -mkdir "dxcompiler-%DXCOMPILER_VERSION%" -cd "dxcompiler-%DXCOMPILER_VERSION%" || goto error -%SEVENZIP% x "..\dxcompiler-%DXCOMPILER_VERSION%.zip" || goto error -copy build\native\include\* "%INSTALLDIR%\include" || goto error -copy build\native\bin\arm64\*.dll "%INSTALLDIR%\bin" || goto error -copy build\native\lib\arm64\*.lib "%INSTALLDIR%\lib" || goto error -cd .. || goto error -rmdir /S /Q "dxcompiler-%DXCOMPILER_VERSION%" - -echo Cleaning up... -cd .. -rd /S /Q deps-build - -echo Exiting with success. -exit 0 - -:error -echo Failed with error #%errorlevel%. -pause -exit %errorlevel% - -:downloadfile -if not exist "%~1" ( - echo Downloading %~1 from %~2... - curl -L -o "%~1" "%~2" || goto error -) - -rem based on https://gist.github.com/gsscoder/e22daefaff9b5d8ac16afb070f1a7971 -set idx=0 -for /f %%F in ('certutil -hashfile "%~1" SHA256') do ( - set "out!idx!=%%F" - set /a idx += 1 -) -set filechecksum=%out1% - -if /i %~3==%filechecksum% ( - echo Validated %~1. - exit /B 0 -) else ( - echo Expected %~3 got %filechecksum%. - exit /B 1 -) diff --git a/scripts/deps/build-dependencies-windows-x64.bat b/scripts/deps/build-dependencies-windows-x64.bat deleted file mode 100644 index 633b262f0..000000000 --- a/scripts/deps/build-dependencies-windows-x64.bat +++ /dev/null @@ -1,377 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -rem SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin -rem SPDX-License-Identifier: CC-BY-NC-ND-4.0 - -echo Setting environment... -if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" ( - call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" -) else if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" ( - call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" -) else ( - echo Visual Studio 2022 not found. - goto error -) - -set SEVENZIP="C:\Program Files\7-Zip\7z.exe" -set PATCH="C:\Program Files\Git\usr\bin\patch.exe" - -if defined DEBUG ( - echo DEBUG=%DEBUG% -) else ( - set DEBUG=1 -) - -pushd %~dp0 -set "SCRIPTDIR=%CD%" -cd ..\..\dep\msvc -mkdir deps-build -cd deps-build || goto error -set "BUILDDIR=%CD%" -cd .. -mkdir deps-x64 -cd deps-x64 || goto error -set "INSTALLDIR=%CD%" -popd - -echo SCRIPTDIR=%SCRIPTDIR% -echo BUILDDIR=%BUILDDIR% -echo INSTALLDIR=%INSTALLDIR% - -set "PATH=%PATH%;%INSTALLDIR%\bin" - -cd "%BUILDDIR%" - -REM Read each line from the file and set as environment variable -for /f "usebackq tokens=1,2 delims==" %%a in ("%SCRIPTDIR%\versions") do ( - if not "%%a"=="" if not "%%b"=="" ( - set "%%a=%%b" - rem echo Set %%a=%%b - ) -) - -call :downloadfile "brotli-%BROTLI%.tar.gz" "https://github.com/google/brotli/archive/refs/tags/v%BROTLI%.tar.gz" "%BROTLI_GZ_HASH%" || goto error -call :downloadfile "freetype-%FREETYPE%.tar.gz" "https://download.savannah.gnu.org/releases/freetype/freetype-%FREETYPE%.tar.gz" "%FREETYPE_GZ_HASH%" || goto error -call :downloadfile "harfbuzz-%HARFBUZZ%.tar.gz" "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.tar.gz" "%HARFBUZZ_GZ_HASH%" || goto error -call :downloadfile "libpng-%LIBPNG%.tar.gz" "https://download.sourceforge.net/libpng/libpng-%LIBPNG%.tar.gz" "%LIBPNG_GZ_HASH%" || goto error -call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "%LIBJPEGTURBO_GZ_HASH%" || goto error -call :downloadfile "SDL3-%SDL3%.zip" "https://github.com/libsdl-org/SDL/releases/download/release-%SDL3%/SDL3-%SDL3%.zip" "%SDL3_ZIP_HASH%" || goto error -call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" "%QTBASE_ZIP_HASH%" || goto error -call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" "%QTIMAGEFORMATS_ZIP_HASH%" || goto error -call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" "%QTSVG_ZIP_HASH%" || goto error -call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" "%QTTOOLS_ZIP_HASH%" || goto error -call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" "%QTTRANSLATIONS_ZIP_HASH%" || goto error -call :downloadfile "libwebp-%LIBWEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%LIBWEBP%.tar.gz" "%LIBWEBP_GZ_HASH%" || goto error -call :downloadfile "libzip-%LIBZIP%.tar.gz" "https://github.com/nih-at/libzip/releases/download/v%LIBZIP%/libzip-%LIBZIP%.tar.gz" "%LIBZIP_GZ_HASH%" || goto error -call :downloadfile "zlib-ng-%ZLIBNG%.tar.gz" "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/%ZLIBNG%.tar.gz" "%ZLIBNG_GZ_HASH%" || goto error -call :downloadfile "zstd-%ZSTD%.tar.gz" "https://github.com/facebook/zstd/releases/download/v%ZSTD%/zstd-%ZSTD%.tar.gz" "%ZSTD_GZ_HASH%" || goto error - -call :downloadfile "cpuinfo-%CPUINFO_COMMIT%.tar.gz" "https://github.com/stenzek/cpuinfo/archive/%CPUINFO_COMMIT%.tar.gz" "%CPUINFO_GZ_HASH%" || goto error -call :downloadfile "discord-rpc-%DISCORD_RPC_COMMIT%.tar.gz" "https://github.com/stenzek/discord-rpc/archive/%DISCORD_RPC_COMMIT%.tar.gz" "%DISCORD_RPC_GZ_HASH%" || goto error -call :downloadfile "plutosvg-%PLUTOSVG_COMMIT%.tar.gz" "https://github.com/stenzek/plutosvg/archive/%PLUTOSVG_COMMIT%.tar.gz" "%PLUTOSVG_GZ_HASH%" || goto error -call :downloadfile "shaderc-%SHADERC_COMMIT%.tar.gz" "https://github.com/stenzek/shaderc/archive/%SHADERC_COMMIT%.tar.gz" "%SHADERC_GZ_HASH%" || goto error -call :downloadfile "soundtouch-%SOUNDTOUCH_COMMIT%.tar.gz" "https://github.com/stenzek/soundtouch/archive/%SOUNDTOUCH_COMMIT%.tar.gz" "%SOUNDTOUCH_GZ_HASH%" || goto error -call :downloadfile "dxcompiler-%DXCOMPILER_VERSION%.zip" "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.DXC/%DXCOMPILER_VERSION%" "%DXCOMPILER_ZIP_HASH%" || goto error - -if not exist SPIRV-Cross\ ( - git clone https://github.com/KhronosGroup/SPIRV-Cross/ -b %SPIRV_CROSS_TAG% --depth 1 || goto error - pushd SPIRV-Cross - git reset --hard %SPIRV_CROSS_SHA% || goto error - popd -) - -if %DEBUG%==1 ( - echo Building debug and release libraries... -) else ( - echo Building release libraries... -) - -set FORCEPDB=-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/DEBUG" -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="/DEBUG" - -echo Building zlib-ng... -rmdir /S /Q "zlib-ng-%ZLIBNG%" -tar -xf "zlib-ng-%ZLIBNG%.tar.gz" || goto error -cd "zlib-ng-%ZLIBNG%" || goto error -rem BUILD_SHARED_LIBS deliberately ommitted so that both shared and static libraries are built, we need static for the updater. -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DZLIB_COMPAT=ON -DBUILD_TESTING=OFF -DWITH_BENCHMARK_APPS=OFF -DWITH_GTEST=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "zlib-ng-%ZLIBNG%" - -echo Building libpng... -rmdir /S /Q "libpng-%LIBPNG%" -tar -xf "libpng-%LIBPNG%.tar.gz" || goto error -cd "libpng-%LIBPNG%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\libpng-1.6.54-apng.patch" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_STATIC=OFF -DPNG_SHARED=ON -DPNG_TOOLS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libpng-%LIBPNG%" - -echo Building libjpeg... -rmdir /S /Q "libjpeg-turbo-%LIBJPEGTURBO%" -tar -xf "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" || goto error -cd "libjpeg-turbo-%LIBJPEGTURBO%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DENABLE_STATIC=OFF -DENABLE_SHARED=ON -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libjpeg-turbo-%LIBJPEGTURBO%" - -echo Building Zstandard... -rmdir /S /Q "zstd-%ZSTD%" -tar -xf "zstd-%ZSTD%.tar.gz" --exclude "zstd-%ZSTD%/tests/cli-tests/*" || goto error -cd "zstd-%ZSTD%" -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_PROGRAMS=OFF -B build -G Ninja build/cmake -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "zstd-%ZSTD%" - -echo Building Brotli... -rmdir /S /Q "brotli-%BROTLI%" -tar -xf "brotli-%BROTLI%.tar.gz" || goto error -cd "brotli-%BROTLI%" || goto error -cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=OFF -DBROTLI_BUILD_TOOLS=OFF -DBROTLI_DISABLE_TESTS=ON -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "brotli-%BROTLI%" - -echo Building WebP... -rmdir /S /Q "libwebp-%LIBWEBP%" -tar -xf "libwebp-%LIBWEBP%.tar.gz" || goto error -cd "libwebp-%LIBWEBP%" || goto error -cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF -DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libwebp-%LIBWEBP%" - -echo Building libzip... -rmdir /S /Q "libzip-%LIBZIP%" -tar -xf "libzip-%LIBZIP%.tar.gz" || goto error -cd "libzip-%LIBZIP%" || goto error -cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=ON -DBUILD_SHARED_LIBS=ON -DLIBZIP_DO_INSTALL=ON -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_OSSFUZZ=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "libzip-%LIBZIP%" - -echo Building FreeType... -rmdir /S /Q "freetype-%FREETYPE%" -tar -xf "freetype-%FREETYPE%.tar.gz" || goto error -cd "freetype-%FREETYPE%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\freetype-harfbuzz-soname.patch" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\freetype-static-brotli.patch" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=TRUE -DFT_REQUIRE_PNG=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_REQUIRE_BROTLI=TRUE -DFT_DYNAMIC_HARFBUZZ=TRUE -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "freetype-%FREETYPE%" - -echo Building HarfBuzz... -rmdir /S /Q "harfbuzz-%HARFBUZZ%" -tar -xf "harfbuzz-%HARFBUZZ%.tar.gz" || goto error -cd "harfbuzz-%HARFBUZZ%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DHB_BUILD_UTILS=OFF -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "harfbuzz-%HARFBUZZ%" - -echo Building SDL... -rmdir /S /Q "SDL3-%SDL3%" -%SEVENZIP% x "SDL3-%SDL3%.zip" || goto error -cd "SDL3-%SDL3%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\sdl3-ezfrd64-dll.patch" || goto error -cmake -B build -DCMAKE_BUILD_TYPE=Release %FORCEPDB% -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TESTS=OFF -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -copy build\SDL3.pdb "%INSTALLDIR%\bin" || goto error -cd .. || goto error -rmdir /S /Q "SDL3-%SDL3%" - -if %DEBUG%==1 ( - set QTBUILDSPEC=-DCMAKE_CONFIGURATION_TYPES="Release;Debug" -G "Ninja Multi-Config" -) else ( - set QTBUILDSPEC=-DCMAKE_BUILD_TYPE=Release -G Ninja -) - -echo Building Qt base... -rmdir /S /Q "qtbase-everywhere-src-%QT%" -%SEVENZIP% x "qtbase-everywhere-src-%QT%.zip" || goto error -cd "qtbase-everywhere-src-%QT%" || goto error - -rem Disable the PCRE2 JIT, it doesn't properly verify AVX2 support. -%PATCH% -p1 < "%SCRIPTDIR%\qtbase-disable-pcre2-jit.patch" || goto error - -rem Stop checkboxes in Fusion theme having such bright outlines. -%PATCH% -p1 < "%SCRIPTDIR%\qtbase-fusion-style.patch" || goto error - -cmake -B build -DFEATURE_sql=OFF -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" %FORCEPDB% -DQT_GENERATE_SBOM=OFF -DINPUT_ssl=yes -DINPUT_openssl=no -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON -DFEATURE_brotli=OFF %QTBUILDSPEC% || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "qtbase-everywhere-src-%QT%" - -echo Building Qt SVG... -rmdir /S /Q "qtsvg-everywhere-src-%QT%" -%SEVENZIP% x "qtsvg-everywhere-src-%QT%.zip" || goto error -cd "qtsvg-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qtsvg-everywhere-src-%QT%" - -echo Building Qt Image Formats... -rmdir /S /Q "qtimageformats-everywhere-src-%QT%" -%SEVENZIP% x "qtimageformats-everywhere-src-%QT%.zip" || goto error -cd "qtimageformats-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF -DFEATURE_system_webp=ON || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qtimageformats-everywhere-src-%QT%" - -echo Building Qt Tools... -rmdir /S /Q "qttools-everywhere-src-%QT%" -%SEVENZIP% x "qttools-everywhere-src-%QT%.zip" || goto error -cd "qttools-everywhere-src-%QT%" || goto error -%PATCH% -p1 < "%SCRIPTDIR%\qttools-linguist-without-quick.patch" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=ON -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF || goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qttools-everywhere-src-%QT%" - -echo Building Qt Translations... -rmdir /S /Q "qttranslations-everywhere-src-%QT%" -%SEVENZIP% x "qttranslations-everywhere-src-%QT%.zip" || goto error -cd "qttranslations-everywhere-src-%QT%" || goto error -mkdir build || goto error -cd build || goto error -call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DQT_GENERATE_SBOM=OFF|| goto error -cmake --build . --parallel || goto error -ninja install || goto error -cd ..\.. || goto error -rmdir /S /Q "qttranslations-everywhere-src-%QT%" - -echo Building shaderc... -rmdir /S /Q "shaderc-%SHADERC_COMMIT%" -tar -xf "shaderc-%SHADERC_COMMIT%.tar.gz" || goto error -cd "shaderc-%SHADERC_COMMIT%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_EXECUTABLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -DSHADERC_ENABLE_SHARED_CRT=ON -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "shaderc-%SHADERC_COMMIT%" - -echo Building SPIRV-Cross... -cd SPIRV-Cross || goto error -rmdir /S /Q "build" -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_STATIC=OFF -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_ENABLE_GLSL=ON -DSPIRV_CROSS_ENABLE_HLSL=ON -DSPIRV_CROSS_ENABLE_MSL=OFF -DSPIRV_CROSS_ENABLE_CPP=OFF -DSPIRV_CROSS_ENABLE_REFLECT=OFF -DSPIRV_CROSS_ENABLE_C_API=ON -DSPIRV_CROSS_ENABLE_UTIL=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -rmdir /S /Q "build" -cd .. || goto error - -echo Building cpuinfo... -rmdir /S /Q "cpuinfo-%CPUINFO_COMMIT%" -tar -xf "cpuinfo-%CPUINFO_COMMIT%.tar.gz" || goto error -cd "cpuinfo-%CPUINFO_COMMIT%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DCPUINFO_LIBRARY_TYPE=shared -DCPUINFO_RUNTIME_TYPE=shared -DCPUINFO_LOG_LEVEL=error -DCPUINFO_LOG_TO_STDIO=ON -DCPUINFO_BUILD_TOOLS=OFF -DCPUINFO_BUILD_UNIT_TESTS=OFF -DCPUINFO_BUILD_MOCK_TESTS=OFF -DCPUINFO_BUILD_BENCHMARKS=OFF -DUSE_SYSTEM_LIBS=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "cpuinfo-%CPUINFO_COMMIT%" - -echo Building discord-rpc... -rmdir /S /Q "discord-rpc-%DISCORD_RPC_COMMIT%" -tar -xf "discord-rpc-%DISCORD_RPC_COMMIT%.tar.gz" || goto error -cd "discord-rpc-%DISCORD_RPC_COMMIT%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "discord-rpc-%DISCORD_RPC_COMMIT%" - -echo Building plutosvg... -rmdir /S /Q "plutosvg-%PLUTOSVG_COMMIT%" -tar -xf "plutosvg-%PLUTOSVG_COMMIT%.tar.gz" || goto error -cd "plutosvg-%PLUTOSVG_COMMIT%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DPLUTOSVG_ENABLE_FREETYPE=ON -DPLUTOSVG_BUILD_EXAMPLES=OFF -B build -G Ninja -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "plutosvg-%PLUTOSVG_COMMIT%" - -echo Building soundtouch... -rmdir /S /Q "soundtouch-%SOUNDTOUCH_COMMIT%" -tar -xf "soundtouch-%SOUNDTOUCH_COMMIT%.tar.gz" || goto error -cd "soundtouch-%SOUNDTOUCH_COMMIT%" || goto error -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -B build -G Ninja || goto error -cmake --build build --parallel || goto error -ninja -C build install || goto error -cd .. || goto error -rmdir /S /Q "soundtouch-%SOUNDTOUCH_COMMIT%" - -rem These should already exist, but just in case. -mkdir "%INSTALLDIR%\bin" -mkdir "%INSTALLDIR%\include" -mkdir "%INSTALLDIR%\lib" - -echo Extracting DXCompiler... -rmdir /S /Q "dxcompiler-%DXCOMPILER_VERSION%" -mkdir "dxcompiler-%DXCOMPILER_VERSION%" -cd "dxcompiler-%DXCOMPILER_VERSION%" || goto error -%SEVENZIP% x "..\dxcompiler-%DXCOMPILER_VERSION%.zip" || goto error -copy build\native\include\* "%INSTALLDIR%\include" || goto error -copy build\native\bin\x64\*.dll "%INSTALLDIR%\bin" || goto error -copy build\native\lib\x64\*.lib "%INSTALLDIR%\lib" || goto error -cd .. || goto error -rmdir /S /Q "dxcompiler-%DXCOMPILER_VERSION%" - -echo Cleaning up... -cd .. -rd /S /Q deps-build - -echo Exiting with success. -exit 0 - -:error -echo Failed with error #%errorlevel%. -pause -exit %errorlevel% - -:downloadfile -if not exist "%~1" ( - echo Downloading %~1 from %~2... - curl -L -o "%~1" "%~2" || goto error -) - -rem based on https://gist.github.com/gsscoder/e22daefaff9b5d8ac16afb070f1a7971 -set idx=0 -for /f %%F in ('certutil -hashfile "%~1" SHA256') do ( - set "out!idx!=%%F" - set /a idx += 1 -) -set filechecksum=%out1% - -if /i %~3==%filechecksum% ( - echo Validated %~1. - exit /B 0 -) else ( - echo Expected %~3 got %filechecksum%. - exit /B 1 -) diff --git a/scripts/deps/build-ffmpeg-linux.sh b/scripts/deps/build-ffmpeg-linux.sh deleted file mode 100755 index 8d6748d95..000000000 --- a/scripts/deps/build-ffmpeg-linux.sh +++ /dev/null @@ -1,356 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ "$#" -lt 1 ]; then - echo "Syntax: $0 " - exit 1 -fi - -for arg in "$@"; do - if [ "$arg" == "-skip-download" ]; then - echo "Not downloading sources." - SKIP_DOWNLOAD=true - shift - elif [ "$arg" == "-skip-cleanup" ]; then - echo "Not removing build directory." - SKIP_CLEANUP=true - shift - elif [ "$arg" == "" ]; then - # Eat empty args. - shift - fi -done - -SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) -NPROCS="$(getconf _NPROCESSORS_ONLN)" -INSTALLDIR="$1" -if [ "${INSTALLDIR:0:1}" != "/" ]; then - INSTALLDIR="$PWD/$INSTALLDIR" -fi - -mkdir -p deps-build -cd deps-build - -DEPSINSTALLDIR="$PWD/ffmpeg-deps" -echo "Installation directory is $INSTALLDIR" -echo "FFmpeg dependencies directory is $DEPSINSTALLDIR" - -source "$SCRIPTDIR/versions" - -LAME=3.100 -LIBVPX=1.15.2 -FDK_AAC=0fc0e0e0b89de3becd5f099eae725f13eeecc0d1 -LIBAOM=d772e334cc724105040382a977ebb10dfd393293 -LIBOGG=1.3.5 -LIBVORBIS=1.3.7 -LIBTHEORA=1.1.1 -FLAC=1.5.0 -SPEEX=1.2.0 -AMF=1.4.36 -OPUS=1.5.2 -SVT_AV1=3.1.2 -GLSLANG=15.4.0 -VULKAN_HEADERS=1.4.329 - -# Encoder list from freedesktop SDK, which apparently came from Fedora. -# Disabled list: av1_qsv h264_qsv hevc_qsv mjpeg_qsv mpeg2_qsv vc1_qsv vp8_qsv vp9_qsv -# av1_nvenc h264_nvenc hevc_nvenc libxvid libtwolame libopenh264 libgsm libgsm_ms -# ilbc libilbc libopencore_amrnb libopenjpeg libvo_amrwbenc libjxl libcodec2 hap librav1e -FFMPEG_ENCODER_LIST=""\ -"a64multi a64multi5 aac libfdk_aac ac3 adpcm_adx "\ -"adpcm_argo adpcm_g722 adpcm_g726 adpcm_g726le adpcm_ima_alp adpcm_ima_amv "\ -"adpcm_ima_apm adpcm_ima_qt adpcm_ima_ssi adpcm_ima_wav adpcm_ima_ws adpcm_ms "\ -"adpcm_swf adpcm_yamaha alac alias_pix amv anull "\ -"apng ass asv1 asv2 av1_amf "\ -"av1_vaapi av1_vulkan ayuv bitpacked bmp cinepak "\ -"cljr dca dfpwm dnxhd dpx dvbsub "\ -"dvdsub dvvideo exr ffv1 ffv1_vulkan ffvhuff flac "\ -"flashsv flashsv2 flv g723_1 gif h261 "\ -"h263 h263_v4l2m2m h263p h264_amf "\ -"h264_v4l2m2m h264_vaapi h264_vulkan hdr hevc_amf "\ -"hevc_v4l2m2m hevc_vaapi hevc_vulkan huffyuv jpegls "\ -"jpeg2000 libaom libaom_av1 libmp3lame "\ -"libopus libschroedinger libspeex libsvtav1 libtheora "\ -"libvorbis libvpx_vp8 libvpx_vp9 libwebp "\ -"libwebp_anim mjpeg mjpeg_vaapi mlp "\ -"mp2 mp2fixed mpeg1video mpeg2video mpeg2_vaapi "\ -"mpeg4 mpeg4_v4l2m2m msmpeg4v2 msmpeg4v3 msvideo1 nellymoser "\ -"opus pam pbm pcm_alaw pcm_f32be pcm_f32le "\ -"pcm_f64be pcm_f64le pcm_mulaw pcm_s16be pcm_s16be_planar pcm_s16le "\ -"pcm_s16le_planar pcm_s24be pcm_s24le pcm_s24le_planar pcm_s32be pcm_s32le "\ -"pcm_s32le_planar pcm_s8 pcm_s8_planar pcm_u16be pcm_u16le pcm_u24be "\ -"pcm_u24le pcm_u32be pcm_u32le pcm_u8 pcx pgm "\ -"pgmyuv phm png ppm qoi qtrle "\ -"r10k r210 ra_144 rawvideo roq roq_dpcm "\ -"rpza rv10 rv20 s302m sbc sgi "\ -"smc snow sonic sonic_ls speedhq srt "\ -"ssa subrip sunrast svq1 targa text "\ -"tiff truehd tta ttml utvideo v210 "\ -"v308 v408 v410 vc1_v4l2m2m vc2 "\ -"vnull vorbis vp8_v4l2m2m vp8_vaapi "\ -"vp9_vaapi wavpack wbmp webvtt wmav1 wmav2 "\ -"wmv1 wmv2 wrapped_avframe xbm xface xsub "\ -"xwd y41p yuv4 zlib zmbv" -FFMPEG_ENCODERS="" -for encoder in $FFMPEG_ENCODER_LIST; do - if [ -z "$FFMPEG_ENCODERS" ]; then - FFMPEG_ENCODERS="--enable-encoder=$encoder" - else - FFMPEG_ENCODERS="$FFMPEG_ENCODERS,$encoder" - fi -done - -if [ "$SKIP_DOWNLOAD" != true ]; then - if [ ! -f "ffmpeg-$FFMPEG_VERSION.tar.xz" ]; then - curl -C - -L -O "https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.xz" - fi - if [ ! -f "lame-$LAME.tar.gz" ]; then - curl -C - -L -o "lame-$LAME.tar.gz" "https://sourceforge.net/projects/lame/files/lame/$LAME/lame-$LAME.tar.gz/download" - fi - if [ ! -f "libvpx-$LIBVPX.tar.gz" ]; then - curl -C - -L -o "libvpx-$LIBVPX.tar.gz" "https://github.com/webmproject/libvpx/archive/refs/tags/v$LIBVPX.tar.gz" - fi - if [ ! -f "fdk-aac-stripped-$FDK_AAC.tar.gz" ]; then - curl -C - -L -o "fdk-aac-stripped-$FDK_AAC.tar.gz" "https://gitlab.freedesktop.org/wtaymans/fdk-aac-stripped/-/archive/$FDK_AAC/fdk-aac-stripped-$FDK_AAC.tar.gz" - fi - if [ ! -d "aom" ]; then - git clone https://aomedia.googlesource.com/aom - cd aom - git checkout "$LIBAOM" - cd .. - fi - if [ ! -f "libogg-$LIBOGG.tar.gz" ]; then - curl -C - -L -O "https://downloads.xiph.org/releases/ogg/libogg-$LIBOGG.tar.gz" - fi - if [ ! -f "libvorbis-$LIBVORBIS.tar.gz" ]; then - curl -C - -L -O "https://github.com/xiph/vorbis/releases/download/v$LIBVORBIS/libvorbis-$LIBVORBIS.tar.gz" - fi - if [ ! -f "libtheora-$LIBTHEORA.tar.bz2" ]; then - curl -C - -L -O "https://downloads.xiph.org/releases/theora/libtheora-$LIBTHEORA.tar.bz2" - fi - if [ ! -f "flac-$FLAC.tar.xz" ]; then - curl -C - -L -O "https://downloads.xiph.org/releases/flac/flac-$FLAC.tar.xz" - fi - if [ ! -f "speex-$SPEEX.tar.gz" ]; then - curl -C - -L -O "https://downloads.xiph.org/releases/speex/speex-$SPEEX.tar.gz" - fi - if [ ! -f "AMF-headers-v$AMF.tar.gz" ]; then - curl -C - -L -O "https://github.com/GPUOpen-LibrariesAndSDKs/AMF/releases/download/v$AMF/AMF-headers-v$AMF.tar.gz" - fi - if [ ! -f "opus-$OPUS.tar.gz" ]; then - curl -C - -L -O "https://downloads.xiph.org/releases/opus/opus-$OPUS.tar.gz" - fi - if [ ! -f "SVT-AV1-$SVT_AV1.tar.gz" ]; then - curl -C - -L -O "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v$SVT_AV1/SVT-AV1-$SVT_AV1.tar.gz" - fi - if [ ! -f "glslang-$GLSLANG.tar.gz" ]; then - curl -C - -L -o "glslang-$GLSLANG.tar.gz" "https://github.com/KhronosGroup/glslang/archive/refs/tags/$GLSLANG.tar.gz" - fi - if [ ! -f "Vulkan-Headers-$VULKAN_HEADERS.tar.gz" ]; then - curl -C - -L -o "Vulkan-Headers-$VULKAN_HEADERS.tar.gz" "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v$VULKAN_HEADERS.tar.gz" - fi -fi - -cat > SHASUMS <= ${HARFBUZZ_MIN_VERSION}") - endif () - if (BROTLIDEC_FOUND) -- target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES}) -+ target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) - target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS}) - target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS}) - list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec") ---- freetype-2.14.1/builds/cmake/FindBrotliDec.cmake 2025-09-07 19:48:18.000000000 -0700 -+++ freetype-2.14.1/builds/cmake/FindBrotliDec.cmake 2025-12-25 21:48:38.433700400 -0800 -@@ -21,7 +21,7 @@ - - find_package(PkgConfig QUIET) - --pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec) -+pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec libbrotlicommon) - - if (PC_BROTLIDEC_VERSION) - set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}") -@@ -40,10 +40,22 @@ - ${PC_BROTLIDEC_LIBRARY_DIRS}) - - -+find_path(BROTLICOMMON_INCLUDE_DIRS -+ NAMES brotli/decode.h -+ HINTS ${PC_BROTLICOMMON_INCLUDEDIR} -+ ${PC_BROTLICOMMON_INCLUDE_DIRS} -+ PATH_SUFFIXES brotli) -+ -+find_library(BROTLICOMMON_LIBRARIES -+ NAMES brotlicommon -+ HINTS ${PC_BROTLICOMMON_LIBDIR} -+ ${PC_BROTLICOMMON_LIBRARY_DIRS}) -+ -+ - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args( - BrotliDec -- REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES -+ REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLICOMMON_INCLUDE_DIRS BROTLIDEC_LIBRARIES BROTLICOMMON_LIBRARIES - FOUND_VAR BROTLIDEC_FOUND - VERSION_VAR BROTLIDEC_VERSION) - diff --git a/scripts/deps/libpng-1.6.54-apng.patch b/scripts/deps/libpng-1.6.54-apng.patch deleted file mode 100644 index 54c0001c9..000000000 --- a/scripts/deps/libpng-1.6.54-apng.patch +++ /dev/null @@ -1,1739 +0,0 @@ -diff -Naru libpng-1.6.54.org/png.h libpng-1.6.54/png.h ---- libpng-1.6.54.org/png.h 2026-01-15 09:54:33.410881877 +0900 -+++ libpng-1.6.54/png.h 2026-01-15 14:49:49.345302877 +0900 -@@ -328,6 +328,10 @@ - # include "pnglibconf.h" - #endif - -+#define PNG_APNG_SUPPORTED -+#define PNG_READ_APNG_SUPPORTED -+#define PNG_WRITE_APNG_SUPPORTED -+ - #ifndef PNG_VERSION_INFO_ONLY - /* Machine specific configuration. */ - # include "pngconf.h" -@@ -423,6 +427,17 @@ - * See pngconf.h for base types that vary by machine/system - */ - -+#ifdef PNG_APNG_SUPPORTED -+/* dispose_op flags from inside fcTL */ -+#define PNG_DISPOSE_OP_NONE 0x00U -+#define PNG_DISPOSE_OP_BACKGROUND 0x01U -+#define PNG_DISPOSE_OP_PREVIOUS 0x02U -+ -+/* blend_op flags from inside fcTL */ -+#define PNG_BLEND_OP_SOURCE 0x00U -+#define PNG_BLEND_OP_OVER 0x01U -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* This triggers a compiler error in png.c, if png.c and png.h - * do not agree upon the version number. - */ -@@ -801,6 +816,10 @@ - (png_structp, png_infop)); - typedef PNG_CALLBACK(void, *png_progressive_end_ptr, - (png_structp, png_infop)); -+#ifdef PNG_APNG_SUPPORTED -+typedef PNG_CALLBACK(void, *png_progressive_frame_ptr, -+ (png_structp, png_uint_32)); -+#endif - - /* The following callback receives png_uint_32 row_number, int pass for the - * png_bytep data of the row. When transforming an interlaced image the -@@ -3506,6 +3525,80 @@ - * END OF HARDWARE AND SOFTWARE OPTIONS - ******************************************************************************/ - -+#ifdef PNG_APNG_SUPPORTED -+PNG_EXPORT(260, png_uint_32, png_get_acTL, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *num_frames, png_uint_32 *num_plays)); -+ -+PNG_EXPORT(261, png_uint_32, png_set_acTL, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays)); -+ -+PNG_EXPORT(262, png_uint_32, png_get_num_frames, -+ (png_structp png_ptr, png_infop info_ptr)); -+ -+PNG_EXPORT(263, png_uint_32, png_get_num_plays, -+ (png_structp png_ptr, png_infop info_ptr)); -+ -+PNG_EXPORT(264, png_uint_32, png_get_next_frame_fcTL, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *width, png_uint_32 *height, -+ png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, -+ png_byte *dispose_op, png_byte *blend_op)); -+ -+PNG_EXPORT(265, png_uint_32, png_set_next_frame_fcTL, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+ -+PNG_EXPORT(266, png_uint_32, png_get_next_frame_width, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(267, png_uint_32, png_get_next_frame_height, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(268, png_uint_32, png_get_next_frame_x_offset, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(269, png_uint_32, png_get_next_frame_y_offset, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(270, png_uint_16, png_get_next_frame_delay_num, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(271, png_uint_16, png_get_next_frame_delay_den, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(272, png_byte, png_get_next_frame_dispose_op, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(273, png_byte, png_get_next_frame_blend_op, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(274, png_byte, png_get_first_frame_is_hidden, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(275, png_uint_32, png_set_first_frame_is_hidden, -+ (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+PNG_EXPORT(276, void, png_read_frame_head, -+ (png_structp png_ptr, png_infop info_ptr)); -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+PNG_EXPORT(277, void, png_set_progressive_frame_fn, -+ (png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn)); -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+PNG_EXPORT(278, void, png_write_frame_head, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+ -+PNG_EXPORT(279, void, png_write_frame_tail, -+ (png_structp png_ptr, png_infop info_ptr)); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* Maintainer: Put new public prototypes here ^, in libpng.3, in project - * defs, and in scripts/symbols.def. - */ -@@ -3514,7 +3608,11 @@ - * one to use is one more than this.) - */ - #ifdef PNG_EXPORT_LAST_ORDINAL -+#ifdef PNG_APNG_SUPPORTED -+ PNG_EXPORT_LAST_ORDINAL(279); -+#else - PNG_EXPORT_LAST_ORDINAL(259); -+#endif /* PNG_APNG_SUPPORTED */ - #endif - - #ifdef __cplusplus -diff -Naru libpng-1.6.54.org/pngget.c libpng-1.6.54/pngget.c ---- libpng-1.6.54.org/pngget.c 2026-01-15 09:54:33.410881877 +0900 -+++ libpng-1.6.54/pngget.c 2026-01-16 15:37:23.199617980 +0900 -@@ -1366,4 +1366,166 @@ - # endif - #endif - -+#ifdef PNG_APNG_SUPPORTED -+png_uint_32 PNGAPI -+png_get_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *num_frames, png_uint_32 *num_plays) -+{ -+ png_debug1(1, "in %s retrieval function", "acTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_acTL) && -+ num_frames != NULL && num_plays != NULL) -+ { -+ *num_frames = info_ptr->num_frames; -+ *num_plays = info_ptr->num_plays; -+ return 1; -+ } -+ -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_num_frames(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_frames"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->num_frames; -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_num_plays(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_plays"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->num_plays; -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *width, png_uint_32 *height, -+ png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, -+ png_byte *dispose_op, png_byte *blend_op) -+{ -+ png_debug1(1, "in %s retrieval function", "fcTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_fcTL) && -+ width != NULL && height != NULL && -+ x_offset != NULL && y_offset != NULL && -+ delay_num != NULL && delay_den != NULL && -+ dispose_op != NULL && blend_op != NULL) -+ { -+ *width = info_ptr->next_frame_width; -+ *height = info_ptr->next_frame_height; -+ *x_offset = info_ptr->next_frame_x_offset; -+ *y_offset = info_ptr->next_frame_y_offset; -+ *delay_num = info_ptr->next_frame_delay_num; -+ *delay_den = info_ptr->next_frame_delay_den; -+ *dispose_op = info_ptr->next_frame_dispose_op; -+ *blend_op = info_ptr->next_frame_blend_op; -+ return 1; -+ } -+ -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_width"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_width; -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_height"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_height; -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_x_offset"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_x_offset; -+ return 0; -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_y_offset"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_y_offset; -+ return 0; -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_num"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_delay_num; -+ return 0; -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_den"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_delay_den; -+ return 0; -+} -+ -+png_byte PNGAPI -+png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_dispose_op"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_dispose_op; -+ return 0; -+} -+ -+png_byte PNGAPI -+png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_blend_op"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return info_ptr->next_frame_blend_op; -+ return 0; -+} -+ -+png_byte PNGAPI -+png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_first_frame_is_hidden"); -+ -+ if (png_ptr != NULL) -+ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); -+ -+ PNG_UNUSED(info_ptr) -+ -+ return 0; -+} -+#endif /* PNG_APNG_SUPPORTED */ - #endif /* READ || WRITE */ -diff -Naru libpng-1.6.54.org/pnginfo.h libpng-1.6.54/pnginfo.h ---- libpng-1.6.54.org/pnginfo.h 2025-05-11 18:44:02.085040902 +0900 -+++ libpng-1.6.54/pnginfo.h 2026-01-15 13:50:32.228564907 +0900 -@@ -259,5 +259,18 @@ - #ifdef PNG_sRGB_SUPPORTED - int rendering_intent; - #endif -+ -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 num_frames; /* including default image */ -+ png_uint_32 num_plays; -+ png_uint_32 next_frame_width; -+ png_uint_32 next_frame_height; -+ png_uint_32 next_frame_x_offset; -+ png_uint_32 next_frame_y_offset; -+ png_uint_16 next_frame_delay_num; -+ png_uint_16 next_frame_delay_den; -+ png_byte next_frame_dispose_op; -+ png_byte next_frame_blend_op; -+#endif - }; - #endif /* PNGINFO_H */ -diff -Naru libpng-1.6.54.org/pngpread.c libpng-1.6.54/pngpread.c ---- libpng-1.6.54.org/pngpread.c 2025-07-06 11:06:43.933735454 +0900 -+++ libpng-1.6.54/pngpread.c 2026-01-16 16:44:17.565675229 +0900 -@@ -200,6 +200,105 @@ - - chunk_name = png_ptr->chunk_name; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->num_frames_read > 0 && -+ png_ptr->num_frames_read < info_ptr->num_frames) -+ { -+ if (chunk_name == png_IDAT) -+ { -+ /* Discard trailing IDATs for the first frame. */ -+ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "Misplaced IDAT in APNG stream"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else if (chunk_name == png_fdAT) -+ { -+ if (png_ptr->buffer_size < 4) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_ensure_sequence_number(png_ptr, 4); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ { -+ /* Discard trailing fdATs for frames other than the first. */ -+ if (png_ptr->num_frames_read < 2) -+ png_error(png_ptr, "Misplaced fdAT in APNG stream"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ else -+ { -+ /* Frame data follows. */ -+ png_ptr->idat_size = png_ptr->push_length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ png_ptr->process_mode = PNG_READ_IDAT_MODE; -+ -+ return; -+ } -+ } -+ -+ else if (chunk_name == png_fcTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ png_error(png_ptr, "Missing required fcTL chunk in APNG stream"); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ png_progressive_read_reset(png_ptr); -+ -+ if (png_ptr->frame_info_fn != NULL) -+ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ -+ return; -+ } -+ -+ else -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence"); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ return; -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - if (chunk_name == png_IDAT) - { - if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) -@@ -268,6 +367,9 @@ - - else if (chunk_name == png_IDAT) - { -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = png_ptr->push_length; - png_ptr->process_mode = PNG_READ_IDAT_MODE; - png_push_have_info(png_ptr, info_ptr); -@@ -278,6 +380,31 @@ - return; - } - -+#ifdef PNG_READ_APNG_SUPPORTED -+ else if (chunk_name == png_acTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ -+ else if (chunk_name == png_fcTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - else - { - PNG_PUSH_SAVE_BUFFER_IF_FULL -@@ -409,7 +536,11 @@ - png_byte chunk_tag[4]; - - /* TODO: this code can be commoned up with the same code in push_read */ -+#ifdef PNG_READ_APNG_SUPPORTED -+ PNG_PUSH_SAVE_BUFFER_IF_LT(12) -+#else - PNG_PUSH_SAVE_BUFFER_IF_LT(8) -+#endif - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); -@@ -417,17 +548,63 @@ - png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0) -+ { -+ if (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) -+ { -+ png_ptr->process_mode = PNG_READ_CHUNK_MODE; -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+ return; -+ } -+ else -+ { -+ if (png_ptr->chunk_name == png_IEND) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence"); -+ png_crc_finish(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ } -+ else -+#endif -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0) -+#else - if (png_ptr->chunk_name != png_IDAT) -+#endif - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) - png_error(png_ptr, "Not enough compressed data"); - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+#endif -+ - return; - } - - png_ptr->idat_size = png_ptr->push_length; -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->num_frames_read > 0) -+ { -+ png_ensure_sequence_number(png_ptr, 4); -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - - if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) -@@ -501,6 +678,15 @@ - if (!(buffer_length > 0) || buffer == NULL) - png_error(png_ptr, "No IDAT data (internal error)"); - -+#ifdef PNG_READ_APNG_SUPPORTED -+ /* If the app is not APNG-aware, decode only the first frame. */ -+ if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read > 0) -+ { -+ png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; -+ return; -+ } -+#endif -+ - /* This routine must process all the data it has been given - * before returning, calling the row callback as required to - * handle the uncompressed results. -@@ -934,6 +1120,18 @@ - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); - } - -+#ifdef PNG_READ_APNG_SUPPORTED -+void PNGAPI -+png_set_progressive_frame_fn(png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn) -+{ -+ png_ptr->frame_info_fn = frame_info_fn; -+ png_ptr->frame_end_fn = frame_end_fn; -+ png_ptr->apng_flags |= PNG_APNG_APP; -+} -+#endif -+ - png_voidp PNGAPI - png_get_progressive_ptr(png_const_structrp png_ptr) - { -diff -Naru libpng-1.6.54.org/pngpriv.h libpng-1.6.54/pngpriv.h ---- libpng-1.6.54.org/pngpriv.h 2026-01-15 09:54:33.411881875 +0900 -+++ libpng-1.6.54/pngpriv.h 2026-01-16 15:15:06.727223750 +0900 -@@ -653,6 +653,10 @@ - #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */ - #define PNG_WROTE_eXIf 0x4000U - #define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */ -+#ifdef PNG_APNG_SUPPORTED -+#define PNG_HAVE_acTL 0x10000U -+#define PNG_HAVE_fcTL 0x20000U -+#endif - - /* Flags for the transformations the PNG library does on the image data */ - #define PNG_BGR 0x0001U -@@ -917,6 +921,13 @@ - #define png_tRNS PNG_U32(116, 82, 78, 83) - #define png_zTXt PNG_U32(122, 84, 88, 116) - -+#ifdef PNG_APNG_SUPPORTED -+ -+/* For png_struct.apng_flags: */ -+#define PNG_FIRST_FRAME_HIDDEN 0x0001U -+#define PNG_APNG_APP 0x0002U -+#endif -+ - /* The following will work on (signed char*) strings, whereas the get_uint_32 - * macro will fail on top-bit-set values because of the sign extension. - */ -@@ -1880,6 +1891,68 @@ - PNG_EMPTY); - #endif /* PROGRESSIVE_READ */ - -+#ifdef PNG_APNG_SUPPORTED -+PNG_INTERNAL_FUNCTION(void, png_ensure_fcTL_is_valid, -+ (png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op), -+ PNG_EMPTY); -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+PNG_INTERNAL_FUNCTION(void, png_handle_acTL, -+ (png_structp png_ptr, png_infop info_ptr, png_uint_32 length), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_handle_fcTL, -+ (png_structp png_ptr, png_infop info_ptr, png_uint_32 length), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_handle_fdAT, -+ (png_structp png_ptr, png_infop info_ptr, png_uint_32 length), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_have_info, -+ (png_structp png_ptr, png_infop info_ptr), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_ensure_sequence_number, -+ (png_structp png_ptr, png_uint_32 length), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_read_reset, -+ (png_structp png_ptr), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_read_reinit, -+ (png_structp png_ptr, png_infop info_ptr), -+ PNG_EMPTY); -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+PNG_INTERNAL_FUNCTION(void, png_progressive_read_reset, -+ (png_structp png_ptr), -+ PNG_EMPTY); -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+PNG_INTERNAL_FUNCTION(void, png_write_acTL, -+ (png_structp png_ptr, png_uint_32 num_frames, png_uint_32 num_plays), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_write_fcTL, -+ (png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_write_fdAT, -+ (png_structp png_ptr, png_const_bytep data, png_size_t length), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_write_reset, -+ (png_structp png_ptr), -+ PNG_EMPTY); -+PNG_INTERNAL_FUNCTION(void, png_write_reinit, -+ (png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height), -+ PNG_EMPTY); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+#endif /* PNG_APNG_SUPPORTED */ -+ - #ifdef PNG_iCCP_SUPPORTED - /* Routines for checking parts of an ICC profile. */ - #ifdef PNG_READ_iCCP_SUPPORTED -diff -Naru libpng-1.6.54.org/pngread.c libpng-1.6.54/pngread.c ---- libpng-1.6.54.org/pngread.c 2026-01-15 09:54:33.412881873 +0900 -+++ libpng-1.6.54/pngread.c 2026-01-16 19:10:26.174024695 +0900 -@@ -157,16 +157,95 @@ - - else if (chunk_name == png_IDAT) - { -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = length; - break; - } - -+#ifdef PNG_READ_APNG_SUPPORTED -+ else if (chunk_name == png_acTL) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ -+ else if (chunk_name == png_fcTL) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ -+ else if (chunk_name == png_fdAT) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif -+ - else - png_handle_chunk(png_ptr, info_ptr, length); - } - } - #endif /* SEQUENTIAL_READ */ - -+#ifdef PNG_READ_APNG_SUPPORTED -+void PNGAPI -+png_read_frame_head(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ -+ -+ png_debug(1, "Reading frame head"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_acTL)) -+ png_error(png_ptr, "Cannot read APNG frame: missing acTL"); -+ -+ /* Do nothing for the main IDAT. */ -+ if (png_ptr->num_frames_read == 0) -+ return; -+ -+ png_read_reset(png_ptr); -+ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ have_chunk_after_DAT = 0; -+ for (;;) -+ { -+ png_uint_32 length = png_read_chunk_header(png_ptr); -+ -+ if (png_ptr->chunk_name == png_IDAT) -+ { -+ /* Discard trailing IDATs for the first frame. */ -+ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "Misplaced IDAT in APNG stream"); -+ png_crc_finish(png_ptr, length); -+ } -+ else if (png_ptr->chunk_name == png_fcTL) -+ { -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ have_chunk_after_DAT = 1; -+ } -+ else if (png_ptr->chunk_name == png_fdAT) -+ { -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* Discard trailing fdATs for all frames except the first. */ -+ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) -+ { -+ png_crc_finish(png_ptr, length - 4); -+ } -+ else if (png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_ptr->idat_size = length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ break; -+ } -+ else -+ { -+ png_error(png_ptr, "Misplaced fdAT in APNG stream"); -+ } -+ } -+ else -+ { -+ png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence"); -+ png_crc_finish(png_ptr, length); -+ } -+ } -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* Optional call to update the users info_ptr structure */ - void PNGAPI - png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) -diff -Naru libpng-1.6.54.org/pngrutil.c libpng-1.6.54/pngrutil.c ---- libpng-1.6.54.org/pngrutil.c 2026-01-15 09:54:33.413881871 +0900 -+++ libpng-1.6.54/pngrutil.c 2026-01-17 10:41:44.972759729 +0900 -@@ -922,6 +922,11 @@ - filter_type = buf[11]; - interlace_type = buf[12]; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* Set internal variables */ - png_ptr->width = width; - png_ptr->height = height; -@@ -2718,6 +2723,184 @@ - # define png_handle_iTXt NULL - #endif - -+#ifdef PNG_READ_APNG_SUPPORTED -+void /* PRIVATE */ -+png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[8]; -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+ -+ png_debug(1, "in png_handle_acTL"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before acTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ png_warning(png_ptr, "Ignoring misplaced acTL after IDAT"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_acTL) -+ { -+ png_warning(png_ptr, "Ignoring duplicate acTL"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 8) -+ { -+ png_warning(png_ptr, "Ignoring acTL with incorrect length"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 8); -+ png_crc_finish(png_ptr, 0); -+ -+ num_frames = png_get_uint_31(png_ptr, data); -+ num_plays = png_get_uint_31(png_ptr, data + 4); -+ -+ /* The set function will do error checking on num_frames. */ -+ if (png_set_acTL(png_ptr, info_ptr, num_frames, num_plays)) -+ png_ptr->mode |= PNG_HAVE_acTL; -+} -+ -+void /* PRIVATE */ -+png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[22]; -+ png_uint_32 width; -+ png_uint_32 height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ -+ png_debug(1, "in png_handle_fcTL"); -+ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before fcTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ /* For any frames other then the first this message may be misleading, -+ * but correct. PNG_HAVE_IDAT is unset before the frame head is read. -+ * I can't think of a better message. -+ */ -+ png_warning(png_ptr, "Ignoring invalid fcTL after IDAT"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_warning(png_ptr, "Ignoring duplicate fcTL within one frame"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ else if (length != 26) -+ { -+ png_warning(png_ptr, "Ignoring fcTL with incorrect length"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 22); -+ png_crc_finish(png_ptr, 0); -+ -+ width = png_get_uint_31(png_ptr, data); -+ height = png_get_uint_31(png_ptr, data + 4); -+ x_offset = png_get_uint_31(png_ptr, data + 8); -+ y_offset = png_get_uint_31(png_ptr, data + 12); -+ delay_num = png_get_uint_16(data + 16); -+ delay_den = png_get_uint_16(data + 18); -+ dispose_op = data[20]; -+ blend_op = data[21]; -+ -+ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) -+ { -+ png_warning(png_ptr, "Ignoring leading fcTL with non-zero frame offset"); -+ return; -+ } -+ -+ if (info_ptr != NULL) -+ { -+ if (png_ptr->num_frames_read == 0 && -+ (width != info_ptr->width || height != info_ptr->height)) -+ { -+ png_warning(png_ptr, -+ "Ignoring leading fcTL with incorrect frame size"); -+ return; -+ } -+ -+ /* The set function will do more error checking. */ -+ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, -+ x_offset, y_offset, delay_num, delay_den, -+ dispose_op, blend_op); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ -+ png_ptr->mode |= PNG_HAVE_fcTL; -+ } -+} -+ -+void /* PRIVATE */ -+png_have_info(png_structp png_ptr, png_infop info_ptr) -+{ -+ if ((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) -+ { -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ info_ptr->num_frames++; -+ } -+} -+ -+void /* PRIVATE */ -+png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* This function is called only from png_read_end(), png_read_info(), -+ * and png_push_read_chunk(). This means one of the following: -+ * - The user doesn't want to read this frame. -+ * - This is an out-of-place fdAT. -+ * In either case, it is safe to ignore the chunk with a warning. -+ */ -+ png_warning(png_ptr, "Ignoring fdAT chunk"); -+ png_crc_finish(png_ptr, length - 4); -+ PNG_UNUSED(info_ptr) -+} -+ -+void /* PRIVATE */ -+png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) -+{ -+ png_byte data[4]; -+ png_uint_32 sequence_number; -+ -+ if (length < 4) -+ { -+ /* TODO: Write a more precise message. */ -+ png_error(png_ptr, "Invalid fcTL or fdAT chunk"); -+ } -+ -+ png_crc_read(png_ptr, data, 4); -+ sequence_number = png_get_uint_31(png_ptr, data); -+ -+ if (sequence_number != png_ptr->next_seq_num) -+ { -+ /* TODO: Write a more precise message. */ -+ png_error(png_ptr, "Out-of-order sequence number in fcTL or fdAT"); -+ } -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ - static int -@@ -4200,7 +4383,38 @@ - { - uInt avail_in; - png_bytep buffer; -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_uint_32 bytes_to_skip = 0; -+ -+ while (png_ptr->idat_size == 0 || bytes_to_skip != 0) -+ { -+ png_crc_finish(png_ptr, bytes_to_skip); -+ bytes_to_skip = 0; -+ -+ png_ptr->idat_size = png_read_chunk_header(png_ptr); -+ if (png_ptr->num_frames_read == 0) -+ { -+ if (png_ptr->chunk_name != png_IDAT) -+ png_error(png_ptr, "Not enough image data"); -+ } -+ else -+ { -+ if (png_ptr->chunk_name == png_IEND) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->chunk_name != png_fdAT) -+ { -+ png_warning(png_ptr, -+ "Ignoring unexpected chunk in APNG sequence"); -+ bytes_to_skip = png_ptr->idat_size; -+ continue; -+ } -+ -+ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); - -+ png_ptr->idat_size -= 4; -+ } -+ } -+#else - while (png_ptr->idat_size == 0) - { - png_crc_finish(png_ptr, 0); -@@ -4212,7 +4426,7 @@ - if (png_ptr->chunk_name != png_IDAT) - png_error(png_ptr, "Not enough image data"); - } -- -+#endif /* PNG_READ_APNG_SUPPORTED */ - avail_in = png_ptr->IDAT_read_size; - - if (avail_in > png_chunk_max(png_ptr)) -@@ -4283,6 +4497,9 @@ - - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_ptr->num_frames_read++; -+#endif - - if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) - png_chunk_benign_error(png_ptr, "Extra compressed data"); -@@ -4692,4 +4909,82 @@ - - png_ptr->flags |= PNG_FLAG_ROW_INIT; - } -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+/* This function should be called after the main IDAT sequence has been read -+ * and before a new fdAT is about to be read. It resets some parts of png_ptr -+ * to make them usable by the read functions again. -+ */ -+void /* PRIVATE */ -+png_read_reset(png_structp png_ptr) -+{ -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+ png_ptr->mode &= ~PNG_AFTER_IDAT; -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+} -+ -+void /* PRIVATE */ -+png_read_reinit(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_ptr->width = info_ptr->next_frame_width; -+ png_ptr->height = info_ptr->next_frame_height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); -+ png_ptr->info_rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, -+ png_ptr->width); -+ if (png_ptr->prev_row) -+ memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); -+} -+ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+/* Same as png_read_reset(), but for the progressive reader. */ -+void /* PRIVATE */ -+png_progressive_read_reset(png_structp png_ptr) -+{ -+#ifdef PNG_READ_INTERLACING_SUPPORTED -+ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ -+ -+ /* Start of interlace block */ -+ const int png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; -+ -+ /* Offset to next interlace block */ -+ const int png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; -+ -+ /* Start of interlace block in the y direction */ -+ const int png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; -+ -+ /* Offset to next interlace block in the y direction */ -+ const int png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; -+ -+ if (png_ptr->interlaced) -+ { -+ if (!(png_ptr->transformations & PNG_INTERLACE)) -+ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - -+ png_pass_ystart[0]) / -+ png_pass_yinc[0]; -+ else -+ png_ptr->num_rows = png_ptr->height; -+ -+ png_ptr->iwidth = (png_ptr->width + -+ png_pass_inc[png_ptr->pass] - 1 - -+ png_pass_start[png_ptr->pass]) / -+ png_pass_inc[png_ptr->pass]; -+ } -+ else -+#endif /* PNG_READ_INTERLACING_SUPPORTED */ -+ { -+ png_ptr->num_rows = png_ptr->height; -+ png_ptr->iwidth = png_ptr->width; -+ } -+ png_ptr->flags &= ~PNG_FLAG_ZSTREAM_ENDED; -+ if (inflateReset(&(png_ptr->zstream)) != Z_OK) -+ png_error(png_ptr, "inflateReset failed"); -+ png_ptr->zstream.avail_in = 0; -+ png_ptr->zstream.next_in = 0; -+ png_ptr->zstream.next_out = png_ptr->row_buf; -+ png_ptr->zstream.avail_out = -+ (uInt)PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1; -+} -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ - #endif /* READ */ -diff -Naru libpng-1.6.54.org/pngset.c libpng-1.6.54/pngset.c ---- libpng-1.6.54.org/pngset.c 2025-05-11 18:44:02.087040907 +0900 -+++ libpng-1.6.54/pngset.c 2026-01-16 19:22:09.948006831 +0900 -@@ -460,6 +460,13 @@ - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); - - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); -+ -+#ifdef PNG_APNG_SUPPORTED -+ /* Assume a non-animated PNG in the beginning. This may be overridden after -+ * seeing an acTL chunk later. -+ */ -+ info_ptr->num_frames = 1; -+#endif - } - - #ifdef PNG_oFFs_SUPPORTED -@@ -1315,6 +1322,145 @@ - } - #endif /* sPLT */ - -+#ifdef PNG_APNG_SUPPORTED -+png_uint_32 PNGAPI -+png_set_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_debug1(1, "in %s storage function", "acTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Ignoring call to png_set_acTL with NULL libpng object args"); -+ return 0; -+ } -+ if (num_frames == 0) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames zero"); -+ return 0; -+ } -+ if (num_frames > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames > 2^31-1"); -+ return 0; -+ } -+ if (num_plays > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_plays > 2^31-1"); -+ return 0; -+ } -+ -+ info_ptr->num_frames = num_frames; -+ info_ptr->num_plays = num_plays; -+ -+ info_ptr->valid |= PNG_INFO_acTL; -+ -+ return 1; -+} -+ -+/* delay_num and delay_den can hold any 16-bit values including zero */ -+png_uint_32 PNGAPI -+png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug1(1, "in %s storage function", "fcTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Ignoring call to png_set_fcTL with NULL libpng object args"); -+ return 0; -+ } -+ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ /* No checking is required for delay_num and delay_den. -+ * They can hold any 16-bit value, including zero. -+ */ -+ -+ if (blend_op == PNG_BLEND_OP_OVER) -+ { -+ if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) && -+ !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) -+ { -+ png_warning(png_ptr, -+ "Ignoring wasteful fcTL BLEND_OP_OVER in opaque images"); -+ blend_op = PNG_BLEND_OP_SOURCE; -+ } -+ } -+ -+ info_ptr->next_frame_width = width; -+ info_ptr->next_frame_height = height; -+ info_ptr->next_frame_x_offset = x_offset; -+ info_ptr->next_frame_y_offset = y_offset; -+ info_ptr->next_frame_delay_num = delay_num; -+ info_ptr->next_frame_delay_den = delay_den; -+ info_ptr->next_frame_dispose_op = dispose_op; -+ info_ptr->next_frame_blend_op = blend_op; -+ -+ info_ptr->valid |= PNG_INFO_fcTL; -+ -+ return 1; -+} -+ -+void /* PRIVATE */ -+png_ensure_fcTL_is_valid(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ if (width == 0 || width > PNG_UINT_31_MAX) -+ png_error(png_ptr, "Invalid frame width in fcTL"); -+ if (height == 0 || height > PNG_UINT_31_MAX) -+ png_error(png_ptr, "Invalid frame height in fcTL"); -+ if (x_offset > PNG_UINT_31_MAX || y_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "Invalid frame offset in fcTL"); -+ if (width + x_offset > png_ptr->first_frame_width || -+ height + y_offset > png_ptr->first_frame_height) -+ png_error(png_ptr, "Oversized frame in fcTL"); -+ -+ if (dispose_op != PNG_DISPOSE_OP_NONE && -+ dispose_op != PNG_DISPOSE_OP_BACKGROUND && -+ dispose_op != PNG_DISPOSE_OP_PREVIOUS) -+ png_error(png_ptr, "Invalid dispose_op in fcTL"); -+ -+ if (blend_op != PNG_BLEND_OP_SOURCE && -+ blend_op != PNG_BLEND_OP_OVER) -+ png_error(png_ptr, "Invalid blend_op in fcTL"); -+ -+ PNG_UNUSED(delay_num) -+ PNG_UNUSED(delay_den) -+} -+ -+png_uint_32 PNGAPI -+png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, -+ png_byte is_hidden) -+{ -+ png_debug(1, "in png_first_frame_is_hidden"); -+ -+ if (png_ptr == NULL) -+ return 0; -+ -+ if (is_hidden) -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ else -+ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; -+ -+ PNG_UNUSED(info_ptr) -+ -+ return 1; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED - static png_byte - check_location(png_const_structrp png_ptr, int location) -diff -Naru libpng-1.6.54.org/pngstruct.h libpng-1.6.54/pngstruct.h ---- libpng-1.6.54.org/pngstruct.h 2025-12-06 20:00:54.866030732 +0900 -+++ libpng-1.6.54/pngstruct.h 2026-01-15 13:50:32.229564906 +0900 -@@ -391,6 +391,27 @@ - png_byte filter_type; - #endif - -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 apng_flags; -+ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ -+ png_uint_32 first_frame_width; -+ png_uint_32 first_frame_height; -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_uint_32 num_frames_read; /* incremented after all image data of */ -+ /* a frame is read */ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ -+ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ -+#endif -+#endif -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_uint_32 num_frames_to_write; -+ png_uint_32 num_frames_written; -+#endif -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* New members added in libpng-1.2.0 */ - - /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -diff -Naru libpng-1.6.54.org/pngtest.c libpng-1.6.54/pngtest.c ---- libpng-1.6.54.org/pngtest.c 2026-01-15 09:54:33.413881871 +0900 -+++ libpng-1.6.54/pngtest.c 2026-01-16 15:31:15.016058178 +0900 -@@ -877,6 +877,10 @@ - int bit_depth, color_type; - user_chunk_info my_user_chunk_data; - int pass, num_passes; -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+#endif - - row_buf = NULL; - error_parameters.file_name = inname; -@@ -1437,6 +1441,22 @@ - } - } - #endif -+ -+#ifdef PNG_APNG_SUPPORTED -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) -+ { -+ if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays)) -+ { -+ png_byte is_hidden; -+ pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)", -+ num_frames, num_plays); -+ png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays); -+ is_hidden = png_get_first_frame_is_hidden(read_ptr, read_info_ptr); -+ png_set_first_frame_is_hidden(write_ptr, write_info_ptr, is_hidden); -+ } -+ } -+#endif -+ - #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - { - png_unknown_chunkp unknowns; -@@ -1496,6 +1516,111 @@ - t_misc += (t_stop - t_start); - t_start = t_stop; - #endif -+#ifdef PNG_APNG_SUPPORTED -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) -+ { -+ png_uint_32 frame; -+ for (frame = 0; frame < num_frames; frame++) -+ { -+ png_uint_32 frame_width; -+ png_uint_32 frame_height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ png_read_frame_head(read_ptr, read_info_ptr); -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL)) -+ { -+ png_get_next_frame_fcTL(read_ptr, read_info_ptr, -+ &frame_width, &frame_height, -+ &x_offset, &y_offset, -+ &delay_num, &delay_den, -+ &dispose_op, &blend_op); -+ } -+ else -+ { -+ frame_width = width; -+ frame_height = height; -+ x_offset = 0; -+ y_offset = 0; -+ delay_num = 1; -+ delay_den = 1; -+ dispose_op = PNG_DISPOSE_OP_NONE; -+ blend_op = PNG_BLEND_OP_SOURCE; -+ } -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_write_frame_head(write_ptr, write_info_ptr, -+ frame_width, frame_height, -+ x_offset, y_offset, -+ delay_num, delay_den, -+ dispose_op, blend_op); -+#endif -+ for (pass = 0; pass < num_passes; pass++) -+ { -+# ifdef calc_pass_height -+ png_uint_32 pass_height; -+ -+ if (num_passes == 7) /* interlaced */ -+ { -+ if (PNG_PASS_COLS(frame_width, pass) > 0) -+ pass_height = PNG_PASS_ROWS(frame_height, pass); -+ -+ else -+ pass_height = 0; -+ } -+ -+ else /* not interlaced */ -+ pass_height = frame_height; -+# else -+# define pass_height frame_height -+# endif -+ -+ pngtest_debug1("Writing row data for pass %d", pass); -+ for (y = 0; y < pass_height; y++) -+ { -+#ifndef SINGLE_ROWBUF_ALLOC -+ pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", -+ pass, y); -+ -+ row_buf = (png_bytep)png_malloc(read_ptr, -+ png_get_rowbytes(read_ptr, read_info_ptr)); -+ -+ pngtest_debug2("\t0x%08lx (%lu bytes)", (unsigned long)row_buf, -+ (unsigned long)png_get_rowbytes(read_ptr, read_info_ptr)); -+ -+#endif /* !SINGLE_ROWBUF_ALLOC */ -+ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); -+ -+#ifdef PNG_WRITE_SUPPORTED -+#ifdef PNGTEST_TIMING -+ t_stop = (float)clock(); -+ t_decode += (t_stop - t_start); -+ t_start = t_stop; -+#endif -+ png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); -+#ifdef PNGTEST_TIMING -+ t_stop = (float)clock(); -+ t_encode += (t_stop - t_start); -+ t_start = t_stop; -+#endif -+#endif /* PNG_WRITE_SUPPORTED */ -+ -+#ifndef SINGLE_ROWBUF_ALLOC -+ pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y); -+ png_free(read_ptr, row_buf); -+ row_buf = NULL; -+#endif /* !SINGLE_ROWBUF_ALLOC */ -+ } -+ } -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_write_frame_tail(write_ptr, write_info_ptr); -+#endif -+ } -+ } -+ else -+#endif - for (pass = 0; pass < num_passes; pass++) - { - # ifdef calc_pass_height -diff -Naru libpng-1.6.54.org/pngwrite.c libpng-1.6.54/pngwrite.c ---- libpng-1.6.54.org/pngwrite.c 2026-01-15 09:54:33.413881871 +0900 -+++ libpng-1.6.54/pngwrite.c 2026-01-16 16:49:59.704764231 +0900 -@@ -127,6 +127,11 @@ - * the application continues writing the PNG. So check the 'invalid' - * flag here too. - */ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if ((info_ptr->valid & PNG_INFO_acTL) != 0) -+ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); -+#endif -+ - #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - /* Write unknown chunks first; PNG v3 establishes a precedence order - * for colourspace chunks. It is certain therefore that new -@@ -405,6 +410,11 @@ - png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); - #endif - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) -+ png_error(png_ptr, "Not enough frames written"); -+#endif -+ - /* See if user wants us to write information chunks */ - if (info_ptr != NULL) - { -@@ -1517,6 +1527,42 @@ - } - #endif - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void PNGAPI -+png_write_frame_head(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug(1, "in png_write_frame_head"); -+ -+ /* There is a chance this has been set after png_write_info was called, -+ * so it would be set but not written. Is there a way to be sure? -+ */ -+ if (!(info_ptr->valid & PNG_INFO_acTL)) -+ png_error(png_ptr, "Cannot write APNG frame: missing acTL"); -+ -+ png_write_reset(png_ptr); -+ -+ png_write_reinit(png_ptr, info_ptr, width, height); -+ -+ if (!(png_ptr->num_frames_written == 0 && -+ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN))) -+ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+} -+ -+void PNGAPI -+png_write_frame_tail(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_write_frame_tail"); -+ -+ png_ptr->num_frames_written++; -+ -+ PNG_UNUSED(info_ptr) -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ - - #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED - /* Initialize the write structure - general purpose utility. */ -diff -Naru libpng-1.6.54.org/pngwutil.c libpng-1.6.54/pngwutil.c ---- libpng-1.6.54.org/pngwutil.c 2026-01-15 09:54:33.414881869 +0900 -+++ libpng-1.6.54/pngwutil.c 2026-01-16 21:11:48.539248758 +0900 -@@ -838,6 +838,11 @@ - /* Write the chunk */ - png_write_complete_chunk(png_ptr, png_IHDR, buf, 13); - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - if ((png_ptr->do_filter) == PNG_NO_FILTERS) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || -@@ -1020,7 +1025,17 @@ - #endif - - if (size > 0) -+ { -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (png_ptr->num_frames_written == 0) -+ png_write_complete_chunk(png_ptr, png_IDAT, data, size); -+ else -+ png_write_fdAT(png_ptr, data, size); -+#else - png_write_complete_chunk(png_ptr, png_IDAT, data, size); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ } -+ - png_ptr->mode |= PNG_HAVE_IDAT; - - png_ptr->zstream.next_out = data; -@@ -1067,7 +1082,17 @@ - #endif - - if (size > 0) -+ { -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (png_ptr->num_frames_written == 0) -+ png_write_complete_chunk(png_ptr, png_IDAT, data, size); -+ else -+ png_write_fdAT(png_ptr, data, size); -+#else - png_write_complete_chunk(png_ptr, png_IDAT, data, size); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ } -+ - png_ptr->zstream.avail_out = 0; - png_ptr->zstream.next_out = NULL; - png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; -@@ -1969,6 +1994,82 @@ - } - #endif - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void /* PRIVATE */ -+png_write_acTL(png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_byte buf[8]; -+ -+ png_debug(1, "in png_write_acTL"); -+ -+ png_ptr->num_frames_to_write = num_frames; -+ -+ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) -+ num_frames--; -+ -+ png_save_uint_32(buf, num_frames); -+ png_save_uint_32(buf + 4, num_plays); -+ -+ png_write_complete_chunk(png_ptr, png_acTL, buf, (png_size_t)8); -+} -+ -+void /* PRIVATE */ -+png_write_fcTL(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_byte buf[26]; -+ -+ png_debug(1, "in png_write_fcTL"); -+ -+ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "Non-zero frame offset in leading fcTL"); -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "Incorrect frame size in leading fcTL"); -+ -+ /* More error checking. */ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_save_uint_32(buf + 4, width); -+ png_save_uint_32(buf + 8, height); -+ png_save_uint_32(buf + 12, x_offset); -+ png_save_uint_32(buf + 16, y_offset); -+ png_save_uint_16(buf + 20, delay_num); -+ png_save_uint_16(buf + 22, delay_den); -+ buf[24] = dispose_op; -+ buf[25] = blend_op; -+ -+ png_write_complete_chunk(png_ptr, png_fcTL, buf, (png_size_t)26); -+ -+ png_ptr->next_seq_num++; -+} -+ -+void /* PRIVATE */ -+png_write_fdAT(png_structp png_ptr, -+ png_const_bytep data, png_size_t length) -+{ -+ png_byte buf[4]; -+ -+ png_write_chunk_header(png_ptr, png_fdAT, (png_uint_32)(4 + length)); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_write_chunk_data(png_ptr, buf, 4); -+ -+ png_write_chunk_data(png_ptr, data, length); -+ -+ png_write_chunk_end(png_ptr); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - /* Initializes the row writing capability of libpng */ - void /* PRIVATE */ - png_write_start_row(png_structrp png_ptr) -@@ -2822,4 +2923,37 @@ - } - #endif /* WRITE_FLUSH */ - } -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void /* PRIVATE */ -+png_write_reset(png_structp png_ptr) -+{ -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+} -+ -+void /* PRIVATE */ -+png_write_reinit(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height) -+{ -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "Incorrect frame size in leading fcTL"); -+ if (width > png_ptr->first_frame_width || -+ height > png_ptr->first_frame_height) -+ png_error(png_ptr, "Oversized frame in fcTL"); -+ -+ png_set_IHDR(png_ptr, info_ptr, width, height, -+ info_ptr->bit_depth, info_ptr->color_type, -+ info_ptr->interlace_type, info_ptr->compression_type, -+ info_ptr->filter_type); -+ -+ png_ptr->width = width; -+ png_ptr->height = height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); -+ png_ptr->usr_width = png_ptr->width; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ - #endif /* WRITE */ -diff -Naru libpng-1.6.54.org/scripts/symbols.def libpng-1.6.54/scripts/symbols.def ---- libpng-1.6.54.org/scripts/symbols.def 2025-01-26 08:07:01.594606745 +0900 -+++ libpng-1.6.54/scripts/symbols.def 2026-01-15 13:50:32.230564905 +0900 -@@ -263,3 +263,23 @@ - png_get_mDCV_fixed @257 - png_set_mDCV @258 - png_set_mDCV_fixed @259 -+ png_get_acTL @260 -+ png_set_acTL @261 -+ png_get_num_frames @262 -+ png_get_num_plays @263 -+ png_get_next_frame_fcTL @264 -+ png_set_next_frame_fcTL @265 -+ png_get_next_frame_width @266 -+ png_get_next_frame_height @267 -+ png_get_next_frame_x_offset @268 -+ png_get_next_frame_y_offset @269 -+ png_get_next_frame_delay_num @270 -+ png_get_next_frame_delay_den @271 -+ png_get_next_frame_dispose_op @272 -+ png_get_next_frame_blend_op @273 -+ png_get_first_frame_is_hidden @274 -+ png_set_first_frame_is_hidden @275 -+ png_read_frame_head @276 -+ png_set_progressive_frame_fn @277 -+ png_write_frame_head @278 -+ png_write_frame_tail @279 diff --git a/scripts/deps/qtbase-disable-pcre2-jit.patch b/scripts/deps/qtbase-disable-pcre2-jit.patch deleted file mode 100644 index dee5482c6..000000000 --- a/scripts/deps/qtbase-disable-pcre2-jit.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- qtbase/src/3rdparty/pcre2/CMakeLists.txt 2024-03-19 08:46:43.000000000 -0700 -+++ qtbase/src/3rdparty/pcre2/CMakeLists.txt 2024-06-06 21:52:20.539619500 -0700 -@@ -41,6 +41,7 @@ - src/pcre2_xclass.c - DEFINES - HAVE_CONFIG_H -+ PCRE2_DISABLE_JIT - PUBLIC_DEFINES - PCRE2_CODE_UNIT_WIDTH=16 - PUBLIC_INCLUDE_DIRECTORIES -@@ -52,23 +53,8 @@ - ## Scopes: - ##################################################################### - --qt_internal_extend_target(BundledPcre2 CONDITION QNX OR UIKIT -- DEFINES -- PCRE2_DISABLE_JIT --) -- --qt_internal_extend_target(BundledPcre2 CONDITION (TEST_architecture_arch STREQUAL "arm") AND WIN32 -- DEFINES -- PCRE2_DISABLE_JIT --) -- --qt_internal_extend_target(BundledPcre2 CONDITION (TEST_architecture_arch STREQUAL "arm64") AND WIN32 -- DEFINES -- PCRE2_DISABLE_JIT --) -- - if (APPLE) -- target_compile_options(BundledPcre2 PRIVATE "SHELL:-Xarch_arm64 -DPCRE2_DISABLE_JIT") -+ target_compile_options(BundledPcre2 PRIVATE "SHELL:-Xarch_arm64") - endif() - - qt_internal_extend_target(BundledPcre2 CONDITION WIN32 diff --git a/scripts/deps/qtbase-fusion-style.patch b/scripts/deps/qtbase-fusion-style.patch deleted file mode 100644 index 07426a8e3..000000000 --- a/scripts/deps/qtbase-fusion-style.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- qtbase/src/widgets/styles/qfusionstyle.cpp 2025-09-03 17:32:08 -+++ qtbase/src/widgets/styles/qfusionstyle.cpp 2025-09-03 17:56:20 -@@ -588,11 +588,12 @@ - - painter->setBrush((state & State_Sunken) ? QBrush(pressedColor) : gradient); - -- if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) -+ if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) { - painter->setPen(highlightedOutline); -- else -- painter->setPen(colorScheme() == Qt::ColorScheme::Dark ? outline.lighter(240) -- : outline.lighter(110)); -+ } else { -+ const bool isDark = (option->palette.windowText().color().value() > option->palette.window().color().value()); -+ painter->setPen(isDark ? outline.lighter(155) : outline.lighter(110)); -+ } - painter->drawRect(rect); - - QColor checkMarkColor = option->palette.text().color().darker(120); diff --git a/scripts/deps/qtbase-macdeploy-imageformats.patch b/scripts/deps/qtbase-macdeploy-imageformats.patch deleted file mode 100644 index 790fd5984..000000000 --- a/scripts/deps/qtbase-macdeploy-imageformats.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/tools/macdeployqt/shared/shared.cpp -+++ b/src/tools/macdeployqt/shared/shared.cpp -@@ -1122,14 +1122,8 @@ - addPlugins(QStringLiteral("networkinformation")); - } - -- // All image formats (svg if QtSvg is used) -- const bool usesSvg = deploymentInfo.containsModule("Svg", libInfix); -- addPlugins(QStringLiteral("imageformats"), [usesSvg](const QString &lib) { -- if (lib.contains(QStringLiteral("qsvg")) && !usesSvg) -- return false; -- return true; -- }); -- -+ // All image formats -+ addPlugins(QStringLiteral("imageformats")); - addPlugins(QStringLiteral("iconengines")); - - // Platforminputcontext plugins if QtGui is in use \ No newline at end of file diff --git a/scripts/deps/qtbase-window-modal-tahoe.patch b/scripts/deps/qtbase-window-modal-tahoe.patch deleted file mode 100644 index e6448fc67..000000000 --- a/scripts/deps/qtbase-window-modal-tahoe.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/plugins/platforms/cocoa/qcocoamessagedialog.mm -+++ b/src/plugins/platforms/cocoa/qcocoamessagedialog.mm -@@ -87,11 +87,6 @@ bool QCocoaMessageDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality w - return false; - } - -- // Tahoe has issues with window-modal alert buttons not responding to mouse -- if (windowModality == Qt::WindowModal -- && QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSTahoe) -- return false; -- - // And without options we don't know what to show - if (!options()) - return false; diff --git a/scripts/deps/qttools-disable-clang.patch b/scripts/deps/qttools-disable-clang.patch deleted file mode 100644 index d56c83b49..000000000 --- a/scripts/deps/qttools-disable-clang.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/configure.cmake -+++ b/configure.cmake -@@ -3,11 +3,11 @@ - - #### Tests - --qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) -+#qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) - --if(TARGET WrapLibClang::WrapLibClang) -- set(TEST_libclang "ON" CACHE BOOL "Required libclang version found." FORCE) --endif() -+#if(TARGET WrapLibClang::WrapLibClang) -+# set(TEST_libclang "ON" CACHE BOOL "Required libclang version found." FORCE) -+#endif() - - - - - diff --git a/scripts/deps/qttools-linguist-without-quick.patch b/scripts/deps/qttools-linguist-without-quick.patch deleted file mode 100644 index 256afb188..000000000 --- a/scripts/deps/qttools-linguist-without-quick.patch +++ /dev/null @@ -1,238 +0,0 @@ ---- a/src/linguist/CMakeLists.txt -+++ b/src/linguist/CMakeLists.txt -@@ -16,7 +16,7 @@ add_subdirectory(lupdate) - add_subdirectory(lupdate-pro) - if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton - AND QT_FEATURE_png AND QT_FEATURE_mdiarea AND QT_FEATURE_syntaxhighlighter -- AND TARGET Qt::Widgets AND TARGET Qt::Quick) -+ AND TARGET Qt::Widgets) - add_subdirectory(linguist) - endif() - ---- a/src/linguist/linguist/CMakeLists.txt -+++ b/src/linguist/linguist/CMakeLists.txt -@@ -22,7 +22,6 @@ qt_internal_add_app(linguist - errorsview.cpp errorsview.h - finddialog.cpp finddialog.h finddialog.ui - uiformpreviewview.cpp uiformpreviewview.h -- qmlformpreviewview.h qmlformpreviewview.cpp - globals.cpp globals.h - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui -@@ -53,8 +52,6 @@ qt_internal_add_app(linguist - Qt::GuiPrivate - Qt::UiToolsPrivate - Qt::Widgets -- Qt::QuickWidgets -- Qt::QuickLayouts - ) - - qt_internal_extend_target(linguist CONDITION QT_FEATURE_printsupport -@@ -66,46 +63,6 @@ qt_internal_extend_target(linguist CONDITION QT_FEATURE_printsupport - - set(available_plugins "") - --set(plugin_targets -- Qt::qtquickcontrols2plugin -- Qt::qtquick2plugin -- Qt::qtquickdialogsplugin -- Qt::qtquickcontrols2universalstyleplugin -- Qt::qtquickcontrols2basicstyleplugin -- Qt::qtquickcontrols2fluentwinui3styleplugin -- Qt::qtquickcontrols2fusionstyleplugin -- Qt::qtquickcontrols2imaginestyleplugin -- Qt::qtquickcontrols2iosstyleplugin -- Qt::qtquickcontrols2macosstyleplugin -- Qt::qtquickcontrols2materialstyleplugin -- Qt::qtquicktemplates2plugin -- Qt::qtquickcontrols2implplugin -- Qt::qtquickdialogs2quickimplplugin -- Qt::qtquickcontrols2universalstyleimplplugin -- Qt::qtquickcontrols2basicstyleimplplugin -- Qt::qtquickcontrols2fluentwinui3styleimplplugin -- Qt::qtquickcontrols2fusionstyleimplplugin -- Qt::qtquickcontrols2imaginestyleimplplugin -- Qt::qtquickcontrols2iosstyleimplplugin -- Qt::qtquickcontrols2macosstyleimplplugin -- Qt::qtquickcontrols2materialstyleimplplugin -- Qt::quickwindow --) -- --foreach(plugin ${plugin_targets}) -- if(TARGET ${plugin}) -- list(APPEND available_plugins ${plugin}) -- endif() --endforeach() -- --if (available_plugins) -- if(BUILD_SHARED_LIBS) -- add_dependencies(linguist ${available_plugins}) -- else() -- qt_internal_extend_target(linguist LIBRARIES ${available_plugins}) -- endif() --endif() -- - qt_add_ui(linguist - SOURCES - batchtranslation.ui ---- a/src/linguist/linguist/mainwindow.cpp -+++ b/src/linguist/linguist/mainwindow.cpp -@@ -12,7 +12,6 @@ - #include "errorsview.h" - #include "finddialog.h" - #include "uiformpreviewview.h" --#include "qmlformpreviewview.h" - #include "globals.h" - #include "messageeditor.h" - #include "messagemodel.h" -@@ -79,11 +78,6 @@ static bool hasUiFormPreview(const QString &fileName) - return fileName.endsWith(".ui"_L1) || fileName.endsWith(".jui"_L1); - } - --static bool hasQmlFormPreview(const QString &fileName, bool qmlPreviewChecked) --{ -- return fileName.endsWith(QLatin1String(".qml")) && qmlPreviewChecked; --} -- - static QString leadingWhitespace(const QString &str) - { - int i = 0; -@@ -491,11 +485,9 @@ MainWindow::MainWindow() - m_sourceAndFormView = new QStackedWidget(this); - m_sourceAndFormDock->setWidget(m_sourceAndFormView); - m_uiFormPreviewView = new UiFormPreviewView(0, m_dataModel); -- m_qmlFormPreviewView = new QmlFormPreviewView(m_dataModel); - m_sourceCodeView = new SourceCodeView(0); - m_sourceAndFormView->addWidget(m_sourceCodeView); - m_sourceAndFormView->addWidget(m_uiFormPreviewView); -- m_sourceAndFormView->addWidget(m_qmlFormPreviewView); - - // Set up errors dock widget - m_errorsDock = new QDockWidget(this); -@@ -693,7 +685,6 @@ void MainWindow::modelCountChanged() - m_ui.actionFindPrev->setEnabled(false); - - m_uiFormPreviewView->setSourceContext(-1, 0); -- m_qmlFormPreviewView->setSourceContext(-1, 0); - } - - struct OpenedFile { -@@ -1673,9 +1664,6 @@ void MainWindow::translationChanged(const MultiDataIndex &index) - MessageItem *m = m_dataModel->messageItem(index); - if (hasUiFormPreview(m->fileName())) - m_uiFormPreviewView->setSourceContext(index.model(), m); -- else if (hasQmlFormPreview(m->fileName(), m_ui.actionQmlPreview->isChecked())) -- if (!m_qmlFormPreviewView->setSourceContext(index.model(), m)) -- m_ui.actionQmlPreview->setChecked(false); - } - - // This and the following function operate directly on the messageitem, -@@ -1691,10 +1679,6 @@ void MainWindow::updateTranslation(const QStringList &translations) - m->setTranslations(translations); - if (!m->fileName().isEmpty() && hasUiFormPreview(m->fileName())) - m_uiFormPreviewView->setSourceContext(m_currentIndex.model(), m); -- else if (!m->fileName().isEmpty() -- && hasQmlFormPreview(m->fileName(), m_ui.actionQmlPreview->isChecked())) -- if (!m_qmlFormPreviewView->setSourceContext(m_currentIndex.model(), m)) -- m_ui.actionQmlPreview->setChecked(false); - updateDanger(m_currentIndex, true); - - if (m->isFinished()) -@@ -2099,7 +2083,6 @@ void MainWindow::setupMenuBar() - connect(m_ui.actionDisplayGuesses, &QAction::triggered, - m_phraseView, &PhraseView::toggleGuessing); - connect(m_ui.actionStatistics, &QAction::triggered, this, &MainWindow::showStatistics); -- connect(m_ui.actionQmlPreview, &QAction::triggered, this, &MainWindow::toggleQmlPreview); - connect(m_ui.actionVisualizeWhitespace, &QAction::triggered, - this, &MainWindow::toggleVisualizeWhitespace); - connect(m_ui.actionIncreaseZoom, &QAction::triggered, -@@ -2209,11 +2192,7 @@ void MainWindow::updateSourceView(int model, MessageItem *item) - if (hasUiFormPreview(item->fileName())) { - m_sourceAndFormView->setCurrentWidget(m_uiFormPreviewView); - m_uiFormPreviewView->setSourceContext(model, item); -- } else if (hasQmlFormPreview(item->fileName(), m_ui.actionQmlPreview->isChecked()) -- && m_qmlFormPreviewView->setSourceContext(model, item)) { -- m_sourceAndFormView->setCurrentWidget(m_qmlFormPreviewView); - } else { -- m_ui.actionQmlPreview->setChecked(false); - m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); - QDir dir = QFileInfo(m_dataModel->srcFileName(model)).dir(); - QString fileName = QDir::cleanPath(dir.absoluteFilePath(item->fileName())); -@@ -2754,14 +2733,6 @@ void MainWindow::showStatistics() - updateStatistics(); - } - --void MainWindow::toggleQmlPreview() --{ -- if (m_ui.actionQmlPreview->isChecked()) -- m_sourceAndFormView->setCurrentWidget(m_qmlFormPreviewView); -- else -- m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); --} -- - void MainWindow::toggleVisualizeWhitespace() - { - m_messageEditor->setVisualizeWhitespace(m_ui.actionVisualizeWhitespace->isChecked()); ---- a/src/linguist/linguist/mainwindow.h -+++ b/src/linguist/linguist/mainwindow.h -@@ -37,7 +37,6 @@ class BatchTranslationDialog; - class ErrorsView; - class FocusWatcher; - class UiFormPreviewView; --class QmlFormPreviewView; - class MessageEditor; - class PhraseView; - class SourceCodeView; -@@ -130,7 +129,6 @@ private slots: - FindDialog::FindOptions options, int statusFilter); - void revalidate(); - void showStatistics(); -- void toggleQmlPreview(); - void toggleVisualizeWhitespace(); - void onWhatsThis(); - void updatePhraseDicts(); -@@ -196,7 +194,6 @@ private: - QStackedWidget *m_sourceAndFormView; - SourceCodeView *m_sourceCodeView; - UiFormPreviewView *m_uiFormPreviewView; -- QmlFormPreviewView *m_qmlFormPreviewView; - ErrorsView *m_errorsView; - QLabel *m_progressLabel; - QLabel *m_modifiedLabel; ---- a/src/linguist/linguist/mainwindow.ui -+++ b/src/linguist/linguist/mainwindow.ui -@@ -97,7 +97,6 @@ - - - -- - - - -@@ -646,26 +645,6 @@ - QAction::NoRole - - -- -- -- true -- -- -- true -- -- -- &QML preview -- -- -- Displays a preview of QML documents. -- -- -- -- -- -- QAction::NoRole -- -- - - - &Manual diff --git a/scripts/deps/sdl3-ezfrd64-dll.patch b/scripts/deps/sdl3-ezfrd64-dll.patch deleted file mode 100644 index f01560aca..000000000 --- a/scripts/deps/sdl3-ezfrd64-dll.patch +++ /dev/null @@ -1,73 +0,0 @@ -From f369e804e27731e128caf3b370e0569e0695c57e Mon Sep 17 00:00:00 2001 -From: Sam Lantinga -Date: Wed, 7 Jan 2026 17:11:57 -0800 -Subject: [PATCH] Fixed crash when the broken EZFRD64.DLL is present - -Fixes https://github.com/ppy/osu/issues/13634 ---- - src/joystick/windows/SDL_dinputjoystick.c | 38 +++++++++++++++++++---- - 1 file changed, 32 insertions(+), 6 deletions(-) - -diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c -index d265d9fcd5fa4..62ffbb46ec9fa 100644 ---- a/src/joystick/windows/SDL_dinputjoystick.c -+++ b/src/joystick/windows/SDL_dinputjoystick.c -@@ -45,6 +45,7 @@ extern HWND SDL_HelperWindow; - // local variables - static bool coinitialized = false; - static LPDIRECTINPUT8 dinput = NULL; -+static bool has_broken_EZFRD64DLL = false; - - // Taken from Wine - Thanks! - static DIOBJECTDATAFORMAT dfDIJoystick2[] = { -@@ -437,6 +438,29 @@ bool SDL_DINPUT_JoystickInit(void) - dinput = NULL; - return SetDIerror("IDirectInput::Initialize", result); - } -+ -+#ifdef _WIN64 -+ if (SDL_GetHintBoolean("SDL_JOYSTICK_CHECK_EZFRD64", true)) { -+ // The 64-bit version of EZFRD64.DLL crashes after being loaded, -+ // which happens implicitly when querying the device capabilities, -+ // so make sure we don't do that if there's a possibility of crashing -+ static const char *directories[] = { -+ "C:/Windows/USB_Vibration", -+ "C:/Windows/USB Vibration" -+ }; -+ for (int i = 0; i < SDL_arraysize(directories) && !has_broken_EZFRD64DLL; ++i) { -+ int count = 0; -+ char **files = SDL_GlobDirectory(directories[i], "*/EZFRD64.DLL", SDL_GLOB_CASEINSENSITIVE, &count); -+ if (count > 0) { -+ has_broken_EZFRD64DLL = true; -+ } -+ SDL_free(files); -+ } -+ if (has_broken_EZFRD64DLL) { -+ SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Broken EZFRD64.DLL detected, disabling DirectInput force feedback"); -+ } -+ } -+#endif - return true; - } - -@@ -778,12 +802,14 @@ bool SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joysti - return SetDIerror("IDirectInputDevice8::SetDataFormat", result); - } - -- // Get device capabilities -- result = -- IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice, -- &joystick->hwdata->Capabilities); -- if (FAILED(result)) { -- return SetDIerror("IDirectInputDevice8::GetCapabilities", result); -+ if (!has_broken_EZFRD64DLL) { -+ // Get device capabilities to see if we are force feedback capable -+ result = -+ IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice, -+ &joystick->hwdata->Capabilities); -+ if (FAILED(result)) { -+ return SetDIerror("IDirectInputDevice8::GetCapabilities", result); -+ } - } - - // Force capable? diff --git a/scripts/deps/versions b/scripts/deps/versions deleted file mode 100644 index 5b66cac37..000000000 --- a/scripts/deps/versions +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin -# SPDX-License-Identifier: CC-BY-NC-ND-4.0 -# -# NOTE: In addition to the terms of CC-BY-NC-ND-4.0, you may not use this file to create -# packages or build recipes without explicit permission from the copyright holder. -# - -BROTLI=1.2.0 -BROTLI_GZ_HASH=816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec - -FREETYPE=2.14.1 -FREETYPE_GZ_HASH=174d9e53402e1bf9ec7277e22ec199ba3e55a6be2c0740cb18c0ee9850fc8c34 - -HARFBUZZ=12.3.2 -HARFBUZZ_GZ_HASH=3ca6621821e19266710ec1a0cb6146fdc832a75828f7c55fea5502c2a810c3c8 - -LIBBACKTRACE_COMMIT=793921876c981ce49759114d7bb89bb89b2d3a2d -LIBBACKTRACE_GZ_HASH=858b1225351052234f7e71f0f36622fc9ad33aac947db7816d0b443ae0dd33ce - -LIBJPEGTURBO=3.1.3 -LIBJPEGTURBO_GZ_HASH=075920b826834ac4ddf97661cc73491047855859affd671d52079c6867c1c6c0 - -LIBPNG=1.6.54 -LIBPNG_GZ_HASH=472db714567391842e410090df5a37e0f5b2ec67148a3007678b0482d2ba5219 - -LIBWEBP=1.6.0 -LIBWEBP_GZ_HASH=e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 - -LIBZIP=1.11.4 -LIBZIP_GZ_HASH=82e9f2f2421f9d7c2466bbc3173cd09595a88ea37db0d559a9d0a2dc60dc722e - -ZLIBNG=2.3.2 -ZLIBNG_GZ_HASH=6a0561b50b8f5f6434a6a9e667a67026f2b2064a1ffa959c6b2dae320161c2a8 - -ZSTD=1.5.7 -ZSTD_GZ_HASH=eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 - -SDL3=3.4.0 -SDL3_GZ_HASH=082cbf5f429e0d80820f68dc2b507a94d4cc1b4e70817b119bbb8ec6a69584b8 -SDL3_ZIP_HASH=9ac2debb493e0d3e13dbd2729fb91f4bfeb00a0f4dff5e04b73cc9bac276b38d - -QT=6.10.2 -QTMINOR=6.10 -QTBASE_XZ_HASH=aeb78d29291a2b5fd53cb55950f8f5065b4978c25fb1d77f627d695ab9adf21e -QTBASE_ZIP_HASH=690e08ce807041150d388b5351de2e591febf0a0bc973b56e1197e2df9a2d96f -QTIMAGEFORMATS_XZ_HASH=8b8f9c718638081e7b3c000e7f31910140b1202a98e98df5d1b496fe6f639d67 -QTIMAGEFORMATS_ZIP_HASH=a407e489ca8d68639530e881aea797f58754e355ca06024a73358bd9cc5fca17 -QTSVG_XZ_HASH=f07ff80f38caf235187200345392ca7479445ddf49a36c3694cd52a735dad6e1 -QTSVG_ZIP_HASH=fd9f4f6e983a55f6b0ba4c49ce13f8b014cd30d12e75a49a478a640462f9bf64 -QTTOOLS_XZ_HASH=1e3d2c07c1fd76d2425c6eaeeaa62ffaff5f79210c4e1a5bc2a6a9db668d5b24 -QTTOOLS_ZIP_HASH=a498357aed659c66aa87ceb556eacab55e3e7d7c9b9599049066de70eb7efa59 -QTTRANSLATIONS_XZ_HASH=b3b3813bc9d76b545716dc8b6e659fa71b6e2bc14569e9fab6dab8b30650a644 -QTTRANSLATIONS_ZIP_HASH=cf5e04a2048c02369f579c1251f61af965f241cde2d69de3db90e6c9f0ee2bf3 -QTWAYLAND_XZ_HASH=391998eb432719df26a6a67d8efdc67f8bf2afdd76c1ee3381ebff4fe7527ee2 - -CPUINFO_COMMIT=ad0339d52555e0252688c4cba69695e13bf3e383 -CPUINFO_GZ_HASH=6621f2e66d6bab2d6833698a3966c0d80cb71544a350fbfa98c5db67a474c1eb - -DISCORD_RPC_COMMIT=cc59d26d1d628fbd6527aac0ac1d6301f4978b92 -DISCORD_RPC_GZ_HASH=297cd48a287a9113eec44902574084c6ab3b6a8b28d02606765a7fded431d7d8 - -PLUTOSVG_COMMIT=bc845bb6b6511e392f9e1097b26f70cf0b3c33be -PLUTOSVG_GZ_HASH=cc8eed38daf68aaaaa96e904f68f5524c02f10b5d42062b91cdc93f93445f68a - -SHADERC_COMMIT=85cd26cc38e3e8b5e3c649f4551900ee330d6552 -SHADERC_GZ_HASH=06c7bf901ee887e1ce17bbca7c17dd7190f9987ff394138e2c8702c651803584 - -SOUNDTOUCH_COMMIT=463ade388f3a51da078dc9ed062bf28e4ba29da7 -SOUNDTOUCH_GZ_HASH=fe45c2af99f6102d2704277d392c1c83b55180a70bfd17fb888cc84a54b70573 - -SPIRV_CROSS_TAG=vulkan-sdk-1.4.328.1 -SPIRV_CROSS_SHA=7affe74d77f93a622bb5002789d5332d32e512ee - -DXCOMPILER_VERSION=1.8.2505.32 -DXCOMPILER_ZIP_HASH=c6e82b70c14552f1dd58e4a79c93eeab1567eeb0a9ee63a51564c410429bce3e - -FFMPEG_VERSION=8.0.1 -FFMPEG_XZ_HASH=05ee0b03119b45c0bdb4df654b96802e909e0a752f72e4fe3794f487229e5a41 diff --git a/src/common-tests/common-tests.vcxproj b/src/common-tests/common-tests.vcxproj index 0f2378691..7c3403cff 100644 --- a/src/common-tests/common-tests.vcxproj +++ b/src/common-tests/common-tests.vcxproj @@ -1,6 +1,6 @@  - + @@ -26,7 +26,7 @@ {EA2B9C7A-B8CC-42F9-879B-191A98680C10} - + @@ -36,5 +36,5 @@ Console - + \ No newline at end of file diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index 1aa153c10..786ee5f5e 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -1,6 +1,6 @@  - + @@ -122,7 +122,7 @@ - + @@ -130,5 +130,5 @@ $(IntDir)/%(RelativeDir)/ - + \ No newline at end of file diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index 45f5dfb68..0140ea772 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj @@ -1,6 +1,6 @@  - + @@ -210,7 +210,7 @@ {868B98C8-65A1-494B-8346-250A73A48C0A} - + @@ -223,5 +223,5 @@ pch.h - + \ No newline at end of file diff --git a/src/duckstation-mini/duckstation-mini.vcxproj b/src/duckstation-mini/duckstation-mini.vcxproj index 591855c15..479f1d5bd 100644 --- a/src/duckstation-mini/duckstation-mini.vcxproj +++ b/src/duckstation-mini/duckstation-mini.vcxproj @@ -1,6 +1,6 @@  - + @@ -31,7 +31,7 @@ {FA259BC0-1007-4FD9-8A47-87CC0ECB8445} duckstation-mini - + - + \ No newline at end of file diff --git a/src/duckstation-qt/duckstation-qt.vcxproj b/src/duckstation-qt/duckstation-qt.vcxproj index 5ebfe8203..4d421a8b7 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj +++ b/src/duckstation-qt/duckstation-qt.vcxproj @@ -1,6 +1,6 @@  - + @@ -365,8 +365,8 @@ {28F14272-0EC4-41BB-849F-182ADB81AF70} - - + + @@ -394,6 +394,6 @@ -Wno-ignored-pragmas %(AdditionalOptions) - - + + \ No newline at end of file diff --git a/src/duckstation-regtest/duckstation-regtest.vcxproj b/src/duckstation-regtest/duckstation-regtest.vcxproj index a6418adf8..e8855f627 100644 --- a/src/duckstation-regtest/duckstation-regtest.vcxproj +++ b/src/duckstation-regtest/duckstation-regtest.vcxproj @@ -1,6 +1,6 @@  - + {3029310E-4211-4C87-801A-72E130A648EF} @@ -18,7 +18,7 @@ {57f6206d-f264-4b07-baf8-11b9bbe1f455} - + - + \ No newline at end of file diff --git a/src/installer/installer.vcxproj b/src/installer/installer.vcxproj index 54e9d9695..eca796e52 100644 --- a/src/installer/installer.vcxproj +++ b/src/installer/installer.vcxproj @@ -1,6 +1,6 @@  - + @@ -34,7 +34,7 @@ {CD6D0C84-042E-4C9A-AAB5-D3BDC80273DA} - + @@ -44,5 +44,5 @@ %(AdditionalDependencies);Comctl32.lib - + \ No newline at end of file diff --git a/src/scmversion/scmversion.vcxproj b/src/scmversion/scmversion.vcxproj index f1942e473..4bef6210a 100644 --- a/src/scmversion/scmversion.vcxproj +++ b/src/scmversion/scmversion.vcxproj @@ -1,6 +1,6 @@  - + @@ -18,7 +18,7 @@ true - + PreBuildEvent @@ -38,5 +38,5 @@ - + \ No newline at end of file diff --git a/src/uninstaller/uninstaller.vcxproj b/src/uninstaller/uninstaller.vcxproj index 8b23e638f..528919444 100644 --- a/src/uninstaller/uninstaller.vcxproj +++ b/src/uninstaller/uninstaller.vcxproj @@ -1,6 +1,6 @@  - + @@ -21,7 +21,7 @@ {91C19063-A8D7-421C-A0E3-A1A3ECFC5EE5} - + @@ -31,5 +31,5 @@ %(AdditionalDependencies);Comctl32.lib;zlibstatic.lib - + \ No newline at end of file diff --git a/src/updater/updater.vcxproj b/src/updater/updater.vcxproj index 8c97a625e..c618fa870 100644 --- a/src/updater/updater.vcxproj +++ b/src/updater/updater.vcxproj @@ -1,6 +1,6 @@  - + @@ -32,7 +32,7 @@ {32EEAF44-57F8-4C6C-A6F0-DE5667123DD5} - + @@ -42,5 +42,5 @@ %(AdditionalDependencies);Comctl32.lib;zlibstatic.lib - + \ No newline at end of file diff --git a/src/util-tests/util-tests.vcxproj b/src/util-tests/util-tests.vcxproj index e3d6ce477..1cfd1565e 100644 --- a/src/util-tests/util-tests.vcxproj +++ b/src/util-tests/util-tests.vcxproj @@ -1,6 +1,6 @@  - + @@ -20,7 +20,7 @@ {15538AD7-2201-45C2-B088-BBB7F37BD7F5} - + @@ -30,5 +30,5 @@ Console - + \ No newline at end of file diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index e30a51e7b..31dd5c399 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -86,7 +86,7 @@ add_library(util target_precompile_headers(util PRIVATE "pch.h") target_include_directories(util PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(util PUBLIC common simpleini imgui) -target_link_libraries(util PRIVATE libchdr lzma JPEG::JPEG PNG::PNG WebP::libwebp plutosvg::plutosvg ZLIB::ZLIB SoundTouch::SoundTouchDLL xxhash zstd::libzstd_shared reshadefx) +target_link_libraries(util PRIVATE libchdr lzma libjpeg-turbo::jpeg PNG::PNG WebP::webp plutosvg::plutosvg ZLIB::ZLIB SoundTouch::SoundTouchDLL xxhash zstd::libzstd_shared reshadefx) if(ENABLE_X11) target_sources(util PRIVATE @@ -309,12 +309,24 @@ function(add_util_resources target) message(WARNING "MoltenVK not found in path, it will depend on the target system having it.") endif() - # Copy dynamically-loaded libraries (harfbuzz/shaderc/spirv-cross) into the bundle - get_target_property(HARFBUZZ_LIBRARY harfbuzz::harfbuzz IMPORTED_LOCATION_RELEASE) - get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_SONAME_RELEASE) - get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION_RELEASE) - target_sources(${target} PRIVATE "${HARFBUZZ_LIBRARY}" "${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}") - set_source_files_properties("${HARFBUZZ_LIBRARY}" "${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) + # Copy dynamically-loaded libraries (harfbuzz/shaderc/spirv-cross) into the bundle. + # Use IMPORTED_SONAME_RELEASE to get the major-versioned filename (stripping the @rpath/ prefix). + foreach(dyn_lib harfbuzz::harfbuzz spirv-cross-c-shared Shaderc::shaderc_shared) + get_target_property(dyn_lib_path ${dyn_lib} IMPORTED_LOCATION_RELEASE) + get_target_property(dyn_lib_soname ${dyn_lib} IMPORTED_SONAME_RELEASE) + if(dyn_lib_soname) + string(REPLACE "@rpath/" "" dyn_lib_soname_filename "${dyn_lib_soname}") + get_filename_component(dyn_lib_dir "${dyn_lib_path}" DIRECTORY) + set(dyn_lib_major_path "${dyn_lib_dir}/${dyn_lib_soname_filename}") + if(EXISTS "${dyn_lib_major_path}") + set(dyn_lib_path "${dyn_lib_major_path}") + else() + message(WARNING "Could not find major-versioned symlink for ${dyn_lib}.") + endif() + endif() + target_sources(${target} PRIVATE "${dyn_lib_path}") + set_source_files_properties("${dyn_lib_path}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) + endforeach() # Copy FFmpeg libraries into the bundle foreach(component avcodec avformat avutil swresample swscale) @@ -323,5 +335,13 @@ function(add_util_resources target) target_sources(${target} PRIVATE ${version_lib}) set_source_files_properties(${target} PRIVATE ${version_lib} PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) endforeach() + elseif(NOT WIN32) + # We need to add the rpath for shaderc to the executable. + get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION) + get_filename_component(SHADERC_LIBRARY_DIRECTORY ${SHADERC_LIBRARY} DIRECTORY) + set_target_properties(${target} PROPERTIES BUILD_RPATH "${SHADERC_LIBRARY_DIRECTORY}") + get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION) + get_filename_component(SPIRV_CROSS_LIBRARY_DIRECTORY ${SPIRV_CROSS_LIBRARY} DIRECTORY) + set_target_properties(${target} PROPERTIES BUILD_RPATH "${SPIRV_CROSS_LIBRARY_DIRECTORY}") endif() endfunction() diff --git a/src/util/gpu_device.cpp b/src/util/gpu_device.cpp index dbe5c7239..303f10c51 100644 --- a/src/util/gpu_device.cpp +++ b/src/util/gpu_device.cpp @@ -1365,13 +1365,6 @@ std::unique_ptr GPUDevice::CreateDeviceForAPI(RenderAPI api) } } -#ifndef _WIN32 -// Use a duckstation-suffixed shaderc name to avoid conflicts and loading another shaderc, e.g. from the Vulkan SDK. -#define SHADERC_LIB_NAME "shaderc_ds" -#else -#define SHADERC_LIB_NAME "shaderc_shared" -#endif - namespace dyn_libs { static void CloseShaderc(); static void CloseSpirvCross(); @@ -1398,7 +1391,7 @@ bool dyn_libs::OpenShaderc(Error* error) if (s_shaderc_library.IsOpen()) return true; - const std::string libname = DynamicLibrary::GetVersionedFilename(SHADERC_LIB_NAME); + const std::string libname = DynamicLibrary::GetVersionedFilename("shaderc_shared"); if (!s_shaderc_library.Open(libname.c_str(), error)) { Error::AddPrefix(error, "Failed to load shaderc: "); diff --git a/src/util/util.vcxproj b/src/util/util.vcxproj index 3f823dc6d..17b3e61ca 100644 --- a/src/util/util.vcxproj +++ b/src/util/util.vcxproj @@ -1,6 +1,6 @@  - + @@ -274,7 +274,7 @@ {57F6206D-F264-4B07-BAF8-11B9BBE1F455} - + @@ -285,5 +285,5 @@ pch.h - + \ No newline at end of file