[ci, tools] shellcheck-ed #397

Closed
DraVee wants to merge 8 commits from DraVee:old/shellcheck into master
18 changed files with 369 additions and 242 deletions

View file

@ -1,11 +1,12 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: Copyright 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: Copyright 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,146 +1,208 @@
#!/bin/sh -e #!/bin/sh -e
HEADER="$(cat "$PWD/.ci/license/header.txt")" # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" # SPDX-License-Identifier: GPL-3.0-or-later
echo "Getting branch changes" COPYRIGHT_YEAR="2025"
COPYRIGHT_OWNER="Eden Emulator Project"
COPYRIGHT_LICENSE="GPL-3.0-or-later"
# BRANCH=`git rev-parse --abbrev-ref HEAD` if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` echo
# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" echo "license-header.sh: Eden License Headers Accreditation Script"
# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` echo
echo "This script checks and optionally fixes license headers in source, CMake and shell script files."
echo
echo "Environment Variables:"
echo " FIX=true | Automatically add the correct license headers to offending files."
echo " UPDATE=true | Automatically update current license headers of 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 " # Update headers only"
echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'"
echo " # or else will have 'FIX=true' behavior)"
echo " UPDATE=true .ci/license-header.sh"
echo
echo " # Fix headers and commit changes"
echo " FIX=true COMMIT=true .ci/license-header.sh"
echo
echo " # Update headers and commit changes"
echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'"
echo " # or else will have 'FIX=true' behavior)"
echo " UPDATE=true COMMIT=true .ci/license-header.sh"
exit 0
fi
BASE=`git merge-base master HEAD` SRC_FILES=""
FILES=`git diff --name-only $BASE` OTHER_FILES=""
#FILES=$(git diff --name-only master) BASE=$(git merge-base master HEAD)
if git diff --quiet "$BASE"..HEAD; then
echo
echo "license-header.sh: No commits on this branch different from master."
exit 0
fi
FILES=$(git diff --name-only "$BASE")
echo "Done" echo_header() {
COMMENT_TYPE="$1"
check_header() { echo "$COMMENT_TYPE SPDX-FileCopyrightText: Copyright $COPYRIGHT_YEAR $COPYRIGHT_OWNER"
CONTENT="`head -n3 < $1`" echo "$COMMENT_TYPE SPDX-License-Identifier: $COPYRIGHT_LICENSE"
case "$CONTENT" in
"$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $1" ;;
esac
} }
check_cmake_header() {
CONTENT="`head -n3 < $1`"
case "$CONTENT" in
"$HEADER_HASH"*) ;;
*)
BAD_CMAKE="$BAD_CMAKE $1" ;;
esac
}
for file in $FILES; do for file in $FILES; do
[ -f "$file" ] || continue [ -f "$file" ] || continue
if [ `basename -- "$file"` = "CMakeLists.txt" ]; then case "$(basename "$file")" in
check_cmake_header "$file" CMakeLists.txt)
COMMENT_TYPE="#" ;;
*)
EXT="${file##*.}"
case "$EXT" in
kts|kt|cpp|h) COMMENT_TYPE="//" ;;
cmake|sh|ps1) COMMENT_TYPE="#" ;;
*) continue ;;
esac ;;
esac
HEADER=$(echo_header "$COMMENT_TYPE")
HEAD_LINES=$(head -n5 "$file")
CORRECT_COPYRIGHT=$(echo "$HEAD_LINES" | awk \
-v line1="$(echo "$HEADER" | sed -n '1p')" \
-v line2="$(echo "$HEADER" | sed -n '2p')" \
'($0==line1){getline; if($0==line2){f=1}else{f=0}} END{print (f?f:0)}')
if [ "$CORRECT_COPYRIGHT" != "1" ]; then
case "$COMMENT_TYPE" in
"//") SRC_FILES="$SRC_FILES $file" ;;
"#") OTHER_FILES="$OTHER_FILES $file" ;;
esac
fi
done
if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then
echo
echo "license-header.sh: All good!"
exit 0
fi
for TYPE in "SRC" "OTHER"; do
if [ "$TYPE" = "SRC" ] && [ -n "$SRC_FILES" ]; then
FILES_LIST="$SRC_FILES"
COMMENT_TYPE="//"
DESC="Source"
elif [ "$TYPE" = "OTHER" ] && [ -n "$OTHER_FILES" ]; then
FILES_LIST="$OTHER_FILES"
COMMENT_TYPE="#"
DESC="CMake and shell script"
else
continue continue
fi fi
EXTENSION="${file##*.}" echo
case "$EXTENSION" in echo "------------------------------------------------------------"
kts|kt|cpp|h) echo "$DESC files"
check_header "$file" echo "------------------------------------------------------------"
;; echo
cmake) echo " The following files contain incorrect license headers:"
check_cmake_header "$file" for file in $FILES_LIST; do
;; echo " - $file"
esac done
echo
echo " The correct license header to be added to all affected"
echo " '$DESC' files is:"
echo
echo "=== BEGIN ==="
echo_header "$COMMENT_TYPE"
echo "=== END ==="
done done
if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then
echo
echo "All good."
exit
fi
if [ "$BAD_FILES" != "" ]; then
echo "The following source files have incorrect license headers:"
echo
for file in $BAD_FILES; do echo $file; done
cat << EOF
The following license header should be added to the start of all offending SOURCE files:
=== BEGIN ===
$HEADER
=== END ===
EOF
fi
if [ "$BAD_CMAKE" != "" ]; then
echo "The following CMake files have incorrect license headers:"
echo
for file in $BAD_CMAKE; do echo $file; done
cat << EOF
The following license header should be added to the start of all offending CMake files:
=== BEGIN ===
$HEADER_HASH
=== END ===
EOF
fi
cat << EOF cat << EOF
If some of the code in this PR is not being contributed by the original author,
the files which have been exclusively changed by that code can be ignored. ------------------------------------------------------------
If this happens, this PR requirement can be bypassed once all other files are addressed.
If some of the code in this pull request was not contributed by the original
author, the files that have been modified exclusively by that code can be
safely ignored. In such cases, this PR requirement may be bypassed once all
other files have been reviewed and addressed.
EOF EOF
if [ "$FIX" = "true" ]; then TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1
echo if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then
echo "FIX set to true. Fixing headers."
echo echo
echo "license-header.sh: FIX set to true, fixing headers..."
for file in $BAD_FILES; do for file in $SRC_FILES $OTHER_FILES; do
cat $file > $file.bak BASENAME=$(basename "$file")
cat .ci/license/header.txt > $file case "$BASENAME" in
echo >> $file CMakeLists.txt) COMMENT_TYPE="#" ;;
cat $file.bak >> $file *)
EXT="${file##*.}"
case "$EXT" in
kts|kt|cpp|h) COMMENT_TYPE="//" ;;
cmake|sh|ps1) COMMENT_TYPE="#" ;;
*) continue ;;
esac
;;
esac
rm $file.bak TMP="$TMP_DIR/$BASENAME.tmp"
UPDATED=0
cp -p "$file" "$TMP"
> "$TMP"
git add $file # this logic is bit hacky but sed don't work well with $VARIABLES
# it's this or complete remove this logic and keep only the old way
if [ "$UPDATE" = "true" ]; then
while IFS= read -r line || [ -n "$line" ]; do
if [ "$UPDATED" -eq 0 ] && echo "$line" | grep "$COPYRIGHT_OWNER" >/dev/null 2>&1; then
echo_header "$COMMENT_TYPE" >> "$TMP"
IFS= read -r _ || true
UPDATED=1
else
echo "$line" >> "$TMP"
fi
done < "$file"
fi
if [ "$UPDATED" -eq 0 ]; then
{
echo_header "$COMMENT_TYPE"
echo
cat "$TMP"
} > "$file"
else
mv "$TMP" "$file"
fi
git add "$file"
done done
for file in $BAD_CMAKE; do rm -rf "$TMP_DIR"
cat $file > $file.bak
cat .ci/license/header-hash.txt > $file echo
echo >> $file echo "license-header.sh: License headers fixed!"
cat $file.bak >> $file
rm $file.bak
git add $file
done
echo "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 [script]"
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
fi fi

