[ci, tools] shellcheck-ed

* now license-header.sh is POSIX compliant
* update-icons now checks for dependencies the correct way
* add --help to license-header
* nuke reset-submodules
* add missing shebang to .ci/windows/package.sh

* Below the error/warnings/infos from shellcheck:
-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.

-- SC3054 (warning): In POSIX sh, array references are undefined.
-- SC2155 (warning): Declare and assign separately to avoid masking return values.
-- SC2046 (warning): Quote this to prevent word splitting.

-- SC2236 (style): Use -n instead of ! -z.
-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
-- SC2001 (style): See if you can use ${variable//search/replace} instead.

-- SC2086 (info): Double quote to prevent globbing and word splitting.
-- SC2185 (info): Some finds don't have a default path. Specify '.' explicitly.

Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
This commit is contained in:
Caio Oliveira 2025-09-08 23:24:36 -03:00 committed by crueter
parent 249e006667
commit 1d43b20312
15 changed files with 201 additions and 158 deletions

View file

@ -1,11 +1,12 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
export NDK_CCACHE=$(which ccache) NDK_CCACHE=$(which ccache)
export NDK_CCACHE
if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then if [ -n "${ANDROID_KEYSTORE_B64}" ]; then
export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks" export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks"
base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}" base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}"
fi fi
@ -16,6 +17,6 @@ chmod +x ./gradlew
./gradlew assembleRelease ./gradlew assembleRelease
./gradlew bundleRelease ./gradlew bundleRelease
if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then if [ -n "${ANDROID_KEYSTORE_B64}" ]; then
rm "${ANDROID_KEYSTORE_FILE}" rm "${ANDROID_KEYSTORE_FILE}"
fi fi

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
GITDATE="$(git show -s --date=short --format='%ad' | sed 's/-//g')" GITDATE="$(git show -s --date=short --format='%ad' | sed 's/-//g')"

View file

