From 82b5772d27330980b6dc485a6bbdff3010d8e04a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 4 Jul 2024 14:52:54 +1000 Subject: [PATCH] Deps: Move build scripts/patches into own directory --- .github/workflows/rolling-release.yml | 20 +++++++++---------- README.md | 4 ++-- .../{ => deps}/build-dependencies-linux.sh | 0 scripts/{ => deps}/build-dependencies-mac.sh | 0 .../build-dependencies-windows-arm64.bat | 2 +- .../build-dependencies-windows-x64.bat | 2 +- .../cmake-toolchain-windows-arm64.cmake | 0 scripts/{ => deps}/cpuinfo-changes.patch | 0 scripts/{ => deps}/libjpeg-cmake.patch | 0 .../{ => deps}/qtbase-disable-pcre2-jit.patch | 0 scripts/{ => deps}/shaderc-changes.patch | 0 scripts/{ => deps}/spirv-cross-changes.patch | 0 scripts/flatpak/modules/22-shaderc.json | 2 +- scripts/flatpak/modules/23-spirv-cross.json | 2 +- scripts/flatpak/modules/24-cpuinfo.json | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) rename scripts/{ => deps}/build-dependencies-linux.sh (100%) rename scripts/{ => deps}/build-dependencies-mac.sh (100%) rename scripts/{ => deps}/build-dependencies-windows-arm64.bat (99%) rename scripts/{ => deps}/build-dependencies-windows-x64.bat (99%) rename scripts/{ => deps}/cmake-toolchain-windows-arm64.cmake (100%) rename scripts/{ => deps}/cpuinfo-changes.patch (100%) rename scripts/{ => deps}/libjpeg-cmake.patch (100%) rename scripts/{ => deps}/qtbase-disable-pcre2-jit.patch (100%) rename scripts/{ => deps}/shaderc-changes.patch (100%) rename scripts/{ => deps}/spirv-cross-changes.patch (100%) diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index 452e9e63b..fdf5dbe8c 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -34,19 +34,19 @@ jobs: path: | dep/msvc/deps-arm64 dep/msvc/deps-x64 - key: deps ${{ hashFiles('scripts/build-dependencies-windows-arm64.bat', 'scripts/build-dependencies-windows-x64.bat') }} + key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }} - name: Build X64 Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' env: DEBUG: 0 - run: scripts/build-dependencies-windows-x64.bat + run: scripts/deps/build-dependencies-windows-x64.bat - name: Build ARM64 Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' env: DEBUG: 0 - run: scripts/build-dependencies-windows-arm64.bat + run: scripts/deps/build-dependencies-windows-arm64.bat - name: Initialize build tag shell: cmd @@ -122,19 +122,19 @@ jobs: path: | dep/msvc/deps-arm64 dep/msvc/deps-x64 - key: deps ${{ hashFiles('scripts/build-dependencies-windows-arm64.bat', 'scripts/build-dependencies-windows-x64.bat') }} + key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }} - name: Build X64 Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' env: DEBUG: 0 - run: scripts/build-dependencies-windows-x64.bat + run: scripts/deps/build-dependencies-windows-x64.bat - name: Build ARM64 Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' env: DEBUG: 0 - run: scripts/build-dependencies-windows-arm64.bat + run: scripts/deps/build-dependencies-windows-arm64.bat - name: Initialize build tag shell: cmd @@ -231,11 +231,11 @@ jobs: uses: actions/cache@v4.0.2 with: path: ~/deps - key: deps ${{ hashFiles('scripts/build-dependencies-linux.sh') }} + key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh') }} - name: Build Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' - run: scripts/build-dependencies-linux.sh "$HOME/deps" + run: scripts/deps/build-dependencies-linux.sh "$HOME/deps" - name: Initialize build tag run: | @@ -361,11 +361,11 @@ jobs: uses: actions/cache@v4.0.2 with: path: ~/deps - key: deps-mac ${{ hashFiles('scripts/build-dependencies-mac.sh') }} + key: deps-mac ${{ hashFiles('scripts/deps/build-dependencies-mac.sh') }} - name: Build Dependencies if: steps.cache-deps-mac.outputs.cache-hit != 'true' - run: scripts/build-dependencies-mac.sh "$HOME/deps" + run: scripts/deps/build-dependencies-mac.sh "$HOME/deps" - name: Initialize build tag run: | diff --git a/README.md b/README.md index 62c11cf0d..0d71e1fe3 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ alsa-lib-devel brotli-devel clang cmake dbus-devel egl-wayland-devel extra-cmake #### Building 1. Clone the repository: `git clone https://github.com/stenzek/duckstation.git`, `cd duckstation`. -2. Build dependencies. You can save these outside of the tree if you like. This will take a while. `scripts/build-dependencies-linux.sh deps`. +2. Build dependencies. You can save these outside of the tree if you like. This will take a while. `scripts/deps/build-dependencies-linux.sh deps`. 3. Run CMake to configure the build system. Assuming a build subdirectory of `build-release`, run `cmake -B build-release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_PREFIX_PATH="$PWD/deps" -G Ninja`. If you want a release (optimized) build, include `-DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON`. 4. Compile the source code. For the example above, run `ninja -C build-release` 5. Run the binary, located in the build directory under `./build-release/bin/duckstation-qt`. @@ -179,7 +179,7 @@ Requirements: 1. Clone the repository: `git clone https://github.com/stenzek/duckstation.git`. -2. Build the dependencies. This will take a while. `scripts/build-dependencies-mac.sh deps`. +2. Build the dependencies. This will take a while. `scripts/deps/build-dependencies-mac.sh deps`. 2. Run CMake to configure the build system: `cmake -Bbuild-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$PWD/deps"`. 4. Compile the source code: `cmake --build build-release --parallel`. 5. Run the binary, located in the build directory under `bin/DuckStation.app`. diff --git a/scripts/build-dependencies-linux.sh b/scripts/deps/build-dependencies-linux.sh similarity index 100% rename from scripts/build-dependencies-linux.sh rename to scripts/deps/build-dependencies-linux.sh diff --git a/scripts/build-dependencies-mac.sh b/scripts/deps/build-dependencies-mac.sh similarity index 100% rename from scripts/build-dependencies-mac.sh rename to scripts/deps/build-dependencies-mac.sh diff --git a/scripts/build-dependencies-windows-arm64.bat b/scripts/deps/build-dependencies-windows-arm64.bat similarity index 99% rename from scripts/build-dependencies-windows-arm64.bat rename to scripts/deps/build-dependencies-windows-arm64.bat index c17a55c42..115af845e 100644 --- a/scripts/build-dependencies-windows-arm64.bat +++ b/scripts/deps/build-dependencies-windows-arm64.bat @@ -22,7 +22,7 @@ if defined DEBUG ( pushd %~dp0 set "SCRIPTDIR=%CD%" -cd ..\dep\msvc +cd ..\..\dep\msvc mkdir deps-build cd deps-build || goto error set "BUILDDIR=%CD%" diff --git a/scripts/build-dependencies-windows-x64.bat b/scripts/deps/build-dependencies-windows-x64.bat similarity index 99% rename from scripts/build-dependencies-windows-x64.bat rename to scripts/deps/build-dependencies-windows-x64.bat index 6b72d265b..71f0276ff 100644 --- a/scripts/build-dependencies-windows-x64.bat +++ b/scripts/deps/build-dependencies-windows-x64.bat @@ -22,7 +22,7 @@ if defined DEBUG ( pushd %~dp0 set "SCRIPTDIR=%CD%" -cd ..\dep\msvc +cd ..\..\dep\msvc mkdir deps-build cd deps-build || goto error set "BUILDDIR=%CD%" diff --git a/scripts/cmake-toolchain-windows-arm64.cmake b/scripts/deps/cmake-toolchain-windows-arm64.cmake similarity index 100% rename from scripts/cmake-toolchain-windows-arm64.cmake rename to scripts/deps/cmake-toolchain-windows-arm64.cmake diff --git a/scripts/cpuinfo-changes.patch b/scripts/deps/cpuinfo-changes.patch similarity index 100% rename from scripts/cpuinfo-changes.patch rename to scripts/deps/cpuinfo-changes.patch diff --git a/scripts/libjpeg-cmake.patch b/scripts/deps/libjpeg-cmake.patch similarity index 100% rename from scripts/libjpeg-cmake.patch rename to scripts/deps/libjpeg-cmake.patch diff --git a/scripts/qtbase-disable-pcre2-jit.patch b/scripts/deps/qtbase-disable-pcre2-jit.patch similarity index 100% rename from scripts/qtbase-disable-pcre2-jit.patch rename to scripts/deps/qtbase-disable-pcre2-jit.patch diff --git a/scripts/shaderc-changes.patch b/scripts/deps/shaderc-changes.patch similarity index 100% rename from scripts/shaderc-changes.patch rename to scripts/deps/shaderc-changes.patch diff --git a/scripts/spirv-cross-changes.patch b/scripts/deps/spirv-cross-changes.patch similarity index 100% rename from scripts/spirv-cross-changes.patch rename to scripts/deps/spirv-cross-changes.patch diff --git a/scripts/flatpak/modules/22-shaderc.json b/scripts/flatpak/modules/22-shaderc.json index ae2126281..1a5fa7a0b 100644 --- a/scripts/flatpak/modules/22-shaderc.json +++ b/scripts/flatpak/modules/22-shaderc.json @@ -37,7 +37,7 @@ }, { "type": "patch", - "path": "../../shaderc-changes.patch" + "path": "../../deps/shaderc-changes.patch" } ], "cleanup": [ diff --git a/scripts/flatpak/modules/23-spirv-cross.json b/scripts/flatpak/modules/23-spirv-cross.json index 1aeca4eb1..f6bd1f576 100644 --- a/scripts/flatpak/modules/23-spirv-cross.json +++ b/scripts/flatpak/modules/23-spirv-cross.json @@ -28,7 +28,7 @@ }, { "type": "patch", - "path": "../../spirv-cross-changes.patch" + "path": "../../deps/spirv-cross-changes.patch" } ], "cleanup": [ diff --git a/scripts/flatpak/modules/24-cpuinfo.json b/scripts/flatpak/modules/24-cpuinfo.json index 205f62d7b..7712e70dc 100644 --- a/scripts/flatpak/modules/24-cpuinfo.json +++ b/scripts/flatpak/modules/24-cpuinfo.json @@ -25,7 +25,7 @@ }, { "type": "patch", - "path": "../../cpuinfo-changes.patch" + "path": "../../deps/cpuinfo-changes.patch" } ], "cleanup": [