View file

@ -1,2 +0,0 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

View file

@ -1,2 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

View file

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: Copyright 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: Copyright 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}"
@ -36,24 +37,26 @@ case "$1" in
echo "Packaging armv9-a build of Eden" echo "Packaging armv9-a build of Eden"
ARCH=armv9 ARCH=armv9
;; ;;
native) native)
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
@ -67,21 +70,19 @@ ln -sf ./dev.eden_emu.eden.svg ./.DirIcon
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync' UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
if [ "$DEVEL" = 'true' ]; then if [ "$DEVEL" = 'true' ]; then
sed -i 's|Name=Eden|Name=Eden Nightly|' ./dev.eden_emu.eden.desktop sed -i 's|Name=Eden|Name=Eden Nightly|' ./dev.eden_emu.eden.desktop
UPINFO="$(echo "$UPINFO" | sed 's|Releases|nightly|')" UPINFO="$(echo "$UPINFO" | sed 's|Releases|nightly|')"
fi 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,40 +91,38 @@ 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
# allow the host vulkan to be used for aarch64 given the sad situation # allow the host vulkan to be used for aarch64 given the sad situation
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
fi fi
# Workaround for Gentoo # Workaround for Gentoo
if [ -d "shared/libproxy" ]; then if [ -d "shared/libproxy" ]; then
cp shared/libproxy/* lib/ cp shared/libproxy/* lib/
fi fi
ln -f ./sharun ./AppRun ln -f ./sharun ./AppRun
@ -134,20 +133,20 @@ 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"
echo "Generating AppImage..." echo "Generating AppImage..."
./uruntime --appimage-mkdwarfs -f \ ./uruntime --appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \ --set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \ --no-history --no-create-timestamp \
--categorize=hotness --hotness-list=.ci/linux/eden.dwfsprof \ --categorize=hotness --hotness-list=.ci/linux/eden.dwfsprof \
--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,22 +1,59 @@
#!/bin/bash -ex #!/bin/sh -e
# git-archive-all # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
export PATH="$PATH:/home/$USER/.local/bin" # 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')
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"
ARTIFACT_DIR="artifacts"
ARCHIVE_PATH="${ARTIFACT_DIR}/${REV_NAME}.tar"
XZ_PATH="${ARCHIVE_PATH}.xz"
SHA_PATH="${XZ_PATH}.sha256sum"
mkdir artifacts # Abort if archive already exists
if [ -e "$XZ_PATH" ]; then
echo "Error: Archive '$XZ_PATH' already exists. Aborting."
exit 1
fi
touch "${COMPAT_LIST}" # Create output directory
git describe --abbrev=0 --always HEAD > GIT-COMMIT mkdir -p "$ARTIFACT_DIR"
git describe --tags HEAD > GIT-TAG || echo 'unknown' > GIT-TAG
git-archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar" # Create temporary directory
TMPDIR=$(mktemp -d)
# Ensure compatibility list file exists
touch "$COMPAT_LIST"
cp "$COMPAT_LIST" "$TMPDIR/"
# Create base archive from git
git archive --format=tar --prefix="${REV_NAME}/" HEAD > "$ARCHIVE_PATH"
# Create commit and tag files with correct names
git describe --abbrev=0 --always HEAD > "$TMPDIR/GIT-COMMIT"
if ! git describe --tags HEAD > "$TMPDIR/GIT-TAG" 2>/dev/null; then
echo "unknown" > "$TMPDIR/GIT-TAG"
fi
# Append extra files to archive
tar --append --file="$ARCHIVE_PATH" -C "$TMPDIR" "$(basename "$COMPAT_LIST")" GIT-COMMIT GIT-TAG
# Remove temporary directory
rm -rf "$TMPDIR"
# Compress using xz
xz -9 "$ARCHIVE_PATH"
# Generate SHA-256 checksum (GNU vs BSD/macOS)
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "$XZ_PATH" > "$SHA_PATH"
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 "$XZ_PATH" > "$SHA_PATH"
else
echo "No SHA-256 tool found (sha256sum or shasum required)" >&2
exit 1
fi
cd artifacts/
xz -T0 -9 "${REV_NAME}.tar"
sha256sum "${REV_NAME}.tar.xz" > "${REV_NAME}.tar.xz.sha256sum"
cd ..

View file

@ -1,11 +1,12 @@
#!/bin/sh #!/bin/sh
# SPDX-FileCopyrightText: Copyright 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]}')
SOURCES=$(find src/yuzu -type f \( -name '*.ui' -o -name '*.cpp' -o -name '*.h' -o -name '*.plist' \))
# requires fd lupdate -source-language $SRC -target-language "$TARGET" "$SOURCES" -ts /data/code/eden/"$i"
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
done done

View file

@ -1,21 +1,47 @@
#!/bin/sh -e #!/bin/sh -e
# SPDX-FileCopyrightText: 2025 eden Emulator Project # SPDX-FileCopyrightText: Copyright 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 ! command -v "$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" EDEN_SVG_ICO="dist/dev.eden_emu.eden.svg"
svgo --multipass $EDEN_SVG_ICO
magick -density 256x256 -background transparent $EDEN_SVG_ICO \ # Create temporary PNG file safely (and POSIX-compliant)
-define icon:auto-resize -colors 256 dist/eden.ico || exit TMP_PNG=$(mktemp /tmp/eden-tmp-XXXXXX)
convert -density 256x256 -resize 256x256 -background transparent $EDEN_SVG_ICO \ TMP_PNG="${TMP_PNG}.png"
dist/yuzu.bmp || exit
# Optimize SVG
svgo --multipass "$EDEN_SVG_ICO"
# Generate ICO
magick \
-density 256x256 -background transparent "$EDEN_SVG_ICO" \
-define icon:auto-resize -colors 256 "dist/eden.ico"
# Generate BMP
magick "$EDEN_SVG_ICO" -resize 256x256 -background transparent "dist/yuzu.bmp"
# Generate PNG for ICNS
magick -size 1024x1024 -background transparent "$EDEN_SVG_ICO" "$TMP_PNG"
# Generate ICNS
png2icns "dist/eden.icns" "$TMP_PNG"
# Copy ICNS to Yuzu file
cp "dist/eden.icns" "dist/yuzu.icns"
# Remove temporary PNG
rm -f "$TMP_PNG"
export TMP_PNG="dist/eden-tmp.png"
magick -size 1024x1024 -background transparent $EDEN_SVG_ICO $TMP_PNG || exit
png2icns dist/eden.icns $TMP_PNG || exit
cp dist/eden.icns dist/yuzu.icns
rm $TMP_PNG

View file

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
# SPDX-FileCopyrightText: 2025 Eden Emulator Project # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
if [ "$COMPILER" == "clang" ] if [ "$COMPILER" == "clang" ]
@ -17,12 +17,12 @@ 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 \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}" \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}" \
-DENABLE_QT_TRANSLATION=ON \ -DENABLE_QT_TRANSLATION=ON \
-DUSE_DISCORD_PRESENCE=ON \ -DUSE_DISCORD_PRESENCE=ON \
-DYUZU_USE_BUNDLED_SDL2=ON \ -DYUZU_USE_BUNDLED_SDL2=ON \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
@ -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,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project # SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later

View file

@ -1,3 +1,8 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: Copyright 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

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 Eden Emulator Project # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 crueter # SPDX-FileCopyrightText: 2025 crueter
@ -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

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
# SPDX-FileCopyrightText: 2025 Eden Emulator Project # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 crueter # SPDX-FileCopyrightText: 2025 crueter
@ -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,7 @@
#!/bin/sh #!/bin/sh
SUM=`wget -q https://github.com/$1/archive/$2.zip -O - | sha512sum` # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
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,7 @@
#!/bin/sh #!/bin/sh
SUM=`wget -q $1 -O - | sha512sum` # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
SUM=$(wget -q "$1" -O - | sha512sum)
echo "$SUM" | cut -d " " -f1 echo "$SUM" | cut -d " " -f1