@ -1,24 +1,48 @@
#!/bin/sh -e #!/bin/sh -e
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo
echo "license-header.sh: Eden License Headers Accreditation Script"
echo
echo "This script checks and optionally fixes license headers in source and CMake files."
echo
echo "Environment Variables:"
echo " FIX=true Automatically add the correct license headers to offending files."
echo " COMMIT=true If FIX=true, commit the changes automatically."
echo
echo "Usage Examples:"
echo " # Just check headers (will fail if headers are missing)"
echo " .ci/license-header.sh"
echo
echo " # Fix headers only"
echo " FIX=true .ci/license-header.sh"
echo
echo " # Fix headers and commit changes"
echo " FIX=true COMMIT=true .ci/license-header.sh"
exit 0
fi
HEADER="$(cat "$PWD/.ci/license/header.txt")" HEADER="$(cat "$PWD/.ci/license/header.txt")"
HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")"
echo "Getting branch changes" echo
echo "license-header.sh: Getting branch changes"
# BRANCH=`git rev-parse --abbrev-ref HEAD` BRANCH=$(git rev-parse --abbrev-ref HEAD)
# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` COMMITS=$(git log "${BRANCH}" --not master --pretty=format:"%h")
# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" if [ -z "$COMMITS" ]; then
# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` echo
echo "license-header.sh: No commits on this branch different from master."
BASE=`git merge-base master HEAD` exit 0
FILES=`git diff --name-only $BASE` fi
RANGE="$(echo "$COMMITS" | tail -n1)^..$(echo "$COMMITS" | head -n1)"
#FILES=$(git diff --name-only master) FILES=$(git diff-tree --no-commit-id --name-only "${RANGE}" -r)
echo "Done"
check_header() { check_header() {
CONTENT="`head -n3 < $1`" CONTENT=$(head -n3 < "$1")
case "$CONTENT" in case "$CONTENT" in
"$HEADER"*) ;; "$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $1" ;; *) BAD_FILES="$BAD_FILES $1" ;;
@ -26,18 +50,17 @@ check_header() {
} }
check_cmake_header() { check_cmake_header() {
CONTENT="`head -n3 < $1`" CONTENT=$(head -n3 < "$1")
case "$CONTENT" in case "$CONTENT" in
"$HEADER_HASH"*) ;; "$HEADER_HASH"*) ;;
*) *) BAD_CMAKE="$BAD_CMAKE $1" ;;
BAD_CMAKE="$BAD_CMAKE $1" ;;
esac esac
} }
for file in $FILES; do for file in $FILES; do
[ -f "$file" ] || continue [ -f "$file" ] || continue
if [ `basename -- "$file"` = "CMakeLists.txt" ]; then if [ "$(basename -- "$file")" = "CMakeLists.txt" ]; then
check_cmake_header "$file" check_cmake_header "$file"
continue continue
fi fi
@ -53,18 +76,20 @@ for file in $FILES; do
esac esac
done done
if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then if [ -z "$BAD_FILES" ] && [ -z "$BAD_CMAKE" ]; then
echo echo
echo "All good." echo "license-header.sh: All good!"
exit 0
exit
fi fi
if [ "$BAD_FILES" != "" ]; then if [ -n "$BAD_FILES" ]; then
echo "The following source files have incorrect license headers:"
echo echo
echo "license-header.sh: The following source files have incorrect license headers:"
for file in $BAD_FILES; do echo $file; done echo
for file in $BAD_FILES; do
echo " - $file"
done
cat << EOF cat << EOF
@ -78,11 +103,14 @@ EOF
fi fi
if [ "$BAD_CMAKE" != "" ]; then if [ -n "$BAD_CMAKE" ]; then
echo "The following CMake files have incorrect license headers:"
echo echo
echo "license-header.sh: The following CMake files have incorrect license headers:"
for file in $BAD_CMAKE; do echo $file; done echo
for file in $BAD_CMAKE; do
echo " - $file"
done
cat << EOF cat << EOF
@ -104,42 +132,41 @@ EOF
if [ "$FIX" = "true" ]; then if [ "$FIX" = "true" ]; then
echo echo
echo "FIX set to true. Fixing headers." echo "license-header.sh: FIX set to true, fixing headers..."
echo
for file in $BAD_FILES; do for file in $BAD_FILES; do
cat $file > $file.bak cp -- "$file" "$file.bak"
cat .ci/license/header.txt > $file cat .ci/license/header.txt > "$file"
echo >> $file echo >> "$file"
cat $file.bak >> $file cat "$file.bak" >> "$file"
rm $file.bak rm -- "$file.bak"
git add "$file"
git add $file
done done
for file in $BAD_CMAKE; do for file in $BAD_CMAKE; do
cat $file > $file.bak cp -- "$file" "$file.bak"
cat .ci/license/header-hash.txt > $file cat .ci/license/header-hash.txt > "$file"
echo >> $file echo >> "$file"
cat $file.bak >> $file cat "$file.bak" >> "$file"
rm $file.bak rm -- "$file.bak"
git add "$file"
git add $file
done done
echo "License headers fixed."
echo
echo "license-header.sh: License headers fixed!"
if [ "$COMMIT" = "true" ]; then if [ "$COMMIT" = "true" ]; then
echo echo
echo "COMMIT set to true. Committing changes." echo "license-header.sh: COMMIT set to true, committing changes..."
git commit -m "[license] Fix license headers"
echo echo
echo "license-header.sh: Changes committed. You may now push."
git commit -m "Fix license headers"
echo "Changes committed. You may now push."
fi fi
else else
exit 1 exit 1

