[cmake] CPMUtil: formatting, git_host, new repos, more system deps, libusb (#392)

I promise I'm a UI developer

- mbedtls can now be used as a system package
- zycore can now be used as a system package
- cleaned up dynarmic externals
- fixed libusb incorrectly showing as bundled
- add version/tag formatting to JSON
- add custom GIT_HOST option for packages
- moved some of my repos to my new git
- slightly better version identification
- combined VUL/VH since they are codependent (using my combo vendor)
- fix cpmfile inclusion
- remove libusb submodule

This PR succeeds #383 since it includes it

Co-authored-by: SDK Chan <sdkchan@eden-emu.dev>
Reviewed-on: #392
Co-authored-by: crueter <crueter@crueter.xyz>
Co-committed-by: crueter <crueter@crueter.xyz>
This commit is contained in:
crueter 2025-09-08 19:21:38 +02:00 committed by crueter
parent ecc99ce9ab
commit 428f136a75
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
39 changed files with 921 additions and 904 deletions

View file

@ -6,5 +6,6 @@
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
LIBS=$(find . externals externals/nx_tzdb src/yuzu/externals externals/ffmpeg src/dynarmic/externals -maxdepth 1 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ")
LIBS=$(find . externals src/yuzu/externals src/dynarmic -maxdepth 2 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ")
tools/cpm-fetch.sh $LIBS

View file

@ -84,7 +84,7 @@ ci_package() {
for platform in windows-amd64 windows-arm64 android solaris freebsd linux linux-aarch64; do
FILENAME="${NAME}-${platform}-${VERSION}.${EXT}"
DOWNLOAD="https://github.com/${REPO}/releases/download/v${VERSION}/${FILENAME}"
DOWNLOAD="https://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}"
PACKAGE_NAME="$PACKAGE"
KEY=$platform
@ -122,14 +122,32 @@ do
URL=$(jq -r ".url" <<< "$JSON")
REPO=$(jq -r ".repo" <<< "$JSON")
SHA=$(jq -r ".sha" <<< "$JSON")
GIT_HOST=$(jq -r ".git_host" <<< "$JSON")
[ "$GIT_HOST" == null ] && GIT_HOST=github.com
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://github.com/$REPO"
GIT_URL="https://$GIT_HOST/$REPO"
TAG=$(jq -r ".tag" <<< "$JSON")
ARTIFACT=$(jq -r ".artifact" <<< "$JSON")
BRANCH=$(jq -r ".branch" <<< "$JSON")
if [ "$TAG" != "null" ]; then
@ -155,24 +173,21 @@ do
# key parsing
KEY=$(jq -r ".key" <<< "$JSON")
if [ "$KEY" == null ]; then
VERSION=$(jq -r ".version" <<< "$JSON")
GIT_VERSION=$(jq -r ".git_version" <<< "$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, version, git_version"
echo "No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version"
continue
fi
fi
echo $KEY
echo "Downloading regular package $package, with key $KEY, from $DOWNLOAD"
# hash parsing