From 13437a360f63d6efe71449886ada13db95a1af49 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 14:39:58 -0400 Subject: [PATCH 01/40] format json script Signed-off-by: crueter --- externals/ffmpeg/cpmfile.json | 2 +- externals/libusb/cpmfile.json | 14 +++++++------- tools/cpm-hash.sh | 2 +- tools/cpm/format-json.sh | 8 ++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100755 tools/cpm/format-json.sh diff --git a/externals/ffmpeg/cpmfile.json b/externals/ffmpeg/cpmfile.json index ff48ce742d..97ca227939 100644 --- a/externals/ffmpeg/cpmfile.json +++ b/externals/ffmpeg/cpmfile.json @@ -5,7 +5,7 @@ "hash": "2a89d664119debbb3c006ab1c48d5d7f26e889f4a65ad2e25c8b0503308295123d5a9c5c78bf683aef5ff09acef8c3fc2837f22d3e8c611528b933bf03bcdd97", "bundled": true }, - "ffmpeg-ci": { + "ffmpeg-ci": { "ci": true, "package": "FFmpeg", "name": "ffmpeg", diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json index 0bfa0d7a86..80a0b917db 100644 --- a/externals/libusb/cpmfile.json +++ b/externals/libusb/cpmfile.json @@ -1,8 +1,8 @@ { - "libusb": { - "repo": "libusb/libusb", - "sha": "c060e9ce30", - "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", - "find_args": "MODULE" - } -} \ No newline at end of file + "libusb": { + "repo": "libusb/libusb", + "sha": "c060e9ce30", + "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", + "find_args": "MODULE" + } +} diff --git a/tools/cpm-hash.sh b/tools/cpm-hash.sh index da0fb395db..b740936f4d 100755 --- a/tools/cpm-hash.sh +++ b/tools/cpm-hash.sh @@ -1,4 +1,4 @@ #!/bin/sh -SUM=`wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum` +SUM=$(wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/format-json.sh b/tools/cpm/format-json.sh new file mode 100755 index 0000000000..6059077fe1 --- /dev/null +++ b/tools/cpm/format-json.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +FILES=$(find . src -maxdepth 3 -name cpmfile.json) + +for file in $FILES; do + jq --indent 4 < $file > $file.new + mv $file.new $file +done From d359415f1dbb82d6858266eadf2ae33e9a72ce0b Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 16:56:46 -0400 Subject: [PATCH 02/40] [tools] refactor: update/hash checking scripts, use tags for more deps Uses tags for a bunch of deps that can use them Also adds a bunmch of scripts to tools/cpm, notably for checking hashes and checking for updates. TODO: - Documentation - CI target to check hashes - Script to update the json directly (dedup) - Function to filter tags (dedup) - Weekly CI to check for updates Need to get that other CI runner up Signed-off-by: crueter --- cpmfile.json | 27 +- externals/cpmfile.json | 128 ++++---- externals/libusb/cpmfile.json | 7 +- src/dynarmic/externals/cpmfile.json | 7 +- tools/cpm-fetch-all.sh | 7 +- tools/cpm-fetch.sh | 410 ++++++++++++------------ tools/cpm-hash.sh | 4 - tools/cpm/check-all-hashes.sh | 14 + tools/cpm/check-all-updates.sh | 11 + tools/cpm/check-hash.sh | 110 +++++++ tools/cpm/check-updates.sh | 97 ++++++ tools/cpm/{format-json.sh => format.sh} | 0 tools/cpm/hash.sh | 22 ++ tools/{ => cpm}/url-hash.sh | 2 +- tools/cpm/which.sh | 9 + 15 files changed, 566 insertions(+), 289 deletions(-) delete mode 100755 tools/cpm-hash.sh create mode 100755 tools/cpm/check-all-hashes.sh create mode 100755 tools/cpm/check-all-updates.sh create mode 100755 tools/cpm/check-hash.sh create mode 100755 tools/cpm/check-updates.sh rename tools/cpm/{format-json.sh => format.sh} (100%) create mode 100755 tools/cpm/hash.sh rename tools/{ => cpm}/url-hash.sh (53%) create mode 100755 tools/cpm/which.sh diff --git a/cpmfile.json b/cpmfile.json index 4cf61f0ffc..385d10cd81 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -26,12 +26,9 @@ }, "fmt": { "repo": "fmtlib/fmt", - "sha": "40626af88b", - "hash": "d59f06c24339f223de4ec2afeba1c67b5835a0f350a1ffa86242a72fc3e616a6b8b21798355428d4200c75287308b66634619ffa0b52ba5bd74cc01772ea1a8a", - "version": "8", - "options": [ - "FMT_INSTALL OFF" - ] + "tag": "12.0.0", + "hash": "c4ab814c20fbad7e3f0ae169125a4988a2795631194703251481dc36b18da65c886c4faa9acd046b0a295005217b3689eb0126108a9ba5aac2ca909aae263c2f", + "version": "8" }, "lz4": { "name": "lz4", @@ -43,16 +40,18 @@ "nlohmann": { "package": "nlohmann_json", "repo": "nlohmann/json", - "sha": "55f93686c0", - "hash": "b739749b066800e21154506ea150d2c5cbce8a45344177f46f884547a1399d26753166fd0df8135269ce28cf223552b1b65cd625b88c844d54753f2434900486", - "version": "3.8" + "tag": "v%VERSION%", + "hash": "6cc1e86261f8fac21cc17a33da3b6b3c3cd5c116755651642af3c9e99bb3538fd42c1bd50397a77c8fb6821bc62d90e6b91bcdde77a78f58f2416c62fc53b97d", + "version": "3.8", + "git_version": "3.12.0" }, "zlib": { "package": "ZLIB", "repo": "madler/zlib", - "sha": "51b7f2abda", - "hash": "16eaf1f3752489d12fd9ce30f7b5f7cbd5cb8ff53d617005a9847ae72d937f65e01e68be747f62d7ac19fd0c9aeba9956e60f16d6b465c5fdc2f3d08b4db2e6c", + "tag": "v%VERSION%", + "hash": "8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088", "version": "1.2", + "git_version": "1.3.1", "options": [ "ZLIB_BUILD_SHARED OFF", "ZLIB_INSTALL OFF" @@ -60,8 +59,8 @@ }, "zstd": { "repo": "facebook/zstd", - "sha": "f8745da6ff", - "hash": "3037007f990040fe32573b46f9bef8762fd5dbeeb07ffffcbfeba51ec98167edae39bb9c87f9299efcd61c4e467c5e84f7c19f0df7799bc1fc04864a278792ee", + "sha": "b8d6101fba", + "hash": "a6c8e5272214fd3e65e03ae4fc375f452bd2f646623886664ee23e239e35751cfc842db4d34a84a8039d89fc8f76556121f2a4ae350d017bdff5e22150f9c3de", "version": "1.5", "source_subdir": "build/cmake", "find_args": "MODULE", @@ -89,7 +88,7 @@ "llvm-mingw": { "repo": "misc/llvm-mingw", "git_host": "git.crueter.xyz", - "tag": "20250828", + "tag": "%VERSION%", "version": "20250828", "artifact": "clang-rt-builtins.tar.zst", "hash": "d902392caf94e84f223766e2cc51ca5fab6cae36ab8dc6ef9ef6a683ab1c483bfcfe291ef0bd38ab16a4ecc4078344fa8af72da2f225ab4c378dee23f6186181" diff --git a/externals/cpmfile.json b/externals/cpmfile.json index cb32a75ed5..1ff392923f 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -2,13 +2,14 @@ "vulkan-memory-allocator": { "package": "VulkanMemoryAllocator", "repo": "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator", - "sha": "1076b348ab", - "hash": "a46b44e4286d08cffda058e856c47f44c7fed3da55fe9555976eb3907fdcc20ead0b1860b0c38319cda01dbf9b1aa5d4b4038c7f1f8fbd97283d837fa9af9772", - "find_args": "CONFIG" + "tag": "v%VERSION%", + "hash": "deb5902ef8db0e329fbd5f3f4385eb0e26bdd9f14f3a2334823fb3fe18f36bc5d235d620d6e5f6fe3551ec3ea7038638899db8778c09f6d5c278f5ff95c3344b", + "find_args": "CONFIG", + "git_version": "3.3.0" }, "sirit": { "repo": "eden-emulator/sirit", - "version": "1.0.1", + "git_version": "1.0.1", "tag": "v%VERSION%", "artifact": "sirit-source-%VERSION%.tar.zst", "hash_suffix": "sha512sum", @@ -23,8 +24,9 @@ }, "httplib": { "repo": "yhirose/cpp-httplib", - "sha": "a609330e4c", - "hash": "dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2" + "tag": "v%VERSION%", + "hash": "b364500f76e2ecb0fe21b032d831272e3f1dfeea71af74e325f8fc4ce9dcdb3c941b97a5b422bdeafb9facd058597b90f8bfc284fb9afe3c33fefa15dd5a010b", + "git_version": "0.26.0" }, "cpp-jwt": { "version": "1.4", @@ -39,16 +41,18 @@ "xbyak_sun": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "9bb219333a", - "hash": "303165d45c8c19387ec49d9fda7d7a4e0d86d4c0153898c23f25ce2d58ece567f44c0bbbfe348239b933edb6e1a1e34f4bc1c0ab3a285bee5da0e548879387b0", - "bundled": true + "tag": "v%VERSION%", + "hash": "e84992c65ad62c577e2746ec5180132fd2875166d1e6b1521a0ff619787e1645792fe5f6a858fe94ed66f297912b6a6b89a509b5d5f5e81a2db1dd7e6790b1f5", + "bundled": true, + "git_version": "7.30" }, "xbyak": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "4e44f4614d", - "hash": "5824e92159e07fa36a774aedd3b3ef3541d0241371d522cffa4ab3e1f215fa5097b1b77865b47b2481376c704fa079875557ea463ca63d0a7fd6a8a20a589e70", - "bundled": true + "sha": "v7.22", + "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "bundled": true, + "skip_updates": true }, "oaknut": { "version": "2.0.1", @@ -66,16 +70,17 @@ }, "oboe": { "repo": "google/oboe", - "sha": "2bc873e53c", - "hash": "02329058a7f9cf7d5039afaae5ab170d9f42f60f4c01e21eaf4f46073886922b057a9ae30eeac040b3ac182f51b9c1bfe9fe1050a2c9f6ce567a1a9a0ec2c768", + "tag": "1.10.0", + "hash": "ce4011afe7345370d4ead3b891cd69a5ef224b129535783586c0ca75051d303ed446e6c7f10bde8da31fff58d6e307f1732a3ffd03b249f9ef1fd48fd4132715", "bundled": true }, "unordered-dense": { "package": "unordered_dense", "repo": "martinus/unordered_dense", - "sha": "73f3cbb237", - "hash": "c08c03063938339d61392b687562909c1a92615b6ef39ec8df19ea472aa6b6478e70d7d5e33d4a27b5d23f7806daf57fe1bacb8124c8a945c918c7663a9e8532", - "find_args": "CONFIG" + "tag": "v%VERSION%", + "hash": "f9c819e28e1c1a387acfee09277d6af5e366597a0d39acf1c687acf0608a941ba966af8aaebdb8fba0126c7360269c4a51754ef4cab17c35c01a30215f953368", + "find_args": "CONFIG", + "git_version": "4.5.0" }, "mbedtls": { "package": "MbedTLS", @@ -84,29 +89,32 @@ "hash": "6671fb8fcaa832e5b115dfdce8f78baa6a4aea71f5c89a640583634cdee27aefe3bf4be075744da91f7c3ae5ea4e0c765c8fc3937b5cfd9ea73d87ef496524da", "version": "3", "git_version": "3.6.4", - "artifact": "%TAG%.tar.bz2" + "artifact": "%TAG%.tar.bz2", + "skip_updates": true }, "enet": { "repo": "lsalzman/enet", - "sha": "2662c0de09", - "hash": "3de1beb4fa3d6b1e03eda8dd1e7580694f854af3ed3975dcdabfdcdf76b97f322b9734d35ea7f185855bb490d957842b938b26da4dd2dfded509390f8d2794dd", + "tag": "v%VERSION%", + "hash": "a0d2fa8c957704dd49e00a726284ac5ca034b50b00d2b20a94fa1bbfbb80841467834bfdc84aa0ed0d6aab894608fd6c86c3b94eee46343f0e6d9c22e391dbf9", "version": "1.3", + "git_version": "1.3.18", "find_args": "MODULE" }, "vulkan-utility-headers": { "package": "VulkanUtilityLibraries", "repo": "scripts/VulkanUtilityHeaders", - "tag": "1.4.326", + "tag": "1.4.328", "artifact": "VulkanUtilityHeaders.tar.zst", "git_host": "git.crueter.xyz", - "hash": "5924629755cb1605c4aa4eee20ef7957a9dd8d61e4df548be656d98054f2730c4109693c1bd35811f401f4705d2ccff9fc849be32b0d8480bc3f73541a5e0964" + "hash": "9922217b39faf73cd4fc1510f2fdba14a49aa5c0d77f9ee24ee0512cef16b234d0cabc83c1fec861fa5df1d43e7f086ca9b6501753899119f39c5ca530cb0dae" }, - "spirv-tools": { + "spirv-tools": { "package": "SPIRV-Tools", "repo": "KhronosGroup/SPIRV-Tools", - "sha": "40eb301f32", - "hash": "58d0fb1047d69373cf24c73e6f78c73a72a6cca3b4df1d9f083b9dcc0962745ef154abf3dbe9b3623b835be20c6ec769431cf11733349f45e7568b3525f707aa", + "tag": "v%VERSION%", + "hash": "b17940433ced72e004c5eeffd7dd411b6afcc6a52ee31de6427d88edceb8172369be8ec8bf5b65708a78bf41fdae264d554aa7750b2209831679ab36bc867567", "find_args": "MODULE", + "git_version": "2025.4", "options": [ "SPIRV_SKIP_EXECUTABLES ON" ] @@ -132,35 +140,6 @@ "BUNDLE_SPEEX ON" ] }, - "discord-rpc": { - "package": "DiscordRPC", - "repo": "eden-emulator/discord-rpc", - "sha": "1cf7772bb6", - "hash": "e9b35e6f2c075823257bcd59f06fe7bb2ccce1976f44818d2e28810435ef79c712a3c4f20f40da41f691342a4058cf86b078eb7f9d9e4dae83c0547c21ec4f97" - }, - "simpleini": { - "package": "SimpleIni", - "repo": "brofield/simpleini", - "sha": "09c21bda1d", - "hash": "99779ca9b6e040d36558cadf484f9ffdab5b47bcc8fc72e4d33639d1d60c0ceb4410d335ba445d72a4324e455167fd6769d99b459943aa135bec085dff2d4b7c", - "find_args": "MODULE" - }, - "sdl2_generic": { - "package": "SDL2", - "repo": "libsdl-org/SDL", - "sha": "54772f345a", - "hash": "2a68a0e01c390043aa9d9df63d8a20a52076c88bb460ac4e0f33194ca7d9bc8fadbbcc04e7506872ac4b6354a73fbc267c036f82200da59465789b87c7d9e3a4", - "key": "generic", - "bundled": true - }, - "sdl2_steamdeck": { - "package": "SDL2", - "repo": "libsdl-org/SDL", - "sha": "cc016b0046", - "hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b", - "key": "steamdeck", - "bundled": true - }, "sdl2": { "ci": true, "package": "SDL2", @@ -175,8 +154,43 @@ "catch2": { "package": "Catch2", "repo": "catchorg/Catch2", - "sha": "644821ce28", - "hash": "f8795f98acf2c02c0db8e734cc866d5caebab4b4a306e93598b97cb3c0c728dafe8283dce27ffe8d42460e5ae7302f3f32e7e274a7f991b73511ac88eef21b1f", - "version": "3.0.1" + "tag": "v%VERSION%", + "hash": "a95495142f915d6e9c2a23e80fe360343e9097680066a2f9d3037a070ba5f81ee5559a0407cc9e972dc2afae325873f1fc7ea07a64012c0f01aac6e549f03e3f", + "version": "3.0.1", + "git_version": "3.11.0" + }, + "discord-rpc": { + "package": "DiscordRPC", + "repo": "eden-emulator/discord-rpc", + "sha": "1cf7772bb6", + "hash": "e9b35e6f2c075823257bcd59f06fe7bb2ccce1976f44818d2e28810435ef79c712a3c4f20f40da41f691342a4058cf86b078eb7f9d9e4dae83c0547c21ec4f97", + "find_args": "MODULE" + }, + "simpleini": { + "package": "SimpleIni", + "repo": "brofield/simpleini", + "tag": "v%VERSION%", + "hash": "6c198636816a0018adbf7f735d402c64245c6fcd540b7360d4388d46f007f3a520686cdaec4705cb8cb31401b2cb4797a80b42ea5d08a6a5807c0848386f7ca1", + "find_args": "MODULE", + "git_version": "4.22" + }, + "sdl2_generic": { + "package": "SDL2", + "repo": "libsdl-org/SDL", + "tag": "release-%VERSION%", + "hash": "d5622d6bb7266f7942a7b8ad43e8a22524893bf0c2ea1af91204838d9b78d32768843f6faa248757427b8404b8c6443776d4afa6b672cd8571a4e0c03a829383", + "key": "generic", + "bundled": true, + "git_version": "2.32.10", + "skip_updates": true + }, + "sdl2_steamdeck": { + "package": "SDL2", + "repo": "libsdl-org/SDL", + "sha": "cc016b0046", + "hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b", + "key": "steamdeck", + "bundled": true, + "skip_updates": "true" } } diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json index 80a0b917db..dc69841ab7 100644 --- a/externals/libusb/cpmfile.json +++ b/externals/libusb/cpmfile.json @@ -1,8 +1,9 @@ { "libusb": { "repo": "libusb/libusb", - "sha": "c060e9ce30", - "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", - "find_args": "MODULE" + "tag": "v%VERSION%", + "hash": "98c5f7940ff06b25c9aa65aa98e23de4c79a4c1067595f4c73cc145af23a1c286639e1ba11185cd91bab702081f307b973f08a4c9746576dc8d01b3620a3aeb5", + "find_args": "MODULE", + "git_version": "1.0.29" } } diff --git a/src/dynarmic/externals/cpmfile.json b/src/dynarmic/externals/cpmfile.json index 718163baf5..099ded57a4 100644 --- a/src/dynarmic/externals/cpmfile.json +++ b/src/dynarmic/externals/cpmfile.json @@ -1,9 +1,10 @@ { "biscuit": { - "version": "0.9.1", "repo": "lioncash/biscuit", - "sha": "76b0be8dae", - "hash": "47d55ed02d032d6cf3dc107c6c0a9aea686d5f25aefb81d1af91db027b6815bd5add1755505e19d76625feeb17aa2db6cd1668fe0dad2e6a411519bde6ca4489" + "tag": "v%VERSION%", + "hash": "1229f345b014f7ca544dedb4edb3311e41ba736f9aa9a67f88b5f26f3c983288c6bb6cdedcfb0b8a02c63088a37e6a0d7ba97d9c2a4d721b213916327cffe28a", + "version": "0.9.1", + "git_version": "0.19.0" }, "mcl": { "version": "0.1.12", diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh index 9d5005ec44..9dc1ac2a55 100755 --- a/tools/cpm-fetch-all.sh +++ b/tools/cpm-fetch-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -6,6 +6,9 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') tools/cpm-fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm-fetch.sh b/tools/cpm-fetch.sh index 0219845707..e9829aa482 100755 --- a/tools/cpm-fetch.sh +++ b/tools/cpm-fetch.sh @@ -10,227 +10,227 @@ mkdir -p $CPM_SOURCE_CACHE +# fetch json once to make lives easier +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + ROOTDIR="$PWD" TMP=$(mktemp -d) download_package() { - FILENAME=$(basename "$DOWNLOAD") + FILENAME=$(basename "$DOWNLOAD") - OUTFILE="$TMP/$FILENAME" - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && return - - curl "$DOWNLOAD" -sS -L -o "$OUTFILE" - - ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) - [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 - - mkdir -p "$OUTDIR" - - pushd "$OUTDIR" > /dev/null - - case "$FILENAME" in - (*.7z) - 7z x "$OUTFILE" > /dev/null - ;; - (*.tar*) - tar xf "$OUTFILE" > /dev/null - ;; - (*.zip) - unzip "$OUTFILE" > /dev/null - ;; - esac - - # basically if only one real item exists at the top we just move everything from there - # since github and some vendors hate me - DIRS=$(find -maxdepth 1 -type d -o -type f) - - # thanks gnu - if [ $(wc -l <<< "$DIRS") -eq 2 ]; then - SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") - mv "$SUBDIR"/* . - mv "$SUBDIR"/.* . 2>/dev/null || true - rmdir "$SUBDIR" - fi - - if grep -e "patches" <<< "$JSON" > /dev/null; then - PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") - for patch in $PATCHES; do - patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch - done - fi - - popd > /dev/null -} - -ci_package() { - REPO=$(jq -r ".repo" <<< "$JSON") - EXT=$(jq -r '.extension' <<< "$JSON") - [ "$EXT" = null ] && EXT="tar.zst" - - VERSION=$(jq -r ".version" <<< "$JSON") - - NAME=$(jq -r ".name" <<< "$JSON") - [ "$NAME" = null ] && NAME="$PACKAGE" - - PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") - - DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") - - [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return - - echo "-- CI package $PACKAGE" - - for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do - echo "-- * platform $platform" - - case $DISABLED in - (*"$platform"*) - echo "-- * -- disabled" - continue - ;; - (*) ;; - esac - - FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" - DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" - PACKAGE_NAME="$PACKAGE" - KEY=$platform + OUTFILE="$TMP/$FILENAME" LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && continue + [ -d "$OUTDIR" ] && return + curl "$DOWNLOAD" -sS -L -o "$OUTFILE" + + ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) + [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 + + mkdir -p "$OUTDIR" + + pushd "$OUTDIR" > /dev/null + + case "$FILENAME" in + (*.7z) + 7z x "$OUTFILE" > /dev/null + ;; + (*.tar*) + tar xf "$OUTFILE" > /dev/null + ;; + (*.zip) + unzip "$OUTFILE" > /dev/null + ;; + esac + + # basically if only one real item exists at the top we just move everything from there + # since github and some vendors hate me + DIRS=$(find -maxdepth 1 -type d -o -type f) + + # thanks gnu + if [ "$(wc -l <<< "$DIRS")" -eq 2 ]; then + SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") + mv "$SUBDIR"/* . + mv "$SUBDIR"/.* . 2>/dev/null || true + rmdir "$SUBDIR" + fi + + if grep -e "patches" <<< "$JSON" > /dev/null; then + PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") + for patch in $PATCHES; do + patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch + done + fi + + popd > /dev/null +} + +ci_package() { + EXT=$(jq -r '.extension' <<< "$JSON") + [ "$EXT" = null ] && EXT="tar.zst" + + VERSION=$(jq -r ".version" <<< "$JSON") + + NAME=$(jq -r ".name" <<< "$JSON") + [ "$NAME" = null ] && NAME="$PACKAGE" + + PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") + + DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") + + [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return + + echo "-- CI package $PACKAGE" + + for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do + echo "-- * platform $platform" + + case $DISABLED in + (*"$platform"*) + echo "-- * -- disabled" + continue + ;; + (*) ;; + esac + + FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" + DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" + PACKAGE_NAME="$PACKAGE" + KEY=$platform + + LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && continue + + HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + + HASH=$(curl "$HASH_URL" -sS -q -L -o -) + + download_package + done +} + +for package in "$@" +do + # prepare for cancer + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") + [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + REPO=$(jq -r ".repo" <<< "$JSON") + + CI=$(jq -r ".ci" <<< "$JSON") + if [ "$CI" != null ]; then + ci_package + continue + fi + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" + + # url parsing + URL=$(jq -r ".url" <<< "$JSON") + SHA=$(jq -r ".sha" <<< "$JSON") + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" + else + VERSION_REPLACE="$VERSION" + fi + + TAG=$(jq -r ".tag" <<< "$JSON") + + TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) + ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) + + if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" + elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(jq -r ".branch" <<< "$JSON") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi + else + echo "!! No repo or URL defined for $package" + continue + fi + + # key parsing + KEY=$(jq -r ".key" <<< "$JSON") + + if [ "$KEY" = null ]; then + if [ "$SHA" != null ]; then + KEY=$(cut -c1-4 - <<< "$SHA") + elif [ "$GIT_VERSION" != null ]; then + KEY="$GIT_VERSION" + elif [ "$TAG" != null ]; then + KEY="$TAG" + elif [ "$VERSION" != null ]; then + KEY="$VERSION" + else + echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + continue + fi + fi + + echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + + # hash parsing HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + HASH=$(jq -r ".hash" <<< "$JSON") - HASH=$(curl "$HASH_URL" -sS -q -L -o -) + if [ "$HASH" = null ]; then + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL=$(jq -r ".hash_url" <<< "$JSON") + + if [ "$HASH_URL" = null ]; then + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + fi + + HASH=$(curl "$HASH_URL" -Ss -L -o -) + fi download_package - done -} - -for package in $@ -do - # prepare for cancer - # TODO(crueter): Fetch json once? - JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -r ".\"$package\" | select( . != null )" {} \;) - - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") - [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - REPO=$(jq -r ".repo" <<< "$JSON") - - CI=$(jq -r ".ci" <<< "$JSON") - if [ "$CI" != null ]; then - ci_package - continue - fi - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" - [ "$GIT_VERSION" = null ] && GIT_VERSION="$TAG" - - # url parsing WOOOHOOHOHOOHOHOH - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=$(jq -r ".tag" <<< "$JSON") - - TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) - ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # key parsing - KEY=$(jq -r ".key" <<< "$JSON") - - if [ "$KEY" = null ]; then - if [ "$SHA" != null ]; then - KEY=$(cut -c1-4 - <<< "$SHA") - elif [ "$GIT_VERSION" != null ]; then - KEY="$GIT_VERSION" - elif [ "$TAG" != null ]; then - KEY="$TAG" - elif [ "$VERSION" != null ]; then - KEY="$VERSION" - else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" - continue - fi - fi - - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - - if [ "$HASH" = null ]; then - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") - - if [ "$HASH_URL" = null ]; then - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - fi - - HASH=$(curl "$HASH_URL" -sS -L -o -) - fi - - download_package done rm -rf $TMP \ No newline at end of file diff --git a/tools/cpm-hash.sh b/tools/cpm-hash.sh deleted file mode 100755 index b740936f4d..0000000000 --- a/tools/cpm-hash.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -SUM=$(wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum) -echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-all-hashes.sh new file mode 100755 index 0000000000..a270c368db --- /dev/null +++ b/tools/cpm/check-all-hashes.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') + +tools/cpm/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-all-updates.sh new file mode 100755 index 0000000000..e0c744abf0 --- /dev/null +++ b/tools/cpm/check-all-updates.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") + +tools/cpm/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh new file mode 100755 index 0000000000..bf7c70ffcb --- /dev/null +++ b/tools/cpm/check-hash.sh @@ -0,0 +1,110 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: update if available +# - FORCE: forcefully update + +# shellcheck disable=SC2016 +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +for package in "$@" +do + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + CI=$(jq -r ".ci" <<< "$JSON") + if [ "$CI" != null ]; then + continue + fi + + HASH_URL=$(jq -r ".hash_url" <<< "$JSON") + [ "$HASH_URL" != null ] && continue + + REPO=$(jq -r ".repo" <<< "$JSON") + TAG=$(jq -r ".tag" <<< "$JSON") + + URL=$(jq -r ".url" <<< "$JSON") + SHA=$(jq -r ".sha" <<< "$JSON") + + echo "-- Package $package" + + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" + else + VERSION_REPLACE="$VERSION" + fi + + TAG=${TAG//%VERSION%/$VERSION_REPLACE} + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=${ARTIFACT//%VERSION%/$VERSION_REPLACE} + ARTIFACT=${ARTIFACT//%TAG%/$TAG} + + if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" + elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(jq -r ".branch" <<< "$JSON") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi + else + echo "!! No repo or URL defined for $package" + continue + fi + + # hash parsing + HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH=$(jq -r ".hash" <<< "$JSON") + + [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue + + export USE_TAG=true + ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD") + + # shellcheck disable=SC2028 + [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" + + if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") + + FILE=$(tools/cpm/which.sh "$package") + + jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new + mv "$FILE".new "$FILE" + + echo "-- * -- Updated $FILE" + fi +done \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh new file mode 100755 index 0000000000..8aa46b3924 --- /dev/null +++ b/tools/cpm/check-updates.sh @@ -0,0 +1,97 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: update if available +# - FORCE: forcefully update + +# shellcheck disable=SC2016 +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +for package in "$@" +do + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + REPO=$(jq -r ".repo" <<< "$JSON") + TAG=$(jq -r ".tag" <<< "$JSON") + SKIP=$(jq -r ".skip_updates" <<< "$JSON") + + [ "$SKIP" = "true" ] && continue + + [ "$REPO" = null ] && continue # echo "No repo defined for $package, skipping" && continue + [ "$GIT_HOST" != "github.com" ] && continue # echo "Unsupported host $GIT_HOST for $package, skipping" && continue + [ "$TAG" = null ] && continue # echo "No tag defined for $package, skipping" && continue + + echo "-- Package $package" + + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false + ORIGINAL_TAG="$TAG" + + TAG=${TAG//%VERSION%/$GIT_VERSION} + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=${ARTIFACT//%VERSION%/$GIT_VERSION} + ARTIFACT=${ARTIFACT//%TAG%/$TAG} + + # Use gh-cli to avoid ratelimits lmao + TAGS=$(gh api --method GET "/repos/$REPO/tags") + + # filter out some commonly known annoyances + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') + + # ignore betas/alphas + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') + + if [ "$HAS_REPLACE" = "true" ]; then + # this just extracts the tag prefix + VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) + + # then we strip out the prefix from the new tag, and make that our new git_version + NEW_GIT_VERSION=${LATEST//$VERSION_PREFIX/} + fi + + # thanks fmt + [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + + LATEST=$(echo "$TAGS" | jq -r '.[0].name') + + [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + + echo "-- * Version $LATEST available, current is $TAG" + + export USE_TAG=true + HASH=$(tools/cpm/hash.sh "$REPO" "$LATEST") + + echo "-- * New hash: $HASH" + + if [ "$UPDATE" = "true" ]; then + if [ "$HAS_REPLACE" = "true" ]; then + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") + else + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") + fi + + FILE=$(tools/cpm/which.sh "$package") + + jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new + mv "$FILE".new "$FILE" + + echo "-- * -- Updated $FILE" + fi +done diff --git a/tools/cpm/format-json.sh b/tools/cpm/format.sh similarity index 100% rename from tools/cpm/format-json.sh rename to tools/cpm/format.sh diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh new file mode 100755 index 0000000000..d9476e19c4 --- /dev/null +++ b/tools/cpm/hash.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# usage: hash.sh repo tag-or-sha +# env vars: GIT_HOST, USE_TAG (use tag instead of sha), ARTIFACT (download artifact with that name instead of src archive) + +REPO="$1" +[ -z "$GIT_HOST" ] && GIT_HOST=github.com +GIT_URL="https://$GIT_HOST/$REPO" + +if [ "$USE_TAG" = "true" ]; then + if [ -z "$ARTIFACT" ]; then + URL="${GIT_URL}/archive/refs/tags/$2.tar.gz" + else + URL="${GIT_URL}/releases/download/$2/${ARTIFACT}" + fi +else + URL="${GIT_URL}/archive/$2.zip" +fi + +SUM=$(wget -q "$URL" -O - | sha512sum) + +echo "$SUM" | cut -d " " -f1 diff --git a/tools/url-hash.sh b/tools/cpm/url-hash.sh similarity index 53% rename from tools/url-hash.sh rename to tools/cpm/url-hash.sh index a54dec8bb2..6709bb4a03 100755 --- a/tools/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -1,4 +1,4 @@ #!/bin/sh -SUM=`wget -q $1 -O - | sha512sum` +SUM=$(wget -q $1 -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh new file mode 100755 index 0000000000..d547bf879d --- /dev/null +++ b/tools/cpm/which.sh @@ -0,0 +1,9 @@ +#!/bin/sh -e + +# check which file a package is in + +JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) + +[ -z "$JSON" ] && echo "!! No cpmfile definition for $1" + +echo $JSON \ No newline at end of file From a65eea69c899f6564f2e01b3a710cf1b8a354bbc Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 16:59:53 -0400 Subject: [PATCH 03/40] license headers Signed-off-by: crueter --- tools/cpm/format.sh | 3 +++ tools/cpm/hash.sh | 3 +++ tools/cpm/url-hash.sh | 3 +++ tools/cpm/which.sh | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 6059077fe1..e636c402b4 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh index d9476e19c4..0c653e75c2 100755 --- a/tools/cpm/hash.sh +++ b/tools/cpm/hash.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + # usage: hash.sh repo tag-or-sha # env vars: GIT_HOST, USE_TAG (use tag instead of sha), ARTIFACT (download artifact with that name instead of src archive) diff --git a/tools/cpm/url-hash.sh b/tools/cpm/url-hash.sh index 6709bb4a03..444b14b174 100755 --- a/tools/cpm/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -1,4 +1,7 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + SUM=$(wget -q $1 -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index d547bf879d..af12deb1b4 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + # check which file a package is in JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) From 9c70334170bb5b3291617dccaa8dfd5c34c24541 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 03:41:01 -0400 Subject: [PATCH 04/40] formatting Signed-off-by: crueter --- externals/ffmpeg/cpmfile.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/externals/ffmpeg/cpmfile.json b/externals/ffmpeg/cpmfile.json index 97ca227939..a4933da275 100644 --- a/externals/ffmpeg/cpmfile.json +++ b/externals/ffmpeg/cpmfile.json @@ -12,10 +12,10 @@ "repo": "crueter-ci/FFmpeg", "version": "8.0", "min_version": "4.1", - "disabled_platforms": [ - "freebsd-amd64", - "solaris-amd64", + "disabled_platforms": [ + "freebsd-amd64", + "solaris-amd64", "macos-universal" - ] + ] } } From d9e641157e5665293e33d6b1feb72fe628d48deb Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 04:59:04 -0400 Subject: [PATCH 05/40] [tools] refactor: reorganize, commonalities, moar tags, posix compat all scripts are fully posix compliant Signed-off-by: crueter --- .shellcheckrc | 1 + cpmfile.json | 5 +- externals/cpmfile.json | 16 ++- tools/cpm-fetch-all.sh | 15 +-- tools/cpm-fetch.sh | 236 --------------------------------- tools/cpm/check-all-hashes.sh | 11 +- tools/cpm/check-all-updates.sh | 8 +- tools/cpm/check-hash.sh | 78 ++--------- tools/cpm/check-updates.sh | 54 +++----- tools/cpm/common.sh | 19 +++ tools/cpm/download.sh | 103 ++++++++++++++ tools/cpm/fetch-all.sh | 13 ++ tools/cpm/fetch.sh | 39 ++++++ tools/cpm/format.sh | 4 +- tools/cpm/hash.sh | 2 +- tools/cpm/package.sh | 225 +++++++++++++++++++++++++++++++ tools/cpm/url-hash.sh | 2 +- tools/cpm/which.sh | 2 +- 18 files changed, 458 insertions(+), 375 deletions(-) create mode 100644 .shellcheckrc mode change 100755 => 120000 tools/cpm-fetch-all.sh delete mode 100755 tools/cpm-fetch.sh create mode 100755 tools/cpm/common.sh create mode 100755 tools/cpm/download.sh create mode 100755 tools/cpm/fetch-all.sh create mode 100755 tools/cpm/fetch.sh create mode 100755 tools/cpm/package.sh diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000000..96e22629de --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +shell=sh diff --git a/cpmfile.json b/cpmfile.json index 385d10cd81..aab9b4dd3d 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -26,9 +26,10 @@ }, "fmt": { "repo": "fmtlib/fmt", - "tag": "12.0.0", + "tag": "%VERSION%", "hash": "c4ab814c20fbad7e3f0ae169125a4988a2795631194703251481dc36b18da65c886c4faa9acd046b0a295005217b3689eb0126108a9ba5aac2ca909aae263c2f", - "version": "8" + "version": "8", + "git_version": "12.0.0" }, "lz4": { "name": "lz4", diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 1ff392923f..a3f7540e6d 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -49,16 +49,18 @@ "xbyak": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "v7.22", + "tag": "v%VERSION%", "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "git_version": "7.22", "bundled": true, "skip_updates": true }, "oaknut": { + "repo": "eden-emulator/oaknut", "version": "2.0.1", - "repo": "merryhime/oaknut", - "sha": "94c726ce03", - "hash": "d8d082242fa1881abce3c82f8dafa002c4e561e66a69e7fc038af67faa5eff2630f082d3d19579c88c4c9f9488e54552accc8cb90e7ce743efe043b6230c08ac" + "git_version": "2.0.3", + "tag": "v%VERSION%", + "hash": "9697e80a7d5d9bcb3ce51051a9a24962fb90ca79d215f1f03ae6b58da8ba13a63b5dda1b4dde3d26ac6445029696b8ef2883f4e5a777b342bba01283ed293856" }, "libadrenotools": { "repo": "bylaws/libadrenotools", @@ -70,8 +72,9 @@ }, "oboe": { "repo": "google/oboe", - "tag": "1.10.0", + "tag": "%VERSION%", "hash": "ce4011afe7345370d4ead3b891cd69a5ef224b129535783586c0ca75051d303ed446e6c7f10bde8da31fff58d6e307f1732a3ffd03b249f9ef1fd48fd4132715", + "git_version": "1.10.0", "bundled": true }, "unordered-dense": { @@ -103,7 +106,8 @@ "vulkan-utility-headers": { "package": "VulkanUtilityLibraries", "repo": "scripts/VulkanUtilityHeaders", - "tag": "1.4.328", + "tag": "%VERSION%", + "git_version": "1.4.328", "artifact": "VulkanUtilityHeaders.tar.zst", "git_host": "git.crueter.xyz", "hash": "9922217b39faf73cd4fc1510f2fdba14a49aa5c0d77f9ee24ee0512cef16b234d0cabc83c1fec861fa5df1d43e7f086ca9b6501753899119f39c5ca530cb0dae" diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh deleted file mode 100755 index 9dc1ac2a55..0000000000 --- a/tools/cpm-fetch-all.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e - -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - -# SPDX-FileCopyrightText: 2025 crueter -# SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC2038 -# shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') -LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') - -tools/cpm-fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh new file mode 120000 index 0000000000..ea773fac18 --- /dev/null +++ b/tools/cpm-fetch-all.sh @@ -0,0 +1 @@ +cpm/fetch-all.sh \ No newline at end of file diff --git a/tools/cpm-fetch.sh b/tools/cpm-fetch.sh deleted file mode 100755 index e9829aa482..0000000000 --- a/tools/cpm-fetch.sh +++ /dev/null @@ -1,236 +0,0 @@ -#!/bin/bash -e - -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - -# SPDX-FileCopyrightText: 2025 crueter -# SPDX-License-Identifier: GPL-3.0-or-later - -[ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm - -mkdir -p $CPM_SOURCE_CACHE - -# fetch json once to make lives easier -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') - -ROOTDIR="$PWD" - -TMP=$(mktemp -d) - -download_package() { - FILENAME=$(basename "$DOWNLOAD") - - OUTFILE="$TMP/$FILENAME" - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && return - - curl "$DOWNLOAD" -sS -L -o "$OUTFILE" - - ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) - [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 - - mkdir -p "$OUTDIR" - - pushd "$OUTDIR" > /dev/null - - case "$FILENAME" in - (*.7z) - 7z x "$OUTFILE" > /dev/null - ;; - (*.tar*) - tar xf "$OUTFILE" > /dev/null - ;; - (*.zip) - unzip "$OUTFILE" > /dev/null - ;; - esac - - # basically if only one real item exists at the top we just move everything from there - # since github and some vendors hate me - DIRS=$(find -maxdepth 1 -type d -o -type f) - - # thanks gnu - if [ "$(wc -l <<< "$DIRS")" -eq 2 ]; then - SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") - mv "$SUBDIR"/* . - mv "$SUBDIR"/.* . 2>/dev/null || true - rmdir "$SUBDIR" - fi - - if grep -e "patches" <<< "$JSON" > /dev/null; then - PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") - for patch in $PATCHES; do - patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch - done - fi - - popd > /dev/null -} - -ci_package() { - EXT=$(jq -r '.extension' <<< "$JSON") - [ "$EXT" = null ] && EXT="tar.zst" - - VERSION=$(jq -r ".version" <<< "$JSON") - - NAME=$(jq -r ".name" <<< "$JSON") - [ "$NAME" = null ] && NAME="$PACKAGE" - - PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") - - DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") - - [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return - - echo "-- CI package $PACKAGE" - - for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do - echo "-- * platform $platform" - - case $DISABLED in - (*"$platform"*) - echo "-- * -- disabled" - continue - ;; - (*) ;; - esac - - FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" - DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" - PACKAGE_NAME="$PACKAGE" - KEY=$platform - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && continue - - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - - HASH=$(curl "$HASH_URL" -sS -q -L -o -) - - download_package - done -} - -for package in "$@" -do - # prepare for cancer - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") - - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") - [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - REPO=$(jq -r ".repo" <<< "$JSON") - - CI=$(jq -r ".ci" <<< "$JSON") - if [ "$CI" != null ]; then - ci_package - continue - fi - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" - - # url parsing - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=$(jq -r ".tag" <<< "$JSON") - - TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) - ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # key parsing - KEY=$(jq -r ".key" <<< "$JSON") - - if [ "$KEY" = null ]; then - if [ "$SHA" != null ]; then - KEY=$(cut -c1-4 - <<< "$SHA") - elif [ "$GIT_VERSION" != null ]; then - KEY="$GIT_VERSION" - elif [ "$TAG" != null ]; then - KEY="$TAG" - elif [ "$VERSION" != null ]; then - KEY="$VERSION" - else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" - continue - fi - fi - - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - - if [ "$HASH" = null ]; then - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") - - if [ "$HASH_URL" = null ]; then - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - fi - - HASH=$(curl "$HASH_URL" -Ss -L -o -) - fi - - download_package -done - -rm -rf $TMP \ No newline at end of file diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-all-hashes.sh index a270c368db..730288b4bf 100755 --- a/tools/cpm/check-all-hashes.sh +++ b/tools/cpm/check-all-hashes.sh @@ -6,9 +6,10 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -# shellcheck disable=SC2038 -# shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') -LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') +SCRIPT_DIR=$(dirname -- "$0") -tools/cpm/check-hash.sh $LIBS \ No newline at end of file +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +"$SCRIPT_DIR"/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-all-updates.sh index e0c744abf0..09f1ec08ea 100755 --- a/tools/cpm/check-all-updates.sh +++ b/tools/cpm/check-all-updates.sh @@ -6,6 +6,10 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") +SCRIPT_DIR=$(dirname -- "$0") -tools/cpm/check-updates.sh $LIBS \ No newline at end of file +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +"$SCRIPT_DIR"/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index bf7c70ffcb..e1081f67ba 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -7,88 +7,26 @@ # SPDX-License-Identifier: GPL-3.0-or-later # env vars: -# - UPDATE: update if available -# - FORCE: forcefully update +# - UPDATE: fix hashes if needed -# shellcheck disable=SC2016 -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC1091 +. tools/cpm/common.sh for package in "$@" do - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - CI=$(jq -r ".ci" <<< "$JSON") if [ "$CI" != null ]; then continue fi - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") [ "$HASH_URL" != null ] && continue - - REPO=$(jq -r ".repo" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") + [ "$HASH_SUFFIX" != null ] && continue echo "-- Package $package" - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=${TAG//%VERSION%/$VERSION_REPLACE} - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=${ARTIFACT//%VERSION%/$VERSION_REPLACE} - ARTIFACT=${ARTIFACT//%TAG%/$TAG} - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue export USE_TAG=true diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 8aa46b3924..3d37d4cbb0 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -10,42 +10,26 @@ # - UPDATE: update if available # - FORCE: forcefully update -# shellcheck disable=SC2016 -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC1091 +. tools/cpm/common.sh for package in "$@" do - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - REPO=$(jq -r ".repo" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - SKIP=$(jq -r ".skip_updates" <<< "$JSON") + SKIP=$(value "skip_updates") [ "$SKIP" = "true" ] && continue - [ "$REPO" = null ] && continue # echo "No repo defined for $package, skipping" && continue - [ "$GIT_HOST" != "github.com" ] && continue # echo "Unsupported host $GIT_HOST for $package, skipping" && continue - [ "$TAG" = null ] && continue # echo "No tag defined for $package, skipping" && continue + [ "$REPO" = null ] && continue + [ "$GIT_HOST" != "github.com" ] && continue # TODO + [ "$TAG" = null ] && continue echo "-- Package $package" - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false - ORIGINAL_TAG="$TAG" - - TAG=${TAG//%VERSION%/$GIT_VERSION} - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=${ARTIFACT//%VERSION%/$GIT_VERSION} - ARTIFACT=${ARTIFACT//%TAG%/$TAG} - + # TODO(crueter): Support for Forgejo updates w/ forgejo_token # Use gh-cli to avoid ratelimits lmao TAGS=$(gh api --method GET "/repos/$REPO/tags") @@ -58,14 +42,6 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') - if [ "$HAS_REPLACE" = "true" ]; then - # this just extracts the tag prefix - VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) - - # then we strip out the prefix from the new tag, and make that our new git_version - NEW_GIT_VERSION=${LATEST//$VERSION_PREFIX/} - fi - # thanks fmt [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') @@ -73,6 +49,14 @@ do [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + if [ "$HAS_REPLACE" = "true" ]; then + # this just extracts the tag prefix + VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) + + # then we strip out the prefix from the new tag, and make that our new git_version + NEW_GIT_VERSION=$(echo "$LATEST" | sed "s/$VERSION_PREFIX//g") + fi + echo "-- * Version $LATEST available, current is $TAG" export USE_TAG=true diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh new file mode 100755 index 0000000000..5f9b2e42c7 --- /dev/null +++ b/tools/cpm/common.sh @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') + +export PACKAGES +export LIBS + +value() { + echo "$JSON" | jq -r ".$1" +} \ No newline at end of file diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh new file mode 100755 index 0000000000..b2f7e3c5c9 --- /dev/null +++ b/tools/cpm/download.sh @@ -0,0 +1,103 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: fix hashes if needed + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +download_package() { + FILENAME=$(basename "$DOWNLOAD") + + OUTFILE="$TMP/$FILENAME" + + LOWER_PACKAGE=$(echo "$PACKAGE_NAME" | tr '[:upper:]' '[:lower:]') + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && return + + curl "$DOWNLOAD" -sS -L -o "$OUTFILE" + + ACTUAL_HASH=$("${HASH_ALGO}"sum "$OUTFILE" | cut -d" " -f1) + [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 + + mkdir -p "$OUTDIR" + + PREVDIR="$PWD" + cd "$OUTDIR" + + case "$FILENAME" in + (*.7z) + 7z x "$OUTFILE" > /dev/null + ;; + (*.tar*) + tar xf "$OUTFILE" > /dev/null + ;; + (*.zip) + unzip "$OUTFILE" > /dev/null + ;; + esac + + # basically if only one real item exists at the top we just move everything from there + # since github and some vendors hate me + DIRS=$(find . -maxdepth 1 -type d -o -type f) + + # thanks gnu + if [ "$(echo "$DIRS" | wc -l)" -eq 2 ]; then + SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") + mv "$SUBDIR"/* . + mv "$SUBDIR"/.* . 2>/dev/null || true + rmdir "$SUBDIR" + fi + + if echo "$JSON" | grep -e "patches" > /dev/null; then + PATCHES=$(echo "$JSON" | jq -r '.patches | join(" ")') + for patch in $PATCHES; do + # shellcheck disable=SC2154 + patch --binary -p1 < "$ROOTDIR/.patch/$package/$patch" + done + fi + + cd "$PREVDIR" +} + +ci_package() { + [ "$REPO" = null ] && echo "-- ! No repo defined" && return + + echo "-- CI package $PACKAGE_NAME" + + for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do + echo "-- * platform $platform" + + case $DISABLED in + (*"$platform"*) + echo "-- * -- disabled" + continue + ;; + (*) ;; + esac + + FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" + DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" + KEY=$platform + + LOWER_PACKAGE=$(echo "$PACKAGE_NAME" | tr '[:upper:]' '[:lower:]') + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && continue + + HASH_ALGO=$(value "hash_algo") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + + HASH=$(curl "$HASH_URL" -sS -q -L -o -) + + download_package + done +} diff --git a/tools/cpm/fetch-all.sh b/tools/cpm/fetch-all.sh new file mode 100755 index 0000000000..16c898023f --- /dev/null +++ b/tools/cpm/fetch-all.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +tools/cpm/fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh new file mode 100755 index 0000000000..26a397d6ae --- /dev/null +++ b/tools/cpm/fetch.sh @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +[ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm + +mkdir -p "$CPM_SOURCE_CACHE" + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC1091 +. tools/cpm/download.sh + +# shellcheck disable=SC2034 +ROOTDIR="$PWD" + +TMP=$(mktemp -d) + +# shellcheck disable=SC2034 +for package in "$@" +do + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh + + if [ "$CI" = "true" ]; then + ci_package + else + echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + download_package + fi +done + +rm -rf "$TMP" \ No newline at end of file diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index e636c402b4..7af66dffa3 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -6,6 +6,6 @@ FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do - jq --indent 4 < $file > $file.new - mv $file.new $file + jq --indent 4 < "$file" > "$file".new + mv "$file".new "$file" done diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh index 0c653e75c2..27061bd9a4 100755 --- a/tools/cpm/hash.sh +++ b/tools/cpm/hash.sh @@ -11,7 +11,7 @@ REPO="$1" GIT_URL="https://$GIT_HOST/$REPO" if [ "$USE_TAG" = "true" ]; then - if [ -z "$ARTIFACT" ]; then + if [ -z "$ARTIFACT" ] || [ "$ARTIFACT" = "null" ]; then URL="${GIT_URL}/archive/refs/tags/$2.tar.gz" else URL="${GIT_URL}/releases/download/$2/${ARTIFACT}" diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh new file mode 100755 index 0000000000..89e01089b0 --- /dev/null +++ b/tools/cpm/package.sh @@ -0,0 +1,225 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: fix hashes if needed + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +[ -z "$package" ] && echo "Package was not specified" && exit 0 + +# shellcheck disable=SC2153 +JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + +[ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 + +# unset stuff +unset PACKAGE_NAME +unset REPO +unset CI +unset GIT_HOST +unset EXT +unset NAME +unset DISABLED +unset TAG +unset ARTIFACT +unset SHA +unset VERSION +unset GIT_VERSION +unset DOWNLOAD +unset URL +unset KEY +unset HASH + +unset ORIGINAL_TAG +unset HAS_REPLACE +unset VERSION_REPLACE + +unset HASH_URL +unset HASH_SUFFIX +unset HASH_ALGO + +######## +# Meta # +######## + +REPO=$(value "repo") +CI=$(value "ci") + +PACKAGE_NAME=$(value "package") +[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" + +GIT_HOST=$(value "git_host") +[ "$GIT_HOST" = null ] && GIT_HOST=github.com + +export PACKAGE_NAME +export REPO +export CI +export GIT_HOST + +###################### +# CI Package Parsing # +###################### + +VERSION=$(value "version") + +if [ "$CI" = "true" ]; then + EXT=$(value "extension") + [ "$EXT" = null ] && EXT="tar.zst" + + NAME=$(value "name") + DISABLED=$(echo "$JSON" | jq -j '.disabled_platforms') + + [ "$NAME" = null ] && NAME="$PACKAGE" + + export EXT + export NAME + export DISABLED + export VERSION + + # slight annoyance + TAG=null + ARTIFACT=null + SHA=null + VERSION=null + GIT_VERSION=null + DOWNLOAD=null + URL=null + KEY=null + HASH=null + ORIGINAL_TAG=null + HAS_REPLACE=null + VERSION_REPLACE=null + HASH_URL=null + HASH_SUFFIX=null + HASH_ALGO=null + + return 0 +fi + +############## +# Versioning # +############## + +TAG=$(value "tag") +ARTIFACT=$(value "artifact") +SHA=$(value "sha") +GIT_VERSION=$(value "git_version") + +[ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" + +if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" +else + VERSION_REPLACE="$VERSION" +fi + +echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false +ORIGINAL_TAG="$TAG" + +TAG=$(echo "$TAG" | sed "s/%VERSION%/$VERSION_REPLACE/g") +ARTIFACT=$(echo "$ARTIFACT" | sed "s/%VERSION%/$VERSION_REPLACE/g") +ARTIFACT=$(echo "$ARTIFACT" | sed "s/%TAG%/$TAG/g") + +export TAG +export ARTIFACT +export SHA +export VERSION +export GIT_VERSION +export ORIGINAL_TAG +export HAS_REPLACE +export VERSION_REPLACE + +############### +# URL Parsing # +############### + +URL=$(value "url") + +if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" +elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(value "branch") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi +else + echo "!! No repo or URL defined for $package" + exit 1 +fi + +export DOWNLOAD +export URL + +############### +# Key Parsing # +############### + +KEY=$(value "key") + +if [ "$KEY" = null ]; then + if [ "$SHA" != null ]; then + KEY=$(echo "$SHA" | cut -c1-4) + elif [ "$GIT_VERSION" != null ]; then + KEY="$GIT_VERSION" + elif [ "$TAG" != null ]; then + KEY="$TAG" + elif [ "$VERSION" != null ]; then + KEY="$VERSION" + else + echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + exit 1 + fi +fi + +export KEY + +################ +# Hash Parsing # +################ + +HASH_ALGO=$(value "hash_algo") +[ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + +HASH=$(value "hash") + +if [ "$HASH" = null ]; then + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL=$(value "hash_url") + + if [ "$HASH_URL" = null ]; then + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + fi + + HASH=$(curl "$HASH_URL" -Ss -L -o -) +else + HASH_URL=null + HASH_SUFFIX=null +fi + +export HASH_URL +export HASH_SUFFIX +export HASH +export HASH_ALGO +export JSON \ No newline at end of file diff --git a/tools/cpm/url-hash.sh b/tools/cpm/url-hash.sh index 444b14b174..c911dacb37 100755 --- a/tools/cpm/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -3,5 +3,5 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SUM=$(wget -q $1 -O - | sha512sum) +SUM=$(wget -q "$1" -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index af12deb1b4..f1ca316a3e 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -9,4 +9,4 @@ JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" -echo $JSON \ No newline at end of file +echo "$JSON" \ No newline at end of file From 6599c1afbef7e72f3dcdd4c76ce243f91d61fa2e Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:40:10 -0400 Subject: [PATCH 06/40] [tools] docs Signed-off-by: crueter --- tools/README.md | 21 ++ tools/clang-format.sh | 5 +- tools/cpm/README.md | 58 ++++++ ...{check-all-hashes.sh => check-hash-all.sh} | 7 +- tools/cpm/check-hash.sh | 3 - ...ck-all-updates.sh => check-updates-all.sh} | 7 +- tools/cpm/check-updates.sh | 4 +- tools/cpm/common.sh | 3 + tools/cpm/download.sh | 3 - tools/cpm/fetch-all.sh | 3 - tools/cpm/fetch.sh | 3 - tools/cpm/format.sh | 4 + tools/cpm/package.sh | 68 +++---- tools/cpm/which.sh | 4 + tools/dtrace-tool.sh | 47 +++-- tools/llvmpipe-run.sh | 192 +++++++++++++++++- tools/optimize-assets.sh | 7 +- tools/reset-submodules.sh | 8 - tools/shellcheck.sh | 11 + tools/update-cpm.sh | 7 +- tools/update-icons.sh | 5 +- 21 files changed, 370 insertions(+), 100 deletions(-) create mode 100644 tools/README.md create mode 100644 tools/cpm/README.md rename tools/cpm/{check-all-hashes.sh => check-hash-all.sh} (50%) rename tools/cpm/{check-all-updates.sh => check-updates-all.sh} (50%) delete mode 100755 tools/reset-submodules.sh create mode 100755 tools/shellcheck.sh diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..9abd96175b --- /dev/null +++ b/tools/README.md @@ -0,0 +1,21 @@ +# Tools + +Tools for Eden and other subprojects. + +## Third-Party + +- [CPMUtil Scripts](./cpm) + +## Eden + +- `shellcheck.sh`: Ensure POSIX compliance (and syntax sanity) for all tools in this directory and subdirectories. +- `llvmpipe-run.sh`: Sets environment variables needed to run any command (or Eden) with llvmpipe. +- `optimize-assets.sh`: Optimize PNG assets with OptiPng. +- `update-cpm.sh`: Updates CPM.cmake to the latest version. +- `update-icons.sh`: Rebuild all icons (macOS, Windows, bitmaps) based on the master SVG file (`dist/dev.eden_emu.eden.svg`) + * Also optimizes the master SVG + * Requires: `png2icns` (libicns), ImageMagick, [`svgo`](https://github.com/svg/svgo) +- `dtrace-tool.sh` +- `lanczos_gen.c` +- `clang-format.sh`: Runs `clang-format` on the entire codebase. + * Requires: clang diff --git a/tools/clang-format.sh b/tools/clang-format.sh index 77c3c847ad..2deb0a3ade 100755 --- a/tools/clang-format.sh +++ b/tools/clang-format.sh @@ -1,3 +1,6 @@ #! /bin/sh -exec find src -iname *.h -o -iname *.cpp | xargs clang-format-15 -i -style=file:src/.clang-format +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +exec find src -iname "*.h" -o -iname "*.cpp" | xargs clang-format -i -style=file:src/.clang-format diff --git a/tools/cpm/README.md b/tools/cpm/README.md new file mode 100644 index 0000000000..b66fe09a25 --- /dev/null +++ b/tools/cpm/README.md @@ -0,0 +1,58 @@ +# CPMUtil Tools + +These are supplemental shell scripts for CPMUtil aiming to ease maintenance burden for sanity checking, updates, prefetching, formatting, and standard operations done by these shell scripts, all in one common place. + +All scripts are POSIX-compliant. + +## Meta + +These scripts are generally reserved for internal use. + +- `common.sh`: Grabs all available cpmfiles and aggregates them together. + * Outputs: + - `PACKAGES`: The aggregated cpmfile + - `LIBS`: The list of individual libraries contained within each cpmfile + - `value`: A function that grabs a key from the `JSON` variable (typically the package key) +- `download.sh`: Utility script to handle downloading of regular and CI packages. + * Generally only used by the fetch scripts. +- `package.sh`: The actual package parser. + * Inputs: + - `package`: The package key + * Outputs: + - Basically everything. You're best off reading the code rather than me poorly explaining it. +- `which.sh`: Find which cpmfile a package is located in. + * Inputs: + - The package key + +## Simple Utilities + +These scripts don't really have any functionality, they just help you out a bit yknow? + +- `format.sh`: Format all cpmfiles (4-space indent is enforced) + * In the future, these scripts will have options for spacing +- `hash.sh`: Determine the hash of a specific package. + * Inputs: + - The repository (e.g. fmtlib/fmt) + - The sha or tag (e.g. v1.0.1) + - `GIT_HOST`: What git host to use (default github.com) + - `USE_TAG`: Set to "true" if the second argument is a tag instead of a sha + - `ARTIFACT`: The artifact to download, if using a tag. Set to null or empty to use the tag source archive instead + * Output: the SHA512 sum of the package +- `url-hash.sh`: Determine the hash of a URL + * Input: the URL + * Output: the SHA512 sum of the URL + +## Functional Utilities + +These modify the CPM cache or cpmfiles. Each allows you to input all the packages to act on, as well as a `-all.sh` that acts upon all available packages. + +For the update and hash scripts, set `UPDATE=true` to update the cpmfile with the new version or hash. Beware: if the hash is `cf83e1357...` that means you got a 404 error! + +- `fetch.sh`: Prefetch a package according to its cpmfile definition + * Packages are fetched to the `.cache/cpm` directory by default, following the CPMUtil default. +- `check-updates.sh`: Check a package for available updates + * This only applies to packages that utilize tags. + * If the tag is a format string, the `git_version` is acted upon instead. + * Setting `FORCE=true` will forcefully update every package and its hash, even if they are on the latest version (`UPDATE` must also be true) +- `check-hashes.sh`: Check a package's hash + * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. \ No newline at end of file diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-hash-all.sh similarity index 50% rename from tools/cpm/check-all-hashes.sh rename to tools/cpm/check-hash-all.sh index 730288b4bf..fd8c270392 100755 --- a/tools/cpm/check-all-hashes.sh +++ b/tools/cpm/check-hash-all.sh @@ -1,15 +1,10 @@ #!/bin/bash -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SCRIPT_DIR=$(dirname -- "$0") - # shellcheck disable=SC1091 . tools/cpm/common.sh # shellcheck disable=SC2086 -"$SCRIPT_DIR"/check-hash.sh $LIBS \ No newline at end of file +tools/cpm/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index e1081f67ba..176e99d9b5 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-updates-all.sh similarity index 50% rename from tools/cpm/check-all-updates.sh rename to tools/cpm/check-updates-all.sh index 09f1ec08ea..a6eda58bac 100755 --- a/tools/cpm/check-all-updates.sh +++ b/tools/cpm/check-updates-all.sh @@ -1,15 +1,10 @@ #!/bin/bash -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SCRIPT_DIR=$(dirname -- "$0") - # shellcheck disable=SC1091 . tools/cpm/common.sh # shellcheck disable=SC2086 -"$SCRIPT_DIR"/check-updates.sh $LIBS \ No newline at end of file +tools/cpm/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 3d37d4cbb0..2e752b26c5 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -25,6 +25,7 @@ do [ "$REPO" = null ] && continue [ "$GIT_HOST" != "github.com" ] && continue # TODO + # shellcheck disable=SC2153 [ "$TAG" = null ] && continue echo "-- Package $package" @@ -34,6 +35,7 @@ do TAGS=$(gh api --method GET "/repos/$REPO/tags") # filter out some commonly known annoyances + # TODO add more TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') @@ -42,7 +44,7 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') - # thanks fmt + # Add package-specific overrides here, e.g. here for fmt: [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') LATEST=$(echo "$TAGS" | jq -r '.[0].name') diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index 5f9b2e42c7..8c67d40436 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -9,6 +9,9 @@ # shellcheck disable=SC2038 # shellcheck disable=SC2016 [ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +# For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) +# Always include . LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') export PACKAGES diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh index b2f7e3c5c9..d6c90b11fa 100755 --- a/tools/cpm/download.sh +++ b/tools/cpm/download.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/fetch-all.sh b/tools/cpm/fetch-all.sh index 16c898023f..5c41b5d080 100755 --- a/tools/cpm/fetch-all.sh +++ b/tools/cpm/fetch-all.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh index 26a397d6ae..e403f86818 100755 --- a/tools/cpm/fetch.sh +++ b/tools/cpm/fetch.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 7af66dffa3..45fd787da3 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,8 +1,12 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later +# like common.sh, change for your directories FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh index 89e01089b0..004111ad7c 100755 --- a/tools/cpm/package.sh +++ b/tools/cpm/package.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later @@ -20,30 +17,28 @@ JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 # unset stuff -unset PACKAGE_NAME -unset REPO -unset CI -unset GIT_HOST -unset EXT -unset NAME -unset DISABLED -unset TAG -unset ARTIFACT -unset SHA -unset VERSION -unset GIT_VERSION -unset DOWNLOAD -unset URL -unset KEY -unset HASH - -unset ORIGINAL_TAG -unset HAS_REPLACE -unset VERSION_REPLACE - -unset HASH_URL -unset HASH_SUFFIX -unset HASH_ALGO +export PACKAGE_NAME="null" +export REPO="null" +export CI="null" +export GIT_HOST="null" +export EXT="null" +export NAME="null" +export DISABLED="null" +export TAG="null" +export ARTIFACT="null" +export SHA="null" +export VERSION="null" +export GIT_VERSION="null" +export DOWNLOAD="null" +export URL="null" +export KEY="null" +export HASH="null" +export ORIGINAL_TAG="null" +export HAS_REPLACE="null" +export VERSION_REPLACE="null" +export HASH_URL="null" +export HASH_SUFFIX="null" +export HASH_ALGO="null" ######## # Meta # @@ -76,30 +71,13 @@ if [ "$CI" = "true" ]; then NAME=$(value "name") DISABLED=$(echo "$JSON" | jq -j '.disabled_platforms') - [ "$NAME" = null ] && NAME="$PACKAGE" + [ "$NAME" = null ] && NAME="$PACKAGE_NAME" export EXT export NAME export DISABLED export VERSION - # slight annoyance - TAG=null - ARTIFACT=null - SHA=null - VERSION=null - GIT_VERSION=null - DOWNLOAD=null - URL=null - KEY=null - HASH=null - ORIGINAL_TAG=null - HAS_REPLACE=null - VERSION_REPLACE=null - HASH_URL=null - HASH_SUFFIX=null - HASH_ALGO=null - return 0 fi diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index f1ca316a3e..f207700571 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,10 +1,14 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in +# like common.sh, change for your directories JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" diff --git a/tools/dtrace-tool.sh b/tools/dtrace-tool.sh index a8cc4c7bad..4a75848fcd 100755 --- a/tools/dtrace-tool.sh +++ b/tools/dtrace-tool.sh @@ -1,42 +1,59 @@ #!/usr/local/bin/bash -ex + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # Basic script to run dtrace sampling over the program (requires Flamegraph) # Usage is either running as: ./dtrace-tool.sh pid (then input the pid of the process) # Or just run directly with: ./dtrace-tool.sh + FLAMEGRAPH_DIR=".." -function fail { - printf '%s\n' "$1" >&2 - exit "${2-1}" +fail() { + printf '%s\n' "$1" >&2 + exit "${2-1}" } + [ -f $FLAMEGRAPH_DIR/FlameGraph/stackcollapse.pl ] || fail 'Where is flamegraph?' #[ which dtrace ] || fail 'Needs DTrace installed' -read -p "Sampling Hz [800]: " TRACE_CFG_HZ + +read -r "Sampling Hz [800]: " TRACE_CFG_HZ if [ -z "${TRACE_CFG_HZ}" ]; then - TRACE_CFG_HZ=800 + TRACE_CFG_HZ=800 fi -read -p "Sampling time [5] sec: " TRACE_CFG_TIME + +read -r "Sampling time [5] sec: " TRACE_CFG_TIME if [ -z "${TRACE_CFG_TIME}" ]; then - TRACE_CFG_TIME=5 + TRACE_CFG_TIME=5 fi + TRACE_FILE=dtrace-out.user_stacks TRACE_FOLD=dtrace-out.fold TRACE_SVG=dtrace-out.svg ps -if [[ $1 = 'pid' ]]; then - read -p "PID: " TRACE_CFG_PID - sudo echo 'Sudo!' + +if [ "$1" = 'pid' ]; then + read -r "PID: " TRACE_CFG_PID + sudo echo 'Sudo!' else - [[ -f $1 && $1 ]] || fail 'Usage: ./tools/dtrace-profile.sh ' - echo "Executing: '$@'" - sudo echo 'Sudo!' - "$@" & - TRACE_CFG_PID=$! + if [ -f "$1" ] && [ "$1" ]; then + fail 'Usage: ./tools/dtrace-profile.sh ' + fi + + printf "Executing: " + echo "$@" + sudo echo 'Sudo!' + "$@" & + TRACE_CFG_PID=$! fi + TRACE_PROBE="profile-${TRACE_CFG_HZ} /pid == ${TRACE_CFG_PID} && arg1/ { @[ustack()] = count(); } tick-${TRACE_CFG_TIME}s { exit(0); }" + rm -- $TRACE_SVG || echo 'Skip' + sudo dtrace -x ustackframes=100 -Z -n "$TRACE_PROBE" -o $TRACE_FILE 2>/dev/null || exit + perl $FLAMEGRAPH_DIR/FlameGraph/stackcollapse.pl $TRACE_FILE > $TRACE_FOLD || exit perl $FLAMEGRAPH_DIR/FlameGraph/flamegraph.pl $TRACE_FOLD > $TRACE_SVG || exit + sudo chmod 0666 $TRACE_FILE rm -- $TRACE_FILE $TRACE_FOLD \ No newline at end of file diff --git a/tools/llvmpipe-run.sh b/tools/llvmpipe-run.sh index 8f53d691c2..c3a5a85d41 100755 --- a/tools/llvmpipe-run.sh +++ b/tools/llvmpipe-run.sh @@ -1,15 +1,205 @@ #!/bin/sh # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # This script basically allows you to "dirtily" use llvmpipe in any configuration # llvmpipe will of course, run at negative mach-1 speeds. However this is mainly useful to test that mesa # is properly working on extraneous systems (such as Managarm). This mainly only works with MESA >22.0.0 # Use as follows: ./llvmpipe-run.sh + export MESA_GL_VERSION_OVERRIDE=4.6 export MESA_GLSL_VERSION_OVERRIDE=460 export MESA_EXTENSION_MAX_YEAR=2025 export MESA_DEBUG=1 export MESA_VK_VERSION_OVERRIDE=1.3 export LIBGL_ALWAYS_SOFTWARE=1 -export MESA_EXTENSION_OVERRIDE="GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2 GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64 GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2 GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64 GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_ANDROID_extension_pack_es31a GL_EXT_EGL_image_external_wrap_modes GL_EXT_base_instance GL_EXT_blend_func_extended GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture GL_EXT_clip_control GL_EXT_clip_cull_distance GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_debug_label GL_EXT_depth_clamp GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_draw_transform_feedback GL_EXT_float_blend GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_indirect GL_EXT_multisample_compatibility GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box GL_EXT_raster_multisample GL_EXT_read_format_bgra GL_EXT_render_snorm GL_EXT_robustness GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_non_constant_global_initializers GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sparse_texture GL_EXT_sparse_texture2 GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_bptc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_format_BGRA8888 GL_EXT_texture_mirror_clamp_to_edge GL_EXT_texture_norm16 GL_EXT_texture_query_lod GL_EXT_texture_rg GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_storage GL_EXT_texture_view GL_EXT_unpack_subimage GL_EXT_window_rectangles GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_clip_space_w_scaling GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers GL_NV_draw_instanced GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_attrib_location GL_NV_fbo_color_attachments GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color GL_NV_fragment_shader_interlock GL_NV_framebuffer_blit GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB GL_NV_geometry_shader_passthrough GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_instanced_arrays GL_NV_internalformat_sample_query GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_non_square_matrices GL_NV_occlusion_query_samples GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object GL_NV_polygon_mode GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_sRGB_formats GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_fp16_vector GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shadow_samplers_array GL_NV_shadow_samplers_cube GL_NV_stereo_view_rendering GL_NV_texture_array GL_NV_texture_barrier GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update GL_NV_timeline_semaphore GL_NV_timer_query GL_NV_viewport_array GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OES_compressed_ETC1_RGB8_texture GL_OES_copy_image GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_get_program_binary GL_OES_gpu_shader5 GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_primitive_bounding_box GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture" + +# This was automated via a script so I might have missed some +ext="GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index" +ext="$ext GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays" +ext="$ext GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture" +ext="$ext GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size" +ext="$ext GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output" +ext="$ext GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers" +ext="$ext GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts" +ext="$ext GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport" +ext="$ext GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments" +ext="$ext GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv" +ext="$ext GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging" +ext="$ext GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata" +ext="$ext GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture" +ext="$ext GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object" +ext="$ext GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query" +ext="$ext GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations" +ext="$ext GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects" +ext="$ext GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock" +ext="$ext GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects" +ext="$ext GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples" +ext="$ext GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack" +ext="$ext GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2" +ext="$ext GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier" +ext="$ext GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression" +ext="$ext GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add" +ext="$ext GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax" +ext="$ext GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample" +ext="$ext GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg" +ext="$ext GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle" +ext="$ext GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced" +ext="$ext GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra" +ext="$ext GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object" +ext="$ext GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev" +ext="$ext GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once" +ext="$ext GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform" +ext="$ext GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax" +ext="$ext GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access" +ext="$ext GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit" +ext="$ext GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object" +ext="$ext GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4" +ext="$ext GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays" +ext="$ext GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil" +ext="$ext GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters" +ext="$ext GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample" +ext="$ext GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd" +ext="$ext GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted" +ext="$ext GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2" +ext="$ext GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array" +ext="$ext GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc" +ext="$ext GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map" +ext="$ext GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3" +ext="$ext GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer" +ext="$ext GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object" +ext="$ext GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod" +ext="$ext GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query" +ext="$ext GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit" +ext="$ext GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat" +ext="$ext GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control" +ext="$ext GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior" +ext="$ext GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers" +ext="$ext GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence" +ext="$ext GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control" +ext="$ext GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture" +ext="$ext GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor" +ext="$ext GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5" +ext="$ext GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate" +ext="$ext GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image" +ext="$ext GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image" +ext="$ext GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle" +ext="$ext GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program" +ext="$ext GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock" +ext="$ext GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4" +ext="$ext GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1" +ext="$ext GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview" +ext="$ext GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent" +ext="$ext GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint" +ext="$ext GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2" +ext="$ext GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite" +ext="$ext GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners" +ext="$ext GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations" +ext="$ext GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float" +ext="$ext GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64" +ext="$ext GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned" +ext="$ext GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection" +ext="$ext GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample" +ext="$ext GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2" +ext="$ext GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2" +ext="$ext GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop" +ext="$ext GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit" +ext="$ext GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2" +ext="$ext GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle" +ext="$ext GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod" +ext="$ext GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_AMD_multi_draw_indirect" +ext="$ext GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index" +ext="$ext GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility" +ext="$ext GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended" +ext="$ext GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control" +ext="$ext GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage" +ext="$ext GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted" +ext="$ext GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance" +ext="$ext GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture" +ext="$ext GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend" +ext="$ext GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts" +ext="$ext GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions" +ext="$ext GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow" +ext="$ext GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments" +ext="$ext GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary" +ext="$ext GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64" +ext="$ext GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging" +ext="$ext GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2" +ext="$ext GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind" +ext="$ext GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query" +ext="$ext GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query" +ext="$ext GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp" +ext="$ext GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object" +ext="$ext GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading" +ext="$ext GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture" +ext="$ext GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters" +ext="$ext GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters" +ext="$ext GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects" +ext="$ext GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine" +ext="$ext GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array" +ext="$ext GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include" +ext="$ext GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture" +ext="$ext GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing" +ext="$ext GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp" +ext="$ext GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range" +ext="$ext GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc" +ext="$ext GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine" +ext="$ext GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic" +ext="$ext GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge" +ext="$ext GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two" +ext="$ext GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg" +ext="$ext GL_ANDROID_extension_pack_es31a GL_EXT_EGL_image_external_wrap_modes GL_EXT_base_instance" +ext="$ext GL_EXT_blend_func_extended GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture" +ext="$ext GL_EXT_clip_control GL_EXT_clip_cull_distance GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float" +ext="$ext GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_debug_label" +ext="$ext GL_EXT_depth_clamp GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed" +ext="$ext GL_EXT_draw_elements_base_vertex GL_EXT_draw_transform_feedback GL_EXT_float_blend GL_EXT_frag_depth" +ext="$ext GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range" +ext="$ext GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_indirect GL_EXT_multisample_compatibility" +ext="$ext GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_EXT_multiview_texture_multisample" +ext="$ext GL_EXT_multiview_timer_query GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp" +ext="$ext GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box GL_EXT_raster_multisample GL_EXT_read_format_bgra" +ext="$ext GL_EXT_render_snorm GL_EXT_robustness GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_semaphore" +ext="$ext GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions" +ext="$ext GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_non_constant_global_initializers" +ext="$ext GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sparse_texture GL_EXT_sparse_texture2" +ext="$ext GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer" +ext="$ext GL_EXT_texture_compression_bptc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc" +ext="$ext GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic" +ext="$ext GL_EXT_texture_filter_minmax GL_EXT_texture_format_BGRA8888 GL_EXT_texture_mirror_clamp_to_edge" +ext="$ext GL_EXT_texture_norm16 GL_EXT_texture_query_lod GL_EXT_texture_rg GL_EXT_texture_sRGB_R8" +ext="$ext GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_storage GL_EXT_texture_view" +ext="$ext GL_EXT_unpack_subimage GL_EXT_window_rectangles GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent" +ext="$ext GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile" +ext="$ext GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_hdr" +ext="$ext GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_NVX_blend_equation_advanced_multi_draw_buffers" +ext="$ext GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent" +ext="$ext GL_NV_blend_minmax_factor GL_NV_clip_space_w_scaling GL_NV_conditional_render GL_NV_conservative_raster" +ext="$ext GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers" +ext="$ext GL_NV_draw_instanced GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_attrib_location" +ext="$ext GL_NV_fbo_color_attachments GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color GL_NV_fragment_shader_interlock" +ext="$ext GL_NV_framebuffer_blit GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB" +ext="$ext GL_NV_geometry_shader_passthrough GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_instanced_arrays" +ext="$ext GL_NV_internalformat_sample_query GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_non_square_matrices" +ext="$ext GL_NV_occlusion_query_samples GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear" +ext="$ext GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object GL_NV_polygon_mode" +ext="$ext GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_sRGB_formats" +ext="$ext GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_fp16_vector" +ext="$ext GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shadow_samplers_array" +ext="$ext GL_NV_shadow_samplers_cube GL_NV_stereo_view_rendering GL_NV_texture_array GL_NV_texture_barrier" +ext="$ext GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update" +ext="$ext GL_NV_timeline_semaphore GL_NV_timer_query GL_NV_viewport_array GL_NV_viewport_array2 GL_NV_viewport_swizzle" +ext="$ext GL_OES_compressed_ETC1_RGB8_texture GL_OES_copy_image GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture" +ext="$ext GL_OES_depth_texture_cube_map GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_element_index_uint" +ext="$ext GL_OES_fbo_render_mipmap GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_get_program_binary" +ext="$ext GL_OES_gpu_shader5 GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_primitive_bounding_box" +ext="$ext GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic" +ext="$ext GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_tessellation_point_size" +ext="$ext GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array" +ext="$ext GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear" +ext="$ext GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view" +ext="$ext GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2" +ext="$ext GL_OVR_multiview_multisampled_render_to_texture" + +export MESA_EXTENSION_OVERRIDE="$ext" "$@" diff --git a/tools/optimize-assets.sh b/tools/optimize-assets.sh index 07facc8fa0..b7d52330f2 100755 --- a/tools/optimize-assets.sh +++ b/tools/optimize-assets.sh @@ -1,6 +1,9 @@ #!/bin/sh -e + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later -# Optimizes assets of eden (requires OptiPng) + +# Optimizes assets of Eden (requires OptiPng) + which optipng || exit -find . -type f -name *.png -exec optipng -o7 {} \; +find . -type f -name "*.png" -exec optipng -o7 {} \; diff --git a/tools/reset-submodules.sh b/tools/reset-submodules.sh deleted file mode 100755 index 6fdfe0bcdb..0000000000 --- a/tools/reset-submodules.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -ex - -# SPDX-FileCopyrightText: 2024 yuzu Emulator Project -# SPDX-License-Identifier: MIT - -git submodule sync -git submodule foreach --recursive git reset --hard -git submodule update --init --recursive diff --git a/tools/shellcheck.sh b/tools/shellcheck.sh new file mode 100755 index 0000000000..719c717cf2 --- /dev/null +++ b/tools/shellcheck.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# fd is slightly faster on NVMe (the syntax sux though) +if command -v fd > /dev/null; then + fd . tools -esh -x shellcheck +else + find tools -name "*.sh" -exec shellcheck -s sh {} \; +fi \ No newline at end of file diff --git a/tools/update-cpm.sh b/tools/update-cpm.sh index 30e400209d..8bd8df2b83 100755 --- a/tools/update-cpm.sh +++ b/tools/update-cpm.sh @@ -1,3 +1,6 @@ -#!/bin/sh +#!/bin/sh -e -wget -O CMakeModules/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +wget -O CMakeModules/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake diff --git a/tools/update-icons.sh b/tools/update-icons.sh index da54156665..a2c1ae8ebf 100755 --- a/tools/update-icons.sh +++ b/tools/update-icons.sh @@ -1,8 +1,11 @@ #!/bin/sh -e + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # Updates main icons for eden -which png2icns || [ which yay && yay libicns ] || exit + +which png2icns || (which yay && yay libicns) || exit which magick || exit export EDEN_SVG_ICO="dist/dev.eden_emu.eden.svg" From 59b71937a3ce64b2a5dd39424635a63e6bc64e10 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:44:47 -0400 Subject: [PATCH 07/40] add tools to root readme Signed-off-by: crueter --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1a4f017576..c78490e6d4 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ Alternatively, if you wish to add translations, go to the [Eden project on Trans See the [General Build Guide](docs/Build.md) +For information on provided development tooling, see the [Tools directory](./tools) + ## Download You can download the latest releases from [here](https://github.com/eden-emulator/Releases/releases). From ae26097553346e15bd38289c14c46062e21b0a78 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:55:01 -0400 Subject: [PATCH 08/40] more doc Signed-off-by: crueter --- tools/cpm/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/cpm/README.md b/tools/cpm/README.md index b66fe09a25..61c90cb521 100644 --- a/tools/cpm/README.md +++ b/tools/cpm/README.md @@ -50,9 +50,17 @@ For the update and hash scripts, set `UPDATE=true` to update the cpmfile with th - `fetch.sh`: Prefetch a package according to its cpmfile definition * Packages are fetched to the `.cache/cpm` directory by default, following the CPMUtil default. + * Already-fetched packages will be skipped. You can invalidate the entire cache with `rm -rf .cache/cpm`, or invalidate a specific package with e.g. `rm -rf .cache/cpm/packagename` to force a refetch. + * In the future, a force option will be added + * Note that full prefetching will take a long time depending on your internet, the amount of dependencies, and the size of each dependency. - `check-updates.sh`: Check a package for available updates * This only applies to packages that utilize tags. * If the tag is a format string, the `git_version` is acted upon instead. * Setting `FORCE=true` will forcefully update every package and its hash, even if they are on the latest version (`UPDATE` must also be true) + * This script generally runs fast. + * Packages that should skip updates (e.g. older versions or packages with poorly-made tag structures... looking at you mbedtls) may specify `"skip_updates": true` in their cpmfile definition. This is unnecessary for untagged (e.g. sha or bare URL) packages. - `check-hashes.sh`: Check a package's hash - * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. \ No newline at end of file + * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. + * This script will take a looooooooooooooong time. This is operationally equivalent to a prefetch, and thus checking all hashes will take a while--but it's worth it! Just make sure you're not using dial-up. + +You are recommended to run sanity hash checking for every pull request and commit, and weekly update checks. \ No newline at end of file From eea90ddbd2078ffc27e2ea0e5e0430dede91931c Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 11:58:24 -0400 Subject: [PATCH 09/40] fix xbyak Signed-off-by: crueter --- externals/cpmfile.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index a3f7540e6d..80f3fbe9ab 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -50,7 +50,7 @@ "package": "xbyak", "repo": "herumi/xbyak", "tag": "v%VERSION%", - "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "hash": "1042090405c426e339506c179d53e91d4d545ce9c9f53d8f797caa092d589f913a9bcb9c8f31c4c60870acb954c556e305fb6732c66bc3c8f1cd924f9172def9", "git_version": "7.22", "bundled": true, "skip_updates": true From 57bb3d9d4e9f949850efe16ef12a9f5926a5f72d Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 12:56:13 -0400 Subject: [PATCH 10/40] port gentoo patches, replace.sh, fix force system Signed-off-by: crueter --- CMakeLists.txt | 8 +++-- CMakeModules/CPM.cmake | 8 +++-- CMakeModules/CPMUtil.cmake | 18 +++++++--- cpmfile.json | 1 + externals/CMakeLists.txt | 36 ++++++++++--------- externals/cpmfile.json | 1 - src/common/common_types.h | 1 - src/core/frontend/applets/cabinet.h | 2 ++ src/core/memory/dmnt_cheat_vm.h | 2 ++ src/dynarmic/src/dynarmic/CMakeLists.txt | 2 +- .../src/dynarmic/common/common_types.h | 3 ++ src/hid_core/resources/applet_resource.h | 1 + src/hid_core/resources/npad/npad_vibration.h | 1 + src/hid_core/resources/touch_screen/gesture.h | 1 + .../resources/touch_screen/touch_screen.h | 1 + src/yuzu/main.cpp | 3 +- tools/cpm-fetch-all.sh | 18 +++++++++- tools/cpm/README.md | 7 +++- tools/cpm/check-hash.sh | 14 +++----- tools/cpm/check-updates.sh | 21 +++++------ tools/cpm/download.sh | 2 +- tools/cpm/fetch.sh | 6 ++-- tools/cpm/package.sh | 12 +++---- tools/cpm/replace.sh | 20 +++++++++++ 24 files changed, 126 insertions(+), 63 deletions(-) mode change 120000 => 100644 tools/cpm-fetch-all.sh mode change 100644 => 100755 tools/cpm/README.md create mode 100755 tools/cpm/replace.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index b397ba01aa..49f9a583fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,6 +454,7 @@ if (YUZU_USE_CPM) if (zstd_ADDED) add_library(zstd::zstd ALIAS libzstd_static) + add_library(zstd::libzstd ALIAS libzstd_static) endif() # Opus @@ -489,9 +490,9 @@ else() # wow if (PLATFORM_LINUX) - find_package(Boost 1.57.0 REQUIRED headers context system fiber) + find_package(Boost 1.57.0 CONFIG REQUIRED headers context system fiber) else() - find_package(Boost 1.57.0 REQUIRED) + find_package(Boost 1.57.0 CONFIG REQUIRED) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID) @@ -542,6 +543,7 @@ find_package(MbedTLS) find_package(VulkanUtilityLibraries) find_package(SimpleIni) find_package(SPIRV-Tools) +find_package(sirit) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) @@ -593,6 +595,8 @@ if (ENABLE_QT) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + # yes Qt, we get it + set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 REQUIRED COMPONENTS DBus OPTIONAL_COMPONENTS GuiPrivate) elseif (UNIX AND NOT APPLE) find_package(Qt6 REQUIRED COMPONENTS DBus Gui) diff --git a/CMakeModules/CPM.cmake b/CMakeModules/CPM.cmake index 3636ee5da0..5544d8eefe 100644 --- a/CMakeModules/CPM.cmake +++ b/CMakeModules/CPM.cmake @@ -743,9 +743,11 @@ function(CPMAddPackage) if(NOT DEFINED CPM_ARGS_NAME) set(CPM_ARGS_NAME ${nameFromUrl}) endif() - if(NOT DEFINED CPM_ARGS_VERSION) - set(CPM_ARGS_VERSION ${verFromUrl}) - endif() + + # this is dumb and should not be done + # if(NOT DEFINED CPM_ARGS_VERSION) + # set(CPM_ARGS_VERSION ${verFromUrl}) + # endif() list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS URL "${CPM_ARGS_URL}") endif() diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index 3347c7e884..314d262bf7 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -277,6 +277,7 @@ function(AddPackage) KEY BUNDLED_PACKAGE + FORCE_BUNDLED_PACKAGE FIND_PACKAGE_ARGUMENTS ) @@ -426,7 +427,9 @@ function(AddPackage) - BUNDLED_PACKAGE - default to allow local ]]# - if (${PKG_ARGS_NAME}_FORCE_SYSTEM) + if (PKG_ARGS_FORCE_BUNDLED_PACKAGE) + set_precedence(OFF OFF) + elseif (${PKG_ARGS_NAME}_FORCE_SYSTEM) set_precedence(ON ON) elseif (${PKG_ARGS_NAME}_FORCE_BUNDLED) set_precedence(OFF OFF) @@ -446,9 +449,14 @@ function(AddPackage) set_precedence(ON OFF) endif() + if (DEFINED PKG_ARGS_VERSION) + list(APPEND EXTRA_ARGS + VERSION ${PKG_ARGS_VERSION} + ) + endif() + CPMAddPackage( NAME ${PKG_ARGS_NAME} - VERSION ${PKG_ARGS_VERSION} URL ${pkg_url} URL_HASH ${pkg_hash} CUSTOM_CACHE_KEY ${pkg_key} @@ -459,6 +467,8 @@ function(AddPackage) PATCHES ${PKG_ARGS_PATCHES} EXCLUDE_FROM_ALL ON + ${EXTRA_ARGS} + ${PKG_ARGS_UNPARSED_ARGUMENTS} ) @@ -511,12 +521,12 @@ function(add_ci_package key) NAME ${ARTIFACT_PACKAGE} REPO ${ARTIFACT_REPO} TAG v${ARTIFACT_VERSION} - VERSION ${ARTIFACT_VERSION} + GIT_VERSION ${ARTIFACT_VERSION} ARTIFACT ${ARTIFACT} KEY ${key} HASH_SUFFIX sha512sum - BUNDLED_PACKAGE ON + FORCE_BUNDLED_PACKAGE ON ) set(ARTIFACT_DIR ${${ARTIFACT_PACKAGE}_SOURCE_DIR} PARENT_SCOPE) diff --git a/cpmfile.json b/cpmfile.json index aab9b4dd3d..e9e53ed326 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -18,6 +18,7 @@ "hash": "4fb7f6fde92762305aad8754d7643cd918dd1f3f67e104e9ab385b18c73178d72a17321354eb203b790b6702f2cf6d725a5d6e2dfbc63b1e35f9eb59fb42ece9", "git_version": "1.89.0", "version": "1.57", + "find_args": "CONFIG", "patches": [ "0001-clang-cl.patch", "0002-use-marmasm.patch", diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index f22b8753f8..4bf88c07a4 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -147,12 +147,29 @@ if (ENABLE_SDL2) find_package(SDL2 2.26.4 REQUIRED) endif() +# Sirit +if (YUZU_USE_BUNDLED_SIRIT) + AddJsonPackage(sirit-ci) +else() + AddJsonPackage(sirit) + if(MSVC AND USE_CCACHE AND sirit_ADDED) + get_target_property(_opts sirit COMPILE_OPTIONS) + list(FILTER _opts EXCLUDE REGEX "/Zi") + list(APPEND _opts "/Z7") + set_target_properties(siritobj PROPERTIES COMPILE_OPTIONS "${_opts}") + elseif(MSVC AND CXX_CLANG) + target_compile_options(siritobj PRIVATE -Wno-error=unused-command-line-argument) + endif() +endif() + # SPIRV Headers # We only need SPIRV-Headers iff spirv-tools is bundled -if (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) +if (TARGET SPIRV-Headers::SPIRV-Headers) + set(NEED_SPIRV_HEADERS OFF) +elseif (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) set(NEED_SPIRV_HEADERS ON) else() - find_package(SPIRV-Tools MODULE QUIET) + find_package(SPIRV-Tools QUIET) if (NOT SPIRV-Tools_FOUND) set(NEED_SPIRV_HEADERS ON) else() @@ -205,21 +222,6 @@ if (VulkanMemoryAllocator_ADDED) endif() endif() -# Sirit -if (YUZU_USE_BUNDLED_SIRIT) - AddJsonPackage(sirit-ci) -else() - AddJsonPackage(sirit) - if(MSVC AND USE_CCACHE AND sirit_ADDED) - get_target_property(_opts sirit COMPILE_OPTIONS) - list(FILTER _opts EXCLUDE REGEX "/Zi") - list(APPEND _opts "/Z7") - set_target_properties(siritobj PROPERTIES COMPILE_OPTIONS "${_opts}") - elseif(MSVC AND CXX_CLANG) - target_compile_options(siritobj PRIVATE -Wno-error=unused-command-line-argument) - endif() -endif() - # httplib if (ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER) AddJsonPackage(httplib) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 80f3fbe9ab..651c964d9c 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -117,7 +117,6 @@ "repo": "KhronosGroup/SPIRV-Tools", "tag": "v%VERSION%", "hash": "b17940433ced72e004c5eeffd7dd411b6afcc6a52ee31de6427d88edceb8172369be8ec8bf5b65708a78bf41fdae264d554aa7750b2209831679ab36bc867567", - "find_args": "MODULE", "git_version": "2025.4", "options": [ "SPIRV_SKIP_EXECUTABLES ON" diff --git a/src/common/common_types.h b/src/common/common_types.h index 99fff66bed..ae04c4d605 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -30,7 +30,6 @@ #include #include -#include using u8 = std::uint8_t; ///< 8-bit unsigned byte using u16 = std::uint16_t; ///< 16-bit unsigned short diff --git a/src/core/frontend/applets/cabinet.h b/src/core/frontend/applets/cabinet.h index af3fc6c3d5..1a7fa40392 100644 --- a/src/core/frontend/applets/cabinet.h +++ b/src/core/frontend/applets/cabinet.h @@ -4,6 +4,8 @@ #pragma once #include +#include + #include "core/frontend/applets/applet.h" #include "core/hle/service/nfp/nfp_types.h" diff --git a/src/core/memory/dmnt_cheat_vm.h b/src/core/memory/dmnt_cheat_vm.h index 1c1ed1259b..20b3c96cc0 100644 --- a/src/core/memory/dmnt_cheat_vm.h +++ b/src/core/memory/dmnt_cheat_vm.h @@ -5,6 +5,8 @@ #include #include +#include + #include #include "common/common_types.h" #include "core/memory/dmnt_cheat_types.h" diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txt index 58efcac747..8aa0f41afa 100644 --- a/src/dynarmic/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/src/dynarmic/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later include(TargetArchitectureSpecificSources) -add_library(dynarmic +add_library(dynarmic STATIC backend/block_range_information.cpp backend/block_range_information.h backend/exception_handler.h diff --git a/src/dynarmic/src/dynarmic/common/common_types.h b/src/dynarmic/src/dynarmic/common/common_types.h index 8127df3623..711418d97f 100644 --- a/src/dynarmic/src/dynarmic/common/common_types.h +++ b/src/dynarmic/src/dynarmic/common/common_types.h @@ -1,9 +1,12 @@ // SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later +// TODO(crueter): This is identical to root common_types.h + #pragma once #include +#include #include using u8 = std::uint8_t; ///< 8-bit unsigned byte diff --git a/src/hid_core/resources/applet_resource.h b/src/hid_core/resources/applet_resource.h index 69ea46b957..19ddf7f43c 100644 --- a/src/hid_core/resources/applet_resource.h +++ b/src/hid_core/resources/applet_resource.h @@ -5,6 +5,7 @@ #include #include +#include #include "common/bit_field.h" #include "common/common_types.h" diff --git a/src/hid_core/resources/npad/npad_vibration.h b/src/hid_core/resources/npad/npad_vibration.h index 6412ca4ab0..aea648b11b 100644 --- a/src/hid_core/resources/npad/npad_vibration.h +++ b/src/hid_core/resources/npad/npad_vibration.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/hid_core/resources/touch_screen/gesture.h b/src/hid_core/resources/touch_screen/gesture.h index d92912bb6e..24a49dd795 100644 --- a/src/hid_core/resources/touch_screen/gesture.h +++ b/src/hid_core/resources/touch_screen/gesture.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/hid_core/resources/touch_screen/touch_screen.h b/src/hid_core/resources/touch_screen/touch_screen.h index 2fcb6247f1..5fdbbbc8c6 100644 --- a/src/hid_core/resources/touch_screen/touch_screen.h +++ b/src/hid_core/resources/touch_screen/touch_screen.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4d5238643c..901a39cc9f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -95,9 +95,10 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include #include -#ifdef HAVE_SDL2 #include #include + +#ifdef HAVE_SDL2 #include // For SDL ScreenSaver functions #endif diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh deleted file mode 120000 index ea773fac18..0000000000 --- a/tools/cpm-fetch-all.sh +++ /dev/null @@ -1 +0,0 @@ -cpm/fetch-all.sh \ No newline at end of file diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh new file mode 100644 index 0000000000..1e7ff92a67 --- /dev/null +++ b/tools/cpm-fetch-all.sh @@ -0,0 +1,17 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# provided for workflow compat + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +chmod +x tools/cpm/fetch.sh + +# shellcheck disable=SC2086 +tools/cpm/fetch.sh $LIBS diff --git a/tools/cpm/README.md b/tools/cpm/README.md old mode 100644 new mode 100755 index 61c90cb521..acd7444518 --- a/tools/cpm/README.md +++ b/tools/cpm/README.md @@ -17,12 +17,17 @@ These scripts are generally reserved for internal use. * Generally only used by the fetch scripts. - `package.sh`: The actual package parser. * Inputs: - - `package`: The package key + - `PACKAGE`: The package key * Outputs: - Basically everything. You're best off reading the code rather than me poorly explaining it. - `which.sh`: Find which cpmfile a package is located in. * Inputs: - The package key +- `replace.sh`: Replace a package's cpmfile definition. + * Inputs: + - `PACKAGE`: The package key + - `NEW_JSON`: All keys to replace/add + * Keys not found in the new json are not touched. Keys cannot currently be deleted. ## Simple Utilities diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index 176e99d9b5..f78fdd605a 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -9,9 +9,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh @@ -22,7 +22,7 @@ do [ "$HASH_URL" != null ] && continue [ "$HASH_SUFFIX" != null ] && continue - echo "-- Package $package" + echo "-- Package $PACKAGE" [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue @@ -33,13 +33,9 @@ do [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") - FILE=$(tools/cpm/which.sh "$package") - - jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new - mv "$FILE".new "$FILE" - - echo "-- * -- Updated $FILE" + tools/cpm/replace.sh fi done \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 2e752b26c5..fc9950f100 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,9 +13,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh @@ -28,7 +28,7 @@ do # shellcheck disable=SC2153 [ "$TAG" = null ] && continue - echo "-- Package $package" + echo "-- Package $PACKAGE" # TODO(crueter): Support for Forgejo updates w/ forgejo_token # Use gh-cli to avoid ratelimits lmao @@ -36,8 +36,8 @@ do # filter out some commonly known annoyances # TODO add more - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') # vulkan + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') # mbedtls # ignore betas/alphas TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') @@ -45,7 +45,7 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') # Add package-specific overrides here, e.g. here for fmt: - [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + [ "$PACKAGE" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') LATEST=$(echo "$TAGS" | jq -r '.[0].name') @@ -68,16 +68,13 @@ do if [ "$UPDATE" = "true" ]; then if [ "$HAS_REPLACE" = "true" ]; then + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") else + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") fi - FILE=$(tools/cpm/which.sh "$package") - - jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new - mv "$FILE".new "$FILE" - - echo "-- * -- Updated $FILE" + tools/cpm/replace.sh fi done diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh index d6c90b11fa..426f1f51e6 100755 --- a/tools/cpm/download.sh +++ b/tools/cpm/download.sh @@ -56,7 +56,7 @@ download_package() { PATCHES=$(echo "$JSON" | jq -r '.patches | join(" ")') for patch in $PATCHES; do # shellcheck disable=SC2154 - patch --binary -p1 < "$ROOTDIR/.patch/$package/$patch" + patch --binary -p1 < "$ROOTDIR/.patch/$PACKAGE/$patch" done fi diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh index e403f86818..bf45676cfa 100755 --- a/tools/cpm/fetch.sh +++ b/tools/cpm/fetch.sh @@ -19,16 +19,16 @@ ROOTDIR="$PWD" TMP=$(mktemp -d) # shellcheck disable=SC2034 -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh if [ "$CI" = "true" ]; then ci_package else - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + echo "-- Downloading regular package $PACKAGE, with key $KEY, from $DOWNLOAD" download_package fi done diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh index 004111ad7c..d82b2fcbe9 100755 --- a/tools/cpm/package.sh +++ b/tools/cpm/package.sh @@ -9,12 +9,12 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -[ -z "$package" ] && echo "Package was not specified" && exit 0 +[ -z "$PACKAGE" ] && echo "Package was not specified" && exit 0 # shellcheck disable=SC2153 -JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") +JSON=$(echo "$PACKAGES" | jq -r ".\"$PACKAGE\" | select( . != null )") -[ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 +[ -z "$JSON" ] && echo "!! No cpmfile definition for $PACKAGE" && exit 1 # unset stuff export PACKAGE_NAME="null" @@ -48,7 +48,7 @@ REPO=$(value "repo") CI=$(value "ci") PACKAGE_NAME=$(value "package") -[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" +[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$PACKAGE" GIT_HOST=$(value "git_host") [ "$GIT_HOST" = null ] && GIT_HOST=github.com @@ -143,7 +143,7 @@ elif [ "$REPO" != "null" ]; then DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" fi else - echo "!! No repo or URL defined for $package" + echo "!! No repo or URL defined for $PACKAGE" exit 1 fi @@ -166,7 +166,7 @@ if [ "$KEY" = null ]; then elif [ "$VERSION" != null ]; then KEY="$VERSION" else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + echo "!! No valid key could be determined for $PACKAGE. Must define one of: key, sha, tag, version, git_version" exit 1 fi fi diff --git a/tools/cpm/replace.sh b/tools/cpm/replace.sh new file mode 100755 index 0000000000..501cfda6b1 --- /dev/null +++ b/tools/cpm/replace.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# Replace a specified package with a modified json. + +# env vars: +# - PACKAGE: The package key to act on +# - NEW_JSON: The new json to use + +[ -z "$PACKAGE" ] && echo "You must provide the PACKAGE environment variable." && return 1 +[ -z "$NEW_JSON" ] && echo "You must provide the NEW_JSON environment variable." && return 1 + +FILE=$(tools/cpm/which.sh "$PACKAGE") + +jq --indent 4 --argjson repl "$NEW_JSON" ".\"$PACKAGE\" *= \$repl" "$FILE" > "$FILE".new +mv "$FILE".new "$FILE" + +echo "-- * -- Updated $FILE" From 0aa38ddc4cec76823ef05243ed85d846c3993817 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 12:58:19 -0400 Subject: [PATCH 11/40] filter function Signed-off-by: crueter --- tools/cpm/check-updates.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index fc9950f100..641c539272 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,6 +13,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +filter() { + TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan +} for PACKAGE in "$@" do export PACKAGE @@ -36,16 +39,17 @@ do # filter out some commonly known annoyances # TODO add more - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') # vulkan - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') # mbedtls - # ignore betas/alphas - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') + filter vulkan-sdk # vulkan + filter yotta # mbedtls + + # ignore betas/alphas (remove if needed) + filter alpha + filter beta + filter rc # Add package-specific overrides here, e.g. here for fmt: - [ "$PACKAGE" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + [ "$PACKAGE" = fmt ] && filter v0.11 LATEST=$(echo "$TAGS" | jq -r '.[0].name') From e58cd02b675f6fb099dc3bfb59d350ec6318bd71 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:02:08 -0400 Subject: [PATCH 12/40] return 1 on unsuccessful hash/available updates Signed-off-by: crueter --- tools/cpm/check-hash.sh | 9 +++++++-- tools/cpm/check-updates.sh | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index f78fdd605a..85c60aad8c 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -9,6 +9,8 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +RETURN=0 + for PACKAGE in "$@" do export PACKAGE @@ -30,12 +32,15 @@ do ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD") # shellcheck disable=SC2028 - [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" + [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" && [ "$UPDATE" != "true" ] && RETURN=1 if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") + export NEW_JSON tools/cpm/replace.sh fi -done \ No newline at end of file +done + +exit $RETURN \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 641c539272..69aab353ba 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,9 +13,12 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +RETURN=0 + filter() { TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan } + for PACKAGE in "$@" do export PACKAGE @@ -55,6 +58,8 @@ do [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + RETURN=1 + if [ "$HAS_REPLACE" = "true" ]; then # this just extracts the tag prefix VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) @@ -71,14 +76,18 @@ do echo "-- * New hash: $HASH" if [ "$UPDATE" = "true" ]; then + RETURN=0 + if [ "$HAS_REPLACE" = "true" ]; then - # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") else - # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") fi + export NEW_JSON + tools/cpm/replace.sh fi done + +exit $RETURN \ No newline at end of file From ee3f270fa423eddf4467b9cdf62b57aa06305297 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:03:06 -0400 Subject: [PATCH 13/40] fix license headers Signed-off-by: crueter --- src/common/common_types.h | 3 +++ src/core/frontend/applets/cabinet.h | 3 +++ src/core/memory/dmnt_cheat_vm.h | 3 +++ src/hid_core/resources/applet_resource.h | 3 +++ src/hid_core/resources/npad/npad_vibration.h | 3 +++ src/hid_core/resources/touch_screen/gesture.h | 3 +++ src/hid_core/resources/touch_screen/touch_screen.h | 3 +++ 7 files changed, 21 insertions(+) diff --git a/src/common/common_types.h b/src/common/common_types.h index ae04c4d605..6e7e4ec0d9 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2012 Gekko Emulator // SPDX-FileContributor: ShizZy // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/frontend/applets/cabinet.h b/src/core/frontend/applets/cabinet.h index 1a7fa40392..157bfe38c6 100644 --- a/src/core/frontend/applets/cabinet.h +++ b/src/core/frontend/applets/cabinet.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/memory/dmnt_cheat_vm.h b/src/core/memory/dmnt_cheat_vm.h index 20b3c96cc0..de5e81add2 100644 --- a/src/core/memory/dmnt_cheat_vm.h +++ b/src/core/memory/dmnt_cheat_vm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/hid_core/resources/applet_resource.h b/src/hid_core/resources/applet_resource.h index 19ddf7f43c..4b7584b962 100644 --- a/src/hid_core/resources/applet_resource.h +++ b/src/hid_core/resources/applet_resource.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/npad/npad_vibration.h b/src/hid_core/resources/npad/npad_vibration.h index aea648b11b..59e29b9f90 100644 --- a/src/hid_core/resources/npad/npad_vibration.h +++ b/src/hid_core/resources/npad/npad_vibration.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/touch_screen/gesture.h b/src/hid_core/resources/touch_screen/gesture.h index 24a49dd795..3fa1933fe8 100644 --- a/src/hid_core/resources/touch_screen/gesture.h +++ b/src/hid_core/resources/touch_screen/gesture.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/touch_screen/touch_screen.h b/src/hid_core/resources/touch_screen/touch_screen.h index 5fdbbbc8c6..f56f7b3839 100644 --- a/src/hid_core/resources/touch_screen/touch_screen.h +++ b/src/hid_core/resources/touch_screen/touch_screen.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later From a415b41064ffde9afe1fa46b608cf71fe045797a Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:51:38 -0400 Subject: [PATCH 14/40] update sirit-ci, fix zstd, update CPMUtil Signed-off-by: crueter --- CMakeModules/Findzstd.cmake | 3 + docs/CPM.md | 258 ------------------------------------ docs/CPMUtil.md | 14 ++ docs/Deps.md | 1 + docs/README.md | 2 +- externals/CMakeLists.txt | 15 +-- externals/cpmfile.json | 2 +- tools/cpm/check-updates.sh | 3 - tools/cpm/common.sh | 17 ++- tools/cpm/format.sh | 5 +- tools/cpm/which.sh | 5 +- 11 files changed, 36 insertions(+), 289 deletions(-) delete mode 100644 docs/CPM.md create mode 100644 docs/CPMUtil.md diff --git a/CMakeModules/Findzstd.cmake b/CMakeModules/Findzstd.cmake index bf38d20fbf..17efec2192 100644 --- a/CMakeModules/Findzstd.cmake +++ b/CMakeModules/Findzstd.cmake @@ -13,9 +13,12 @@ find_package_handle_standard_args(zstd if (zstd_FOUND AND NOT TARGET zstd::zstd) if (TARGET zstd::libzstd_shared) add_library(zstd::zstd ALIAS zstd::libzstd_shared) + add_library(zstd::libzstd ALIAS zstd::libzstd_shared) elseif (TARGET zstd::libzstd_static) add_library(zstd::zstd ALIAS zstd::libzstd_static) + add_library(zstd::libzstd ALIAS zstd::libzstd_static) else() add_library(zstd::zstd ALIAS PkgConfig::ZSTD) + add_library(zstd::libzstd ALIAS PkgConfig::ZSTD) endif() endif() diff --git a/docs/CPM.md b/docs/CPM.md deleted file mode 100644 index c01376469d..0000000000 --- a/docs/CPM.md +++ /dev/null @@ -1,258 +0,0 @@ -# CPM - -CPM (CMake Package Manager) is the preferred method of managing dependencies within Eden. - -Global Options: - -- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing - * If this is `OFF`, required system dependencies will be searched via `find_package`, although certain externals use CPM regardless. -- `CPMUTIL_FORCE_SYSTEM` (default `OFF`): Require all CPM dependencies to use system packages. NOT RECOMMENDED! - * Many packages, e.g. mcl, sirit, xbyak, discord-rpc, are not generally available as a system package. - * You may optionally override these (see CPMUtil section) -- `CPMUTIL_FORCE_BUNDLED` (default `ON` on MSVC and Android, `OFF` elsewhere): Require all CPM dependencies to use bundled packages. - -## CPMUtil - -CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake. - -### AddPackage - -`AddPackage` is the core of the CPMUtil wrapper, and is generally the lowest level you will need to go when dealing with dependencies. - -**Identification/Fetching** - -- `NAME` (required): The package name (must be the same as the `find_package` name if applicable) -- `VERSION`: The minimum version of this package that can be used on the system -- `GIT_VERSION`: The "version" found within git -- `URL`: The URL to fetch. -- `REPO`: The GitHub repo to use (`owner/repo`). - * Only GitHub is supported for now, though other platforms will see support at some point -- `TAG`: The tag to fetch, if applicable. -- `ARTIFACT`: The name of the artifact, if applicable. -- `SHA`: Commit sha to fetch, if applicable. -- `BRANCH`: Branch to fetch, if applicable. - -The following configurations are supported, in descending order of precedence: - -- `URL`: Bare URL download, useful for custom artifacts - * If this is set, `GIT_URL` or `REPO` should be set to allow the dependency viewer to link to the project's Git repository. - * If this is NOT set, `REPO` must be defined. -- `REPO + TAG + ARTIFACT`: GitHub release artifact - * The final download URL will be `https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}` - * Useful for prebuilt libraries and prefetched archives -- `REPO + TAG`: GitHub tag archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/tags/${TAG}.tar.gz` - * Useful for pinning to a specific tag, better for build identification -- `REPO + SHA`: GitHub commit archive - * The final download URL will be `https://github.com/${REPO}/archive/${SHA}.zip` - * Useful for pinning to a specific commit -- `REPO + BRANCH`: GitHub branch archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/${BRANCH}.zip` - * Generally not recommended unless the branch is frozen -- `REPO`: GitHub master archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/master.zip` - * Generally not recommended unless the project is dead - -**Hashing** - -Hashing is used for verifying downloads. It's highly recommended to use these. - -- `HASH_ALGO` (default `SHA512`): Hash algorithm to use - -Hashing strategies, descending order of precedence: - -- `HASH`: Bare hash verification, useful for static downloads e.g. commit archives -- `HASH_SUFFIX`: Download the hash as `${DOWNLOAD_URL}.${HASH_SUFFIX}` - * The downloaded hash *must* match the hash algorithm and contain nothing but the hash; no filenames or extra content. -- `HASH_URL`: Download the hash from a separate URL - -**Additional Options** - -- `KEY`: Custom cache key to use (stored as `.cache/cpm/${packagename_lower}/${key}`) - * Default is based on, in descending order of precedence: - - First 4 characters of the sha - - `GIT_VERSION` - - Tag - - `VERSION` - - Otherwise, CPM defaults will be used. This is not recommended as it doesn't produce reproducible caches -- `DOWNLOAD_ONLY`: Whether or not to configure the downloaded package via CMake - * Useful to turn `OFF` if the project doesn't use CMake -- `SOURCE_SUBDIR`: Subdirectory of the project containing a CMakeLists.txt file -- `FIND_PACKAGE_ARGUMENTS`: Arguments to pass to the `find_package` call -- `BUNDLED_PACKAGE`: Set to `ON` to force the usage of a bundled package -- `OPTIONS`: Options to pass to the configuration of the package -- `PATCHES`: Patches to apply to the package, stored in `.patch/${packagename_lower}/0001-patch-name.patch` and so on -- Other arguments can be passed to CPM as well - -**Extra Variables** - -For each added package, users may additionally force usage of the system/bundled package. - -- `${package}_FORCE_SYSTEM`: Require the package to be installed on the system -- `${package}_FORCE_BUNDLED`: Force the package to be fetched and use the bundled version - -**Bundled/System Switching** - -Descending order of precedence: -- If `${package}_FORCE_SYSTEM` is true, requires the package to be on the system -- If `${package}_FORCE_BUNDLED` is true, forcefully uses the bundled package -- If `CPMUTIL_FORCE_SYSTEM` is true, requires the package to be on the system -- If `CPMUTIL_FORCE_BUNDLED` is true, forcefully uses the bundled package -- If the `BUNDLED_PACKAGE` argument is true, forcefully uses the bundled package -- Otherwise, CPM will search for the package first, and if not found, will use the bundled package - -**Identification** - -All dependencies must be identifiable in some way for usage in the dependency viewer. Lists are provided in descending order of precedence. - -URLs: - -- `GIT_URL` -- `REPO` as a Git repository - * You may optionally specify `GIT_HOST` to use a custom host, e.g. `GIT_HOST git.crueter.xyz`. Note that the git host MUST be GitHub-like in its artifact/archive downloads, e.g. Forgejo - * If `GIT_HOST` is unspecified, defaults to `github.com` -- `URL` - -Versions (bundled): - -- `SHA` -- `GIT_VERSION` -- `VERSION` -- `TAG` -- "unknown" - -If the package is a system package, AddPackage will attempt to determine the package version and append ` (system)` to the identifier. Otherwise, it will be marked as `unknown (system)` - -### AddCIPackage - -Adds a package that follows crueter's CI repository spec. - -- `VERSION` (required): The version to get (the tag will be `v${VERSION}`) -- `NAME` (required): Name used within the artifacts -- `REPO` (required): CI repository, e.g. `crueter-ci/OpenSSL` -- `PACKAGE` (required): `find_package` package name -- `EXTENSION`: Artifact extension (default `tar.zst`) -- `MIN_VERSION`: Minimum version for `find_package`. Only used if platform does not support this package as a bundled artifact -- `DISABLED_PLATFORMS`: List of platforms that lack artifacts for this package. One of: - * `windows-amd64` - * `windows-arm64` - * `android` - * `solaris-amd64` - * `freebsd-amd64` - * `linux-amd64` - * `linux-aarch64` - * `macos-universal` - -### AddJsonPackage - -This is the recommended method of usage for CPMUtil. In each directory that utilizes `CPMUtil`, there must be a `cpmfile.json` that defines dependencies in a similar manner to the individual calls. - -The cpmfile is an object of objects, with each sub-object being named according to the package's identifier, e.g. `openssl`, which can then be fetched with `AddJsonPackage()`. Options are designed to map closely to the argument names, and are always strings unless otherwise specified. - -- `package` -> `NAME` (`PACKAGE` for CI), defaults to the object key -- `repo` -> `REPO` -- `version` -> `VERSION` -- `ci` (bool) - -If `ci` is `false`: - -- `hash` -> `HASH` -- `hash_suffix` -> `HASH_SUFFIX` -- `sha` -> `SHA` -- `key` -> `KEY` -- `tag` -> `TAG` - * If the tag contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified -- `url` -> `URL` -- `artifact` -> `ARTIFACT` - * If the artifact contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified - * If the artifact contains `%TAG%`, that part will be replaced by the `tag` (with its replacement already done) -- `git_version` -> `GIT_VERSION` -- `git_host` -> `GIT_HOST` -- `source_subdir` -> `SOURCE_SUBDIR` -- `bundled` -> `BUNDLED_PACKAGE` -- `find_args` -> `FIND_PACKAGE_ARGUMENTS` -- `patches` -> `PATCHES` (array) -- `options` -> `OPTIONS` (array) - -Other arguments aren't currently supported. If you wish to add them, see the `AddJsonPackage` function in `CMakeModules/CPMUtil.cmake`. - -If `ci` is `true`: - -- `name` -> `NAME`, defaults to the object key -- `extension` -> `EXTENSION`, defaults to `tar.zst` -- `min_version` -> `MIN_VERSION` -- `extension` -> `EXTENSION` - -### Examples - -In order: OpenSSL CI, Boost (tag + artifact), Opus (options + find_args), discord-rpc (sha + options + patches) - -```json -{ - "openssl": { - "ci": true, - "package": "OpenSSL", - "name": "openssl", - "repo": "crueter-ci/OpenSSL", - "version": "3.5.2", - "min_version": "1.1.1" - }, - "boost": { - "package": "Boost", - "repo": "boostorg/boost", - "tag": "boost-%VERSION%", - "artifact": "%TAG%-cmake.7z", - "hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01", - "git_version": "1.88.0", - "version": "1.57" - }, - "opus": { - "package": "Opus", - "repo": "xiph/opus", - "sha": "5ded705cf4", - "hash": "0dc89e58ddda1f3bc6a7037963994770c5806c10e66f5cc55c59286fc76d0544fe4eca7626772b888fd719f434bc8a92f792bdb350c807968b2ac14cfc04b203", - "version": "1.3", - "find_args": "MODULE", - "options": [ - "OPUS_BUILD_TESTING OFF", - "OPUS_BUILD_PROGRAMS OFF", - "OPUS_INSTALL_PKG_CONFIG_MODULE OFF", - "OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF" - ] - }, - "discord-rpc": { - "repo": "discord/discord-rpc", - "sha": "963aa9f3e5", - "hash": "386e1344e9a666d730f2d335ee3aef1fd05b1039febefd51aa751b705009cc764411397f3ca08dffd46205c72f75b235c870c737b2091a4ed0c3b061f5919bde", - "options": [ - "BUILD_EXAMPLES OFF" - ], - "patches": [ - "0001-cmake-version.patch", - "0002-no-clang-format.patch", - "0003-fix-cpp17.patch" - ] - }, -} -``` - -### Inclusion - -To include CPMUtil: - -```cmake -include(CPMUtil) -``` - -## Prefetching - -- To prefetch a CPM dependency (requires cpmfile): - * `tools/cpm-fetch.sh ` -- To prefetch all CPM dependencies: - * `tools/cpm-fetch-all.sh` - -Currently, `cpm-fetch.sh` defines the following directories for cpmfiles (max depth of 2, so subdirs are caught as well): - -`externals src/qt_common src/dynarmic .` - -Whenever you add a new cpmfile, update the script accordingly \ No newline at end of file diff --git a/docs/CPMUtil.md b/docs/CPMUtil.md new file mode 100644 index 0000000000..779515ae7e --- /dev/null +++ b/docs/CPMUtil.md @@ -0,0 +1,14 @@ +# CPMUtil + +CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake. + +See more in [its repository](https://git.crueter.xyz/CMake/CPMUtil) + +Eden-specific options: + +- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing + * If this is `OFF`, required system dependencies will be searched via `find_package`, although most externals use CPM regardless. + +## Tooling + +See the [tooling docs](../tools/cpm) \ No newline at end of file diff --git a/docs/Deps.md b/docs/Deps.md index 573d1fe14a..69f41794ea 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -63,6 +63,7 @@ Certain other dependencies will be fetched by CPM regardless. System packages *c * [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) * [sirit](https://github.com/eden-emulator/sirit) * [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_QT_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on + - This package is known to be broken on the AUR. * [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on * [unordered-dense](https://github.com/martinus/unordered_dense) * [mcl](https://github.com/azahar-emu/mcl) - subject to removal diff --git a/docs/README.md b/docs/README.md index 71e79e15ea..49617fa43a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,6 +5,6 @@ This contains documentation created by developers. This contains build instructi - **[General Build Instructions](Build.md)** - **[Development Guidelines](Development.md)** - **[Dependencies](Deps.md)** -- **[CPM - CMake Package Manager](CPM.md)** +- **[CPM - CMake Package Manager](CPMUtil.md)** - **[Platform-Specific Caveats](Caveats.md)** - **[User Directory Handling](User.md)** \ No newline at end of file diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 4bf88c07a4..1d7ddae61f 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -163,21 +163,8 @@ else() endif() # SPIRV Headers -# We only need SPIRV-Headers iff spirv-tools is bundled -if (TARGET SPIRV-Headers::SPIRV-Headers) - set(NEED_SPIRV_HEADERS OFF) -elseif (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) - set(NEED_SPIRV_HEADERS ON) -else() - find_package(SPIRV-Tools QUIET) - if (NOT SPIRV-Tools_FOUND) - set(NEED_SPIRV_HEADERS ON) - else() - set(NEED_SPIRV_HEADERS OFF) - endif() -endif() -if (NEED_SPIRV_HEADERS) +if (NOT TARGET SPIRV-Headers::SPIRV-Headers) AddJsonPackage(spirv-headers) endif() diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 651c964d9c..47ac1d6e3d 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -20,7 +20,7 @@ "package": "sirit", "name": "sirit", "repo": "eden-emulator/sirit", - "version": "1.0.0" + "version": "1.0.1" }, "httplib": { "repo": "yhirose/cpp-httplib", diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 69aab353ba..bdccf96ca2 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index 8c67d40436..f26d76ee05 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -1,14 +1,21 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later +################################## +# CHANGE THESE FOR YOUR PROJECT! # +################################## + +# Which directories to search +DIRS=". src" + +# How many levels to go (3 is 2 subdirs max) +MAXDEPTH=3 + # shellcheck disable=SC2038 # shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +[ -z "$PACKAGES" ] && PACKAGES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') # For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) # Always include . @@ -16,6 +23,8 @@ LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') export PACKAGES export LIBS +export DIRS +export MAXDEPTH value() { echo "$JSON" | jq -r ".$1" diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 45fd787da3..873a18debe 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,13 +1,10 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # like common.sh, change for your directories -FILES=$(find . src -maxdepth 3 -name cpmfile.json) +FILES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json) for file in $FILES; do jq --indent 4 < "$file" > "$file".new diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index f207700571..fd1029ef3d 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,15 +1,12 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in # like common.sh, change for your directories -JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) +JSON=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" From fb8f9e5698917977c503c5b6cf542bd65d109053 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:11:54 -0400 Subject: [PATCH 15/40] update spirv-headers, fix cpmutil scripts Signed-off-by: crueter --- externals/cpmfile.json | 4 ++-- tools/cpm/common.sh | 3 ++- tools/cpm/format.sh | 7 +++++-- tools/cpm/which.sh | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 47ac1d6e3d..eb1e5853cd 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -125,8 +125,8 @@ "spirv-headers": { "package": "SPIRV-Headers", "repo": "KhronosGroup/SPIRV-Headers", - "sha": "4e209d3d7e", - "hash": "f48bbe18341ed55ea0fe280dbbbc0a44bf222278de6e716e143ca1e95ca320b06d4d23d6583fbf8d03e1428f3dac8fa00e5b82ddcd6b425e6236d85af09550a4", + "sha": "01e0577914", + "hash": "d0f905311faf7d743de686fdf241dc4cb0a4f08e2184f5a3b3b2946e680db3cd89eeb72954eafe6fa457f93550e27d516575c8709cb134d8aecc0b43064636ce", "options": [ "SPIRV_WERROR OFF" ] diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index f26d76ee05..4aff058bdc 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -15,7 +15,8 @@ MAXDEPTH=3 # shellcheck disable=SC2038 # shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC2086 +[ -z "$PACKAGES" ] && PACKAGES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') # For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) # Always include . diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 873a18debe..8d99b4796b 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -3,8 +3,11 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -# like common.sh, change for your directories -FILES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json) +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +FILES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json) for file in $FILES; do jq --indent 4 < "$file" > "$file".new diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index fd1029ef3d..c936d0a97f 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -4,9 +4,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in +# shellcheck disable=SC1091 +. tools/cpm/common.sh -# like common.sh, change for your directories -JSON=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) +# shellcheck disable=SC2086 +JSON=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" From 53d6b79390d1215bf4748f757f27e88621891e74 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:33:28 -0400 Subject: [PATCH 16/40] Update CPMUtil CI packages now use version Signed-off-by: crueter --- CMakeModules/CPMUtil.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index 314d262bf7..3d7b84c029 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -524,7 +524,7 @@ function(add_ci_package key) GIT_VERSION ${ARTIFACT_VERSION} ARTIFACT ${ARTIFACT} - KEY ${key} + KEY ${key}-${ARTIFACT_VERSION} HASH_SUFFIX sha512sum FORCE_BUNDLED_PACKAGE ON ) From 128168c868e7be85548e7070d82f051116ca03eb Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:44:43 -0400 Subject: [PATCH 17/40] update sirit Signed-off-by: crueter --- externals/CMakeLists.txt | 9 +++------ externals/cpmfile.json | 9 ++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 1d7ddae61f..434e6fb100 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -147,6 +147,9 @@ if (ENABLE_SDL2) find_package(SDL2 2.26.4 REQUIRED) endif() +# SPIRV Headers +AddJsonPackage(spirv-headers) + # Sirit if (YUZU_USE_BUNDLED_SIRIT) AddJsonPackage(sirit-ci) @@ -162,12 +165,6 @@ else() endif() endif() -# SPIRV Headers - -if (NOT TARGET SPIRV-Headers::SPIRV-Headers) - AddJsonPackage(spirv-headers) -endif() - # SPIRV Tools AddJsonPackage(spirv-tools) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index eb1e5853cd..aa3a97c128 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -9,18 +9,21 @@ }, "sirit": { "repo": "eden-emulator/sirit", - "git_version": "1.0.1", + "git_version": "1.0.2", "tag": "v%VERSION%", "artifact": "sirit-source-%VERSION%.tar.zst", "hash_suffix": "sha512sum", - "find_args": "CONFIG" + "find_args": "CONFIG", + "options": [ + "SIRIT_USE_SYSTEM_SPIRV_HEADERS ON" + ] }, "sirit-ci": { "ci": true, "package": "sirit", "name": "sirit", "repo": "eden-emulator/sirit", - "version": "1.0.1" + "version": "1.0.2" }, "httplib": { "repo": "yhirose/cpp-httplib", From 268918aeced185684d246a2eaaf8ffce3fb795b1 Mon Sep 17 00:00:00 2001 From: Ribbit Date: Sat, 4 Oct 2025 23:58:08 +0200 Subject: [PATCH 18/40] [vk] Implement Shader Read Barrier (#2671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding the shader read barrier keeps every render/compute/transfer write visible before the image is sampled, so it prevents the “read-before-writes-finish” hazards. Without it you can get random stale frames, flickering post process passes, partially updated HUD textures, and corrupted depth-to-color conversions especially in scenes that render into an offscreen image and immediately feed that image to a shader (reflections, bloom, dynamic resolution, depth visualizers, etc.). This fix makes those R2T chains deterministic again across all Vulkan drivers. Co-authored-by: Ribbit Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2671 Reviewed-by: MaranBr Reviewed-by: crueter Co-authored-by: Ribbit Co-committed-by: Ribbit --- src/video_core/engines/maxwell_dma.cpp | 2 + src/video_core/renderer_vulkan/blit_image.cpp | 83 +++++++++++++++++-- src/video_core/renderer_vulkan/blit_image.h | 13 +-- .../renderer_vulkan/vk_texture_cache.cpp | 17 ++-- 4 files changed, 95 insertions(+), 20 deletions(-) diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 52ca9bbdb6..e2aa6c7e49 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -156,6 +156,8 @@ void MaxwellDMA::Launch() { } void MaxwellDMA::CopyBlockLinearToPitch() { + + u32 bytes_per_pixel = 1; DMA::ImageOperand src_operand; src_operand.bytes_per_pixel = bytes_per_pixel; diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 7bfcd6503b..68543bdd48 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -46,6 +46,38 @@ namespace Vulkan { using VideoCommon::ImageViewType; namespace { + +[[nodiscard]] VkImageAspectFlags AspectMaskFromFormat(VideoCore::Surface::PixelFormat format) { + using VideoCore::Surface::SurfaceType; + switch (VideoCore::Surface::GetFormatType(format)) { + case SurfaceType::ColorTexture: + return VK_IMAGE_ASPECT_COLOR_BIT; + case SurfaceType::Depth: + return VK_IMAGE_ASPECT_DEPTH_BIT; + case SurfaceType::Stencil: + return VK_IMAGE_ASPECT_STENCIL_BIT; + case SurfaceType::DepthStencil: + return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; + default: + return VK_IMAGE_ASPECT_COLOR_BIT; + } +} + +[[nodiscard]] VkImageSubresourceRange SubresourceRangeFromView(const ImageView& image_view) { + auto range = image_view.range; + if ((image_view.flags & VideoCommon::ImageViewFlagBits::Slice) != VideoCommon::ImageViewFlagBits{}) { + range.base.layer = 0; + range.extent.layers = 1; + } + return VkImageSubresourceRange{ + .aspectMask = AspectMaskFromFormat(image_view.format), + .baseMipLevel = static_cast(range.base.level), + .levelCount = static_cast(range.extent.levels), + .baseArrayLayer = static_cast(range.base.layer), + .layerCount = static_cast(range.extent.layers), + }; +} + struct PushConstants { std::array tex_scale; std::array tex_offset; @@ -417,6 +449,40 @@ void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayo 0, barrier); } +void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) { + const VkImage image = image_view.ImageHandle(); + const VkImageSubresourceRange subresource_range = SubresourceRangeFromView(image_view); + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record([image, subresource_range](vk::CommandBuffer cmdbuf) { + const VkImageMemoryBarrier barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = nullptr, + .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = image, + .subresourceRange = subresource_range, + }; + cmdbuf.PipelineBarrier( + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_TRANSFER_BIT | + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + 0, + barrier); + }); +} + void BeginRenderPass(vk::CommandBuffer& cmdbuf, const Framebuffer* framebuffer) { const VkRenderPass render_pass = framebuffer->RenderPass(); const VkFramebuffer framebuffer_handle = framebuffer->Handle(); @@ -484,7 +550,7 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_, BlitImageHelper::~BlitImageHelper() = default; -void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView src_view, +void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, const ImageView& src_image_view, const Region2D& dst_region, const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation) { @@ -496,10 +562,12 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView const VkPipelineLayout layout = *one_texture_pipeline_layout; const VkSampler sampler = is_linear ? *linear_sampler : *nearest_sampler; const VkPipeline pipeline = FindOrEmplaceColorPipeline(key); + const VkImageView src_view = src_image_view.Handle(Shader::TextureType::Color2D); + + RecordShaderReadBarrier(scheduler, src_image_view); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([this, dst_region, src_region, pipeline, layout, sampler, src_view](vk::CommandBuffer cmdbuf) { - // TODO: Barriers const VkDescriptorSet descriptor_set = one_texture_descriptor_allocator.Commit(); UpdateOneTextureDescriptorSet(device, descriptor_set, sampler, src_view); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); @@ -538,7 +606,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView } void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, - VkImageView src_depth_view, VkImageView src_stencil_view, + ImageView& src_image_view, const Region2D& dst_region, const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation) { @@ -554,10 +622,13 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, const VkPipelineLayout layout = *two_textures_pipeline_layout; const VkSampler sampler = *nearest_sampler; const VkPipeline pipeline = FindOrEmplaceDepthStencilPipeline(key); + const VkImageView src_depth_view = src_image_view.DepthView(); + const VkImageView src_stencil_view = src_image_view.StencilView(); + + RecordShaderReadBarrier(scheduler, src_image_view); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([dst_region, src_region, pipeline, layout, sampler, src_depth_view, src_stencil_view, this](vk::CommandBuffer cmdbuf) { - // TODO: Barriers const VkDescriptorSet descriptor_set = two_textures_descriptor_allocator.Commit(); UpdateTwoTexturesDescriptorSet(device, descriptor_set, sampler, src_depth_view, src_stencil_view); @@ -692,6 +763,7 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb const VkSampler sampler = *nearest_sampler; const VkExtent2D extent = GetConversionExtent(src_image_view); + RecordShaderReadBarrier(scheduler, src_image_view); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([pipeline, layout, sampler, src_view, extent, this](vk::CommandBuffer cmdbuf) { const VkOffset2D offset{ @@ -717,7 +789,6 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb const VkDescriptorSet descriptor_set = one_texture_descriptor_allocator.Commit(); UpdateOneTextureDescriptorSet(device, descriptor_set, sampler, src_view); - // TODO: Barriers cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, nullptr); @@ -737,6 +808,7 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer const VkSampler sampler = *nearest_sampler; const VkExtent2D extent = GetConversionExtent(src_image_view); + RecordShaderReadBarrier(scheduler, src_image_view); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([pipeline, layout, sampler, src_depth_view, src_stencil_view, extent, this](vk::CommandBuffer cmdbuf) { @@ -763,7 +835,6 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer const VkDescriptorSet descriptor_set = two_textures_descriptor_allocator.Commit(); UpdateTwoTexturesDescriptorSet(device, descriptor_set, sampler, src_depth_view, src_stencil_view); - // TODO: Barriers cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, nullptr); diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index 3d400be6a9..bdb8cce883 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h @@ -1,4 +1,7 @@ -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -43,7 +46,7 @@ public: StateTracker& state_tracker, DescriptorPool& descriptor_pool); ~BlitImageHelper(); - void BlitColor(const Framebuffer* dst_framebuffer, VkImageView src_image_view, + void BlitColor(const Framebuffer* dst_framebuffer, const ImageView& src_image_view, const Region2D& dst_region, const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation); @@ -52,9 +55,9 @@ public: VkImage src_image, VkSampler src_sampler, const Region2D& dst_region, const Region2D& src_region, const Extent3D& src_size); - void BlitDepthStencil(const Framebuffer* dst_framebuffer, VkImageView src_depth_view, - VkImageView src_stencil_view, const Region2D& dst_region, - const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, + void BlitDepthStencil(const Framebuffer* dst_framebuffer, ImageView& src_image_view, + const Region2D& dst_region, const Region2D& src_region, + Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation); void ConvertD32ToR32(const Framebuffer* dst_framebuffer, const ImageView& src_image_view); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 8d1d609a35..575651905e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1086,8 +1086,8 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst return; } if (aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT && !is_src_msaa && !is_dst_msaa) { - blit_image_helper.BlitColor(dst_framebuffer, src.Handle(Shader::TextureType::Color2D), - dst_region, src_region, filter, operation); + blit_image_helper.BlitColor(dst_framebuffer, src, dst_region, src_region, filter, + operation); return; } ASSERT(src.format == dst.format); @@ -1106,8 +1106,8 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst }(); if (!can_blit_depth_stencil) { UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa); - blit_image_helper.BlitDepthStencil(dst_framebuffer, src.DepthView(), src.StencilView(), - dst_region, src_region, filter, operation); + blit_image_helper.BlitDepthStencil(dst_framebuffer, src, dst_region, src_region, + filter, operation); return; } } @@ -1968,18 +1968,17 @@ bool Image::BlitScaleHelper(bool scale_up) { blit_framebuffer = std::make_unique(*runtime, view_ptr, nullptr, extent, scale_up); } - const auto color_view = blit_view->Handle(Shader::TextureType::Color2D); - runtime->blit_image_helper.BlitColor(blit_framebuffer.get(), color_view, dst_region, + runtime->blit_image_helper.BlitColor(blit_framebuffer.get(), *blit_view, dst_region, src_region, operation, BLIT_OPERATION); } else if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { if (!blit_framebuffer) { blit_framebuffer = std::make_unique(*runtime, nullptr, view_ptr, extent, scale_up); } - runtime->blit_image_helper.BlitDepthStencil(blit_framebuffer.get(), blit_view->DepthView(), - blit_view->StencilView(), dst_region, - src_region, operation, BLIT_OPERATION); + runtime->blit_image_helper.BlitDepthStencil(blit_framebuffer.get(), *blit_view, + dst_region, src_region, operation, + BLIT_OPERATION); } else { // TODO: Use helper blits where applicable flags &= ~ImageFlagBits::Rescaled; From 1a13e79c3d8619ff302d9c77eacf1a35c2210b66 Mon Sep 17 00:00:00 2001 From: crueter Date: Sun, 5 Oct 2025 00:00:52 +0200 Subject: [PATCH 19/40] [cmake] fix video_core and tests comp errors on Windows (#2631) did not link to video_core thus did not properly propagate the GPUOpen target thus failed to find vk_mem_alloc also msvc sucks Signed-off-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2631 Reviewed-by: MaranBr --- src/tests/CMakeLists.txt | 5 ++++- src/video_core/vulkan_common/vma.h | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 1e158f3759..c1fdd374ef 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + # SPDX-FileCopyrightText: 2018 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later @@ -21,7 +24,7 @@ add_executable(tests create_target_directory_groups(tests) -target_link_libraries(tests PRIVATE common core input_common) +target_link_libraries(tests PRIVATE common core input_common video_core) target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2WithMain Threads::Threads) add_test(NAME tests COMMAND tests) diff --git a/src/video_core/vulkan_common/vma.h b/src/video_core/vulkan_common/vma.h index 911c1114b2..e022b2bf7d 100644 --- a/src/video_core/vulkan_common/vma.h +++ b/src/video_core/vulkan_common/vma.h @@ -10,4 +10,12 @@ #define VMA_STATIC_VULKAN_FUNCTIONS 0 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4189 ) +#endif #include "vk_mem_alloc.h" + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif From 4b677bbbb98f8a9c91bdca9b8d9c7b0ab244931d Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 20:48:26 -0400 Subject: [PATCH 20/40] solaris Signed-off-by: crueter --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f9a583fd..7f192887f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,10 +32,20 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") + +# NB: this does not account for SPARC +# If you get Eden working on SPARC, please shoot crueter@crueter.xyz multiple emails +# and you will be hailed for eternity if (PLATFORM_SUN) # Terrific Solaris pkg shenanigans list(APPEND CMAKE_PREFIX_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") + + # amazing + # absolutely incredible + list(APPEND CMAKE_PREFIX_PATH "/usr/lib/amd64/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/lib/amd64/cmake") + # For some mighty reason, doing a normal release build sometimes may not trigger # the proper -O3 switch to materialize if (CMAKE_BUILD_TYPE MATCHES "Release") From 800d98d2127dad72bcac2a1dfcd47197dd29923e Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 21:00:35 -0400 Subject: [PATCH 21/40] allow system libusb on solaris Signed-off-by: crueter --- docs/Deps.md | 2 +- externals/libusb/CMakeLists.txt | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/docs/Deps.md b/docs/Deps.md index 69f41794ea..b8a1be66d2 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -195,7 +195,7 @@ Run the usual update + install of essential toolings: `sudo pkg update && sudo p - **gcc**: `sudo pkg install developer/gcc-14`. - **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`. -Then install the libraries: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm developer/fmt`. +Then install the libraries: `sudo pkg install qt6 boost glslang libzip library/lz4 libusb-1 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm developer/fmt`.
diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt index 77a762d070..a53464ea98 100644 --- a/externals/libusb/CMakeLists.txt +++ b/externals/libusb/CMakeLists.txt @@ -6,18 +6,7 @@ include(CPMUtil) -# we love our libraries don't we folks -if (PLATFORM_SUN) - set(libusb_bundled ON) -else() - set(libusb_bundled OFF) -endif() - -# TODO(crueter): Fix on Solaris -AddJsonPackage( - NAME libusb - BUNDLED_PACKAGE ${libusb_bundled} -) +AddJsonPackage(libusb) if (NOT libusb_ADDED) return() From 8fb98d9e992ced1b31a8a961faf5d267fe422bf2 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 14:39:58 -0400 Subject: [PATCH 22/40] format json script Signed-off-by: crueter --- externals/ffmpeg/cpmfile.json | 2 +- externals/libusb/cpmfile.json | 14 +++++++------- tools/cpm-hash.sh | 2 +- tools/cpm/format-json.sh | 8 ++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100755 tools/cpm/format-json.sh diff --git a/externals/ffmpeg/cpmfile.json b/externals/ffmpeg/cpmfile.json index ff48ce742d..97ca227939 100644 --- a/externals/ffmpeg/cpmfile.json +++ b/externals/ffmpeg/cpmfile.json @@ -5,7 +5,7 @@ "hash": "2a89d664119debbb3c006ab1c48d5d7f26e889f4a65ad2e25c8b0503308295123d5a9c5c78bf683aef5ff09acef8c3fc2837f22d3e8c611528b933bf03bcdd97", "bundled": true }, - "ffmpeg-ci": { + "ffmpeg-ci": { "ci": true, "package": "FFmpeg", "name": "ffmpeg", diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json index 0bfa0d7a86..80a0b917db 100644 --- a/externals/libusb/cpmfile.json +++ b/externals/libusb/cpmfile.json @@ -1,8 +1,8 @@ { - "libusb": { - "repo": "libusb/libusb", - "sha": "c060e9ce30", - "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", - "find_args": "MODULE" - } -} \ No newline at end of file + "libusb": { + "repo": "libusb/libusb", + "sha": "c060e9ce30", + "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", + "find_args": "MODULE" + } +} diff --git a/tools/cpm-hash.sh b/tools/cpm-hash.sh index da0fb395db..b740936f4d 100755 --- a/tools/cpm-hash.sh +++ b/tools/cpm-hash.sh @@ -1,4 +1,4 @@ #!/bin/sh -SUM=`wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum` +SUM=$(wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/format-json.sh b/tools/cpm/format-json.sh new file mode 100755 index 0000000000..6059077fe1 --- /dev/null +++ b/tools/cpm/format-json.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +FILES=$(find . src -maxdepth 3 -name cpmfile.json) + +for file in $FILES; do + jq --indent 4 < $file > $file.new + mv $file.new $file +done From aad0ee6c5866d96055968e02df145cfd57f584d1 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 16:56:46 -0400 Subject: [PATCH 23/40] [tools] refactor: update/hash checking scripts, use tags for more deps Uses tags for a bunch of deps that can use them Also adds a bunmch of scripts to tools/cpm, notably for checking hashes and checking for updates. TODO: - Documentation - CI target to check hashes - Script to update the json directly (dedup) - Function to filter tags (dedup) - Weekly CI to check for updates Need to get that other CI runner up Signed-off-by: crueter --- cpmfile.json | 27 +- externals/cpmfile.json | 128 ++++---- externals/libusb/cpmfile.json | 7 +- src/dynarmic/externals/cpmfile.json | 7 +- tools/cpm-fetch-all.sh | 7 +- tools/cpm-fetch.sh | 410 ++++++++++++------------ tools/cpm-hash.sh | 4 - tools/cpm/check-all-hashes.sh | 14 + tools/cpm/check-all-updates.sh | 11 + tools/cpm/check-hash.sh | 110 +++++++ tools/cpm/check-updates.sh | 97 ++++++ tools/cpm/{format-json.sh => format.sh} | 0 tools/cpm/hash.sh | 22 ++ tools/{ => cpm}/url-hash.sh | 2 +- tools/cpm/which.sh | 9 + 15 files changed, 566 insertions(+), 289 deletions(-) delete mode 100755 tools/cpm-hash.sh create mode 100755 tools/cpm/check-all-hashes.sh create mode 100755 tools/cpm/check-all-updates.sh create mode 100755 tools/cpm/check-hash.sh create mode 100755 tools/cpm/check-updates.sh rename tools/cpm/{format-json.sh => format.sh} (100%) create mode 100755 tools/cpm/hash.sh rename tools/{ => cpm}/url-hash.sh (53%) create mode 100755 tools/cpm/which.sh diff --git a/cpmfile.json b/cpmfile.json index 4cf61f0ffc..385d10cd81 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -26,12 +26,9 @@ }, "fmt": { "repo": "fmtlib/fmt", - "sha": "40626af88b", - "hash": "d59f06c24339f223de4ec2afeba1c67b5835a0f350a1ffa86242a72fc3e616a6b8b21798355428d4200c75287308b66634619ffa0b52ba5bd74cc01772ea1a8a", - "version": "8", - "options": [ - "FMT_INSTALL OFF" - ] + "tag": "12.0.0", + "hash": "c4ab814c20fbad7e3f0ae169125a4988a2795631194703251481dc36b18da65c886c4faa9acd046b0a295005217b3689eb0126108a9ba5aac2ca909aae263c2f", + "version": "8" }, "lz4": { "name": "lz4", @@ -43,16 +40,18 @@ "nlohmann": { "package": "nlohmann_json", "repo": "nlohmann/json", - "sha": "55f93686c0", - "hash": "b739749b066800e21154506ea150d2c5cbce8a45344177f46f884547a1399d26753166fd0df8135269ce28cf223552b1b65cd625b88c844d54753f2434900486", - "version": "3.8" + "tag": "v%VERSION%", + "hash": "6cc1e86261f8fac21cc17a33da3b6b3c3cd5c116755651642af3c9e99bb3538fd42c1bd50397a77c8fb6821bc62d90e6b91bcdde77a78f58f2416c62fc53b97d", + "version": "3.8", + "git_version": "3.12.0" }, "zlib": { "package": "ZLIB", "repo": "madler/zlib", - "sha": "51b7f2abda", - "hash": "16eaf1f3752489d12fd9ce30f7b5f7cbd5cb8ff53d617005a9847ae72d937f65e01e68be747f62d7ac19fd0c9aeba9956e60f16d6b465c5fdc2f3d08b4db2e6c", + "tag": "v%VERSION%", + "hash": "8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088", "version": "1.2", + "git_version": "1.3.1", "options": [ "ZLIB_BUILD_SHARED OFF", "ZLIB_INSTALL OFF" @@ -60,8 +59,8 @@ }, "zstd": { "repo": "facebook/zstd", - "sha": "f8745da6ff", - "hash": "3037007f990040fe32573b46f9bef8762fd5dbeeb07ffffcbfeba51ec98167edae39bb9c87f9299efcd61c4e467c5e84f7c19f0df7799bc1fc04864a278792ee", + "sha": "b8d6101fba", + "hash": "a6c8e5272214fd3e65e03ae4fc375f452bd2f646623886664ee23e239e35751cfc842db4d34a84a8039d89fc8f76556121f2a4ae350d017bdff5e22150f9c3de", "version": "1.5", "source_subdir": "build/cmake", "find_args": "MODULE", @@ -89,7 +88,7 @@ "llvm-mingw": { "repo": "misc/llvm-mingw", "git_host": "git.crueter.xyz", - "tag": "20250828", + "tag": "%VERSION%", "version": "20250828", "artifact": "clang-rt-builtins.tar.zst", "hash": "d902392caf94e84f223766e2cc51ca5fab6cae36ab8dc6ef9ef6a683ab1c483bfcfe291ef0bd38ab16a4ecc4078344fa8af72da2f225ab4c378dee23f6186181" diff --git a/externals/cpmfile.json b/externals/cpmfile.json index cb32a75ed5..1ff392923f 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -2,13 +2,14 @@ "vulkan-memory-allocator": { "package": "VulkanMemoryAllocator", "repo": "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator", - "sha": "1076b348ab", - "hash": "a46b44e4286d08cffda058e856c47f44c7fed3da55fe9555976eb3907fdcc20ead0b1860b0c38319cda01dbf9b1aa5d4b4038c7f1f8fbd97283d837fa9af9772", - "find_args": "CONFIG" + "tag": "v%VERSION%", + "hash": "deb5902ef8db0e329fbd5f3f4385eb0e26bdd9f14f3a2334823fb3fe18f36bc5d235d620d6e5f6fe3551ec3ea7038638899db8778c09f6d5c278f5ff95c3344b", + "find_args": "CONFIG", + "git_version": "3.3.0" }, "sirit": { "repo": "eden-emulator/sirit", - "version": "1.0.1", + "git_version": "1.0.1", "tag": "v%VERSION%", "artifact": "sirit-source-%VERSION%.tar.zst", "hash_suffix": "sha512sum", @@ -23,8 +24,9 @@ }, "httplib": { "repo": "yhirose/cpp-httplib", - "sha": "a609330e4c", - "hash": "dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2" + "tag": "v%VERSION%", + "hash": "b364500f76e2ecb0fe21b032d831272e3f1dfeea71af74e325f8fc4ce9dcdb3c941b97a5b422bdeafb9facd058597b90f8bfc284fb9afe3c33fefa15dd5a010b", + "git_version": "0.26.0" }, "cpp-jwt": { "version": "1.4", @@ -39,16 +41,18 @@ "xbyak_sun": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "9bb219333a", - "hash": "303165d45c8c19387ec49d9fda7d7a4e0d86d4c0153898c23f25ce2d58ece567f44c0bbbfe348239b933edb6e1a1e34f4bc1c0ab3a285bee5da0e548879387b0", - "bundled": true + "tag": "v%VERSION%", + "hash": "e84992c65ad62c577e2746ec5180132fd2875166d1e6b1521a0ff619787e1645792fe5f6a858fe94ed66f297912b6a6b89a509b5d5f5e81a2db1dd7e6790b1f5", + "bundled": true, + "git_version": "7.30" }, "xbyak": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "4e44f4614d", - "hash": "5824e92159e07fa36a774aedd3b3ef3541d0241371d522cffa4ab3e1f215fa5097b1b77865b47b2481376c704fa079875557ea463ca63d0a7fd6a8a20a589e70", - "bundled": true + "sha": "v7.22", + "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "bundled": true, + "skip_updates": true }, "oaknut": { "version": "2.0.1", @@ -66,16 +70,17 @@ }, "oboe": { "repo": "google/oboe", - "sha": "2bc873e53c", - "hash": "02329058a7f9cf7d5039afaae5ab170d9f42f60f4c01e21eaf4f46073886922b057a9ae30eeac040b3ac182f51b9c1bfe9fe1050a2c9f6ce567a1a9a0ec2c768", + "tag": "1.10.0", + "hash": "ce4011afe7345370d4ead3b891cd69a5ef224b129535783586c0ca75051d303ed446e6c7f10bde8da31fff58d6e307f1732a3ffd03b249f9ef1fd48fd4132715", "bundled": true }, "unordered-dense": { "package": "unordered_dense", "repo": "martinus/unordered_dense", - "sha": "73f3cbb237", - "hash": "c08c03063938339d61392b687562909c1a92615b6ef39ec8df19ea472aa6b6478e70d7d5e33d4a27b5d23f7806daf57fe1bacb8124c8a945c918c7663a9e8532", - "find_args": "CONFIG" + "tag": "v%VERSION%", + "hash": "f9c819e28e1c1a387acfee09277d6af5e366597a0d39acf1c687acf0608a941ba966af8aaebdb8fba0126c7360269c4a51754ef4cab17c35c01a30215f953368", + "find_args": "CONFIG", + "git_version": "4.5.0" }, "mbedtls": { "package": "MbedTLS", @@ -84,29 +89,32 @@ "hash": "6671fb8fcaa832e5b115dfdce8f78baa6a4aea71f5c89a640583634cdee27aefe3bf4be075744da91f7c3ae5ea4e0c765c8fc3937b5cfd9ea73d87ef496524da", "version": "3", "git_version": "3.6.4", - "artifact": "%TAG%.tar.bz2" + "artifact": "%TAG%.tar.bz2", + "skip_updates": true }, "enet": { "repo": "lsalzman/enet", - "sha": "2662c0de09", - "hash": "3de1beb4fa3d6b1e03eda8dd1e7580694f854af3ed3975dcdabfdcdf76b97f322b9734d35ea7f185855bb490d957842b938b26da4dd2dfded509390f8d2794dd", + "tag": "v%VERSION%", + "hash": "a0d2fa8c957704dd49e00a726284ac5ca034b50b00d2b20a94fa1bbfbb80841467834bfdc84aa0ed0d6aab894608fd6c86c3b94eee46343f0e6d9c22e391dbf9", "version": "1.3", + "git_version": "1.3.18", "find_args": "MODULE" }, "vulkan-utility-headers": { "package": "VulkanUtilityLibraries", "repo": "scripts/VulkanUtilityHeaders", - "tag": "1.4.326", + "tag": "1.4.328", "artifact": "VulkanUtilityHeaders.tar.zst", "git_host": "git.crueter.xyz", - "hash": "5924629755cb1605c4aa4eee20ef7957a9dd8d61e4df548be656d98054f2730c4109693c1bd35811f401f4705d2ccff9fc849be32b0d8480bc3f73541a5e0964" + "hash": "9922217b39faf73cd4fc1510f2fdba14a49aa5c0d77f9ee24ee0512cef16b234d0cabc83c1fec861fa5df1d43e7f086ca9b6501753899119f39c5ca530cb0dae" }, - "spirv-tools": { + "spirv-tools": { "package": "SPIRV-Tools", "repo": "KhronosGroup/SPIRV-Tools", - "sha": "40eb301f32", - "hash": "58d0fb1047d69373cf24c73e6f78c73a72a6cca3b4df1d9f083b9dcc0962745ef154abf3dbe9b3623b835be20c6ec769431cf11733349f45e7568b3525f707aa", + "tag": "v%VERSION%", + "hash": "b17940433ced72e004c5eeffd7dd411b6afcc6a52ee31de6427d88edceb8172369be8ec8bf5b65708a78bf41fdae264d554aa7750b2209831679ab36bc867567", "find_args": "MODULE", + "git_version": "2025.4", "options": [ "SPIRV_SKIP_EXECUTABLES ON" ] @@ -132,35 +140,6 @@ "BUNDLE_SPEEX ON" ] }, - "discord-rpc": { - "package": "DiscordRPC", - "repo": "eden-emulator/discord-rpc", - "sha": "1cf7772bb6", - "hash": "e9b35e6f2c075823257bcd59f06fe7bb2ccce1976f44818d2e28810435ef79c712a3c4f20f40da41f691342a4058cf86b078eb7f9d9e4dae83c0547c21ec4f97" - }, - "simpleini": { - "package": "SimpleIni", - "repo": "brofield/simpleini", - "sha": "09c21bda1d", - "hash": "99779ca9b6e040d36558cadf484f9ffdab5b47bcc8fc72e4d33639d1d60c0ceb4410d335ba445d72a4324e455167fd6769d99b459943aa135bec085dff2d4b7c", - "find_args": "MODULE" - }, - "sdl2_generic": { - "package": "SDL2", - "repo": "libsdl-org/SDL", - "sha": "54772f345a", - "hash": "2a68a0e01c390043aa9d9df63d8a20a52076c88bb460ac4e0f33194ca7d9bc8fadbbcc04e7506872ac4b6354a73fbc267c036f82200da59465789b87c7d9e3a4", - "key": "generic", - "bundled": true - }, - "sdl2_steamdeck": { - "package": "SDL2", - "repo": "libsdl-org/SDL", - "sha": "cc016b0046", - "hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b", - "key": "steamdeck", - "bundled": true - }, "sdl2": { "ci": true, "package": "SDL2", @@ -175,8 +154,43 @@ "catch2": { "package": "Catch2", "repo": "catchorg/Catch2", - "sha": "644821ce28", - "hash": "f8795f98acf2c02c0db8e734cc866d5caebab4b4a306e93598b97cb3c0c728dafe8283dce27ffe8d42460e5ae7302f3f32e7e274a7f991b73511ac88eef21b1f", - "version": "3.0.1" + "tag": "v%VERSION%", + "hash": "a95495142f915d6e9c2a23e80fe360343e9097680066a2f9d3037a070ba5f81ee5559a0407cc9e972dc2afae325873f1fc7ea07a64012c0f01aac6e549f03e3f", + "version": "3.0.1", + "git_version": "3.11.0" + }, + "discord-rpc": { + "package": "DiscordRPC", + "repo": "eden-emulator/discord-rpc", + "sha": "1cf7772bb6", + "hash": "e9b35e6f2c075823257bcd59f06fe7bb2ccce1976f44818d2e28810435ef79c712a3c4f20f40da41f691342a4058cf86b078eb7f9d9e4dae83c0547c21ec4f97", + "find_args": "MODULE" + }, + "simpleini": { + "package": "SimpleIni", + "repo": "brofield/simpleini", + "tag": "v%VERSION%", + "hash": "6c198636816a0018adbf7f735d402c64245c6fcd540b7360d4388d46f007f3a520686cdaec4705cb8cb31401b2cb4797a80b42ea5d08a6a5807c0848386f7ca1", + "find_args": "MODULE", + "git_version": "4.22" + }, + "sdl2_generic": { + "package": "SDL2", + "repo": "libsdl-org/SDL", + "tag": "release-%VERSION%", + "hash": "d5622d6bb7266f7942a7b8ad43e8a22524893bf0c2ea1af91204838d9b78d32768843f6faa248757427b8404b8c6443776d4afa6b672cd8571a4e0c03a829383", + "key": "generic", + "bundled": true, + "git_version": "2.32.10", + "skip_updates": true + }, + "sdl2_steamdeck": { + "package": "SDL2", + "repo": "libsdl-org/SDL", + "sha": "cc016b0046", + "hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b", + "key": "steamdeck", + "bundled": true, + "skip_updates": "true" } } diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json index 80a0b917db..dc69841ab7 100644 --- a/externals/libusb/cpmfile.json +++ b/externals/libusb/cpmfile.json @@ -1,8 +1,9 @@ { "libusb": { "repo": "libusb/libusb", - "sha": "c060e9ce30", - "hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc", - "find_args": "MODULE" + "tag": "v%VERSION%", + "hash": "98c5f7940ff06b25c9aa65aa98e23de4c79a4c1067595f4c73cc145af23a1c286639e1ba11185cd91bab702081f307b973f08a4c9746576dc8d01b3620a3aeb5", + "find_args": "MODULE", + "git_version": "1.0.29" } } diff --git a/src/dynarmic/externals/cpmfile.json b/src/dynarmic/externals/cpmfile.json index 718163baf5..099ded57a4 100644 --- a/src/dynarmic/externals/cpmfile.json +++ b/src/dynarmic/externals/cpmfile.json @@ -1,9 +1,10 @@ { "biscuit": { - "version": "0.9.1", "repo": "lioncash/biscuit", - "sha": "76b0be8dae", - "hash": "47d55ed02d032d6cf3dc107c6c0a9aea686d5f25aefb81d1af91db027b6815bd5add1755505e19d76625feeb17aa2db6cd1668fe0dad2e6a411519bde6ca4489" + "tag": "v%VERSION%", + "hash": "1229f345b014f7ca544dedb4edb3311e41ba736f9aa9a67f88b5f26f3c983288c6bb6cdedcfb0b8a02c63088a37e6a0d7ba97d9c2a4d721b213916327cffe28a", + "version": "0.9.1", + "git_version": "0.19.0" }, "mcl": { "version": "0.1.12", diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh index 9d5005ec44..9dc1ac2a55 100755 --- a/tools/cpm-fetch-all.sh +++ b/tools/cpm-fetch-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -6,6 +6,9 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') tools/cpm-fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm-fetch.sh b/tools/cpm-fetch.sh index 0219845707..e9829aa482 100755 --- a/tools/cpm-fetch.sh +++ b/tools/cpm-fetch.sh @@ -10,227 +10,227 @@ mkdir -p $CPM_SOURCE_CACHE +# fetch json once to make lives easier +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + ROOTDIR="$PWD" TMP=$(mktemp -d) download_package() { - FILENAME=$(basename "$DOWNLOAD") + FILENAME=$(basename "$DOWNLOAD") - OUTFILE="$TMP/$FILENAME" - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && return - - curl "$DOWNLOAD" -sS -L -o "$OUTFILE" - - ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) - [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 - - mkdir -p "$OUTDIR" - - pushd "$OUTDIR" > /dev/null - - case "$FILENAME" in - (*.7z) - 7z x "$OUTFILE" > /dev/null - ;; - (*.tar*) - tar xf "$OUTFILE" > /dev/null - ;; - (*.zip) - unzip "$OUTFILE" > /dev/null - ;; - esac - - # basically if only one real item exists at the top we just move everything from there - # since github and some vendors hate me - DIRS=$(find -maxdepth 1 -type d -o -type f) - - # thanks gnu - if [ $(wc -l <<< "$DIRS") -eq 2 ]; then - SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") - mv "$SUBDIR"/* . - mv "$SUBDIR"/.* . 2>/dev/null || true - rmdir "$SUBDIR" - fi - - if grep -e "patches" <<< "$JSON" > /dev/null; then - PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") - for patch in $PATCHES; do - patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch - done - fi - - popd > /dev/null -} - -ci_package() { - REPO=$(jq -r ".repo" <<< "$JSON") - EXT=$(jq -r '.extension' <<< "$JSON") - [ "$EXT" = null ] && EXT="tar.zst" - - VERSION=$(jq -r ".version" <<< "$JSON") - - NAME=$(jq -r ".name" <<< "$JSON") - [ "$NAME" = null ] && NAME="$PACKAGE" - - PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") - - DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") - - [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return - - echo "-- CI package $PACKAGE" - - for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do - echo "-- * platform $platform" - - case $DISABLED in - (*"$platform"*) - echo "-- * -- disabled" - continue - ;; - (*) ;; - esac - - FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" - DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" - PACKAGE_NAME="$PACKAGE" - KEY=$platform + OUTFILE="$TMP/$FILENAME" LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && continue + [ -d "$OUTDIR" ] && return + curl "$DOWNLOAD" -sS -L -o "$OUTFILE" + + ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) + [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 + + mkdir -p "$OUTDIR" + + pushd "$OUTDIR" > /dev/null + + case "$FILENAME" in + (*.7z) + 7z x "$OUTFILE" > /dev/null + ;; + (*.tar*) + tar xf "$OUTFILE" > /dev/null + ;; + (*.zip) + unzip "$OUTFILE" > /dev/null + ;; + esac + + # basically if only one real item exists at the top we just move everything from there + # since github and some vendors hate me + DIRS=$(find -maxdepth 1 -type d -o -type f) + + # thanks gnu + if [ "$(wc -l <<< "$DIRS")" -eq 2 ]; then + SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") + mv "$SUBDIR"/* . + mv "$SUBDIR"/.* . 2>/dev/null || true + rmdir "$SUBDIR" + fi + + if grep -e "patches" <<< "$JSON" > /dev/null; then + PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") + for patch in $PATCHES; do + patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch + done + fi + + popd > /dev/null +} + +ci_package() { + EXT=$(jq -r '.extension' <<< "$JSON") + [ "$EXT" = null ] && EXT="tar.zst" + + VERSION=$(jq -r ".version" <<< "$JSON") + + NAME=$(jq -r ".name" <<< "$JSON") + [ "$NAME" = null ] && NAME="$PACKAGE" + + PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") + + DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") + + [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return + + echo "-- CI package $PACKAGE" + + for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do + echo "-- * platform $platform" + + case $DISABLED in + (*"$platform"*) + echo "-- * -- disabled" + continue + ;; + (*) ;; + esac + + FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" + DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" + PACKAGE_NAME="$PACKAGE" + KEY=$platform + + LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && continue + + HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + + HASH=$(curl "$HASH_URL" -sS -q -L -o -) + + download_package + done +} + +for package in "$@" +do + # prepare for cancer + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") + [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + REPO=$(jq -r ".repo" <<< "$JSON") + + CI=$(jq -r ".ci" <<< "$JSON") + if [ "$CI" != null ]; then + ci_package + continue + fi + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" + + # url parsing + URL=$(jq -r ".url" <<< "$JSON") + SHA=$(jq -r ".sha" <<< "$JSON") + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" + else + VERSION_REPLACE="$VERSION" + fi + + TAG=$(jq -r ".tag" <<< "$JSON") + + TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) + ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) + + if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" + elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(jq -r ".branch" <<< "$JSON") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi + else + echo "!! No repo or URL defined for $package" + continue + fi + + # key parsing + KEY=$(jq -r ".key" <<< "$JSON") + + if [ "$KEY" = null ]; then + if [ "$SHA" != null ]; then + KEY=$(cut -c1-4 - <<< "$SHA") + elif [ "$GIT_VERSION" != null ]; then + KEY="$GIT_VERSION" + elif [ "$TAG" != null ]; then + KEY="$TAG" + elif [ "$VERSION" != null ]; then + KEY="$VERSION" + else + echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + continue + fi + fi + + echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + + # hash parsing HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + HASH=$(jq -r ".hash" <<< "$JSON") - HASH=$(curl "$HASH_URL" -sS -q -L -o -) + if [ "$HASH" = null ]; then + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL=$(jq -r ".hash_url" <<< "$JSON") + + if [ "$HASH_URL" = null ]; then + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + fi + + HASH=$(curl "$HASH_URL" -Ss -L -o -) + fi download_package - done -} - -for package in $@ -do - # prepare for cancer - # TODO(crueter): Fetch json once? - JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -r ".\"$package\" | select( . != null )" {} \;) - - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") - [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - REPO=$(jq -r ".repo" <<< "$JSON") - - CI=$(jq -r ".ci" <<< "$JSON") - if [ "$CI" != null ]; then - ci_package - continue - fi - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" - [ "$GIT_VERSION" = null ] && GIT_VERSION="$TAG" - - # url parsing WOOOHOOHOHOOHOHOH - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=$(jq -r ".tag" <<< "$JSON") - - TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) - ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # key parsing - KEY=$(jq -r ".key" <<< "$JSON") - - if [ "$KEY" = null ]; then - if [ "$SHA" != null ]; then - KEY=$(cut -c1-4 - <<< "$SHA") - elif [ "$GIT_VERSION" != null ]; then - KEY="$GIT_VERSION" - elif [ "$TAG" != null ]; then - KEY="$TAG" - elif [ "$VERSION" != null ]; then - KEY="$VERSION" - else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" - continue - fi - fi - - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - - if [ "$HASH" = null ]; then - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") - - if [ "$HASH_URL" = null ]; then - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - fi - - HASH=$(curl "$HASH_URL" -sS -L -o -) - fi - - download_package done rm -rf $TMP \ No newline at end of file diff --git a/tools/cpm-hash.sh b/tools/cpm-hash.sh deleted file mode 100755 index b740936f4d..0000000000 --- a/tools/cpm-hash.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -SUM=$(wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum) -echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-all-hashes.sh new file mode 100755 index 0000000000..a270c368db --- /dev/null +++ b/tools/cpm/check-all-hashes.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') + +tools/cpm/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-all-updates.sh new file mode 100755 index 0000000000..e0c744abf0 --- /dev/null +++ b/tools/cpm/check-all-updates.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") + +tools/cpm/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh new file mode 100755 index 0000000000..bf7c70ffcb --- /dev/null +++ b/tools/cpm/check-hash.sh @@ -0,0 +1,110 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: update if available +# - FORCE: forcefully update + +# shellcheck disable=SC2016 +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +for package in "$@" +do + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + CI=$(jq -r ".ci" <<< "$JSON") + if [ "$CI" != null ]; then + continue + fi + + HASH_URL=$(jq -r ".hash_url" <<< "$JSON") + [ "$HASH_URL" != null ] && continue + + REPO=$(jq -r ".repo" <<< "$JSON") + TAG=$(jq -r ".tag" <<< "$JSON") + + URL=$(jq -r ".url" <<< "$JSON") + SHA=$(jq -r ".sha" <<< "$JSON") + + echo "-- Package $package" + + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + VERSION=$(jq -r ".version" <<< "$JSON") + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" + else + VERSION_REPLACE="$VERSION" + fi + + TAG=${TAG//%VERSION%/$VERSION_REPLACE} + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=${ARTIFACT//%VERSION%/$VERSION_REPLACE} + ARTIFACT=${ARTIFACT//%TAG%/$TAG} + + if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" + elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(jq -r ".branch" <<< "$JSON") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi + else + echo "!! No repo or URL defined for $package" + continue + fi + + # hash parsing + HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH=$(jq -r ".hash" <<< "$JSON") + + [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue + + export USE_TAG=true + ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD") + + # shellcheck disable=SC2028 + [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" + + if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") + + FILE=$(tools/cpm/which.sh "$package") + + jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new + mv "$FILE".new "$FILE" + + echo "-- * -- Updated $FILE" + fi +done \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh new file mode 100755 index 0000000000..8aa46b3924 --- /dev/null +++ b/tools/cpm/check-updates.sh @@ -0,0 +1,97 @@ +#!/bin/bash -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: update if available +# - FORCE: forcefully update + +# shellcheck disable=SC2016 +# shellcheck disable=SC2038 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +for package in "$@" +do + JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + + [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue + + GIT_HOST=$(jq -r ".git_host" <<< "$JSON") + [ "$GIT_HOST" = null ] && GIT_HOST=github.com + + REPO=$(jq -r ".repo" <<< "$JSON") + TAG=$(jq -r ".tag" <<< "$JSON") + SKIP=$(jq -r ".skip_updates" <<< "$JSON") + + [ "$SKIP" = "true" ] && continue + + [ "$REPO" = null ] && continue # echo "No repo defined for $package, skipping" && continue + [ "$GIT_HOST" != "github.com" ] && continue # echo "Unsupported host $GIT_HOST for $package, skipping" && continue + [ "$TAG" = null ] && continue # echo "No tag defined for $package, skipping" && continue + + echo "-- Package $package" + + GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") + + echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false + ORIGINAL_TAG="$TAG" + + TAG=${TAG//%VERSION%/$GIT_VERSION} + + ARTIFACT=$(jq -r ".artifact" <<< "$JSON") + ARTIFACT=${ARTIFACT//%VERSION%/$GIT_VERSION} + ARTIFACT=${ARTIFACT//%TAG%/$TAG} + + # Use gh-cli to avoid ratelimits lmao + TAGS=$(gh api --method GET "/repos/$REPO/tags") + + # filter out some commonly known annoyances + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') + + # ignore betas/alphas + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') + + if [ "$HAS_REPLACE" = "true" ]; then + # this just extracts the tag prefix + VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) + + # then we strip out the prefix from the new tag, and make that our new git_version + NEW_GIT_VERSION=${LATEST//$VERSION_PREFIX/} + fi + + # thanks fmt + [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + + LATEST=$(echo "$TAGS" | jq -r '.[0].name') + + [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + + echo "-- * Version $LATEST available, current is $TAG" + + export USE_TAG=true + HASH=$(tools/cpm/hash.sh "$REPO" "$LATEST") + + echo "-- * New hash: $HASH" + + if [ "$UPDATE" = "true" ]; then + if [ "$HAS_REPLACE" = "true" ]; then + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") + else + NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") + fi + + FILE=$(tools/cpm/which.sh "$package") + + jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new + mv "$FILE".new "$FILE" + + echo "-- * -- Updated $FILE" + fi +done diff --git a/tools/cpm/format-json.sh b/tools/cpm/format.sh similarity index 100% rename from tools/cpm/format-json.sh rename to tools/cpm/format.sh diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh new file mode 100755 index 0000000000..d9476e19c4 --- /dev/null +++ b/tools/cpm/hash.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# usage: hash.sh repo tag-or-sha +# env vars: GIT_HOST, USE_TAG (use tag instead of sha), ARTIFACT (download artifact with that name instead of src archive) + +REPO="$1" +[ -z "$GIT_HOST" ] && GIT_HOST=github.com +GIT_URL="https://$GIT_HOST/$REPO" + +if [ "$USE_TAG" = "true" ]; then + if [ -z "$ARTIFACT" ]; then + URL="${GIT_URL}/archive/refs/tags/$2.tar.gz" + else + URL="${GIT_URL}/releases/download/$2/${ARTIFACT}" + fi +else + URL="${GIT_URL}/archive/$2.zip" +fi + +SUM=$(wget -q "$URL" -O - | sha512sum) + +echo "$SUM" | cut -d " " -f1 diff --git a/tools/url-hash.sh b/tools/cpm/url-hash.sh similarity index 53% rename from tools/url-hash.sh rename to tools/cpm/url-hash.sh index a54dec8bb2..6709bb4a03 100755 --- a/tools/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -1,4 +1,4 @@ #!/bin/sh -SUM=`wget -q $1 -O - | sha512sum` +SUM=$(wget -q $1 -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh new file mode 100755 index 0000000000..d547bf879d --- /dev/null +++ b/tools/cpm/which.sh @@ -0,0 +1,9 @@ +#!/bin/sh -e + +# check which file a package is in + +JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) + +[ -z "$JSON" ] && echo "!! No cpmfile definition for $1" + +echo $JSON \ No newline at end of file From 8257bcc809816bf12d6421de98b4f1cfbfa1cb4e Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 16:59:53 -0400 Subject: [PATCH 24/40] license headers Signed-off-by: crueter --- tools/cpm/format.sh | 3 +++ tools/cpm/hash.sh | 3 +++ tools/cpm/url-hash.sh | 3 +++ tools/cpm/which.sh | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 6059077fe1..e636c402b4 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh index d9476e19c4..0c653e75c2 100755 --- a/tools/cpm/hash.sh +++ b/tools/cpm/hash.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + # usage: hash.sh repo tag-or-sha # env vars: GIT_HOST, USE_TAG (use tag instead of sha), ARTIFACT (download artifact with that name instead of src archive) diff --git a/tools/cpm/url-hash.sh b/tools/cpm/url-hash.sh index 6709bb4a03..444b14b174 100755 --- a/tools/cpm/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -1,4 +1,7 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + SUM=$(wget -q $1 -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index d547bf879d..af12deb1b4 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + # check which file a package is in JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) From dbc89d2f202b3b7a98f09cbc28499db5224c01b3 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 03:41:01 -0400 Subject: [PATCH 25/40] formatting Signed-off-by: crueter --- externals/ffmpeg/cpmfile.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/externals/ffmpeg/cpmfile.json b/externals/ffmpeg/cpmfile.json index 97ca227939..a4933da275 100644 --- a/externals/ffmpeg/cpmfile.json +++ b/externals/ffmpeg/cpmfile.json @@ -12,10 +12,10 @@ "repo": "crueter-ci/FFmpeg", "version": "8.0", "min_version": "4.1", - "disabled_platforms": [ - "freebsd-amd64", - "solaris-amd64", + "disabled_platforms": [ + "freebsd-amd64", + "solaris-amd64", "macos-universal" - ] + ] } } From 240c2d14d4c3864da4b96e639ea25ea6c1bfc6db Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 04:59:04 -0400 Subject: [PATCH 26/40] [tools] refactor: reorganize, commonalities, moar tags, posix compat all scripts are fully posix compliant Signed-off-by: crueter --- .shellcheckrc | 1 + cpmfile.json | 5 +- externals/cpmfile.json | 16 ++- tools/cpm-fetch-all.sh | 15 +-- tools/cpm-fetch.sh | 236 --------------------------------- tools/cpm/check-all-hashes.sh | 11 +- tools/cpm/check-all-updates.sh | 8 +- tools/cpm/check-hash.sh | 78 ++--------- tools/cpm/check-updates.sh | 54 +++----- tools/cpm/common.sh | 19 +++ tools/cpm/download.sh | 103 ++++++++++++++ tools/cpm/fetch-all.sh | 13 ++ tools/cpm/fetch.sh | 39 ++++++ tools/cpm/format.sh | 4 +- tools/cpm/hash.sh | 2 +- tools/cpm/package.sh | 225 +++++++++++++++++++++++++++++++ tools/cpm/url-hash.sh | 2 +- tools/cpm/which.sh | 2 +- 18 files changed, 458 insertions(+), 375 deletions(-) create mode 100644 .shellcheckrc mode change 100755 => 120000 tools/cpm-fetch-all.sh delete mode 100755 tools/cpm-fetch.sh create mode 100755 tools/cpm/common.sh create mode 100755 tools/cpm/download.sh create mode 100755 tools/cpm/fetch-all.sh create mode 100755 tools/cpm/fetch.sh create mode 100755 tools/cpm/package.sh diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000000..96e22629de --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +shell=sh diff --git a/cpmfile.json b/cpmfile.json index 385d10cd81..aab9b4dd3d 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -26,9 +26,10 @@ }, "fmt": { "repo": "fmtlib/fmt", - "tag": "12.0.0", + "tag": "%VERSION%", "hash": "c4ab814c20fbad7e3f0ae169125a4988a2795631194703251481dc36b18da65c886c4faa9acd046b0a295005217b3689eb0126108a9ba5aac2ca909aae263c2f", - "version": "8" + "version": "8", + "git_version": "12.0.0" }, "lz4": { "name": "lz4", diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 1ff392923f..a3f7540e6d 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -49,16 +49,18 @@ "xbyak": { "package": "xbyak", "repo": "herumi/xbyak", - "sha": "v7.22", + "tag": "v%VERSION%", "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "git_version": "7.22", "bundled": true, "skip_updates": true }, "oaknut": { + "repo": "eden-emulator/oaknut", "version": "2.0.1", - "repo": "merryhime/oaknut", - "sha": "94c726ce03", - "hash": "d8d082242fa1881abce3c82f8dafa002c4e561e66a69e7fc038af67faa5eff2630f082d3d19579c88c4c9f9488e54552accc8cb90e7ce743efe043b6230c08ac" + "git_version": "2.0.3", + "tag": "v%VERSION%", + "hash": "9697e80a7d5d9bcb3ce51051a9a24962fb90ca79d215f1f03ae6b58da8ba13a63b5dda1b4dde3d26ac6445029696b8ef2883f4e5a777b342bba01283ed293856" }, "libadrenotools": { "repo": "bylaws/libadrenotools", @@ -70,8 +72,9 @@ }, "oboe": { "repo": "google/oboe", - "tag": "1.10.0", + "tag": "%VERSION%", "hash": "ce4011afe7345370d4ead3b891cd69a5ef224b129535783586c0ca75051d303ed446e6c7f10bde8da31fff58d6e307f1732a3ffd03b249f9ef1fd48fd4132715", + "git_version": "1.10.0", "bundled": true }, "unordered-dense": { @@ -103,7 +106,8 @@ "vulkan-utility-headers": { "package": "VulkanUtilityLibraries", "repo": "scripts/VulkanUtilityHeaders", - "tag": "1.4.328", + "tag": "%VERSION%", + "git_version": "1.4.328", "artifact": "VulkanUtilityHeaders.tar.zst", "git_host": "git.crueter.xyz", "hash": "9922217b39faf73cd4fc1510f2fdba14a49aa5c0d77f9ee24ee0512cef16b234d0cabc83c1fec861fa5df1d43e7f086ca9b6501753899119f39c5ca530cb0dae" diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh deleted file mode 100755 index 9dc1ac2a55..0000000000 --- a/tools/cpm-fetch-all.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e - -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - -# SPDX-FileCopyrightText: 2025 crueter -# SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC2038 -# shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') -LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') - -tools/cpm-fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh new file mode 120000 index 0000000000..ea773fac18 --- /dev/null +++ b/tools/cpm-fetch-all.sh @@ -0,0 +1 @@ +cpm/fetch-all.sh \ No newline at end of file diff --git a/tools/cpm-fetch.sh b/tools/cpm-fetch.sh deleted file mode 100755 index e9829aa482..0000000000 --- a/tools/cpm-fetch.sh +++ /dev/null @@ -1,236 +0,0 @@ -#!/bin/bash -e - -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - -# SPDX-FileCopyrightText: 2025 crueter -# SPDX-License-Identifier: GPL-3.0-or-later - -[ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm - -mkdir -p $CPM_SOURCE_CACHE - -# fetch json once to make lives easier -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') - -ROOTDIR="$PWD" - -TMP=$(mktemp -d) - -download_package() { - FILENAME=$(basename "$DOWNLOAD") - - OUTFILE="$TMP/$FILENAME" - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && return - - curl "$DOWNLOAD" -sS -L -o "$OUTFILE" - - ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) - [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 - - mkdir -p "$OUTDIR" - - pushd "$OUTDIR" > /dev/null - - case "$FILENAME" in - (*.7z) - 7z x "$OUTFILE" > /dev/null - ;; - (*.tar*) - tar xf "$OUTFILE" > /dev/null - ;; - (*.zip) - unzip "$OUTFILE" > /dev/null - ;; - esac - - # basically if only one real item exists at the top we just move everything from there - # since github and some vendors hate me - DIRS=$(find -maxdepth 1 -type d -o -type f) - - # thanks gnu - if [ "$(wc -l <<< "$DIRS")" -eq 2 ]; then - SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") - mv "$SUBDIR"/* . - mv "$SUBDIR"/.* . 2>/dev/null || true - rmdir "$SUBDIR" - fi - - if grep -e "patches" <<< "$JSON" > /dev/null; then - PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") - for patch in $PATCHES; do - patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch - done - fi - - popd > /dev/null -} - -ci_package() { - EXT=$(jq -r '.extension' <<< "$JSON") - [ "$EXT" = null ] && EXT="tar.zst" - - VERSION=$(jq -r ".version" <<< "$JSON") - - NAME=$(jq -r ".name" <<< "$JSON") - [ "$NAME" = null ] && NAME="$PACKAGE" - - PACKAGE=$(jq -r ".package | \"$package\"" <<< "$JSON") - - DISABLED=$(jq -j '.disabled_platforms' <<< "$JSON") - - [ "$REPO" = null ] && echo "No repo defined for CI package $package" && return - - echo "-- CI package $PACKAGE" - - for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do - echo "-- * platform $platform" - - case $DISABLED in - (*"$platform"*) - echo "-- * -- disabled" - continue - ;; - (*) ;; - esac - - FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" - DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" - PACKAGE_NAME="$PACKAGE" - KEY=$platform - - LOWER_PACKAGE=$(tr '[:upper:]' '[:lower:]' <<< "$PACKAGE_NAME") - OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" - [ -d "$OUTDIR" ] && continue - - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - - HASH=$(curl "$HASH_URL" -sS -q -L -o -) - - download_package - done -} - -for package in "$@" -do - # prepare for cancer - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") - - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - PACKAGE_NAME=$(jq -r ".package" <<< "$JSON") - [ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - REPO=$(jq -r ".repo" <<< "$JSON") - - CI=$(jq -r ".ci" <<< "$JSON") - if [ "$CI" != null ]; then - ci_package - continue - fi - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - [ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" - - # url parsing - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=$(jq -r ".tag" <<< "$JSON") - - TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG) - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) - ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # key parsing - KEY=$(jq -r ".key" <<< "$JSON") - - if [ "$KEY" = null ]; then - if [ "$SHA" != null ]; then - KEY=$(cut -c1-4 - <<< "$SHA") - elif [ "$GIT_VERSION" != null ]; then - KEY="$GIT_VERSION" - elif [ "$TAG" != null ]; then - KEY="$TAG" - elif [ "$VERSION" != null ]; then - KEY="$VERSION" - else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" - continue - fi - fi - - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - - if [ "$HASH" = null ]; then - HASH_SUFFIX="${HASH_ALGO}sum" - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") - - if [ "$HASH_URL" = null ]; then - HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" - fi - - HASH=$(curl "$HASH_URL" -Ss -L -o -) - fi - - download_package -done - -rm -rf $TMP \ No newline at end of file diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-all-hashes.sh index a270c368db..730288b4bf 100755 --- a/tools/cpm/check-all-hashes.sh +++ b/tools/cpm/check-all-hashes.sh @@ -6,9 +6,10 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -# shellcheck disable=SC2038 -# shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') -LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') +SCRIPT_DIR=$(dirname -- "$0") -tools/cpm/check-hash.sh $LIBS \ No newline at end of file +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +"$SCRIPT_DIR"/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-all-updates.sh index e0c744abf0..09f1ec08ea 100755 --- a/tools/cpm/check-all-updates.sh +++ b/tools/cpm/check-all-updates.sh @@ -6,6 +6,10 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -LIBS=$(find . src -maxdepth 3 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") +SCRIPT_DIR=$(dirname -- "$0") -tools/cpm/check-updates.sh $LIBS \ No newline at end of file +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +"$SCRIPT_DIR"/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index bf7c70ffcb..e1081f67ba 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -7,88 +7,26 @@ # SPDX-License-Identifier: GPL-3.0-or-later # env vars: -# - UPDATE: update if available -# - FORCE: forcefully update +# - UPDATE: fix hashes if needed -# shellcheck disable=SC2016 -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC1091 +. tools/cpm/common.sh for package in "$@" do - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - CI=$(jq -r ".ci" <<< "$JSON") if [ "$CI" != null ]; then continue fi - HASH_URL=$(jq -r ".hash_url" <<< "$JSON") [ "$HASH_URL" != null ] && continue - - REPO=$(jq -r ".repo" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - - URL=$(jq -r ".url" <<< "$JSON") - SHA=$(jq -r ".sha" <<< "$JSON") + [ "$HASH_SUFFIX" != null ] && continue echo "-- Package $package" - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - VERSION=$(jq -r ".version" <<< "$JSON") - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - if [ "$GIT_VERSION" != null ]; then - VERSION_REPLACE="$GIT_VERSION" - else - VERSION_REPLACE="$VERSION" - fi - - TAG=${TAG//%VERSION%/$VERSION_REPLACE} - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=${ARTIFACT//%VERSION%/$VERSION_REPLACE} - ARTIFACT=${ARTIFACT//%TAG%/$TAG} - - if [ "$URL" != "null" ]; then - DOWNLOAD="$URL" - elif [ "$REPO" != "null" ]; then - GIT_URL="https://$GIT_HOST/$REPO" - - BRANCH=$(jq -r ".branch" <<< "$JSON") - - if [ "$TAG" != "null" ]; then - if [ "$ARTIFACT" != "null" ]; then - DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" - else - DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" - fi - elif [ "$SHA" != "null" ]; then - DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" - else - if [ "$BRANCH" = null ]; then - BRANCH=master - fi - - DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" - fi - else - echo "!! No repo or URL defined for $package" - continue - fi - - # hash parsing - HASH_ALGO=$(jq -r ".hash_algo" <<< "$JSON") - [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 - - HASH=$(jq -r ".hash" <<< "$JSON") - [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue export USE_TAG=true diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 8aa46b3924..3d37d4cbb0 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later @@ -10,42 +10,26 @@ # - UPDATE: update if available # - FORCE: forcefully update -# shellcheck disable=SC2016 -# shellcheck disable=SC2038 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC1091 +. tools/cpm/common.sh for package in "$@" do - JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh - [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && continue - - GIT_HOST=$(jq -r ".git_host" <<< "$JSON") - [ "$GIT_HOST" = null ] && GIT_HOST=github.com - - REPO=$(jq -r ".repo" <<< "$JSON") - TAG=$(jq -r ".tag" <<< "$JSON") - SKIP=$(jq -r ".skip_updates" <<< "$JSON") + SKIP=$(value "skip_updates") [ "$SKIP" = "true" ] && continue - [ "$REPO" = null ] && continue # echo "No repo defined for $package, skipping" && continue - [ "$GIT_HOST" != "github.com" ] && continue # echo "Unsupported host $GIT_HOST for $package, skipping" && continue - [ "$TAG" = null ] && continue # echo "No tag defined for $package, skipping" && continue + [ "$REPO" = null ] && continue + [ "$GIT_HOST" != "github.com" ] && continue # TODO + [ "$TAG" = null ] && continue echo "-- Package $package" - GIT_VERSION=$(jq -r ".git_version" <<< "$JSON") - - echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false - ORIGINAL_TAG="$TAG" - - TAG=${TAG//%VERSION%/$GIT_VERSION} - - ARTIFACT=$(jq -r ".artifact" <<< "$JSON") - ARTIFACT=${ARTIFACT//%VERSION%/$GIT_VERSION} - ARTIFACT=${ARTIFACT//%TAG%/$TAG} - + # TODO(crueter): Support for Forgejo updates w/ forgejo_token # Use gh-cli to avoid ratelimits lmao TAGS=$(gh api --method GET "/repos/$REPO/tags") @@ -58,14 +42,6 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') - if [ "$HAS_REPLACE" = "true" ]; then - # this just extracts the tag prefix - VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) - - # then we strip out the prefix from the new tag, and make that our new git_version - NEW_GIT_VERSION=${LATEST//$VERSION_PREFIX/} - fi - # thanks fmt [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') @@ -73,6 +49,14 @@ do [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + if [ "$HAS_REPLACE" = "true" ]; then + # this just extracts the tag prefix + VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) + + # then we strip out the prefix from the new tag, and make that our new git_version + NEW_GIT_VERSION=$(echo "$LATEST" | sed "s/$VERSION_PREFIX//g") + fi + echo "-- * Version $LATEST available, current is $TAG" export USE_TAG=true diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh new file mode 100755 index 0000000000..5f9b2e42c7 --- /dev/null +++ b/tools/cpm/common.sh @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC2038 +# shellcheck disable=SC2016 +[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') + +export PACKAGES +export LIBS + +value() { + echo "$JSON" | jq -r ".$1" +} \ No newline at end of file diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh new file mode 100755 index 0000000000..b2f7e3c5c9 --- /dev/null +++ b/tools/cpm/download.sh @@ -0,0 +1,103 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: fix hashes if needed + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +download_package() { + FILENAME=$(basename "$DOWNLOAD") + + OUTFILE="$TMP/$FILENAME" + + LOWER_PACKAGE=$(echo "$PACKAGE_NAME" | tr '[:upper:]' '[:lower:]') + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && return + + curl "$DOWNLOAD" -sS -L -o "$OUTFILE" + + ACTUAL_HASH=$("${HASH_ALGO}"sum "$OUTFILE" | cut -d" " -f1) + [ "$ACTUAL_HASH" != "$HASH" ] && echo "!! $FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1 + + mkdir -p "$OUTDIR" + + PREVDIR="$PWD" + cd "$OUTDIR" + + case "$FILENAME" in + (*.7z) + 7z x "$OUTFILE" > /dev/null + ;; + (*.tar*) + tar xf "$OUTFILE" > /dev/null + ;; + (*.zip) + unzip "$OUTFILE" > /dev/null + ;; + esac + + # basically if only one real item exists at the top we just move everything from there + # since github and some vendors hate me + DIRS=$(find . -maxdepth 1 -type d -o -type f) + + # thanks gnu + if [ "$(echo "$DIRS" | wc -l)" -eq 2 ]; then + SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") + mv "$SUBDIR"/* . + mv "$SUBDIR"/.* . 2>/dev/null || true + rmdir "$SUBDIR" + fi + + if echo "$JSON" | grep -e "patches" > /dev/null; then + PATCHES=$(echo "$JSON" | jq -r '.patches | join(" ")') + for patch in $PATCHES; do + # shellcheck disable=SC2154 + patch --binary -p1 < "$ROOTDIR/.patch/$package/$patch" + done + fi + + cd "$PREVDIR" +} + +ci_package() { + [ "$REPO" = null ] && echo "-- ! No repo defined" && return + + echo "-- CI package $PACKAGE_NAME" + + for platform in windows-amd64 windows-arm64 android solaris-amd64 freebsd-amd64 linux-amd64 linux-aarch64 macos-universal; do + echo "-- * platform $platform" + + case $DISABLED in + (*"$platform"*) + echo "-- * -- disabled" + continue + ;; + (*) ;; + esac + + FILENAME="${NAME}-${platform}-${VERSION}.${EXT}" + DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}" + KEY=$platform + + LOWER_PACKAGE=$(echo "$PACKAGE_NAME" | tr '[:upper:]' '[:lower:]') + OUTDIR="${CPM_SOURCE_CACHE}/${LOWER_PACKAGE}/${KEY}" + [ -d "$OUTDIR" ] && continue + + HASH_ALGO=$(value "hash_algo") + [ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + + HASH=$(curl "$HASH_URL" -sS -q -L -o -) + + download_package + done +} diff --git a/tools/cpm/fetch-all.sh b/tools/cpm/fetch-all.sh new file mode 100755 index 0000000000..16c898023f --- /dev/null +++ b/tools/cpm/fetch-all.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +tools/cpm/fetch.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh new file mode 100755 index 0000000000..26a397d6ae --- /dev/null +++ b/tools/cpm/fetch.sh @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +[ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm + +mkdir -p "$CPM_SOURCE_CACHE" + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC1091 +. tools/cpm/download.sh + +# shellcheck disable=SC2034 +ROOTDIR="$PWD" + +TMP=$(mktemp -d) + +# shellcheck disable=SC2034 +for package in "$@" +do + export package + # shellcheck disable=SC1091 + . tools/cpm/package.sh + + if [ "$CI" = "true" ]; then + ci_package + else + echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + download_package + fi +done + +rm -rf "$TMP" \ No newline at end of file diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index e636c402b4..7af66dffa3 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -6,6 +6,6 @@ FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do - jq --indent 4 < $file > $file.new - mv $file.new $file + jq --indent 4 < "$file" > "$file".new + mv "$file".new "$file" done diff --git a/tools/cpm/hash.sh b/tools/cpm/hash.sh index 0c653e75c2..27061bd9a4 100755 --- a/tools/cpm/hash.sh +++ b/tools/cpm/hash.sh @@ -11,7 +11,7 @@ REPO="$1" GIT_URL="https://$GIT_HOST/$REPO" if [ "$USE_TAG" = "true" ]; then - if [ -z "$ARTIFACT" ]; then + if [ -z "$ARTIFACT" ] || [ "$ARTIFACT" = "null" ]; then URL="${GIT_URL}/archive/refs/tags/$2.tar.gz" else URL="${GIT_URL}/releases/download/$2/${ARTIFACT}" diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh new file mode 100755 index 0000000000..89e01089b0 --- /dev/null +++ b/tools/cpm/package.sh @@ -0,0 +1,225 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# env vars: +# - UPDATE: fix hashes if needed + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +[ -z "$package" ] && echo "Package was not specified" && exit 0 + +# shellcheck disable=SC2153 +JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") + +[ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 + +# unset stuff +unset PACKAGE_NAME +unset REPO +unset CI +unset GIT_HOST +unset EXT +unset NAME +unset DISABLED +unset TAG +unset ARTIFACT +unset SHA +unset VERSION +unset GIT_VERSION +unset DOWNLOAD +unset URL +unset KEY +unset HASH + +unset ORIGINAL_TAG +unset HAS_REPLACE +unset VERSION_REPLACE + +unset HASH_URL +unset HASH_SUFFIX +unset HASH_ALGO + +######## +# Meta # +######## + +REPO=$(value "repo") +CI=$(value "ci") + +PACKAGE_NAME=$(value "package") +[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" + +GIT_HOST=$(value "git_host") +[ "$GIT_HOST" = null ] && GIT_HOST=github.com + +export PACKAGE_NAME +export REPO +export CI +export GIT_HOST + +###################### +# CI Package Parsing # +###################### + +VERSION=$(value "version") + +if [ "$CI" = "true" ]; then + EXT=$(value "extension") + [ "$EXT" = null ] && EXT="tar.zst" + + NAME=$(value "name") + DISABLED=$(echo "$JSON" | jq -j '.disabled_platforms') + + [ "$NAME" = null ] && NAME="$PACKAGE" + + export EXT + export NAME + export DISABLED + export VERSION + + # slight annoyance + TAG=null + ARTIFACT=null + SHA=null + VERSION=null + GIT_VERSION=null + DOWNLOAD=null + URL=null + KEY=null + HASH=null + ORIGINAL_TAG=null + HAS_REPLACE=null + VERSION_REPLACE=null + HASH_URL=null + HASH_SUFFIX=null + HASH_ALGO=null + + return 0 +fi + +############## +# Versioning # +############## + +TAG=$(value "tag") +ARTIFACT=$(value "artifact") +SHA=$(value "sha") +GIT_VERSION=$(value "git_version") + +[ "$GIT_VERSION" = null ] && GIT_VERSION="$VERSION" + +if [ "$GIT_VERSION" != null ]; then + VERSION_REPLACE="$GIT_VERSION" +else + VERSION_REPLACE="$VERSION" +fi + +echo "$TAG" | grep -e "%VERSION%" > /dev/null && HAS_REPLACE=true || HAS_REPLACE=false +ORIGINAL_TAG="$TAG" + +TAG=$(echo "$TAG" | sed "s/%VERSION%/$VERSION_REPLACE/g") +ARTIFACT=$(echo "$ARTIFACT" | sed "s/%VERSION%/$VERSION_REPLACE/g") +ARTIFACT=$(echo "$ARTIFACT" | sed "s/%TAG%/$TAG/g") + +export TAG +export ARTIFACT +export SHA +export VERSION +export GIT_VERSION +export ORIGINAL_TAG +export HAS_REPLACE +export VERSION_REPLACE + +############### +# URL Parsing # +############### + +URL=$(value "url") + +if [ "$URL" != "null" ]; then + DOWNLOAD="$URL" +elif [ "$REPO" != "null" ]; then + GIT_URL="https://$GIT_HOST/$REPO" + + BRANCH=$(value "branch") + + if [ "$TAG" != "null" ]; then + if [ "$ARTIFACT" != "null" ]; then + DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}" + else + DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz" + fi + elif [ "$SHA" != "null" ]; then + DOWNLOAD="${GIT_URL}/archive/${SHA}.zip" + else + if [ "$BRANCH" = null ]; then + BRANCH=master + fi + + DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" + fi +else + echo "!! No repo or URL defined for $package" + exit 1 +fi + +export DOWNLOAD +export URL + +############### +# Key Parsing # +############### + +KEY=$(value "key") + +if [ "$KEY" = null ]; then + if [ "$SHA" != null ]; then + KEY=$(echo "$SHA" | cut -c1-4) + elif [ "$GIT_VERSION" != null ]; then + KEY="$GIT_VERSION" + elif [ "$TAG" != null ]; then + KEY="$TAG" + elif [ "$VERSION" != null ]; then + KEY="$VERSION" + else + echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + exit 1 + fi +fi + +export KEY + +################ +# Hash Parsing # +################ + +HASH_ALGO=$(value "hash_algo") +[ "$HASH_ALGO" = null ] && HASH_ALGO=sha512 + +HASH=$(value "hash") + +if [ "$HASH" = null ]; then + HASH_SUFFIX="${HASH_ALGO}sum" + HASH_URL=$(value "hash_url") + + if [ "$HASH_URL" = null ]; then + HASH_URL="${DOWNLOAD}.${HASH_SUFFIX}" + fi + + HASH=$(curl "$HASH_URL" -Ss -L -o -) +else + HASH_URL=null + HASH_SUFFIX=null +fi + +export HASH_URL +export HASH_SUFFIX +export HASH +export HASH_ALGO +export JSON \ No newline at end of file diff --git a/tools/cpm/url-hash.sh b/tools/cpm/url-hash.sh index 444b14b174..c911dacb37 100755 --- a/tools/cpm/url-hash.sh +++ b/tools/cpm/url-hash.sh @@ -3,5 +3,5 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SUM=$(wget -q $1 -O - | sha512sum) +SUM=$(wget -q "$1" -O - | sha512sum) echo "$SUM" | cut -d " " -f1 diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index af12deb1b4..f1ca316a3e 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -9,4 +9,4 @@ JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" -echo $JSON \ No newline at end of file +echo "$JSON" \ No newline at end of file From 9cf7cd6e5063850a7404160415101a257ffc9c8a Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:40:10 -0400 Subject: [PATCH 27/40] [tools] docs Signed-off-by: crueter --- tools/README.md | 21 ++ tools/clang-format.sh | 5 +- tools/cpm/README.md | 58 ++++++ ...{check-all-hashes.sh => check-hash-all.sh} | 7 +- tools/cpm/check-hash.sh | 3 - ...ck-all-updates.sh => check-updates-all.sh} | 7 +- tools/cpm/check-updates.sh | 4 +- tools/cpm/common.sh | 3 + tools/cpm/download.sh | 3 - tools/cpm/fetch-all.sh | 3 - tools/cpm/fetch.sh | 3 - tools/cpm/format.sh | 4 + tools/cpm/package.sh | 68 +++---- tools/cpm/which.sh | 4 + tools/dtrace-tool.sh | 47 +++-- tools/llvmpipe-run.sh | 192 +++++++++++++++++- tools/optimize-assets.sh | 7 +- tools/reset-submodules.sh | 8 - tools/shellcheck.sh | 11 + tools/update-cpm.sh | 7 +- tools/update-icons.sh | 5 +- 21 files changed, 370 insertions(+), 100 deletions(-) create mode 100644 tools/README.md create mode 100644 tools/cpm/README.md rename tools/cpm/{check-all-hashes.sh => check-hash-all.sh} (50%) rename tools/cpm/{check-all-updates.sh => check-updates-all.sh} (50%) delete mode 100755 tools/reset-submodules.sh create mode 100755 tools/shellcheck.sh diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..9abd96175b --- /dev/null +++ b/tools/README.md @@ -0,0 +1,21 @@ +# Tools + +Tools for Eden and other subprojects. + +## Third-Party + +- [CPMUtil Scripts](./cpm) + +## Eden + +- `shellcheck.sh`: Ensure POSIX compliance (and syntax sanity) for all tools in this directory and subdirectories. +- `llvmpipe-run.sh`: Sets environment variables needed to run any command (or Eden) with llvmpipe. +- `optimize-assets.sh`: Optimize PNG assets with OptiPng. +- `update-cpm.sh`: Updates CPM.cmake to the latest version. +- `update-icons.sh`: Rebuild all icons (macOS, Windows, bitmaps) based on the master SVG file (`dist/dev.eden_emu.eden.svg`) + * Also optimizes the master SVG + * Requires: `png2icns` (libicns), ImageMagick, [`svgo`](https://github.com/svg/svgo) +- `dtrace-tool.sh` +- `lanczos_gen.c` +- `clang-format.sh`: Runs `clang-format` on the entire codebase. + * Requires: clang diff --git a/tools/clang-format.sh b/tools/clang-format.sh index 77c3c847ad..2deb0a3ade 100755 --- a/tools/clang-format.sh +++ b/tools/clang-format.sh @@ -1,3 +1,6 @@ #! /bin/sh -exec find src -iname *.h -o -iname *.cpp | xargs clang-format-15 -i -style=file:src/.clang-format +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +exec find src -iname "*.h" -o -iname "*.cpp" | xargs clang-format -i -style=file:src/.clang-format diff --git a/tools/cpm/README.md b/tools/cpm/README.md new file mode 100644 index 0000000000..b66fe09a25 --- /dev/null +++ b/tools/cpm/README.md @@ -0,0 +1,58 @@ +# CPMUtil Tools + +These are supplemental shell scripts for CPMUtil aiming to ease maintenance burden for sanity checking, updates, prefetching, formatting, and standard operations done by these shell scripts, all in one common place. + +All scripts are POSIX-compliant. + +## Meta + +These scripts are generally reserved for internal use. + +- `common.sh`: Grabs all available cpmfiles and aggregates them together. + * Outputs: + - `PACKAGES`: The aggregated cpmfile + - `LIBS`: The list of individual libraries contained within each cpmfile + - `value`: A function that grabs a key from the `JSON` variable (typically the package key) +- `download.sh`: Utility script to handle downloading of regular and CI packages. + * Generally only used by the fetch scripts. +- `package.sh`: The actual package parser. + * Inputs: + - `package`: The package key + * Outputs: + - Basically everything. You're best off reading the code rather than me poorly explaining it. +- `which.sh`: Find which cpmfile a package is located in. + * Inputs: + - The package key + +## Simple Utilities + +These scripts don't really have any functionality, they just help you out a bit yknow? + +- `format.sh`: Format all cpmfiles (4-space indent is enforced) + * In the future, these scripts will have options for spacing +- `hash.sh`: Determine the hash of a specific package. + * Inputs: + - The repository (e.g. fmtlib/fmt) + - The sha or tag (e.g. v1.0.1) + - `GIT_HOST`: What git host to use (default github.com) + - `USE_TAG`: Set to "true" if the second argument is a tag instead of a sha + - `ARTIFACT`: The artifact to download, if using a tag. Set to null or empty to use the tag source archive instead + * Output: the SHA512 sum of the package +- `url-hash.sh`: Determine the hash of a URL + * Input: the URL + * Output: the SHA512 sum of the URL + +## Functional Utilities + +These modify the CPM cache or cpmfiles. Each allows you to input all the packages to act on, as well as a `-all.sh` that acts upon all available packages. + +For the update and hash scripts, set `UPDATE=true` to update the cpmfile with the new version or hash. Beware: if the hash is `cf83e1357...` that means you got a 404 error! + +- `fetch.sh`: Prefetch a package according to its cpmfile definition + * Packages are fetched to the `.cache/cpm` directory by default, following the CPMUtil default. +- `check-updates.sh`: Check a package for available updates + * This only applies to packages that utilize tags. + * If the tag is a format string, the `git_version` is acted upon instead. + * Setting `FORCE=true` will forcefully update every package and its hash, even if they are on the latest version (`UPDATE` must also be true) +- `check-hashes.sh`: Check a package's hash + * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. \ No newline at end of file diff --git a/tools/cpm/check-all-hashes.sh b/tools/cpm/check-hash-all.sh similarity index 50% rename from tools/cpm/check-all-hashes.sh rename to tools/cpm/check-hash-all.sh index 730288b4bf..fd8c270392 100755 --- a/tools/cpm/check-all-hashes.sh +++ b/tools/cpm/check-hash-all.sh @@ -1,15 +1,10 @@ #!/bin/bash -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SCRIPT_DIR=$(dirname -- "$0") - # shellcheck disable=SC1091 . tools/cpm/common.sh # shellcheck disable=SC2086 -"$SCRIPT_DIR"/check-hash.sh $LIBS \ No newline at end of file +tools/cpm/check-hash.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index e1081f67ba..176e99d9b5 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/check-all-updates.sh b/tools/cpm/check-updates-all.sh similarity index 50% rename from tools/cpm/check-all-updates.sh rename to tools/cpm/check-updates-all.sh index 09f1ec08ea..a6eda58bac 100755 --- a/tools/cpm/check-all-updates.sh +++ b/tools/cpm/check-updates-all.sh @@ -1,15 +1,10 @@ #!/bin/bash -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -SCRIPT_DIR=$(dirname -- "$0") - # shellcheck disable=SC1091 . tools/cpm/common.sh # shellcheck disable=SC2086 -"$SCRIPT_DIR"/check-updates.sh $LIBS \ No newline at end of file +tools/cpm/check-updates.sh $LIBS \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 3d37d4cbb0..2e752b26c5 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -25,6 +25,7 @@ do [ "$REPO" = null ] && continue [ "$GIT_HOST" != "github.com" ] && continue # TODO + # shellcheck disable=SC2153 [ "$TAG" = null ] && continue echo "-- Package $package" @@ -34,6 +35,7 @@ do TAGS=$(gh api --method GET "/repos/$REPO/tags") # filter out some commonly known annoyances + # TODO add more TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') @@ -42,7 +44,7 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') - # thanks fmt + # Add package-specific overrides here, e.g. here for fmt: [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') LATEST=$(echo "$TAGS" | jq -r '.[0].name') diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index 5f9b2e42c7..8c67d40436 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -9,6 +9,9 @@ # shellcheck disable=SC2038 # shellcheck disable=SC2016 [ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') + +# For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) +# Always include . LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') export PACKAGES diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh index b2f7e3c5c9..d6c90b11fa 100755 --- a/tools/cpm/download.sh +++ b/tools/cpm/download.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/fetch-all.sh b/tools/cpm/fetch-all.sh index 16c898023f..5c41b5d080 100755 --- a/tools/cpm/fetch-all.sh +++ b/tools/cpm/fetch-all.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh index 26a397d6ae..e403f86818 100755 --- a/tools/cpm/fetch.sh +++ b/tools/cpm/fetch.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 7af66dffa3..45fd787da3 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,8 +1,12 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later +# like common.sh, change for your directories FILES=$(find . src -maxdepth 3 -name cpmfile.json) for file in $FILES; do diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh index 89e01089b0..004111ad7c 100755 --- a/tools/cpm/package.sh +++ b/tools/cpm/package.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later @@ -20,30 +17,28 @@ JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") [ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 # unset stuff -unset PACKAGE_NAME -unset REPO -unset CI -unset GIT_HOST -unset EXT -unset NAME -unset DISABLED -unset TAG -unset ARTIFACT -unset SHA -unset VERSION -unset GIT_VERSION -unset DOWNLOAD -unset URL -unset KEY -unset HASH - -unset ORIGINAL_TAG -unset HAS_REPLACE -unset VERSION_REPLACE - -unset HASH_URL -unset HASH_SUFFIX -unset HASH_ALGO +export PACKAGE_NAME="null" +export REPO="null" +export CI="null" +export GIT_HOST="null" +export EXT="null" +export NAME="null" +export DISABLED="null" +export TAG="null" +export ARTIFACT="null" +export SHA="null" +export VERSION="null" +export GIT_VERSION="null" +export DOWNLOAD="null" +export URL="null" +export KEY="null" +export HASH="null" +export ORIGINAL_TAG="null" +export HAS_REPLACE="null" +export VERSION_REPLACE="null" +export HASH_URL="null" +export HASH_SUFFIX="null" +export HASH_ALGO="null" ######## # Meta # @@ -76,30 +71,13 @@ if [ "$CI" = "true" ]; then NAME=$(value "name") DISABLED=$(echo "$JSON" | jq -j '.disabled_platforms') - [ "$NAME" = null ] && NAME="$PACKAGE" + [ "$NAME" = null ] && NAME="$PACKAGE_NAME" export EXT export NAME export DISABLED export VERSION - # slight annoyance - TAG=null - ARTIFACT=null - SHA=null - VERSION=null - GIT_VERSION=null - DOWNLOAD=null - URL=null - KEY=null - HASH=null - ORIGINAL_TAG=null - HAS_REPLACE=null - VERSION_REPLACE=null - HASH_URL=null - HASH_SUFFIX=null - HASH_ALGO=null - return 0 fi diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index f1ca316a3e..f207700571 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,10 +1,14 @@ #!/bin/sh -e +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in +# like common.sh, change for your directories JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" diff --git a/tools/dtrace-tool.sh b/tools/dtrace-tool.sh index a8cc4c7bad..4a75848fcd 100755 --- a/tools/dtrace-tool.sh +++ b/tools/dtrace-tool.sh @@ -1,42 +1,59 @@ #!/usr/local/bin/bash -ex + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # Basic script to run dtrace sampling over the program (requires Flamegraph) # Usage is either running as: ./dtrace-tool.sh pid (then input the pid of the process) # Or just run directly with: ./dtrace-tool.sh + FLAMEGRAPH_DIR=".." -function fail { - printf '%s\n' "$1" >&2 - exit "${2-1}" +fail() { + printf '%s\n' "$1" >&2 + exit "${2-1}" } + [ -f $FLAMEGRAPH_DIR/FlameGraph/stackcollapse.pl ] || fail 'Where is flamegraph?' #[ which dtrace ] || fail 'Needs DTrace installed' -read -p "Sampling Hz [800]: " TRACE_CFG_HZ + +read -r "Sampling Hz [800]: " TRACE_CFG_HZ if [ -z "${TRACE_CFG_HZ}" ]; then - TRACE_CFG_HZ=800 + TRACE_CFG_HZ=800 fi -read -p "Sampling time [5] sec: " TRACE_CFG_TIME + +read -r "Sampling time [5] sec: " TRACE_CFG_TIME if [ -z "${TRACE_CFG_TIME}" ]; then - TRACE_CFG_TIME=5 + TRACE_CFG_TIME=5 fi + TRACE_FILE=dtrace-out.user_stacks TRACE_FOLD=dtrace-out.fold TRACE_SVG=dtrace-out.svg ps -if [[ $1 = 'pid' ]]; then - read -p "PID: " TRACE_CFG_PID - sudo echo 'Sudo!' + +if [ "$1" = 'pid' ]; then + read -r "PID: " TRACE_CFG_PID + sudo echo 'Sudo!' else - [[ -f $1 && $1 ]] || fail 'Usage: ./tools/dtrace-profile.sh ' - echo "Executing: '$@'" - sudo echo 'Sudo!' - "$@" & - TRACE_CFG_PID=$! + if [ -f "$1" ] && [ "$1" ]; then + fail 'Usage: ./tools/dtrace-profile.sh ' + fi + + printf "Executing: " + echo "$@" + sudo echo 'Sudo!' + "$@" & + TRACE_CFG_PID=$! fi + TRACE_PROBE="profile-${TRACE_CFG_HZ} /pid == ${TRACE_CFG_PID} && arg1/ { @[ustack()] = count(); } tick-${TRACE_CFG_TIME}s { exit(0); }" + rm -- $TRACE_SVG || echo 'Skip' + sudo dtrace -x ustackframes=100 -Z -n "$TRACE_PROBE" -o $TRACE_FILE 2>/dev/null || exit + perl $FLAMEGRAPH_DIR/FlameGraph/stackcollapse.pl $TRACE_FILE > $TRACE_FOLD || exit perl $FLAMEGRAPH_DIR/FlameGraph/flamegraph.pl $TRACE_FOLD > $TRACE_SVG || exit + sudo chmod 0666 $TRACE_FILE rm -- $TRACE_FILE $TRACE_FOLD \ No newline at end of file diff --git a/tools/llvmpipe-run.sh b/tools/llvmpipe-run.sh index 8f53d691c2..c3a5a85d41 100755 --- a/tools/llvmpipe-run.sh +++ b/tools/llvmpipe-run.sh @@ -1,15 +1,205 @@ #!/bin/sh # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # This script basically allows you to "dirtily" use llvmpipe in any configuration # llvmpipe will of course, run at negative mach-1 speeds. However this is mainly useful to test that mesa # is properly working on extraneous systems (such as Managarm). This mainly only works with MESA >22.0.0 # Use as follows: ./llvmpipe-run.sh + export MESA_GL_VERSION_OVERRIDE=4.6 export MESA_GLSL_VERSION_OVERRIDE=460 export MESA_EXTENSION_MAX_YEAR=2025 export MESA_DEBUG=1 export MESA_VK_VERSION_OVERRIDE=1.3 export LIBGL_ALWAYS_SOFTWARE=1 -export MESA_EXTENSION_OVERRIDE="GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2 GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64 GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2 GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64 GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_ANDROID_extension_pack_es31a GL_EXT_EGL_image_external_wrap_modes GL_EXT_base_instance GL_EXT_blend_func_extended GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture GL_EXT_clip_control GL_EXT_clip_cull_distance GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_debug_label GL_EXT_depth_clamp GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_draw_transform_feedback GL_EXT_float_blend GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_indirect GL_EXT_multisample_compatibility GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box GL_EXT_raster_multisample GL_EXT_read_format_bgra GL_EXT_render_snorm GL_EXT_robustness GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_non_constant_global_initializers GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sparse_texture GL_EXT_sparse_texture2 GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_bptc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_format_BGRA8888 GL_EXT_texture_mirror_clamp_to_edge GL_EXT_texture_norm16 GL_EXT_texture_query_lod GL_EXT_texture_rg GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_storage GL_EXT_texture_view GL_EXT_unpack_subimage GL_EXT_window_rectangles GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_clip_space_w_scaling GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers GL_NV_draw_instanced GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_attrib_location GL_NV_fbo_color_attachments GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color GL_NV_fragment_shader_interlock GL_NV_framebuffer_blit GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB GL_NV_geometry_shader_passthrough GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_instanced_arrays GL_NV_internalformat_sample_query GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_non_square_matrices GL_NV_occlusion_query_samples GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object GL_NV_polygon_mode GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_sRGB_formats GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_fp16_vector GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shadow_samplers_array GL_NV_shadow_samplers_cube GL_NV_stereo_view_rendering GL_NV_texture_array GL_NV_texture_barrier GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update GL_NV_timeline_semaphore GL_NV_timer_query GL_NV_viewport_array GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_OES_compressed_ETC1_RGB8_texture GL_OES_copy_image GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_get_program_binary GL_OES_gpu_shader5 GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_primitive_bounding_box GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture" + +# This was automated via a script so I might have missed some +ext="GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index" +ext="$ext GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays" +ext="$ext GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture" +ext="$ext GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_compute_variable_group_size" +ext="$ext GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output" +ext="$ext GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers" +ext="$ext GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts" +ext="$ext GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport" +ext="$ext GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments" +ext="$ext GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv" +ext="$ext GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging" +ext="$ext GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata" +ext="$ext GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture" +ext="$ext GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object" +ext="$ext GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query" +ext="$ext GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations" +ext="$ext GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects" +ext="$ext GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock" +ext="$ext GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects" +ext="$ext GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples" +ext="$ext GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_100 GL_ARB_shading_language_420pack" +ext="$ext GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2" +ext="$ext GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier" +ext="$ext GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression" +ext="$ext GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add" +ext="$ext GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_filter_minmax" +ext="$ext GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample" +ext="$ext GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg" +ext="$ext GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle" +ext="$ext GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced" +ext="$ext GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra" +ext="$ext GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object" +ext="$ext GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev" +ext="$ext GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once" +ext="$ext GL_EXTX_framebuffer_mixed_formats GL_EXT_Cg_shader GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform" +ext="$ext GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax" +ext="$ext GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_depth_bounds_test GL_EXT_direct_state_access" +ext="$ext GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit" +ext="$ext GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object" +ext="$ext GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4" +ext="$ext GL_EXT_import_sync_object GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays" +ext="$ext GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil" +ext="$ext GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters" +ext="$ext GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample" +ext="$ext GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd" +ext="$ext GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted" +ext="$ext GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2" +ext="$ext GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array" +ext="$ext GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc" +ext="$ext GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map" +ext="$ext GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3" +ext="$ext GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_integer" +ext="$ext GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object" +ext="$ext GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod" +ext="$ext GL_EXT_texture_shared_exponent GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query" +ext="$ext GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit" +ext="$ext GL_EXT_window_rectangles GL_EXT_x11_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat" +ext="$ext GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control" +ext="$ext GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior" +ext="$ext GL_KHR_robustness GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NVX_blend_equation_advanced_multi_draw_buffers" +ext="$ext GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NVX_nvenc_interop GL_NVX_progress_fence" +ext="$ext GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_alpha_to_coverage_dither_control" +ext="$ext GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture" +ext="$ext GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor" +ext="$ext GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5" +ext="$ext GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate" +ext="$ext GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_depth_to_color GL_NV_copy_image" +ext="$ext GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image" +ext="$ext GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle" +ext="$ext GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program" +ext="$ext GL_NV_fragment_program2 GL_NV_fragment_program_option GL_NV_fragment_shader_interlock" +ext="$ext GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4" +ext="$ext GL_NV_geometry_shader_passthrough GL_NV_gpu_multicast GL_NV_gpu_program4 GL_NV_gpu_program4_1" +ext="$ext GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_program_multiview" +ext="$ext GL_NV_gpu_shader5 GL_NV_half_float GL_NV_internalformat_sample_query GL_NV_light_max_exponent" +ext="$ext GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_multisample_coverage GL_NV_multisample_filter_hint" +ext="$ext GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2" +ext="$ext GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite" +ext="$ext GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners" +ext="$ext GL_NV_register_combiners2 GL_NV_robustness_video_memory_purge GL_NV_sample_locations" +ext="$ext GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_counters GL_NV_shader_atomic_float" +ext="$ext GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64" +ext="$ext GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned" +ext="$ext GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_NV_stereo_view_rendering GL_NV_texgen_reflection" +ext="$ext GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample" +ext="$ext GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2" +ext="$ext GL_NV_texture_shader3 GL_NV_timeline_semaphore GL_NV_transform_feedback GL_NV_transform_feedback2" +ext="$ext GL_NV_uniform_buffer_std430_layout GL_NV_uniform_buffer_unified_memory GL_NV_vdpau_interop" +ext="$ext GL_NV_vdpau_interop2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit" +ext="$ext GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2" +ext="$ext GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle" +ext="$ext GL_OVR_multiview GL_OVR_multiview2 GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_lod" +ext="$ext GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_AMD_multi_draw_indirect" +ext="$ext GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index" +ext="$ext GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_ES3_compatibility" +ext="$ext GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended" +ext="$ext GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control" +ext="$ext GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage" +ext="$ext GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted" +ext="$ext GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance" +ext="$ext GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture" +ext="$ext GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend" +ext="$ext GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts" +ext="$ext GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions" +ext="$ext GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow" +ext="$ext GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments" +ext="$ext GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary" +ext="$ext GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64" +ext="$ext GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging" +ext="$ext GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2" +ext="$ext GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind" +ext="$ext GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query" +ext="$ext GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query" +ext="$ext GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp" +ext="$ext GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object" +ext="$ext GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading" +ext="$ext GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture" +ext="$ext GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters" +ext="$ext GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters" +ext="$ext GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects" +ext="$ext GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine" +ext="$ext GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shader_viewport_layer_array" +ext="$ext GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include" +ext="$ext GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture" +ext="$ext GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing" +ext="$ext GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp" +ext="$ext GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range" +ext="$ext GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc" +ext="$ext GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine" +ext="$ext GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic" +ext="$ext GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge" +ext="$ext GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two" +ext="$ext GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg" +ext="$ext GL_ANDROID_extension_pack_es31a GL_EXT_EGL_image_external_wrap_modes GL_EXT_base_instance" +ext="$ext GL_EXT_blend_func_extended GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture" +ext="$ext GL_EXT_clip_control GL_EXT_clip_cull_distance GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float" +ext="$ext GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_debug_label" +ext="$ext GL_EXT_depth_clamp GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed" +ext="$ext GL_EXT_draw_elements_base_vertex GL_EXT_draw_transform_feedback GL_EXT_float_blend GL_EXT_frag_depth" +ext="$ext GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range" +ext="$ext GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_indirect GL_EXT_multisample_compatibility" +ext="$ext GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_EXT_multiview_texture_multisample" +ext="$ext GL_EXT_multiview_timer_query GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp" +ext="$ext GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box GL_EXT_raster_multisample GL_EXT_read_format_bgra" +ext="$ext GL_EXT_render_snorm GL_EXT_robustness GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_semaphore" +ext="$ext GL_EXT_semaphore_fd GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions" +ext="$ext GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_non_constant_global_initializers" +ext="$ext GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sparse_texture GL_EXT_sparse_texture2" +ext="$ext GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer" +ext="$ext GL_EXT_texture_compression_bptc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc" +ext="$ext GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic" +ext="$ext GL_EXT_texture_filter_minmax GL_EXT_texture_format_BGRA8888 GL_EXT_texture_mirror_clamp_to_edge" +ext="$ext GL_EXT_texture_norm16 GL_EXT_texture_query_lod GL_EXT_texture_rg GL_EXT_texture_sRGB_R8" +ext="$ext GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod GL_EXT_texture_storage GL_EXT_texture_view" +ext="$ext GL_EXT_unpack_subimage GL_EXT_window_rectangles GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent" +ext="$ext GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile" +ext="$ext GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_hdr" +ext="$ext GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_NVX_blend_equation_advanced_multi_draw_buffers" +ext="$ext GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent" +ext="$ext GL_NV_blend_minmax_factor GL_NV_clip_space_w_scaling GL_NV_conditional_render GL_NV_conservative_raster" +ext="$ext GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers" +ext="$ext GL_NV_draw_instanced GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_attrib_location" +ext="$ext GL_NV_fbo_color_attachments GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color GL_NV_fragment_shader_interlock" +ext="$ext GL_NV_framebuffer_blit GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB" +ext="$ext GL_NV_geometry_shader_passthrough GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_instanced_arrays" +ext="$ext GL_NV_internalformat_sample_query GL_NV_memory_attachment GL_NV_memory_object_sparse GL_NV_non_square_matrices" +ext="$ext GL_NV_occlusion_query_samples GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear" +ext="$ext GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object GL_NV_polygon_mode" +ext="$ext GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_sRGB_formats" +ext="$ext GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_shader_atomic_fp16_vector" +ext="$ext GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shadow_samplers_array" +ext="$ext GL_NV_shadow_samplers_cube GL_NV_stereo_view_rendering GL_NV_texture_array GL_NV_texture_barrier" +ext="$ext GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update" +ext="$ext GL_NV_timeline_semaphore GL_NV_timer_query GL_NV_viewport_array GL_NV_viewport_array2 GL_NV_viewport_swizzle" +ext="$ext GL_OES_compressed_ETC1_RGB8_texture GL_OES_copy_image GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture" +ext="$ext GL_OES_depth_texture_cube_map GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_element_index_uint" +ext="$ext GL_OES_fbo_render_mipmap GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_get_program_binary" +ext="$ext GL_OES_gpu_shader5 GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_primitive_bounding_box" +ext="$ext GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic" +ext="$ext GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_tessellation_point_size" +ext="$ext GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array" +ext="$ext GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear" +ext="$ext GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view" +ext="$ext GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2" +ext="$ext GL_OVR_multiview_multisampled_render_to_texture" + +export MESA_EXTENSION_OVERRIDE="$ext" "$@" diff --git a/tools/optimize-assets.sh b/tools/optimize-assets.sh index 07facc8fa0..b7d52330f2 100755 --- a/tools/optimize-assets.sh +++ b/tools/optimize-assets.sh @@ -1,6 +1,9 @@ #!/bin/sh -e + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later -# Optimizes assets of eden (requires OptiPng) + +# Optimizes assets of Eden (requires OptiPng) + which optipng || exit -find . -type f -name *.png -exec optipng -o7 {} \; +find . -type f -name "*.png" -exec optipng -o7 {} \; diff --git a/tools/reset-submodules.sh b/tools/reset-submodules.sh deleted file mode 100755 index 6fdfe0bcdb..0000000000 --- a/tools/reset-submodules.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -ex - -# SPDX-FileCopyrightText: 2024 yuzu Emulator Project -# SPDX-License-Identifier: MIT - -git submodule sync -git submodule foreach --recursive git reset --hard -git submodule update --init --recursive diff --git a/tools/shellcheck.sh b/tools/shellcheck.sh new file mode 100755 index 0000000000..719c717cf2 --- /dev/null +++ b/tools/shellcheck.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# fd is slightly faster on NVMe (the syntax sux though) +if command -v fd > /dev/null; then + fd . tools -esh -x shellcheck +else + find tools -name "*.sh" -exec shellcheck -s sh {} \; +fi \ No newline at end of file diff --git a/tools/update-cpm.sh b/tools/update-cpm.sh index 30e400209d..8bd8df2b83 100755 --- a/tools/update-cpm.sh +++ b/tools/update-cpm.sh @@ -1,3 +1,6 @@ -#!/bin/sh +#!/bin/sh -e -wget -O CMakeModules/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +wget -O CMakeModules/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake diff --git a/tools/update-icons.sh b/tools/update-icons.sh index da54156665..a2c1ae8ebf 100755 --- a/tools/update-icons.sh +++ b/tools/update-icons.sh @@ -1,8 +1,11 @@ #!/bin/sh -e + # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later + # Updates main icons for eden -which png2icns || [ which yay && yay libicns ] || exit + +which png2icns || (which yay && yay libicns) || exit which magick || exit export EDEN_SVG_ICO="dist/dev.eden_emu.eden.svg" From c21686ccd42fe9842b76e82a5fd73eb597c18e83 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:44:47 -0400 Subject: [PATCH 28/40] add tools to root readme Signed-off-by: crueter --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1a4f017576..c78490e6d4 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ Alternatively, if you wish to add translations, go to the [Eden project on Trans See the [General Build Guide](docs/Build.md) +For information on provided development tooling, see the [Tools directory](./tools) + ## Download You can download the latest releases from [here](https://github.com/eden-emulator/Releases/releases). From b88f497a109705fd4bd1a122d68716192769539b Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 05:55:01 -0400 Subject: [PATCH 29/40] more doc Signed-off-by: crueter --- tools/cpm/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/cpm/README.md b/tools/cpm/README.md index b66fe09a25..61c90cb521 100644 --- a/tools/cpm/README.md +++ b/tools/cpm/README.md @@ -50,9 +50,17 @@ For the update and hash scripts, set `UPDATE=true` to update the cpmfile with th - `fetch.sh`: Prefetch a package according to its cpmfile definition * Packages are fetched to the `.cache/cpm` directory by default, following the CPMUtil default. + * Already-fetched packages will be skipped. You can invalidate the entire cache with `rm -rf .cache/cpm`, or invalidate a specific package with e.g. `rm -rf .cache/cpm/packagename` to force a refetch. + * In the future, a force option will be added + * Note that full prefetching will take a long time depending on your internet, the amount of dependencies, and the size of each dependency. - `check-updates.sh`: Check a package for available updates * This only applies to packages that utilize tags. * If the tag is a format string, the `git_version` is acted upon instead. * Setting `FORCE=true` will forcefully update every package and its hash, even if they are on the latest version (`UPDATE` must also be true) + * This script generally runs fast. + * Packages that should skip updates (e.g. older versions or packages with poorly-made tag structures... looking at you mbedtls) may specify `"skip_updates": true` in their cpmfile definition. This is unnecessary for untagged (e.g. sha or bare URL) packages. - `check-hashes.sh`: Check a package's hash - * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. \ No newline at end of file + * This only applies to packages with hardcoded hashes, NOT ones that use hash URLs. + * This script will take a looooooooooooooong time. This is operationally equivalent to a prefetch, and thus checking all hashes will take a while--but it's worth it! Just make sure you're not using dial-up. + +You are recommended to run sanity hash checking for every pull request and commit, and weekly update checks. \ No newline at end of file From a954a20170ff9daa1a56293b1d7051f0b487e89b Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 11:58:24 -0400 Subject: [PATCH 30/40] fix xbyak Signed-off-by: crueter --- externals/cpmfile.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index a3f7540e6d..80f3fbe9ab 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -50,7 +50,7 @@ "package": "xbyak", "repo": "herumi/xbyak", "tag": "v%VERSION%", - "hash": "ff4a461b35ced007adbe9b388a90e4b53c46f9250260a559c04a757ad34ac482baf92700f113c106af6512d6894e849c4409efaf1c003207bf245a5910d848a1", + "hash": "1042090405c426e339506c179d53e91d4d545ce9c9f53d8f797caa092d589f913a9bcb9c8f31c4c60870acb954c556e305fb6732c66bc3c8f1cd924f9172def9", "git_version": "7.22", "bundled": true, "skip_updates": true From bf63e6e91eb8491eff2628cea3438921e103ca23 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 12:56:13 -0400 Subject: [PATCH 31/40] port gentoo patches, replace.sh, fix force system Signed-off-by: crueter --- CMakeLists.txt | 8 +++-- CMakeModules/CPM.cmake | 8 +++-- CMakeModules/CPMUtil.cmake | 18 +++++++--- cpmfile.json | 1 + externals/CMakeLists.txt | 36 ++++++++++--------- externals/cpmfile.json | 1 - src/common/common_types.h | 1 - src/core/frontend/applets/cabinet.h | 2 ++ src/core/memory/dmnt_cheat_vm.h | 2 ++ src/dynarmic/src/dynarmic/CMakeLists.txt | 2 +- .../src/dynarmic/common/common_types.h | 3 ++ src/hid_core/resources/applet_resource.h | 1 + src/hid_core/resources/npad/npad_vibration.h | 1 + src/hid_core/resources/touch_screen/gesture.h | 1 + .../resources/touch_screen/touch_screen.h | 1 + src/yuzu/main.cpp | 3 +- tools/cpm-fetch-all.sh | 18 +++++++++- tools/cpm/README.md | 7 +++- tools/cpm/check-hash.sh | 14 +++----- tools/cpm/check-updates.sh | 21 +++++------ tools/cpm/download.sh | 2 +- tools/cpm/fetch.sh | 6 ++-- tools/cpm/package.sh | 12 +++---- tools/cpm/replace.sh | 20 +++++++++++ 24 files changed, 126 insertions(+), 63 deletions(-) mode change 120000 => 100644 tools/cpm-fetch-all.sh mode change 100644 => 100755 tools/cpm/README.md create mode 100755 tools/cpm/replace.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index b397ba01aa..49f9a583fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,6 +454,7 @@ if (YUZU_USE_CPM) if (zstd_ADDED) add_library(zstd::zstd ALIAS libzstd_static) + add_library(zstd::libzstd ALIAS libzstd_static) endif() # Opus @@ -489,9 +490,9 @@ else() # wow if (PLATFORM_LINUX) - find_package(Boost 1.57.0 REQUIRED headers context system fiber) + find_package(Boost 1.57.0 CONFIG REQUIRED headers context system fiber) else() - find_package(Boost 1.57.0 REQUIRED) + find_package(Boost 1.57.0 CONFIG REQUIRED) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID) @@ -542,6 +543,7 @@ find_package(MbedTLS) find_package(VulkanUtilityLibraries) find_package(SimpleIni) find_package(SPIRV-Tools) +find_package(sirit) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) @@ -593,6 +595,8 @@ if (ENABLE_QT) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + # yes Qt, we get it + set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 REQUIRED COMPONENTS DBus OPTIONAL_COMPONENTS GuiPrivate) elseif (UNIX AND NOT APPLE) find_package(Qt6 REQUIRED COMPONENTS DBus Gui) diff --git a/CMakeModules/CPM.cmake b/CMakeModules/CPM.cmake index 3636ee5da0..5544d8eefe 100644 --- a/CMakeModules/CPM.cmake +++ b/CMakeModules/CPM.cmake @@ -743,9 +743,11 @@ function(CPMAddPackage) if(NOT DEFINED CPM_ARGS_NAME) set(CPM_ARGS_NAME ${nameFromUrl}) endif() - if(NOT DEFINED CPM_ARGS_VERSION) - set(CPM_ARGS_VERSION ${verFromUrl}) - endif() + + # this is dumb and should not be done + # if(NOT DEFINED CPM_ARGS_VERSION) + # set(CPM_ARGS_VERSION ${verFromUrl}) + # endif() list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS URL "${CPM_ARGS_URL}") endif() diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index 3347c7e884..314d262bf7 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -277,6 +277,7 @@ function(AddPackage) KEY BUNDLED_PACKAGE + FORCE_BUNDLED_PACKAGE FIND_PACKAGE_ARGUMENTS ) @@ -426,7 +427,9 @@ function(AddPackage) - BUNDLED_PACKAGE - default to allow local ]]# - if (${PKG_ARGS_NAME}_FORCE_SYSTEM) + if (PKG_ARGS_FORCE_BUNDLED_PACKAGE) + set_precedence(OFF OFF) + elseif (${PKG_ARGS_NAME}_FORCE_SYSTEM) set_precedence(ON ON) elseif (${PKG_ARGS_NAME}_FORCE_BUNDLED) set_precedence(OFF OFF) @@ -446,9 +449,14 @@ function(AddPackage) set_precedence(ON OFF) endif() + if (DEFINED PKG_ARGS_VERSION) + list(APPEND EXTRA_ARGS + VERSION ${PKG_ARGS_VERSION} + ) + endif() + CPMAddPackage( NAME ${PKG_ARGS_NAME} - VERSION ${PKG_ARGS_VERSION} URL ${pkg_url} URL_HASH ${pkg_hash} CUSTOM_CACHE_KEY ${pkg_key} @@ -459,6 +467,8 @@ function(AddPackage) PATCHES ${PKG_ARGS_PATCHES} EXCLUDE_FROM_ALL ON + ${EXTRA_ARGS} + ${PKG_ARGS_UNPARSED_ARGUMENTS} ) @@ -511,12 +521,12 @@ function(add_ci_package key) NAME ${ARTIFACT_PACKAGE} REPO ${ARTIFACT_REPO} TAG v${ARTIFACT_VERSION} - VERSION ${ARTIFACT_VERSION} + GIT_VERSION ${ARTIFACT_VERSION} ARTIFACT ${ARTIFACT} KEY ${key} HASH_SUFFIX sha512sum - BUNDLED_PACKAGE ON + FORCE_BUNDLED_PACKAGE ON ) set(ARTIFACT_DIR ${${ARTIFACT_PACKAGE}_SOURCE_DIR} PARENT_SCOPE) diff --git a/cpmfile.json b/cpmfile.json index aab9b4dd3d..e9e53ed326 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -18,6 +18,7 @@ "hash": "4fb7f6fde92762305aad8754d7643cd918dd1f3f67e104e9ab385b18c73178d72a17321354eb203b790b6702f2cf6d725a5d6e2dfbc63b1e35f9eb59fb42ece9", "git_version": "1.89.0", "version": "1.57", + "find_args": "CONFIG", "patches": [ "0001-clang-cl.patch", "0002-use-marmasm.patch", diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index f22b8753f8..4bf88c07a4 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -147,12 +147,29 @@ if (ENABLE_SDL2) find_package(SDL2 2.26.4 REQUIRED) endif() +# Sirit +if (YUZU_USE_BUNDLED_SIRIT) + AddJsonPackage(sirit-ci) +else() + AddJsonPackage(sirit) + if(MSVC AND USE_CCACHE AND sirit_ADDED) + get_target_property(_opts sirit COMPILE_OPTIONS) + list(FILTER _opts EXCLUDE REGEX "/Zi") + list(APPEND _opts "/Z7") + set_target_properties(siritobj PROPERTIES COMPILE_OPTIONS "${_opts}") + elseif(MSVC AND CXX_CLANG) + target_compile_options(siritobj PRIVATE -Wno-error=unused-command-line-argument) + endif() +endif() + # SPIRV Headers # We only need SPIRV-Headers iff spirv-tools is bundled -if (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) +if (TARGET SPIRV-Headers::SPIRV-Headers) + set(NEED_SPIRV_HEADERS OFF) +elseif (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) set(NEED_SPIRV_HEADERS ON) else() - find_package(SPIRV-Tools MODULE QUIET) + find_package(SPIRV-Tools QUIET) if (NOT SPIRV-Tools_FOUND) set(NEED_SPIRV_HEADERS ON) else() @@ -205,21 +222,6 @@ if (VulkanMemoryAllocator_ADDED) endif() endif() -# Sirit -if (YUZU_USE_BUNDLED_SIRIT) - AddJsonPackage(sirit-ci) -else() - AddJsonPackage(sirit) - if(MSVC AND USE_CCACHE AND sirit_ADDED) - get_target_property(_opts sirit COMPILE_OPTIONS) - list(FILTER _opts EXCLUDE REGEX "/Zi") - list(APPEND _opts "/Z7") - set_target_properties(siritobj PROPERTIES COMPILE_OPTIONS "${_opts}") - elseif(MSVC AND CXX_CLANG) - target_compile_options(siritobj PRIVATE -Wno-error=unused-command-line-argument) - endif() -endif() - # httplib if (ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER) AddJsonPackage(httplib) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 80f3fbe9ab..651c964d9c 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -117,7 +117,6 @@ "repo": "KhronosGroup/SPIRV-Tools", "tag": "v%VERSION%", "hash": "b17940433ced72e004c5eeffd7dd411b6afcc6a52ee31de6427d88edceb8172369be8ec8bf5b65708a78bf41fdae264d554aa7750b2209831679ab36bc867567", - "find_args": "MODULE", "git_version": "2025.4", "options": [ "SPIRV_SKIP_EXECUTABLES ON" diff --git a/src/common/common_types.h b/src/common/common_types.h index 99fff66bed..ae04c4d605 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -30,7 +30,6 @@ #include #include -#include using u8 = std::uint8_t; ///< 8-bit unsigned byte using u16 = std::uint16_t; ///< 16-bit unsigned short diff --git a/src/core/frontend/applets/cabinet.h b/src/core/frontend/applets/cabinet.h index af3fc6c3d5..1a7fa40392 100644 --- a/src/core/frontend/applets/cabinet.h +++ b/src/core/frontend/applets/cabinet.h @@ -4,6 +4,8 @@ #pragma once #include +#include + #include "core/frontend/applets/applet.h" #include "core/hle/service/nfp/nfp_types.h" diff --git a/src/core/memory/dmnt_cheat_vm.h b/src/core/memory/dmnt_cheat_vm.h index 1c1ed1259b..20b3c96cc0 100644 --- a/src/core/memory/dmnt_cheat_vm.h +++ b/src/core/memory/dmnt_cheat_vm.h @@ -5,6 +5,8 @@ #include #include +#include + #include #include "common/common_types.h" #include "core/memory/dmnt_cheat_types.h" diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txt index 58efcac747..8aa0f41afa 100644 --- a/src/dynarmic/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/src/dynarmic/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later include(TargetArchitectureSpecificSources) -add_library(dynarmic +add_library(dynarmic STATIC backend/block_range_information.cpp backend/block_range_information.h backend/exception_handler.h diff --git a/src/dynarmic/src/dynarmic/common/common_types.h b/src/dynarmic/src/dynarmic/common/common_types.h index 8127df3623..711418d97f 100644 --- a/src/dynarmic/src/dynarmic/common/common_types.h +++ b/src/dynarmic/src/dynarmic/common/common_types.h @@ -1,9 +1,12 @@ // SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later +// TODO(crueter): This is identical to root common_types.h + #pragma once #include +#include #include using u8 = std::uint8_t; ///< 8-bit unsigned byte diff --git a/src/hid_core/resources/applet_resource.h b/src/hid_core/resources/applet_resource.h index 69ea46b957..19ddf7f43c 100644 --- a/src/hid_core/resources/applet_resource.h +++ b/src/hid_core/resources/applet_resource.h @@ -5,6 +5,7 @@ #include #include +#include #include "common/bit_field.h" #include "common/common_types.h" diff --git a/src/hid_core/resources/npad/npad_vibration.h b/src/hid_core/resources/npad/npad_vibration.h index 6412ca4ab0..aea648b11b 100644 --- a/src/hid_core/resources/npad/npad_vibration.h +++ b/src/hid_core/resources/npad/npad_vibration.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/hid_core/resources/touch_screen/gesture.h b/src/hid_core/resources/touch_screen/gesture.h index d92912bb6e..24a49dd795 100644 --- a/src/hid_core/resources/touch_screen/gesture.h +++ b/src/hid_core/resources/touch_screen/gesture.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/hid_core/resources/touch_screen/touch_screen.h b/src/hid_core/resources/touch_screen/touch_screen.h index 2fcb6247f1..5fdbbbc8c6 100644 --- a/src/hid_core/resources/touch_screen/touch_screen.h +++ b/src/hid_core/resources/touch_screen/touch_screen.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4d5238643c..901a39cc9f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -95,9 +95,10 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include #include -#ifdef HAVE_SDL2 #include #include + +#ifdef HAVE_SDL2 #include // For SDL ScreenSaver functions #endif diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh deleted file mode 120000 index ea773fac18..0000000000 --- a/tools/cpm-fetch-all.sh +++ /dev/null @@ -1 +0,0 @@ -cpm/fetch-all.sh \ No newline at end of file diff --git a/tools/cpm-fetch-all.sh b/tools/cpm-fetch-all.sh new file mode 100644 index 0000000000..1e7ff92a67 --- /dev/null +++ b/tools/cpm-fetch-all.sh @@ -0,0 +1,17 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# provided for workflow compat + +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +chmod +x tools/cpm/fetch.sh + +# shellcheck disable=SC2086 +tools/cpm/fetch.sh $LIBS diff --git a/tools/cpm/README.md b/tools/cpm/README.md old mode 100644 new mode 100755 index 61c90cb521..acd7444518 --- a/tools/cpm/README.md +++ b/tools/cpm/README.md @@ -17,12 +17,17 @@ These scripts are generally reserved for internal use. * Generally only used by the fetch scripts. - `package.sh`: The actual package parser. * Inputs: - - `package`: The package key + - `PACKAGE`: The package key * Outputs: - Basically everything. You're best off reading the code rather than me poorly explaining it. - `which.sh`: Find which cpmfile a package is located in. * Inputs: - The package key +- `replace.sh`: Replace a package's cpmfile definition. + * Inputs: + - `PACKAGE`: The package key + - `NEW_JSON`: All keys to replace/add + * Keys not found in the new json are not touched. Keys cannot currently be deleted. ## Simple Utilities diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index 176e99d9b5..f78fdd605a 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -9,9 +9,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh @@ -22,7 +22,7 @@ do [ "$HASH_URL" != null ] && continue [ "$HASH_SUFFIX" != null ] && continue - echo "-- Package $package" + echo "-- Package $PACKAGE" [ "$HASH" = null ] && echo "-- * Warning: no hash specified" && continue @@ -33,13 +33,9 @@ do [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") - FILE=$(tools/cpm/which.sh "$package") - - jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new - mv "$FILE".new "$FILE" - - echo "-- * -- Updated $FILE" + tools/cpm/replace.sh fi done \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 2e752b26c5..fc9950f100 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,9 +13,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh @@ -28,7 +28,7 @@ do # shellcheck disable=SC2153 [ "$TAG" = null ] && continue - echo "-- Package $package" + echo "-- Package $PACKAGE" # TODO(crueter): Support for Forgejo updates w/ forgejo_token # Use gh-cli to avoid ratelimits lmao @@ -36,8 +36,8 @@ do # filter out some commonly known annoyances # TODO add more - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') # vulkan + TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') # mbedtls # ignore betas/alphas TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') @@ -45,7 +45,7 @@ do TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') # Add package-specific overrides here, e.g. here for fmt: - [ "$package" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + [ "$PACKAGE" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') LATEST=$(echo "$TAGS" | jq -r '.[0].name') @@ -68,16 +68,13 @@ do if [ "$UPDATE" = "true" ]; then if [ "$HAS_REPLACE" = "true" ]; then + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") else + # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") fi - FILE=$(tools/cpm/which.sh "$package") - - jq --indent 4 --argjson repl "$NEW_JSON" ".\"$package\" *= \$repl" "$FILE" > "$FILE".new - mv "$FILE".new "$FILE" - - echo "-- * -- Updated $FILE" + tools/cpm/replace.sh fi done diff --git a/tools/cpm/download.sh b/tools/cpm/download.sh index d6c90b11fa..426f1f51e6 100755 --- a/tools/cpm/download.sh +++ b/tools/cpm/download.sh @@ -56,7 +56,7 @@ download_package() { PATCHES=$(echo "$JSON" | jq -r '.patches | join(" ")') for patch in $PATCHES; do # shellcheck disable=SC2154 - patch --binary -p1 < "$ROOTDIR/.patch/$package/$patch" + patch --binary -p1 < "$ROOTDIR/.patch/$PACKAGE/$patch" done fi diff --git a/tools/cpm/fetch.sh b/tools/cpm/fetch.sh index e403f86818..bf45676cfa 100755 --- a/tools/cpm/fetch.sh +++ b/tools/cpm/fetch.sh @@ -19,16 +19,16 @@ ROOTDIR="$PWD" TMP=$(mktemp -d) # shellcheck disable=SC2034 -for package in "$@" +for PACKAGE in "$@" do - export package + export PACKAGE # shellcheck disable=SC1091 . tools/cpm/package.sh if [ "$CI" = "true" ]; then ci_package else - echo "-- Downloading regular package $package, with key $KEY, from $DOWNLOAD" + echo "-- Downloading regular package $PACKAGE, with key $KEY, from $DOWNLOAD" download_package fi done diff --git a/tools/cpm/package.sh b/tools/cpm/package.sh index 004111ad7c..d82b2fcbe9 100755 --- a/tools/cpm/package.sh +++ b/tools/cpm/package.sh @@ -9,12 +9,12 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh -[ -z "$package" ] && echo "Package was not specified" && exit 0 +[ -z "$PACKAGE" ] && echo "Package was not specified" && exit 0 # shellcheck disable=SC2153 -JSON=$(echo "$PACKAGES" | jq -r ".\"$package\" | select( . != null )") +JSON=$(echo "$PACKAGES" | jq -r ".\"$PACKAGE\" | select( . != null )") -[ -z "$JSON" ] && echo "!! No cpmfile definition for $package" && exit 1 +[ -z "$JSON" ] && echo "!! No cpmfile definition for $PACKAGE" && exit 1 # unset stuff export PACKAGE_NAME="null" @@ -48,7 +48,7 @@ REPO=$(value "repo") CI=$(value "ci") PACKAGE_NAME=$(value "package") -[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$package" +[ "$PACKAGE_NAME" = null ] && PACKAGE_NAME="$PACKAGE" GIT_HOST=$(value "git_host") [ "$GIT_HOST" = null ] && GIT_HOST=github.com @@ -143,7 +143,7 @@ elif [ "$REPO" != "null" ]; then DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip" fi else - echo "!! No repo or URL defined for $package" + echo "!! No repo or URL defined for $PACKAGE" exit 1 fi @@ -166,7 +166,7 @@ if [ "$KEY" = null ]; then elif [ "$VERSION" != null ]; then KEY="$VERSION" else - echo "!! No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version" + echo "!! No valid key could be determined for $PACKAGE. Must define one of: key, sha, tag, version, git_version" exit 1 fi fi diff --git a/tools/cpm/replace.sh b/tools/cpm/replace.sh new file mode 100755 index 0000000000..501cfda6b1 --- /dev/null +++ b/tools/cpm/replace.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: 2025 crueter +# SPDX-License-Identifier: GPL-3.0-or-later + +# Replace a specified package with a modified json. + +# env vars: +# - PACKAGE: The package key to act on +# - NEW_JSON: The new json to use + +[ -z "$PACKAGE" ] && echo "You must provide the PACKAGE environment variable." && return 1 +[ -z "$NEW_JSON" ] && echo "You must provide the NEW_JSON environment variable." && return 1 + +FILE=$(tools/cpm/which.sh "$PACKAGE") + +jq --indent 4 --argjson repl "$NEW_JSON" ".\"$PACKAGE\" *= \$repl" "$FILE" > "$FILE".new +mv "$FILE".new "$FILE" + +echo "-- * -- Updated $FILE" From f43652949993ba3cb7068733b9536e50cbe87eed Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 12:58:19 -0400 Subject: [PATCH 32/40] filter function Signed-off-by: crueter --- tools/cpm/check-updates.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index fc9950f100..641c539272 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,6 +13,9 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +filter() { + TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan +} for PACKAGE in "$@" do export PACKAGE @@ -36,16 +39,17 @@ do # filter out some commonly known annoyances # TODO add more - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("vulkan-sdk"; "i") | not)]') # vulkan - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("yotta"; "i") | not)]') # mbedtls - # ignore betas/alphas - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("alpha"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("beta"; "i") | not)]') - TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("rc"; "i") | not)]') + filter vulkan-sdk # vulkan + filter yotta # mbedtls + + # ignore betas/alphas (remove if needed) + filter alpha + filter beta + filter rc # Add package-specific overrides here, e.g. here for fmt: - [ "$PACKAGE" = fmt ] && TAGS=$(echo "$TAGS" | jq '[.[] | select(.name | test("v0.11"; "i") | not)]') + [ "$PACKAGE" = fmt ] && filter v0.11 LATEST=$(echo "$TAGS" | jq -r '.[0].name') From 96f1881f45e33345a31360e84fe95410f453d691 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:02:08 -0400 Subject: [PATCH 33/40] return 1 on unsuccessful hash/available updates Signed-off-by: crueter --- tools/cpm/check-hash.sh | 9 +++++++-- tools/cpm/check-updates.sh | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tools/cpm/check-hash.sh b/tools/cpm/check-hash.sh index f78fdd605a..85c60aad8c 100755 --- a/tools/cpm/check-hash.sh +++ b/tools/cpm/check-hash.sh @@ -9,6 +9,8 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +RETURN=0 + for PACKAGE in "$@" do export PACKAGE @@ -30,12 +32,15 @@ do ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD") # shellcheck disable=SC2028 - [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" + [ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" && [ "$UPDATE" != "true" ] && RETURN=1 if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"") + export NEW_JSON tools/cpm/replace.sh fi -done \ No newline at end of file +done + +exit $RETURN \ No newline at end of file diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 641c539272..69aab353ba 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -13,9 +13,12 @@ # shellcheck disable=SC1091 . tools/cpm/common.sh +RETURN=0 + filter() { TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan } + for PACKAGE in "$@" do export PACKAGE @@ -55,6 +58,8 @@ do [ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue + RETURN=1 + if [ "$HAS_REPLACE" = "true" ]; then # this just extracts the tag prefix VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1) @@ -71,14 +76,18 @@ do echo "-- * New hash: $HASH" if [ "$UPDATE" = "true" ]; then + RETURN=0 + if [ "$HAS_REPLACE" = "true" ]; then - # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"") else - # shellcheck disable=SC2034 NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"") fi + export NEW_JSON + tools/cpm/replace.sh fi done + +exit $RETURN \ No newline at end of file From 4db4ee5d0ab6ed2c480ea5d0a20a6ec7af6937be Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:03:06 -0400 Subject: [PATCH 34/40] fix license headers Signed-off-by: crueter --- src/common/common_types.h | 3 +++ src/core/frontend/applets/cabinet.h | 3 +++ src/core/memory/dmnt_cheat_vm.h | 3 +++ src/hid_core/resources/applet_resource.h | 3 +++ src/hid_core/resources/npad/npad_vibration.h | 3 +++ src/hid_core/resources/touch_screen/gesture.h | 3 +++ src/hid_core/resources/touch_screen/touch_screen.h | 3 +++ 7 files changed, 21 insertions(+) diff --git a/src/common/common_types.h b/src/common/common_types.h index ae04c4d605..6e7e4ec0d9 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2012 Gekko Emulator // SPDX-FileContributor: ShizZy // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/frontend/applets/cabinet.h b/src/core/frontend/applets/cabinet.h index 1a7fa40392..157bfe38c6 100644 --- a/src/core/frontend/applets/cabinet.h +++ b/src/core/frontend/applets/cabinet.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/memory/dmnt_cheat_vm.h b/src/core/memory/dmnt_cheat_vm.h index 20b3c96cc0..de5e81add2 100644 --- a/src/core/memory/dmnt_cheat_vm.h +++ b/src/core/memory/dmnt_cheat_vm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/hid_core/resources/applet_resource.h b/src/hid_core/resources/applet_resource.h index 19ddf7f43c..4b7584b962 100644 --- a/src/hid_core/resources/applet_resource.h +++ b/src/hid_core/resources/applet_resource.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/npad/npad_vibration.h b/src/hid_core/resources/npad/npad_vibration.h index aea648b11b..59e29b9f90 100644 --- a/src/hid_core/resources/npad/npad_vibration.h +++ b/src/hid_core/resources/npad/npad_vibration.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/touch_screen/gesture.h b/src/hid_core/resources/touch_screen/gesture.h index 24a49dd795..3fa1933fe8 100644 --- a/src/hid_core/resources/touch_screen/gesture.h +++ b/src/hid_core/resources/touch_screen/gesture.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/hid_core/resources/touch_screen/touch_screen.h b/src/hid_core/resources/touch_screen/touch_screen.h index 5fdbbbc8c6..f56f7b3839 100644 --- a/src/hid_core/resources/touch_screen/touch_screen.h +++ b/src/hid_core/resources/touch_screen/touch_screen.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later From 7c074dec479688a8117ecfdde49b092b471969ac Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 13:51:38 -0400 Subject: [PATCH 35/40] update sirit-ci, fix zstd, update CPMUtil Signed-off-by: crueter --- CMakeModules/Findzstd.cmake | 3 + docs/CPM.md | 258 ------------------------------------ docs/CPMUtil.md | 14 ++ docs/Deps.md | 1 + docs/README.md | 2 +- externals/CMakeLists.txt | 15 +-- externals/cpmfile.json | 2 +- tools/cpm/check-updates.sh | 3 - tools/cpm/common.sh | 17 ++- tools/cpm/format.sh | 5 +- tools/cpm/which.sh | 5 +- 11 files changed, 36 insertions(+), 289 deletions(-) delete mode 100644 docs/CPM.md create mode 100644 docs/CPMUtil.md diff --git a/CMakeModules/Findzstd.cmake b/CMakeModules/Findzstd.cmake index bf38d20fbf..17efec2192 100644 --- a/CMakeModules/Findzstd.cmake +++ b/CMakeModules/Findzstd.cmake @@ -13,9 +13,12 @@ find_package_handle_standard_args(zstd if (zstd_FOUND AND NOT TARGET zstd::zstd) if (TARGET zstd::libzstd_shared) add_library(zstd::zstd ALIAS zstd::libzstd_shared) + add_library(zstd::libzstd ALIAS zstd::libzstd_shared) elseif (TARGET zstd::libzstd_static) add_library(zstd::zstd ALIAS zstd::libzstd_static) + add_library(zstd::libzstd ALIAS zstd::libzstd_static) else() add_library(zstd::zstd ALIAS PkgConfig::ZSTD) + add_library(zstd::libzstd ALIAS PkgConfig::ZSTD) endif() endif() diff --git a/docs/CPM.md b/docs/CPM.md deleted file mode 100644 index c01376469d..0000000000 --- a/docs/CPM.md +++ /dev/null @@ -1,258 +0,0 @@ -# CPM - -CPM (CMake Package Manager) is the preferred method of managing dependencies within Eden. - -Global Options: - -- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing - * If this is `OFF`, required system dependencies will be searched via `find_package`, although certain externals use CPM regardless. -- `CPMUTIL_FORCE_SYSTEM` (default `OFF`): Require all CPM dependencies to use system packages. NOT RECOMMENDED! - * Many packages, e.g. mcl, sirit, xbyak, discord-rpc, are not generally available as a system package. - * You may optionally override these (see CPMUtil section) -- `CPMUTIL_FORCE_BUNDLED` (default `ON` on MSVC and Android, `OFF` elsewhere): Require all CPM dependencies to use bundled packages. - -## CPMUtil - -CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake. - -### AddPackage - -`AddPackage` is the core of the CPMUtil wrapper, and is generally the lowest level you will need to go when dealing with dependencies. - -**Identification/Fetching** - -- `NAME` (required): The package name (must be the same as the `find_package` name if applicable) -- `VERSION`: The minimum version of this package that can be used on the system -- `GIT_VERSION`: The "version" found within git -- `URL`: The URL to fetch. -- `REPO`: The GitHub repo to use (`owner/repo`). - * Only GitHub is supported for now, though other platforms will see support at some point -- `TAG`: The tag to fetch, if applicable. -- `ARTIFACT`: The name of the artifact, if applicable. -- `SHA`: Commit sha to fetch, if applicable. -- `BRANCH`: Branch to fetch, if applicable. - -The following configurations are supported, in descending order of precedence: - -- `URL`: Bare URL download, useful for custom artifacts - * If this is set, `GIT_URL` or `REPO` should be set to allow the dependency viewer to link to the project's Git repository. - * If this is NOT set, `REPO` must be defined. -- `REPO + TAG + ARTIFACT`: GitHub release artifact - * The final download URL will be `https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}` - * Useful for prebuilt libraries and prefetched archives -- `REPO + TAG`: GitHub tag archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/tags/${TAG}.tar.gz` - * Useful for pinning to a specific tag, better for build identification -- `REPO + SHA`: GitHub commit archive - * The final download URL will be `https://github.com/${REPO}/archive/${SHA}.zip` - * Useful for pinning to a specific commit -- `REPO + BRANCH`: GitHub branch archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/${BRANCH}.zip` - * Generally not recommended unless the branch is frozen -- `REPO`: GitHub master archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/master.zip` - * Generally not recommended unless the project is dead - -**Hashing** - -Hashing is used for verifying downloads. It's highly recommended to use these. - -- `HASH_ALGO` (default `SHA512`): Hash algorithm to use - -Hashing strategies, descending order of precedence: - -- `HASH`: Bare hash verification, useful for static downloads e.g. commit archives -- `HASH_SUFFIX`: Download the hash as `${DOWNLOAD_URL}.${HASH_SUFFIX}` - * The downloaded hash *must* match the hash algorithm and contain nothing but the hash; no filenames or extra content. -- `HASH_URL`: Download the hash from a separate URL - -**Additional Options** - -- `KEY`: Custom cache key to use (stored as `.cache/cpm/${packagename_lower}/${key}`) - * Default is based on, in descending order of precedence: - - First 4 characters of the sha - - `GIT_VERSION` - - Tag - - `VERSION` - - Otherwise, CPM defaults will be used. This is not recommended as it doesn't produce reproducible caches -- `DOWNLOAD_ONLY`: Whether or not to configure the downloaded package via CMake - * Useful to turn `OFF` if the project doesn't use CMake -- `SOURCE_SUBDIR`: Subdirectory of the project containing a CMakeLists.txt file -- `FIND_PACKAGE_ARGUMENTS`: Arguments to pass to the `find_package` call -- `BUNDLED_PACKAGE`: Set to `ON` to force the usage of a bundled package -- `OPTIONS`: Options to pass to the configuration of the package -- `PATCHES`: Patches to apply to the package, stored in `.patch/${packagename_lower}/0001-patch-name.patch` and so on -- Other arguments can be passed to CPM as well - -**Extra Variables** - -For each added package, users may additionally force usage of the system/bundled package. - -- `${package}_FORCE_SYSTEM`: Require the package to be installed on the system -- `${package}_FORCE_BUNDLED`: Force the package to be fetched and use the bundled version - -**Bundled/System Switching** - -Descending order of precedence: -- If `${package}_FORCE_SYSTEM` is true, requires the package to be on the system -- If `${package}_FORCE_BUNDLED` is true, forcefully uses the bundled package -- If `CPMUTIL_FORCE_SYSTEM` is true, requires the package to be on the system -- If `CPMUTIL_FORCE_BUNDLED` is true, forcefully uses the bundled package -- If the `BUNDLED_PACKAGE` argument is true, forcefully uses the bundled package -- Otherwise, CPM will search for the package first, and if not found, will use the bundled package - -**Identification** - -All dependencies must be identifiable in some way for usage in the dependency viewer. Lists are provided in descending order of precedence. - -URLs: - -- `GIT_URL` -- `REPO` as a Git repository - * You may optionally specify `GIT_HOST` to use a custom host, e.g. `GIT_HOST git.crueter.xyz`. Note that the git host MUST be GitHub-like in its artifact/archive downloads, e.g. Forgejo - * If `GIT_HOST` is unspecified, defaults to `github.com` -- `URL` - -Versions (bundled): - -- `SHA` -- `GIT_VERSION` -- `VERSION` -- `TAG` -- "unknown" - -If the package is a system package, AddPackage will attempt to determine the package version and append ` (system)` to the identifier. Otherwise, it will be marked as `unknown (system)` - -### AddCIPackage - -Adds a package that follows crueter's CI repository spec. - -- `VERSION` (required): The version to get (the tag will be `v${VERSION}`) -- `NAME` (required): Name used within the artifacts -- `REPO` (required): CI repository, e.g. `crueter-ci/OpenSSL` -- `PACKAGE` (required): `find_package` package name -- `EXTENSION`: Artifact extension (default `tar.zst`) -- `MIN_VERSION`: Minimum version for `find_package`. Only used if platform does not support this package as a bundled artifact -- `DISABLED_PLATFORMS`: List of platforms that lack artifacts for this package. One of: - * `windows-amd64` - * `windows-arm64` - * `android` - * `solaris-amd64` - * `freebsd-amd64` - * `linux-amd64` - * `linux-aarch64` - * `macos-universal` - -### AddJsonPackage - -This is the recommended method of usage for CPMUtil. In each directory that utilizes `CPMUtil`, there must be a `cpmfile.json` that defines dependencies in a similar manner to the individual calls. - -The cpmfile is an object of objects, with each sub-object being named according to the package's identifier, e.g. `openssl`, which can then be fetched with `AddJsonPackage()`. Options are designed to map closely to the argument names, and are always strings unless otherwise specified. - -- `package` -> `NAME` (`PACKAGE` for CI), defaults to the object key -- `repo` -> `REPO` -- `version` -> `VERSION` -- `ci` (bool) - -If `ci` is `false`: - -- `hash` -> `HASH` -- `hash_suffix` -> `HASH_SUFFIX` -- `sha` -> `SHA` -- `key` -> `KEY` -- `tag` -> `TAG` - * If the tag contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified -- `url` -> `URL` -- `artifact` -> `ARTIFACT` - * If the artifact contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified - * If the artifact contains `%TAG%`, that part will be replaced by the `tag` (with its replacement already done) -- `git_version` -> `GIT_VERSION` -- `git_host` -> `GIT_HOST` -- `source_subdir` -> `SOURCE_SUBDIR` -- `bundled` -> `BUNDLED_PACKAGE` -- `find_args` -> `FIND_PACKAGE_ARGUMENTS` -- `patches` -> `PATCHES` (array) -- `options` -> `OPTIONS` (array) - -Other arguments aren't currently supported. If you wish to add them, see the `AddJsonPackage` function in `CMakeModules/CPMUtil.cmake`. - -If `ci` is `true`: - -- `name` -> `NAME`, defaults to the object key -- `extension` -> `EXTENSION`, defaults to `tar.zst` -- `min_version` -> `MIN_VERSION` -- `extension` -> `EXTENSION` - -### Examples - -In order: OpenSSL CI, Boost (tag + artifact), Opus (options + find_args), discord-rpc (sha + options + patches) - -```json -{ - "openssl": { - "ci": true, - "package": "OpenSSL", - "name": "openssl", - "repo": "crueter-ci/OpenSSL", - "version": "3.5.2", - "min_version": "1.1.1" - }, - "boost": { - "package": "Boost", - "repo": "boostorg/boost", - "tag": "boost-%VERSION%", - "artifact": "%TAG%-cmake.7z", - "hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01", - "git_version": "1.88.0", - "version": "1.57" - }, - "opus": { - "package": "Opus", - "repo": "xiph/opus", - "sha": "5ded705cf4", - "hash": "0dc89e58ddda1f3bc6a7037963994770c5806c10e66f5cc55c59286fc76d0544fe4eca7626772b888fd719f434bc8a92f792bdb350c807968b2ac14cfc04b203", - "version": "1.3", - "find_args": "MODULE", - "options": [ - "OPUS_BUILD_TESTING OFF", - "OPUS_BUILD_PROGRAMS OFF", - "OPUS_INSTALL_PKG_CONFIG_MODULE OFF", - "OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF" - ] - }, - "discord-rpc": { - "repo": "discord/discord-rpc", - "sha": "963aa9f3e5", - "hash": "386e1344e9a666d730f2d335ee3aef1fd05b1039febefd51aa751b705009cc764411397f3ca08dffd46205c72f75b235c870c737b2091a4ed0c3b061f5919bde", - "options": [ - "BUILD_EXAMPLES OFF" - ], - "patches": [ - "0001-cmake-version.patch", - "0002-no-clang-format.patch", - "0003-fix-cpp17.patch" - ] - }, -} -``` - -### Inclusion - -To include CPMUtil: - -```cmake -include(CPMUtil) -``` - -## Prefetching - -- To prefetch a CPM dependency (requires cpmfile): - * `tools/cpm-fetch.sh ` -- To prefetch all CPM dependencies: - * `tools/cpm-fetch-all.sh` - -Currently, `cpm-fetch.sh` defines the following directories for cpmfiles (max depth of 2, so subdirs are caught as well): - -`externals src/qt_common src/dynarmic .` - -Whenever you add a new cpmfile, update the script accordingly \ No newline at end of file diff --git a/docs/CPMUtil.md b/docs/CPMUtil.md new file mode 100644 index 0000000000..779515ae7e --- /dev/null +++ b/docs/CPMUtil.md @@ -0,0 +1,14 @@ +# CPMUtil + +CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake. + +See more in [its repository](https://git.crueter.xyz/CMake/CPMUtil) + +Eden-specific options: + +- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing + * If this is `OFF`, required system dependencies will be searched via `find_package`, although most externals use CPM regardless. + +## Tooling + +See the [tooling docs](../tools/cpm) \ No newline at end of file diff --git a/docs/Deps.md b/docs/Deps.md index 573d1fe14a..69f41794ea 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -63,6 +63,7 @@ Certain other dependencies will be fetched by CPM regardless. System packages *c * [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) * [sirit](https://github.com/eden-emulator/sirit) * [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_QT_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on + - This package is known to be broken on the AUR. * [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on * [unordered-dense](https://github.com/martinus/unordered_dense) * [mcl](https://github.com/azahar-emu/mcl) - subject to removal diff --git a/docs/README.md b/docs/README.md index 71e79e15ea..49617fa43a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,6 +5,6 @@ This contains documentation created by developers. This contains build instructi - **[General Build Instructions](Build.md)** - **[Development Guidelines](Development.md)** - **[Dependencies](Deps.md)** -- **[CPM - CMake Package Manager](CPM.md)** +- **[CPM - CMake Package Manager](CPMUtil.md)** - **[Platform-Specific Caveats](Caveats.md)** - **[User Directory Handling](User.md)** \ No newline at end of file diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 4bf88c07a4..1d7ddae61f 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -163,21 +163,8 @@ else() endif() # SPIRV Headers -# We only need SPIRV-Headers iff spirv-tools is bundled -if (TARGET SPIRV-Headers::SPIRV-Headers) - set(NEED_SPIRV_HEADERS OFF) -elseif (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) - set(NEED_SPIRV_HEADERS ON) -else() - find_package(SPIRV-Tools QUIET) - if (NOT SPIRV-Tools_FOUND) - set(NEED_SPIRV_HEADERS ON) - else() - set(NEED_SPIRV_HEADERS OFF) - endif() -endif() -if (NEED_SPIRV_HEADERS) +if (NOT TARGET SPIRV-Headers::SPIRV-Headers) AddJsonPackage(spirv-headers) endif() diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 651c964d9c..47ac1d6e3d 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -20,7 +20,7 @@ "package": "sirit", "name": "sirit", "repo": "eden-emulator/sirit", - "version": "1.0.0" + "version": "1.0.1" }, "httplib": { "repo": "yhirose/cpp-httplib", diff --git a/tools/cpm/check-updates.sh b/tools/cpm/check-updates.sh index 69aab353ba..bdccf96ca2 100755 --- a/tools/cpm/check-updates.sh +++ b/tools/cpm/check-updates.sh @@ -1,8 +1,5 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index 8c67d40436..f26d76ee05 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -1,14 +1,21 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later +################################## +# CHANGE THESE FOR YOUR PROJECT! # +################################## + +# Which directories to search +DIRS=". src" + +# How many levels to go (3 is 2 subdirs max) +MAXDEPTH=3 + # shellcheck disable=SC2038 # shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find . src -maxdepth 3 -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +[ -z "$PACKAGES" ] && PACKAGES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') # For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) # Always include . @@ -16,6 +23,8 @@ LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")') export PACKAGES export LIBS +export DIRS +export MAXDEPTH value() { echo "$JSON" | jq -r ".$1" diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 45fd787da3..873a18debe 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -1,13 +1,10 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # like common.sh, change for your directories -FILES=$(find . src -maxdepth 3 -name cpmfile.json) +FILES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json) for file in $FILES; do jq --indent 4 < "$file" > "$file".new diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index f207700571..fd1029ef3d 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -1,15 +1,12 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later - # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in # like common.sh, change for your directories -JSON=$(find . src -maxdepth 3 -name cpmfile.json -exec grep -l "$1" {} \;) +JSON=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" From 979a9558438d023273e3c3b44aa06c4dd27e6a91 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:11:54 -0400 Subject: [PATCH 36/40] update spirv-headers, fix cpmutil scripts Signed-off-by: crueter --- externals/cpmfile.json | 4 ++-- tools/cpm/common.sh | 3 ++- tools/cpm/format.sh | 7 +++++-- tools/cpm/which.sh | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 47ac1d6e3d..eb1e5853cd 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -125,8 +125,8 @@ "spirv-headers": { "package": "SPIRV-Headers", "repo": "KhronosGroup/SPIRV-Headers", - "sha": "4e209d3d7e", - "hash": "f48bbe18341ed55ea0fe280dbbbc0a44bf222278de6e716e143ca1e95ca320b06d4d23d6583fbf8d03e1428f3dac8fa00e5b82ddcd6b425e6236d85af09550a4", + "sha": "01e0577914", + "hash": "d0f905311faf7d743de686fdf241dc4cb0a4f08e2184f5a3b3b2946e680db3cd89eeb72954eafe6fa457f93550e27d516575c8709cb134d8aecc0b43064636ce", "options": [ "SPIRV_WERROR OFF" ] diff --git a/tools/cpm/common.sh b/tools/cpm/common.sh index f26d76ee05..4aff058bdc 100755 --- a/tools/cpm/common.sh +++ b/tools/cpm/common.sh @@ -15,7 +15,8 @@ MAXDEPTH=3 # shellcheck disable=SC2038 # shellcheck disable=SC2016 -[ -z "$PACKAGES" ] && PACKAGES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') +# shellcheck disable=SC2086 +[ -z "$PACKAGES" ] && PACKAGES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)') # For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.) # Always include . diff --git a/tools/cpm/format.sh b/tools/cpm/format.sh index 873a18debe..8d99b4796b 100755 --- a/tools/cpm/format.sh +++ b/tools/cpm/format.sh @@ -3,8 +3,11 @@ # SPDX-FileCopyrightText: 2025 crueter # SPDX-License-Identifier: GPL-3.0-or-later -# like common.sh, change for your directories -FILES=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json) +# shellcheck disable=SC1091 +. tools/cpm/common.sh + +# shellcheck disable=SC2086 +FILES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json) for file in $FILES; do jq --indent 4 < "$file" > "$file".new diff --git a/tools/cpm/which.sh b/tools/cpm/which.sh index fd1029ef3d..c936d0a97f 100755 --- a/tools/cpm/which.sh +++ b/tools/cpm/which.sh @@ -4,9 +4,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later # check which file a package is in +# shellcheck disable=SC1091 +. tools/cpm/common.sh -# like common.sh, change for your directories -JSON=$(find "$DIRS" -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) +# shellcheck disable=SC2086 +JSON=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;) [ -z "$JSON" ] && echo "!! No cpmfile definition for $1" From 64b19b48c773af6bd5cf9003b02e709cc290c229 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:33:28 -0400 Subject: [PATCH 37/40] Update CPMUtil CI packages now use version Signed-off-by: crueter --- CMakeModules/CPMUtil.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index 314d262bf7..3d7b84c029 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -524,7 +524,7 @@ function(add_ci_package key) GIT_VERSION ${ARTIFACT_VERSION} ARTIFACT ${ARTIFACT} - KEY ${key} + KEY ${key}-${ARTIFACT_VERSION} HASH_SUFFIX sha512sum FORCE_BUNDLED_PACKAGE ON ) From bb86625e6cc7c40add2349ca3d7398e1b4e3a9b8 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 14:44:43 -0400 Subject: [PATCH 38/40] update sirit Signed-off-by: crueter --- externals/CMakeLists.txt | 9 +++------ externals/cpmfile.json | 9 ++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 1d7ddae61f..434e6fb100 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -147,6 +147,9 @@ if (ENABLE_SDL2) find_package(SDL2 2.26.4 REQUIRED) endif() +# SPIRV Headers +AddJsonPackage(spirv-headers) + # Sirit if (YUZU_USE_BUNDLED_SIRIT) AddJsonPackage(sirit-ci) @@ -162,12 +165,6 @@ else() endif() endif() -# SPIRV Headers - -if (NOT TARGET SPIRV-Headers::SPIRV-Headers) - AddJsonPackage(spirv-headers) -endif() - # SPIRV Tools AddJsonPackage(spirv-tools) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index eb1e5853cd..aa3a97c128 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -9,18 +9,21 @@ }, "sirit": { "repo": "eden-emulator/sirit", - "git_version": "1.0.1", + "git_version": "1.0.2", "tag": "v%VERSION%", "artifact": "sirit-source-%VERSION%.tar.zst", "hash_suffix": "sha512sum", - "find_args": "CONFIG" + "find_args": "CONFIG", + "options": [ + "SIRIT_USE_SYSTEM_SPIRV_HEADERS ON" + ] }, "sirit-ci": { "ci": true, "package": "sirit", "name": "sirit", "repo": "eden-emulator/sirit", - "version": "1.0.1" + "version": "1.0.2" }, "httplib": { "repo": "yhirose/cpp-httplib", From 06a65b89c9b81e61e80131142dbe1310c629fa8a Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 20:48:26 -0400 Subject: [PATCH 39/40] solaris Signed-off-by: crueter --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f9a583fd..7f192887f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,10 +32,20 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") + +# NB: this does not account for SPARC +# If you get Eden working on SPARC, please shoot crueter@crueter.xyz multiple emails +# and you will be hailed for eternity if (PLATFORM_SUN) # Terrific Solaris pkg shenanigans list(APPEND CMAKE_PREFIX_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") + + # amazing + # absolutely incredible + list(APPEND CMAKE_PREFIX_PATH "/usr/lib/amd64/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/lib/amd64/cmake") + # For some mighty reason, doing a normal release build sometimes may not trigger # the proper -O3 switch to materialize if (CMAKE_BUILD_TYPE MATCHES "Release") From 7e975a4224fabc1e5ad1a08f128bb878341775e1 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 4 Oct 2025 21:00:35 -0400 Subject: [PATCH 40/40] allow system libusb on solaris Signed-off-by: crueter --- docs/Deps.md | 2 +- externals/libusb/CMakeLists.txt | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/docs/Deps.md b/docs/Deps.md index 69f41794ea..b8a1be66d2 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -195,7 +195,7 @@ Run the usual update + install of essential toolings: `sudo pkg update && sudo p - **gcc**: `sudo pkg install developer/gcc-14`. - **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`. -Then install the libraries: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm developer/fmt`. +Then install the libraries: `sudo pkg install qt6 boost glslang libzip library/lz4 libusb-1 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm developer/fmt`.
diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt index 77a762d070..a53464ea98 100644 --- a/externals/libusb/CMakeLists.txt +++ b/externals/libusb/CMakeLists.txt @@ -6,18 +6,7 @@ include(CPMUtil) -# we love our libraries don't we folks -if (PLATFORM_SUN) - set(libusb_bundled ON) -else() - set(libusb_bundled OFF) -endif() - -# TODO(crueter): Fix on Solaris -AddJsonPackage( - NAME libusb - BUNDLED_PACKAGE ${libusb_bundled} -) +AddJsonPackage(libusb) if (NOT libusb_ADDED) return()