View file

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
case "$1" in case "$1" in
@ -87,7 +87,7 @@ if [ -z "$BUILD_TYPE" ]; then
export BUILD_TYPE="Release" export BUILD_TYPE="Release"
fi fi
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@) export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" "$@")
mkdir -p build && cd build mkdir -p build && cd build
cmake .. -G Ninja \ cmake .. -G Ninja \
@ -107,7 +107,7 @@ cmake .. -G Ninja \
-DDYNARMIC_ENABLE_LTO=ON \ -DDYNARMIC_ENABLE_LTO=ON \
"${EXTRA_CMAKE_FLAGS[@]}" "${EXTRA_CMAKE_FLAGS[@]}"
ninja -j${NPROC} ninja -j"${NPROC}"
if [ -d "bin/Release" ]; then if [ -d "bin/Release" ]; then
strip -s bin/Release/* strip -s bin/Release/*

View file

@ -1,12 +1,13 @@
#!/bin/sh -e #!/bin/sh -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# This script assumes you're in the source directory # This script assumes you're in the source directory
export APPIMAGE_EXTRACT_AND_RUN=1 export APPIMAGE_EXTRACT_AND_RUN=1
export BASE_ARCH="$(uname -m)" BASE_ARCH="$(uname -m)"
export BASE_ARCH
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio" SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}" URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
@ -40,20 +41,22 @@ case "$1" in
echo "Packaging native build of Eden" echo "Packaging native build of Eden"
ARCH="$BASE_ARCH" ARCH="$BASE_ARCH"
;; ;;
*)
echo "Unknown target: $1"
exit 1
;;
esac esac
export BUILDDIR="$2" export BUILDDIR="$2"
if [ "$BUILDDIR" = '' ] if [ -z "$BUILDDIR" ]; then
then
BUILDDIR=build BUILDDIR=build
fi fi
EDEN_TAG=$(git describe --tags --abbrev=0) EDEN_TAG=$(git describe --tags --abbrev=0)
echo "Making \"$EDEN_TAG\" build" echo "Making \"$EDEN_TAG\" build"
# git checkout "$EDEN_TAG" # git checkout "$EDEN_TAG"
VERSION="$(echo "$EDEN_TAG")" VERSION="$EDEN_TAG"
# NOW MAKE APPIMAGE # NOW MAKE APPIMAGE
mkdir -p ./AppDir mkdir -p ./AppDir
@ -74,14 +77,12 @@ fi
LIBDIR="/usr/lib" LIBDIR="/usr/lib"
# Workaround for Gentoo # Workaround for Gentoo
if [ ! -d "$LIBDIR/qt6" ] if [ ! -d "$LIBDIR/qt6" ]; then
then
LIBDIR="/usr/lib64" LIBDIR="/usr/lib64"
fi fi
# Workaround for Debian # Workaround for Debian
if [ ! -d "$LIBDIR/qt6" ] if [ ! -d "$LIBDIR/qt6" ]; then
then
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu" LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
fi fi
@ -90,30 +91,28 @@ fi
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
chmod +x ./sharun-aio chmod +x ./sharun-aio
xvfb-run -a ./sharun-aio l -p -v -e -s -k \ xvfb-run -a ./sharun-aio l -p -v -e -s -k \
../$BUILDDIR/bin/eden* \ ../"$BUILDDIR"/bin/eden* \
$LIBDIR/lib*GL*.so* \ "$LIBDIR"/lib*GL*.so* \
$LIBDIR/dri/* \ "$LIBDIR"/dri/* \
$LIBDIR/vdpau/* \ "$LIBDIR"/vdpau/* \
$LIBDIR/libvulkan* \ "$LIBDIR"/libvulkan* \
$LIBDIR/libXss.so* \ "$LIBDIR"/libXss.so* \
$LIBDIR/libdecor-0.so* \ "$LIBDIR"/libdecor-0.so* \
$LIBDIR/libgamemode.so* \ "$LIBDIR"/libgamemode.so* \
$LIBDIR/qt6/plugins/audio/* \ "$LIBDIR"/qt6/plugins/audio/* \
$LIBDIR/qt6/plugins/bearer/* \ "$LIBDIR"/qt6/plugins/bearer/* \
$LIBDIR/qt6/plugins/imageformats/* \ "$LIBDIR"/qt6/plugins/imageformats/* \
$LIBDIR/qt6/plugins/iconengines/* \ "$LIBDIR"/qt6/plugins/iconengines/* \
$LIBDIR/qt6/plugins/platforms/* \ "$LIBDIR"/qt6/plugins/platforms/* \
$LIBDIR/qt6/plugins/platformthemes/* \ "$LIBDIR"/qt6/plugins/platformthemes/* \
$LIBDIR/qt6/plugins/platforminputcontexts/* \ "$LIBDIR"/qt6/plugins/platforminputcontexts/* \
$LIBDIR/qt6/plugins/styles/* \ "$LIBDIR"/qt6/plugins/styles/* \
$LIBDIR/qt6/plugins/xcbglintegrations/* \ "$LIBDIR"/qt6/plugins/xcbglintegrations/* \
$LIBDIR/qt6/plugins/wayland-*/* \ "$LIBDIR"/qt6/plugins/wayland-*/* \
$LIBDIR/pulseaudio/* \ "$LIBDIR"/pulseaudio/* \
$LIBDIR/pipewire-0.3/* \ "$LIBDIR"/pipewire-0.3/* \
$LIBDIR/spa-0.2/*/* \ "$LIBDIR"/spa-0.2/*/* \
$LIBDIR/alsa-lib/* "$LIBDIR"/alsa-lib/*
rm -f ./sharun-aio
# Prepare sharun # Prepare sharun
if [ "$ARCH" = 'aarch64' ]; then if [ "$ARCH" = 'aarch64' ]; then
@ -134,7 +133,7 @@ cd ..
wget -q "$URUNTIME" -O ./uruntime wget -q "$URUNTIME" -O ./uruntime
chmod +x ./uruntime chmod +x ./uruntime
#Add udpate info to runtime # Add update info to runtime
echo "Adding update information \"$UPINFO\" to runtime..." echo "Adding update information \"$UPINFO\" to runtime..."
./uruntime --appimage-addupdinfo "$UPINFO" ./uruntime --appimage-addupdinfo "$UPINFO"
@ -146,8 +145,8 @@ echo "Generating AppImage..."
--compression zstd:level=22 -S26 -B32 \ --compression zstd:level=22 -S26 -B32 \
--header uruntime \ --header uruntime \
-N 4 \ -N 4 \
-i ./AppDir -o Eden-"$VERSION"-"$ARCH".AppImage -i ./AppDir -o "Eden-$VERSION-$ARCH.AppImage"
echo "Generating zsync file..." echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage zsyncmake ./*.AppImage -u ./*.AppImage
echo "All Done!" echo "All Done!"

View file

@ -1,10 +1,13 @@
#!/bin/bash -ex #!/bin/bash -ex
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# git-archive-all # git-archive-all
export PATH="$PATH:/home/$USER/.local/bin" export PATH="$PATH:/home/$USER/.local/bin"
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" GITDATE="$(git show -s --date=short --format='%ad' | sed 's/-//g')"
GITREV="`git show -s --format='%h'`" GITREV="$(git show -s --format='%h')"
REV_NAME="eden-unified-source-${GITDATE}-${GITREV}" REV_NAME="eden-unified-source-${GITDATE}-${GITREV}"
COMPAT_LIST='dist/compatibility_list/compatibility_list.json' COMPAT_LIST='dist/compatibility_list/compatibility_list.json'

View file

@ -1,11 +1,14 @@
#!/bin/sh #!/bin/sh
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
for i in dist/languages/*.ts; do for i in dist/languages/*.ts; do
SRC=en_US SRC=en_US
TARGET=`head -n1 $i | awk -F 'language="' '{split($2, a, "\""); print a[1]}'` TARGET=$(head -n1 "$i" | awk -F 'language="' '{split($2, a, "\""); print a[1]}')
# requires fd # requires fd
SOURCES=`fd . src/yuzu -tf -e ui -e cpp -e h -e plist` SOURCES=$(fd . src/yuzu -tf -e ui -e cpp -e h -e plist)
lupdate -source-language $SRC -target-language $TARGET $SOURCES -ts /data/code/eden/$i lupdate -source-language $SRC -target-language "$TARGET" "$SOURCES" -ts /data/code/eden/"$i"
done done

View file

@ -1,21 +1,35 @@
#!/bin/sh -e #!/bin/sh -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
which png2icns || [ which yay && yay libicns ] || exit # Check dependencies
which magick || exit for cmd in png2icns magick svgo; do
if ! which "$cmd" >/dev/null 2>&1; then
pkg="$cmd"
case "$cmd" in
png2icns) pkg="icnsutils" ;;
magick) pkg="imagemagick" ;;
esac
echo "Error: command '$cmd' not found. Install the package '$pkg'."
exit 1
fi
done
export EDEN_SVG_ICO="dist/dev.eden_emu.eden.svg" export EDEN_SVG_ICO="dist/dev.eden_emu.eden.svg"
svgo --multipass $EDEN_SVG_ICO TMP_PNG="$(mktemp /tmp/eden-tmp-XXXXXX.png)"
magick -density 256x256 -background transparent $EDEN_SVG_ICO \ svgo --multipass "$EDEN_SVG_ICO"
-define icon:auto-resize -colors 256 dist/eden.ico || exit
convert -density 256x256 -resize 256x256 -background transparent $EDEN_SVG_ICO \
dist/yuzu.bmp || exit
export TMP_PNG="dist/eden-tmp.png" magick \
magick -size 1024x1024 -background transparent $EDEN_SVG_ICO $TMP_PNG || exit -density 256x256 -background transparent "$EDEN_SVG_ICO" \
png2icns dist/eden.icns $TMP_PNG || exit -define icon:auto-resize -colors 256 "dist/eden.ico"
cp dist/eden.icns dist/yuzu.icns
rm $TMP_PNG magick "$EDEN_SVG_ICO" -resize 256x256 -background transparent "dist/yuzu.bmp"
magick -size 1024x1024 -background transparent "$EDEN_SVG_ICO" "$TMP_PNG"
png2icns "dist/eden.icns" "$TMP_PNG"
cp "dist/eden.icns" "dist/yuzu.icns"
rm -f "$TMP_PNG"

View file

@ -17,7 +17,7 @@ fi
[ -z "$WINDEPLOYQT" ] && { echo "WINDEPLOYQT environment variable required."; exit 1; } [ -z "$WINDEPLOYQT" ] && { echo "WINDEPLOYQT environment variable required."; exit 1; }
echo $EXTRA_CMAKE_FLAGS echo "${EXTRA_CMAKE_FLAGS[@]}"
mkdir -p build && cd build mkdir -p build && cd build
cmake .. -G Ninja \ cmake .. -G Ninja \
@ -30,14 +30,14 @@ cmake .. -G Ninja \
-DDYNARMIC_TESTS=OFF \ -DDYNARMIC_TESTS=OFF \
-DYUZU_CMD=OFF \ -DYUZU_CMD=OFF \
-DYUZU_ROOM_STANDALONE=OFF \ -DYUZU_ROOM_STANDALONE=OFF \
-DYUZU_USE_QT_MULTIMEDIA=${USE_MULTIMEDIA:-false} \ -DYUZU_USE_QT_MULTIMEDIA="${USE_MULTIMEDIA:-false}" \
-DYUZU_USE_QT_WEB_ENGINE=${USE_WEBENGINE:-false} \ -DYUZU_USE_QT_WEB_ENGINE="${USE_WEBENGINE:-false}" \
-DYUZU_ENABLE_LTO=ON \ -DYUZU_ENABLE_LTO=ON \
-DCMAKE_EXE_LINKER_FLAGS=" /LTCG" \ -DCMAKE_EXE_LINKER_FLAGS=" /LTCG" \
-DDYNARMIC_ENABLE_LTO=ON \ -DDYNARMIC_ENABLE_LTO=ON \
-DYUZU_USE_BUNDLED_QT=${BUNDLE_QT:-false} \ -DYUZU_USE_BUNDLED_QT="${BUNDLE_QT:-false}" \
-DUSE_CCACHE=${CCACHE:-false} \ -DUSE_CCACHE="${CCACHE:-false}" \
-DENABLE_QT_UPDATE_CHECKER=${DEVEL:-true} \ -DENABLE_QT_UPDATE_CHECKER="${DEVEL:-true}" \
"${EXTRA_CMAKE_FLAGS[@]}" \ "${EXTRA_CMAKE_FLAGS[@]}" \
"$@" "$@"

View file

@ -1,3 +1,8 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
GITDATE=$(git show -s --date=short --format='%ad' | tr -d "-") GITDATE=$(git show -s --date=short --format='%ad' | tr -d "-")
GITREV=$(git show -s --format='%h') GITREV=$(git show -s --format='%h')

View file

@ -8,4 +8,4 @@
LIBS=$(find . externals src/qt_common src/dynarmic -maxdepth 2 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ") LIBS=$(find . externals src/qt_common src/dynarmic -maxdepth 2 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ")
tools/cpm-fetch.sh $LIBS tools/cpm-fetch.sh "$LIBS"

View file

@ -8,7 +8,7 @@
[ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm [ -z "$CPM_SOURCE_CACHE" ] && CPM_SOURCE_CACHE=$PWD/.cache/cpm
mkdir -p $CPM_SOURCE_CACHE mkdir -p "$CPM_SOURCE_CACHE"
ROOTDIR="$PWD" ROOTDIR="$PWD"
@ -25,7 +25,7 @@ download_package() {
curl "$DOWNLOAD" -sS -L -o "$OUTFILE" curl "$DOWNLOAD" -sS -L -o "$OUTFILE"
ACTUAL_HASH=$(${HASH_ALGO}sum "$OUTFILE" | cut -d" " -f1) 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 [ "$ACTUAL_HASH" != "$HASH" ] && echo "$FILENAME did not match expected hash; expected $HASH but got $ACTUAL_HASH" && exit 1
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
@ -46,10 +46,10 @@ download_package() {
# basically if only one real item exists at the top we just move everything from there # basically if only one real item exists at the top we just move everything from there
# since github and some vendors hate me # since github and some vendors hate me
DIRS=$(find -maxdepth 1 -type d -o -type f) DIRS=$(find . -maxdepth 1 -type d -o -type f)
# thanks gnu # thanks gnu
if [ $(wc -l <<< "$DIRS") -eq 2 ]; then if [ "$(wc -l <<< "$DIRS")" -eq 2 ]; then
SUBDIR=$(find . -maxdepth 1 -type d -not -name ".") SUBDIR=$(find . -maxdepth 1 -type d -not -name ".")
mv "$SUBDIR"/* . mv "$SUBDIR"/* .
mv "$SUBDIR"/.* . 2>/dev/null || true mv "$SUBDIR"/.* . 2>/dev/null || true
@ -59,7 +59,7 @@ download_package() {
if grep -e "patches" <<< "$JSON" > /dev/null; then if grep -e "patches" <<< "$JSON" > /dev/null; then
PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON") PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON")
for patch in $PATCHES; do for patch in $PATCHES; do
patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch patch --binary -p1 < "$ROOTDIR"/.patch/"$package"/"$patch"
done done
fi fi
@ -102,7 +102,7 @@ ci_package() {
done done
} }
for package in $@ for package in "$@"
do do
# prepare for cancer # prepare for cancer
# TODO(crueter): Fetch json once? # TODO(crueter): Fetch json once?
@ -145,12 +145,11 @@ do
fi fi
TAG=$(jq -r ".tag" <<< "$JSON") TAG=$(jq -r ".tag" <<< "$JSON")
TAG="${TAG//%VERSION%/$VERSION_REPLACE}"
TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG)
ARTIFACT=$(jq -r ".artifact" <<< "$JSON") ARTIFACT=$(jq -r ".artifact" <<< "$JSON")
ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT) ARTIFACT="${ARTIFACT//%VERSION%/$VERSION_REPLACE}"
ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT) ARTIFACT="${ARTIFACT//%TAG%/$TAG}"
if [ "$URL" != "null" ]; then if [ "$URL" != "null" ]; then
DOWNLOAD="$URL" DOWNLOAD="$URL"
@ -219,4 +218,4 @@ do
download_package download_package
done done
rm -rf $TMP rm -rf "$TMP"

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/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 echo "$SUM" | cut -d " " -f1

View file

@ -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

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
SUM=`wget -q $1 -O - | sha512sum` SUM=$(wget -q "$1" -O - | sha512sum)
echo "$SUM" | cut -d " " -f1 echo "$SUM" | cut -d " " -f1