From 69d36eaaf7a93f7701e1d9540432b993076ef74f Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 09:45:59 +0900 Subject: [PATCH 01/38] LIBMAN: got rid of tmplib and fetch missing libs and introduce the new libman engine --- automation_tools/libman.sh | 34 ++++++ net.retrodeck.retrodeck.yml | 234 +++++++++++++++++------------------- 2 files changed, 141 insertions(+), 127 deletions(-) create mode 100644 automation_tools/libman.sh diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh new file mode 100644 index 00000000..82ffa105 --- /dev/null +++ b/automation_tools/libman.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Set default destination if FLATPAK_DEST is not set +if [ -z "$FLATPAK_DEST" ]; then + FLATPAK_DEST="/app" +fi + +# Check if source directory is provided +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Define target directory +target_dir="${FLATPAK_DEST}/retrodeck/lib" + +# Ensure the target directory exists +mkdir -p "$target_dir" + +# Find and copy files +find "$1" -type f -exec sh -c ' + for file; do + dest_file="$1/$(basename "$file")" + if [ ! -e "$dest_file" ]; then + if cp "$file" "$dest_file"; then + echo "Copied $file to $dest_file" + else + echo "Failed to copy $file to $dest_file" + fi + else + echo "Skipped $file as $dest_file already exists" + fi + done + ' sh {} + "$target_dir" \ No newline at end of file diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 602682a3..63b40941 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -36,6 +36,9 @@ finish-args: # PPSSPP, DOLPHIN - --filesystem=xdg-run/gamescope-0:ro +environment: + LD_LIBRARY_PATH: "${FLATPAK_DEST}/retrodeck/lib:${LD_LIBRARY_PATH}" + cleanup: # ES-DE - /include @@ -53,7 +56,6 @@ cleanup: - /src - '*.a' - '*.la' - - /app/retrodeck/tmplib modules: @@ -93,6 +95,12 @@ modules: url: THISREPO branch: THISBRANCH + # libman (as in Library Manager) is a module that allows to copy library files from the various modules to the retrodeck library folder + - name: libman + buildsystem: simple + build-commands: + - install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" + - name: xmlstarlet config-opts: - --disable-static-libs @@ -229,21 +237,22 @@ modules: - name: retroarch buildsystem: simple build-commands: + # Step 1: Create required directories - mkdir -p "${FLATPAK_DEST}/share/libretro/" + # Step 2: Copy RetroArch configuration files - cp -r ./RetroArch-Linux-x86_64.AppImage.home/.config/retroarch/* "${FLATPAK_DEST}/share/libretro/" + # Step 3: Extract the AppImage - chmod +x ./*.AppImage - ./*.AppImage --appimage-extract - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 4: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 5: Copy remaining extracted files to the Flatpak destination - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://buildbot.libretro.com/stable/1.20.0/linux/x86_64/RetroArch.7z - #sha256: RASHAPLACEHOLDER sha256: 809b3e9f02a9849719453d0f189a0edc544ad3235c8ce75a79488e710ba9668a - # Not part of the offical RetroArch AppImage - # TODO: outsource me - name: libbz2 no-autogen: true @@ -341,11 +350,15 @@ modules: - name: retrodeck-ppsspp buildsystem: simple build-commands: + # Step 1: Remove unused manifest file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" + # Step 2: Use libman.sh to copy libraries to the RetroDeck library folder + - /app/bin/libman.sh "files/lib" + # Step 3: Clean up source library folder - rm -rf "files/lib" + # Step 4: Make binaries executable - chmod +x "files/bin/"* + # Step 5: Copy remaining files to Flatpak destination - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive @@ -360,10 +373,13 @@ modules: - name: pcsx2 buildsystem: simple build-commands: + # Step 1: Ensure the AppImage is executable - chmod +x *.AppImage + # Step 2: Extract the AppImage - ./*.AppImage --appimage-extract - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 3: Use libman.sh to handle library files + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy the remaining extracted files to the Flatpak destination - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: file @@ -377,14 +393,15 @@ modules: - name: retrodeck-dolphin buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - "cp -rnL files/lib/debug ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib/debug" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.DolphinEmu.dolphin-emu/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -396,15 +413,15 @@ modules: - name: retrodeck-primehack buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - rm -rf "files/lib/pkgconfig" - - "cp -rnL files/lib/debug ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib/debug" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/io.github.shiiion.primehack/releases/latest/download/RetroDECK-primehack-Artifact.tar.gz @@ -413,33 +430,18 @@ modules: # RPCS3 # https://rpcs3.net/download - # - name: rpcs3 - # buildsystem: simple - # build-commands: - # - chmod +x *.AppImage - # - ./*.AppImage --appimage-extract - # - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - # - mkdir -p ${FLATPAK_DEST}/lib/ffmpeg # Needed for a ffmpeg bufgix - # - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" - # - cp -r "squashfs-root/usr/bin/"* "${FLATPAK_DEST}/bin/" - # - cp -r "squashfs-root/usr/share/"* "${FLATPAK_DEST}/share/" - # #TODO: - cp -r squashfs-root/usr/optional* # maybe already included in flatpak runtime - # #TODO: - cp -r squashfs-root/usr/plugins* # maybe already included in qt - # #TODO: Do we need this wrapper? squashfs-root/apprun-hooks/linuxdeploy-plugin-qt-hook.sh - # sources: - # - type: file - # url: https://github.com/RPCS3/rpcs3-binaries-linux/releases/download/build-cd8954db140855101d94a33c0dd7f4d72bdf5a35/rpcs3-v0.0.33-17066-cd8954db_linux64.AppImage - # sha256: 2d258b557c17ebba4bea927be4032cfcbc230c26b8f090b796daa5935faa4a8b - - name: retrodeck-rpcs3 buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/net.rpcs3.RPCS3/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -451,12 +453,15 @@ modules: - name: melonds buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib/" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}/" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/net.kuribo64.melonDS/releases/latest/download/RetroDECK-melonds-Artifact.tar.gz @@ -469,10 +474,12 @@ modules: - name: duckstation buildsystem: simple build-commands: + # Step 1: Ensure the AppImage is executable and extract it - chmod +x *.AppImage - ./*.AppImage --appimage-extract - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 3: Copy remaining extracted files to the Flatpak destination - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: file @@ -486,14 +493,17 @@ modules: - name: cemu buildsystem: simple build-commands: + # Step 1: Ensure the AppImage is executable and extract it - chmod +x *.AppImage - ./*.AppImage --appimage-extract - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - rm -rf "squashfs-root/usr/lib/girepository-1.0" # causes issues, I think we already have this - - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 2: Remove unnecessary files causing potential issues + - rm -rf "squashfs-root/usr/lib/girepository-1.0" + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 5: Install the wrapper script - install -Dm755 Cemu-wrapper "${FLATPAK_DEST}/bin/" - #TODO: do we need this wrapper? squashfs-root/apprun-hooks/linuxdeploy-plugin-gtk.sh sources: - type: file url: https://github.com/cemu-project/Cemu/releases/download/v2.4/Cemu-2.4-x86_64.AppImage @@ -536,12 +546,15 @@ modules: - name: retrodeck-solarus buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - #- cp -r "files/lib/debug/lib/*" "${FLATPAK_DEST}/retrodeck/tmplib/debug/" - - rm -rf "files/lib/debug" "files/lib/pkgconfig" - - chmod +x "files/bin/"* - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.solarus_games.solarus.Launcher/releases/latest/download/RetroDECK-solarus-Artifact.tar.gz @@ -554,13 +567,17 @@ modules: - name: retrodeck-gzdoom buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - rm -rf "files/lib/cmake" "files/lib/pkgconfig" "files/lib/debug" - - "cp -rnL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib || echo 'Warning: Some files could not be copied, but the build will continue.'" - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Remove unnecessary files + - rm -rf "squashfs-root/usr/lib/cmake" "squashfs-root/usr/lib/pkgconfig" "squashfs-root/usr/lib/debug" + # Step 4: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 5: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.zdoom.GZDoom/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -568,13 +585,19 @@ modules: # Pancakes - - name: Pancakes + - name: pancakes buildsystem: simple build-commands: + # Step 1: Create the Flatpak destination directory - mkdir -p "${FLATPAK_DEST}" - - mv *.so* "${FLATPAK_DEST}/retrodeck/tmplib/" + # Step 2: Extract and manage library files + - chmod +x *.so* + - mv *.so* "squashfs-root/usr/lib" + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 3: Move and set up the binary - mv R*x* "${FLATPAK_DEST}/bin/" - chmod +x "${FLATPAK_DEST}/bin/"R*x* + # Step 4: Set up license directory and move license files - mkdir -p "${FLATPAK_DEST}/retrodeck/licenses" - mv LICENSE.txt "${FLATPAK_DEST}/retrodeck/licenses" sources: @@ -589,10 +612,12 @@ modules: - name: xemu buildsystem: simple build-commands: + # Step 1: Ensure the AppImage is executable and extract it - chmod +x *.AppImage - ./*.AppImage --appimage-extract - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 3: Copy remaining extracted files to the Flatpak destination - cp -r squashfs-root/usr/* "${FLATPAK_DEST}/" sources: - type: file @@ -661,13 +686,15 @@ modules: - name: ES-DE buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - - cp -rfL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib - - cp -rfL files/lib/* ${FLATPAK_DEST}/retrodeck/tmplib - - rm -rf "files/lib" - - chmod +x "files/bin/"* - - cp -r files/* "${FLATPAK_DEST}" + # Step 2: Extract the AppImage + - chmod +x ./*.AppImage + - ./*.AppImage --appimage-extract + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "squashfs-root/usr/lib" + # Step 4: Copy remaining extracted files to the Flatpak destination + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/ES-DE/releases/latest/download/RetroDECK-ES-DE-Artifact.tar.gz @@ -698,53 +725,6 @@ modules: url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2025-01-04/ruffle-nightly-2025_01_04-linux-x86_64.tar.gz sha256: 27287f45c56c7a66c62f2dc218abffc57a864ba7b1a783e38e2c54609fde496d - - name: fetch-missing-libs - buildsystem: simple - build-commands: - - | - # Search for missing libraries in our libtmp folder - missing_libs=$(find /app/bin -type f -exec ldd {} + 2>/dev/null | grep 'not found' | awk '$1 ~ /\.so/ {print $1}' | sort | uniq) - echo "$missing_libs" - - # Manually specified libraries that are not automatically detected - manually_imported="libpostproc.so.56 libswscale.so.6 libshaderc_shared.so.1 libbz2.so.1.0 libaio.so.1 ld-linux.so.2 libvpx.so.9 libzmusic.so.1 libicuuc.so.73 libLLVM.so.18.1" - - # Combine detected missing libraries and manually specified ones - missing_libs="$missing_libs $manually_imported" - echo -e "Missing libs and manually imported:\n$missing_libs" - - # Source paths - src_dir="${FLATPAK_DEST}/retrodeck/tmplib" - src_debug_dir="${FLATPAK_DEST}/retrodeck/tmplib/debug" - - # Destination paths - dest_dir="${FLATPAK_DEST}/lib" - dest_debug_dir="${FLATPAK_DEST}/retrodeck/lib/debug" - - mkdir -p "$dest_dir" "$dest_debug_dir" - - copy_missing_libs() { - local src=$1 - local src_debug=$2 - local dest=$3 - for lib in $missing_libs; do - if [[ -f "$src/$lib" ]]; then - cp "$src/$lib" "$dest" && echo "Copied \"$lib\" to \"$dest\"" || echo "Error copying \"$lib\"" - elif [[ -f "$src_debug/$lib.debug" ]]; then - cp "$src_debug/$lib.debug" "$dest" && echo "Copied debug version of \"$lib\" to \"$dest\"" || echo "Error copying debug version of \"$lib\"" - else - echo "Library \"$lib\" not found in \"$src\" or \"$src_debug\"" - fi - done - } - - # Copy libraries from source to destination - copy_missing_libs "$src_dir" "$src_debug_dir" "$dest_dir" - copy_missing_libs "$src_debug_dir" "$dest_debug_dir" - - # Remove temporary source directory to free up space - rm -rf "$src_dir" - - name: retrodeck buildsystem: simple build-commands: From ee3ee8271ee9b1b4c4835915a1e046ff18a2cbf6 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 09:57:49 +0900 Subject: [PATCH 02/38] ES-DE: fixed libman integration --- net.retrodeck.retrodeck.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 63b40941..360552e9 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -688,13 +688,14 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract - # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 3: Clean up source library folder + - rm -rf "files/lib" + # Step 4: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 5: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/ES-DE/releases/latest/download/RetroDECK-ES-DE-Artifact.tar.gz From 0079239d087d773d95a24f13bbe21a76a7927ca3 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 10:26:05 +0900 Subject: [PATCH 03/38] LIBMAN: fixed modules wrongly managed as appimages --- net.retrodeck.retrodeck.yml | 114 ++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 360552e9..d4c67626 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -395,13 +395,15 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract - # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 3: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 4: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 5: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.DolphinEmu.dolphin-emu/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -415,13 +417,17 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract + # Step 2: Remove unnecessary files + - rm -rf "files/lib/pkgconfig" # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - /app/bin/libman.sh "files/lib" + # Step 4: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 5: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 6: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/io.github.shiiion.primehack/releases/latest/download/RetroDECK-primehack-Artifact.tar.gz @@ -435,13 +441,15 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract - # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 3: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 4: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 5: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/net.rpcs3.RPCS3/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -455,13 +463,15 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract - # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 3: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 4: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 5: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}/" sources: - type: archive url: https://github.com/RetroDECK/net.kuribo64.melonDS/releases/latest/download/RetroDECK-melonds-Artifact.tar.gz @@ -548,13 +558,17 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract + # Step 2: Remove unnecessary files + - rm -rf "files/lib/debug" "files/lib/pkgconfig" # Step 3: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - /app/bin/libman.sh "files/lib" + # Step 4: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 5: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 6: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.solarus_games.solarus.Launcher/releases/latest/download/RetroDECK-solarus-Artifact.tar.gz @@ -569,15 +583,17 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f "files/manifest.json" - # Step 2: Extract the AppImage - - chmod +x ./*.AppImage - - ./*.AppImage --appimage-extract - # Step 3: Remove unnecessary files - - rm -rf "squashfs-root/usr/lib/cmake" "squashfs-root/usr/lib/pkgconfig" "squashfs-root/usr/lib/debug" - # Step 4: Use libman.sh to manage libraries - - /app/bin/libman.sh "squashfs-root/usr/lib" - # Step 5: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + # Step 2: Remove unnecessary files + - rm -rf "files/lib/cmake" "files/lib/pkgconfig" "files/lib/debug" + # Step 3: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 4: Copy the managed libraries to the Flatpak destination + - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + - rm -rf "files/lib" + # Step 5: Ensure binaries are executable + - chmod +x "files/bin/"* + # Step 6: Copy all remaining files to the Flatpak destination + - cp -r files/* "${FLATPAK_DEST}" sources: - type: archive url: https://github.com/RetroDECK/org.zdoom.GZDoom/releases/latest/download/RetroDECK-Artifact.tar.gz @@ -639,23 +655,17 @@ modules: - name: retrodeck-mame buildsystem: simple build-commands: + # Step 1: Remove any existing manifest.json file - rm -f files/manifest.json + # Step 2: Use libman.sh to manage libraries + - /app/bin/libman.sh "files/lib" + # Step 3: Copy the managed libraries and all other files to the Flatpak destination - cp -rn files/* ${FLATPAK_DEST} sources: - type: archive url: https://github.com/RetroDECK/org.mamedev.MAME/releases/latest/download/RetroDECK-Artifact.tar.gz sha256: RETRODECKMAMELATEST - # - name: retrodeck-mame - # buildsystem: simple - # build-commands: - # - rm -f files/manifest.json - # - cp -rn files/* ${FLATPAK_DEST} - # sources: - # - type: archive - # url: https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz - # sha256: RETRODECKOLDMAMELATEST - # PortMaster - name: PortMaster From 8d054098893c072c151f6d7dadb323b4a8ae938c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 10:30:06 +0900 Subject: [PATCH 04/38] LIBMAN: fixed modules wrongly managed as appimages - fix --- net.retrodeck.retrodeck.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index d4c67626..76971560 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -397,8 +397,7 @@ modules: - rm -f "files/manifest.json" # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 3: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 3: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 4: Ensure binaries are executable - chmod +x "files/bin/"* @@ -421,8 +420,7 @@ modules: - rm -rf "files/lib/pkgconfig" # Step 3: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 4: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 4: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 5: Ensure binaries are executable - chmod +x "files/bin/"* @@ -443,8 +441,7 @@ modules: - rm -f "files/manifest.json" # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 3: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 3: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 4: Ensure binaries are executable - chmod +x "files/bin/"* @@ -465,8 +462,7 @@ modules: - rm -f "files/manifest.json" # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 3: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 3: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 4: Ensure binaries are executable - chmod +x "files/bin/"* @@ -562,8 +558,7 @@ modules: - rm -rf "files/lib/debug" "files/lib/pkgconfig" # Step 3: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 4: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 4: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 5: Ensure binaries are executable - chmod +x "files/bin/"* @@ -587,8 +582,7 @@ modules: - rm -rf "files/lib/cmake" "files/lib/pkgconfig" "files/lib/debug" # Step 3: Use libman.sh to manage libraries - /app/bin/libman.sh "files/lib" - # Step 4: Copy the managed libraries to the Flatpak destination - - cp -rL files/lib/* "${FLATPAK_DEST}/retrodeck/tmplib" + # Step 4: removing libraries folder that have been already moved - rm -rf "files/lib" # Step 5: Ensure binaries are executable - chmod +x "files/bin/"* From d6ae6d13baa3698d2598706486c5142a61cca619 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 10:31:47 +0900 Subject: [PATCH 05/38] LIBMAN: first we read from the runtime libraries, then the imported ones --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 76971560..0b95709e 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -37,7 +37,7 @@ finish-args: - --filesystem=xdg-run/gamescope-0:ro environment: - LD_LIBRARY_PATH: "${FLATPAK_DEST}/retrodeck/lib:${LD_LIBRARY_PATH}" + LD_LIBRARY_PATH: "{LD_LIBRARY_PATH}:${FLATPAK_DEST}/retrodeck/lib" cleanup: # ES-DE From 7c54399f1698888baa3d1cf7776f68fc15d12563 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 10:49:20 +0900 Subject: [PATCH 06/38] LIBMAN: simplified installation --- net.retrodeck.retrodeck.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 0b95709e..14a1e74d 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -72,11 +72,12 @@ modules: # [ ] Update the VERSION variable on line containing "VERSION=THISBRANCH" # [ ] Update the appdata.xml with the version number and notes - - name: version-initialization + - name: retrodeck-initialization buildsystem: simple build-commands: - | + # VERSION INITIALIZATION # on main please update this with the version variable, eg: VERSION=0.8.0b # on cooker will be VERSION=cooker-0.9.0b for example VERSION=cooker-0.9.0b @@ -90,17 +91,14 @@ modules: echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version cat ${FLATPAK_DEST}/retrodeck/version echo "Version is $VERSION" + + # LBIMAN INSTALLATION + - install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" sources: - type: git url: THISREPO branch: THISBRANCH - # libman (as in Library Manager) is a module that allows to copy library files from the various modules to the retrodeck library folder - - name: libman - buildsystem: simple - build-commands: - - install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" - - name: xmlstarlet config-opts: - --disable-static-libs From 919cad23ec61ee0f6adba4b14617fb9a68421525 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 10:58:12 +0900 Subject: [PATCH 07/38] LIBMAN: simplified installation - fix --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 14a1e74d..dacc8660 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -93,7 +93,7 @@ modules: echo "Version is $VERSION" # LBIMAN INSTALLATION - - install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" + install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" sources: - type: git url: THISREPO From 0368aadcd3d88aa84c6f882ac9458595ae4813b9 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 11:47:41 +0900 Subject: [PATCH 08/38] LIBMAN: tentatively fixed directory recognition in flatpak builder environment --- automation_tools/libman.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index 82ffa105..cfe628d2 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -19,16 +19,18 @@ mkdir -p "$target_dir" # Find and copy files find "$1" -type f -exec sh -c ' - for file; do - dest_file="$1/$(basename "$file")" - if [ ! -e "$dest_file" ]; then + target_dir="$1" + shift + for file in "$@"; do + dest_file="$target_dir/$(basename "$file")" + if [ ! -e "$dest_file" ]; then if cp "$file" "$dest_file"; then - echo "Copied $file to $dest_file" + echo "Copied $file to $dest_file" else - echo "Failed to copy $file to $dest_file" + echo "Failed to copy $file to $dest_file" fi - else + else echo "Skipped $file as $dest_file already exists" - fi - done - ' sh {} + "$target_dir" \ No newline at end of file + fi + done +' sh "$target_dir" {} + From 5203448698506381259ea64fe8fe9ec6880d3fe6 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 14:02:54 +0900 Subject: [PATCH 09/38] LIBMAN: tentatively fixed cp not able to copy unversioned libraries --- automation_tools/libman.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index cfe628d2..c69fc847 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -24,10 +24,10 @@ find "$1" -type f -exec sh -c ' for file in "$@"; do dest_file="$target_dir/$(basename "$file")" if [ ! -e "$dest_file" ]; then - if cp "$file" "$dest_file"; then - echo "Copied $file to $dest_file" + if ! cp "$file" "$dest_file" 2>/dev/null; then + echo "Warning: Failed to copy $file. Skipping." else - echo "Failed to copy $file to $dest_file" + echo "Copied $file to $dest_file" fi else echo "Skipped $file as $dest_file already exists" From 90856f1dbe56c4cf1bb131238a5ed88073a770f7 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 15:26:15 +0900 Subject: [PATCH 10/38] LIBMAN: simplified script --- automation_tools/libman.sh | 43 +++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index c69fc847..5c2a2918 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -1,5 +1,7 @@ #!/bin/bash +echo "Starting LibMan" + # Set default destination if FLATPAK_DEST is not set if [ -z "$FLATPAK_DEST" ]; then FLATPAK_DEST="/app" @@ -15,22 +17,29 @@ fi target_dir="${FLATPAK_DEST}/retrodeck/lib" # Ensure the target directory exists -mkdir -p "$target_dir" +if ! mkdir -p "$target_dir"; then + echo "Error: Failed to create target directory $target_dir" + exit 0 +fi # Find and copy files -find "$1" -type f -exec sh -c ' - target_dir="$1" - shift - for file in "$@"; do - dest_file="$target_dir/$(basename "$file")" - if [ ! -e "$dest_file" ]; then - if ! cp "$file" "$dest_file" 2>/dev/null; then - echo "Warning: Failed to copy $file. Skipping." - else - echo "Copied $file to $dest_file" - fi - else - echo "Skipped $file as $dest_file already exists" - fi - done -' sh "$target_dir" {} + +find "$1" -type f | while IFS= read -r file; do + # Define destination file path + dest_file="$target_dir/$(basename "$file")" + + # Skip if the destination file already exists + if [ -e "$dest_file" ]; then + echo "Skipped $file as $dest_file already exists" + continue + fi + + # Attempt to copy the file + if cp "$file" "$dest_file"; then + echo "Copied $file to $dest_file" + else + echo "Warning: Failed to copy $file. Skipping." + fi +done + +echo "Terminating LibMan" + From ca059f2659517c02609993b2e661e96500a30ea8 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 16:20:31 +0900 Subject: [PATCH 11/38] LIBMAN: fixed comment [skip ci] --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index dacc8660..4c1b3d4f 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -92,7 +92,7 @@ modules: cat ${FLATPAK_DEST}/retrodeck/version echo "Version is $VERSION" - # LBIMAN INSTALLATION + # LIBMAN INSTALLATION install -Dm755 "automation_tools/libman.sh" "/app/bin/libman.sh" sources: - type: git From da14ec5290d623bce86b317305df1742c7855f9d Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 20:07:52 +0900 Subject: [PATCH 12/38] LIBMAN: using install instead of cp and made it more verbose --- automation_tools/libman.sh | 45 ++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index 5c2a2918..5df65a5b 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "Starting LibMan" +echo "Worry not, LibMan is here!" # Set default destination if FLATPAK_DEST is not set if [ -z "$FLATPAK_DEST" ]; then @@ -10,7 +10,7 @@ fi # Check if source directory is provided if [ -z "$1" ]; then echo "Usage: $0 " - exit 1 + exit 0 fi # Define target directory @@ -22,7 +22,21 @@ if ! mkdir -p "$target_dir"; then exit 0 fi +# List all libraries in LD_LIBRARY_PATH and store them in an array +libraries=() +IFS=: read -ra dirs <<< "$LD_LIBRARY_PATH" +for dir in "${dirs[@]}"; do + if [ -d "$dir" ]; then + while IFS= read -r lib; do + libraries+=("$lib") + done < <(find "$dir" -type f -name "*.so") + fi +done + # Find and copy files +copied_files=() +failed_files=() + find "$1" -type f | while IFS= read -r file; do # Define destination file path dest_file="$target_dir/$(basename "$file")" @@ -33,13 +47,36 @@ find "$1" -type f | while IFS= read -r file; do continue fi + # Skip if the file is already in the list of libraries + if [[ " ${libraries[*]} " == *" $file "* ]]; then + echo "Skipped $file as it is already present in the system" + failed_files+=("$file, already present in the system") + continue + fi + # Attempt to copy the file - if cp "$file" "$dest_file"; then + if install -D "$file" "$dest_file" 2>error_log; then echo "Copied $file to $dest_file" + copied_files+=("$file") else + error_message=$( Date: Mon, 6 Jan 2025 20:34:42 +0900 Subject: [PATCH 13/38] ONE_OFF: to test the build --- .github/workflows/build_retrodeck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_retrodeck.yml b/.github/workflows/build_retrodeck.yml index c0457f5e..98dc08d5 100644 --- a/.github/workflows/build_retrodeck.yml +++ b/.github/workflows/build_retrodeck.yml @@ -7,6 +7,7 @@ on: - cooker* - feat* - branch/cooker* + - feat/libman paths: - '.github/workflows/**' - 'automation_tools/**' From 1bca6342657fdc00cc784400440d81872287394e Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 21:00:51 +0900 Subject: [PATCH 14/38] LIBMAN: deleting source directory + list fix --- automation_tools/libman.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index 5df65a5b..cf35ee74 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Be aware that this script is deleting the source directory after copying the files and it's intended to be used onyl by flatpak builder + echo "Worry not, LibMan is here!" # Set default destination if FLATPAK_DEST is not set @@ -37,7 +39,7 @@ done copied_files=() failed_files=() -find "$1" -type f | while IFS= read -r file; do +while IFS= read -r file; do # Define destination file path dest_file="$target_dir/$(basename "$file")" @@ -63,7 +65,10 @@ find "$1" -type f | while IFS= read -r file; do echo "Warning: Failed to copy $file. Skipping." failed_files+=("$file, $error_message") fi -done +done < <(find "$1" -type f) + +echo "Deleting the used lib directory" +rm -rf "$1" echo "LibMan is flying away" From 72deb3ed731bc22c64a6e70ab80bc96330325749 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 21:32:19 +0900 Subject: [PATCH 15/38] PANCAKES: module fixed for libman --- net.retrodeck.retrodeck.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 4c1b3d4f..5c2ff690 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -599,8 +599,6 @@ modules: # Step 1: Create the Flatpak destination directory - mkdir -p "${FLATPAK_DEST}" # Step 2: Extract and manage library files - - chmod +x *.so* - - mv *.so* "squashfs-root/usr/lib" - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 3: Move and set up the binary - mv R*x* "${FLATPAK_DEST}/bin/" From 3f7b09368ce53cbf934de6efa327648c76e32e1d Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 21:41:47 +0900 Subject: [PATCH 16/38] Revert "ONE_OFF: to test the build" This reverts commit 250e7b0eb94a00464f8a7a56080d3950578f9acf. --- .github/workflows/build_retrodeck.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_retrodeck.yml b/.github/workflows/build_retrodeck.yml index 98dc08d5..c0457f5e 100644 --- a/.github/workflows/build_retrodeck.yml +++ b/.github/workflows/build_retrodeck.yml @@ -7,7 +7,6 @@ on: - cooker* - feat* - branch/cooker* - - feat/libman paths: - '.github/workflows/**' - 'automation_tools/**' From 5213cb13b227bcbb733bd178de3dd5f7a8a5ea17 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 23:14:13 +0900 Subject: [PATCH 17/38] LIBMAN: searching only for linux libraries + not showing failed files if there aren't --- automation_tools/libman.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index cf35ee74..ab891cf9 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -39,7 +39,7 @@ done copied_files=() failed_files=() -while IFS= read -r file; do +find "$1" -type f -name "*.so*" | while IFS= read -r file; do # Define destination file path dest_file="$target_dir/$(basename "$file")" @@ -65,10 +65,7 @@ while IFS= read -r file; do echo "Warning: Failed to copy $file. Skipping." failed_files+=("$file, $error_message") fi -done < <(find "$1" -type f) - -echo "Deleting the used lib directory" -rm -rf "$1" +done echo "LibMan is flying away" @@ -78,10 +75,13 @@ for file in "${copied_files[@]}"; do echo "$file" done -echo "Failed files:" -for file in "${failed_files[@]}"; do - echo "$file" -done +# Output failed files only if the list is not empty +if [ ${#failed_files[@]} -ne 0 ]; then + echo "Failed files:" + for file in "${failed_files[@]}"; do + echo "$file" + fi +fi From 73f18fb899daa4cb8201931ff5fc58c0e79825a3 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 23:14:31 +0900 Subject: [PATCH 18/38] MANIFEST: fixed issue in library pathing --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 5c2ff690..877bec52 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -37,7 +37,7 @@ finish-args: - --filesystem=xdg-run/gamescope-0:ro environment: - LD_LIBRARY_PATH: "{LD_LIBRARY_PATH}:${FLATPAK_DEST}/retrodeck/lib" + LD_LIBRARY_PATH: "${LD_LIBRARY_PATH}:${FLATPAK_DEST}/retrodeck/lib" cleanup: # ES-DE From c388468a7e71fd40343e8a53a8cd9cc210f7eccc Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 23:30:18 +0900 Subject: [PATCH 19/38] LIBMAN: fixed for --- automation_tools/libman.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index ab891cf9..4ae49582 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Be aware that this script is deleting the source directory after copying the files and it's intended to be used onyl by flatpak builder +# Be aware that this script is deleting the source directory after copying the files and it's intended to be used only by flatpak builder echo "Worry not, LibMan is here!" @@ -62,7 +62,7 @@ find "$1" -type f -name "*.so*" | while IFS= read -r file; do copied_files+=("$file") else error_message=$( Date: Mon, 6 Jan 2025 23:54:12 +0900 Subject: [PATCH 20/38] Reapply "ONE_OFF: to test the build" This reverts commit 3f7b09368ce53cbf934de6efa327648c76e32e1d. --- .github/workflows/build_retrodeck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_retrodeck.yml b/.github/workflows/build_retrodeck.yml index c0457f5e..98dc08d5 100644 --- a/.github/workflows/build_retrodeck.yml +++ b/.github/workflows/build_retrodeck.yml @@ -7,6 +7,7 @@ on: - cooker* - feat* - branch/cooker* + - feat/libman paths: - '.github/workflows/**' - 'automation_tools/**' From d49e5b2bc5dec526b0e2f33d06750d2eaf4ef539 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:16:35 +0900 Subject: [PATCH 21/38] LIBMAN: using for to don't fall in a subshell --- automation_tools/libman.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index 4ae49582..f13bbb28 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -39,7 +39,7 @@ done copied_files=() failed_files=() -find "$1" -type f -name "*.so*" | while IFS= read -r file; do +for file in $(find "$1" -type f -name "*.so*"); do # Define destination file path dest_file="$target_dir/$(basename "$file")" From f428f95c3e7a9d04d9ae27587007d52c81530dfa Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:17:47 +0900 Subject: [PATCH 22/38] APPDATA: added LibMan --- net.retrodeck.retrodeck.appdata.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/net.retrodeck.retrodeck.appdata.xml b/net.retrodeck.retrodeck.appdata.xml index 790a2296..58f4c6b1 100644 --- a/net.retrodeck.retrodeck.appdata.xml +++ b/net.retrodeck.retrodeck.appdata.xml @@ -97,6 +97,7 @@
  • RetroDECK now is migrated to an organization on GitHub, as before, please check the October blog post
  • pre_build_automation script was reworked and additional functions are added
  • Contributing is now easier and the manifest build time is down to about 1h (was 3h30)
  • +
  • Introduced a new library management system called LibMan to make sure that each compoent is bringing its own libraries while built from the manifest
  • Known issues:

      From 598fdc4829909497b503112c0927ca2d4c8b9794 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:21:32 +0900 Subject: [PATCH 23/38] MANIFEST: cp command is often failing because of some libraries aren't versioned, trying with install command instead --- net.retrodeck.retrodeck.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 877bec52..5b962969 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -245,7 +245,7 @@ modules: # Step 4: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 5: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; sources: - type: archive url: https://buildbot.libretro.com/stable/1.20.0/linux/x86_64/RetroArch.7z @@ -378,7 +378,7 @@ modules: # Step 3: Use libman.sh to handle library files - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 4: Copy the remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; sources: - type: file url: https://github.com/PCSX2/pcsx2/releases/download/v2.3.88/pcsx2-v2.3.88-linux-appimage-x64-Qt.AppImage @@ -484,7 +484,7 @@ modules: # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 3: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; sources: - type: file url: https://github.com/RetroDECK/Duckstation/releases/download/preview/DuckStation-x64.AppImage @@ -505,7 +505,7 @@ modules: # Step 3: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 4: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}" + - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; # Step 5: Install the wrapper script - install -Dm755 Cemu-wrapper "${FLATPAK_DEST}/bin/" sources: From cd027eb71a28387c3fd08c084f8cf70e6feeb9cb Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:54:17 +0900 Subject: [PATCH 24/38] LIBMAN: not showing "Copied files" if there aren't --- automation_tools/libman.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index f13bbb28..f95dbc32 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -70,10 +70,12 @@ done echo "LibMan is flying away" # Output the lists of copied and failed files -echo "Copied files:" -for file in "${copied_files[@]}"; do - echo "$file" -done +if [ ${#copied_files[@]} -ne 0 ]; then + echo "Copied files:" + for file in "${copied_files[@]}"; do + echo "$file" + done +fi # Output failed files only if the list is not empty if [ ${#failed_files[@]} -ne 0 ]; then From fd7e23b32b09dd0beca10222ed5e068c42e5fde9 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:54:50 +0900 Subject: [PATCH 25/38] LIBMAN: changing echoes --- automation_tools/libman.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index f95dbc32..bbc0d8a9 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -71,7 +71,7 @@ echo "LibMan is flying away" # Output the lists of copied and failed files if [ ${#copied_files[@]} -ne 0 ]; then - echo "Copied files:" + echo "Imported libraries:" for file in "${copied_files[@]}"; do echo "$file" done @@ -79,7 +79,7 @@ fi # Output failed files only if the list is not empty if [ ${#failed_files[@]} -ne 0 ]; then - echo "Failed files:" + echo "Failed library files:" for file in "${failed_files[@]}"; do echo "$file" done From 4a1f36dcedc7b9cb32afc4e2df7078dcb3334e53 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 09:56:55 +0900 Subject: [PATCH 26/38] MAME: removed LibMan --- net.retrodeck.retrodeck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 5b962969..7cb0d746 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -647,8 +647,8 @@ modules: build-commands: # Step 1: Remove any existing manifest.json file - rm -f files/manifest.json - # Step 2: Use libman.sh to manage libraries - - /app/bin/libman.sh "files/lib" + # Step 2: Use libman.sh to manage libraries - REMOVED AS MAME DON'T BRING ANY LIBS WITH IT + # - /app/bin/libman.sh "files/lib" # Step 3: Copy the managed libraries and all other files to the Flatpak destination - cp -rn files/* ${FLATPAK_DEST} sources: From 164b5bd7049a6fe299afabc291bfa82635260722 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 11:57:06 +0900 Subject: [PATCH 27/38] MANIFEST: fixed modules installation in the wrong path --- net.retrodeck.retrodeck.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 7cb0d746..0ddf447f 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -245,7 +245,7 @@ modules: # Step 4: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 5: Copy remaining extracted files to the Flatpak destination - - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; + - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; sources: - type: archive url: https://buildbot.libretro.com/stable/1.20.0/linux/x86_64/RetroArch.7z @@ -378,7 +378,7 @@ modules: # Step 3: Use libman.sh to handle library files - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 4: Copy the remaining extracted files to the Flatpak destination - - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; + - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; sources: - type: file url: https://github.com/PCSX2/pcsx2/releases/download/v2.3.88/pcsx2-v2.3.88-linux-appimage-x64-Qt.AppImage @@ -484,7 +484,7 @@ modules: # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 3: Copy remaining extracted files to the Flatpak destination - - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; + - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; sources: - type: file url: https://github.com/RetroDECK/Duckstation/releases/download/preview/DuckStation-x64.AppImage @@ -505,7 +505,7 @@ modules: # Step 3: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 4: Copy remaining extracted files to the Flatpak destination - - find squashfs-root/usr/ -type f -exec install -Dm755 "{}" "${FLATPAK_DEST}/{}" \; + - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; # Step 5: Install the wrapper script - install -Dm755 Cemu-wrapper "${FLATPAK_DEST}/bin/" sources: From ab28b58b649eafd9edbe34cd02a574a5083e811a Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 12:05:56 +0900 Subject: [PATCH 28/38] MANIFEST: tentative fixing the ld library path --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 0ddf447f..2bdf7e1c 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -37,7 +37,7 @@ finish-args: - --filesystem=xdg-run/gamescope-0:ro environment: - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH}:${FLATPAK_DEST}/retrodeck/lib" + LD_LIBRARY_PATH: "/app/lib:/app/retrodeck/lib" cleanup: # ES-DE From 67f88f42cccc06b3b776aedac029e9323b4cb866 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 12:07:53 +0900 Subject: [PATCH 29/38] MANIFEST: tentative fixing the ld library path --- net.retrodeck.retrodeck.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 2bdf7e1c..16218ab9 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -35,9 +35,8 @@ finish-args: - --filesystem=~/.var/app/com.valvesoftware.Steam:rw # Steam (Flatpak) # PPSSPP, DOLPHIN - --filesystem=xdg-run/gamescope-0:ro + - --env=LD_LIBRARY_PATH=/app/lib:/app/retrodeck/lib -environment: - LD_LIBRARY_PATH: "/app/lib:/app/retrodeck/lib" cleanup: # ES-DE From 86e8294c3342bb76a63bb0ca97f14187685418ce Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 14:12:59 +0900 Subject: [PATCH 30/38] LIBMAN: his costume might be ready to write directly into /app/lib - NANANANANANA: LIBMAN! --- automation_tools/libman.sh | 2 +- net.retrodeck.retrodeck.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index bbc0d8a9..d5386e7e 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -16,7 +16,7 @@ if [ -z "$1" ]; then fi # Define target directory -target_dir="${FLATPAK_DEST}/retrodeck/lib" +target_dir="${FLATPAK_DEST}/lib" # Ensure the target directory exists if ! mkdir -p "$target_dir"; then diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 16218ab9..3c6d585d 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -35,8 +35,6 @@ finish-args: - --filesystem=~/.var/app/com.valvesoftware.Steam:rw # Steam (Flatpak) # PPSSPP, DOLPHIN - --filesystem=xdg-run/gamescope-0:ro - - --env=LD_LIBRARY_PATH=/app/lib:/app/retrodeck/lib - cleanup: # ES-DE From e0ae658383b9f7d8e2bc8f77371085f716c05339 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 14:39:28 +0900 Subject: [PATCH 31/38] LIBMAN: added exclusion list + tweaks, removed LD_LIBRAY_PATH search as the runtime libraries are safe --- automation_tools/libman.sh | 49 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index d5386e7e..342154a3 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -1,12 +1,20 @@ #!/bin/bash -# Be aware that this script is deleting the source directory after copying the files and it's intended to be used only by flatpak builder +# Be aware that this script deletes the source directory after copying the files. It is intended to be used only by the flatpak builder. + + +# List of user-defined libraries to exclude +excluded_libraries=("libselinux.so.1") + +# Define target directory +target_dir="${FLATPAK_DEST}/lib" + echo "Worry not, LibMan is here!" # Set default destination if FLATPAK_DEST is not set if [ -z "$FLATPAK_DEST" ]; then - FLATPAK_DEST="/app" + export FLATPAK_DEST="/app" fi # Check if source directory is provided @@ -15,25 +23,22 @@ if [ -z "$1" ]; then exit 0 fi -# Define target directory -target_dir="${FLATPAK_DEST}/lib" - # Ensure the target directory exists if ! mkdir -p "$target_dir"; then echo "Error: Failed to create target directory $target_dir" exit 0 fi -# List all libraries in LD_LIBRARY_PATH and store them in an array -libraries=() -IFS=: read -ra dirs <<< "$LD_LIBRARY_PATH" -for dir in "${dirs[@]}"; do - if [ -d "$dir" ]; then - while IFS= read -r lib; do - libraries+=("$lib") - done < <(find "$dir" -type f -name "*.so") - fi -done +# Function to check if a file is in the excluded libraries list +is_excluded() { + local file="$1" + for excluded in "${excluded_libraries[@]}"; do + if [[ "$excluded" == "$file" ]]; then + return 0 + fi + done + return 1 +} # Find and copy files copied_files=() @@ -49,13 +54,13 @@ for file in $(find "$1" -type f -name "*.so*"); do continue fi - # Skip if the file is already in the list of libraries - if [[ " ${libraries[*]} " == *" $file "* ]]; then - echo "Skipped $file as it is already present in the system" - failed_files+=("$file, already present in the system") + # Skip if the file is in the list of excluded libraries + if is_excluded "$(basename "$file")"; then + reason="library is in the exclusion list" + echo "Skipped $file as it is $reason" + failed_files+=("$file, $reason") continue fi - # Attempt to copy the file if install -D "$file" "$dest_file" 2>error_log; then echo "Copied $file to $dest_file" @@ -67,8 +72,6 @@ for file in $(find "$1" -type f -name "*.so*"); do fi done -echo "LibMan is flying away" - # Output the lists of copied and failed files if [ ${#copied_files[@]} -ne 0 ]; then echo "Imported libraries:" @@ -84,3 +87,5 @@ if [ ${#failed_files[@]} -ne 0 ]; then echo "$file" done fi + +echo "LibMan is flying away" From 8bf12280ff4f13f8a239139dd76e7b666a4b5e7f Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 15:08:04 +0900 Subject: [PATCH 32/38] XEMU: using install instead of cp --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 3c6d585d..ffef582d 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -621,7 +621,7 @@ modules: # Step 2: Use libman.sh to manage libraries - /app/bin/libman.sh "squashfs-root/usr/lib" # Step 3: Copy remaining extracted files to the Flatpak destination - - cp -r squashfs-root/usr/* "${FLATPAK_DEST}/" + - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; sources: - type: file url: https://github.com/xemu-project/xemu/releases/download/v0.8.5/xemu-v0.8.5-x86_64.AppImage From c5e0938d0abe808934571a74370421344092af27 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 7 Jan 2025 20:23:39 +0900 Subject: [PATCH 33/38] LIBMAN: added symlinked libaries support --- automation_tools/libman.sh | 50 ++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index 342154a3..ed395fee 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -44,15 +44,10 @@ is_excluded() { copied_files=() failed_files=() -for file in $(find "$1" -type f -name "*.so*"); do +# First, copy all regular files +for file in $(find "$1" -type f -name "*.so*" ! -type l); do # Define destination file path dest_file="$target_dir/$(basename "$file")" - - # Skip if the destination file already exists - if [ -e "$dest_file" ]; then - echo "Skipped $file as $dest_file already exists" - continue - fi # Skip if the file is in the list of excluded libraries if is_excluded "$(basename "$file")"; then @@ -61,6 +56,13 @@ for file in $(find "$1" -type f -name "*.so*"); do failed_files+=("$file, $reason") continue fi + + # Skip if the destination file already exists + if [ -e "$dest_file" ]; then + echo "Skipped $file as $dest_file already exists" + continue + fi + # Attempt to copy the file if install -D "$file" "$dest_file" 2>error_log; then echo "Copied $file to $dest_file" @@ -72,6 +74,40 @@ for file in $(find "$1" -type f -name "*.so*"); do fi done +# Then, copy all symlinks +for file in $(find "$1" -type l -name "*.so*"); do + # Define destination file path + dest_file="$target_dir/$(basename "$file")" + + # Get the target of the symlink + symlink_target=$(readlink "$file") + # Define the destination for the symlink target + dest_symlink_target="$target_dir/$(basename "$symlink_target")" + + # Copy the symlink target if it doesn't already exist + if [ ! -e "$dest_symlink_target" ]; then + if install -D "$symlink_target" "$dest_symlink_target" 2>error_log; then + echo "Copied symlink target $symlink_target to $dest_symlink_target" + copied_files+=("$symlink_target") + else + error_message=$(error_log; then + echo "Created symlink $dest_file -> $dest_symlink_target" + copied_files+=("$file") + else + error_message=$( Date: Tue, 7 Jan 2025 21:04:27 +0900 Subject: [PATCH 34/38] LIBMAN: we clean it up in the end [skip ci] --- net.retrodeck.retrodeck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index ffef582d..448340f4 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -53,6 +53,7 @@ cleanup: - /src - '*.a' - '*.la' + - /app/bin/libman.sh modules: From 2490debc15f59d64a1245a3ef544210996185f80 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Jan 2025 00:00:21 +0900 Subject: [PATCH 35/38] MANFIEST: runtime 6.7 --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 448340f4..8bf0a722 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1,6 +1,6 @@ app-id: net.retrodeck.retrodeck runtime: org.kde.Platform -runtime-version: "6.8" +runtime-version: "6.7" sdk: org.kde.Sdk base: org.electronjs.Electron2.BaseApp # Needed for Steam ROM Manager base-version: "22.08" From 48c7f74b5b76fbf5d6daf3625e336e8545980918 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Jan 2025 10:24:14 +0900 Subject: [PATCH 36/38] RUFFLE: updated to 2025-01-07 (was 2025-01-04) --- net.retrodeck.retrodeck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 8bf0a722..7a4fbf32 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -721,8 +721,8 @@ modules: sources: - type: archive strip-components: 0 - url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2025-01-04/ruffle-nightly-2025_01_04-linux-x86_64.tar.gz - sha256: 27287f45c56c7a66c62f2dc218abffc57a864ba7b1a783e38e2c54609fde496d + url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2025-01-07/ruffle-nightly-2025_01_07-linux-x86_64.tar.gz + sha256: cb36782b62c9fe000b08bf6dc07ff49d1fb9bd5825cecf8300bcf4ba2a4be27d - name: retrodeck buildsystem: simple From 275805e20738c6ad6ab1529738e0456b725fcdf7 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Jan 2025 10:39:10 +0900 Subject: [PATCH 37/38] PANCAKES: LibMan was poiting the wrong folder --- net.retrodeck.retrodeck.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 7a4fbf32..133a45c9 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -379,8 +379,8 @@ modules: - find squashfs-root/usr/ -exec sh -c 'install -Dm755 "{}" "${FLATPAK_DEST}/$(echo "{}" | sed "s|^squashfs-root/usr||")"' \; sources: - type: file - url: https://github.com/PCSX2/pcsx2/releases/download/v2.3.88/pcsx2-v2.3.88-linux-appimage-x64-Qt.AppImage - sha256: e65495068c7ac5675cef872478497d7bd3ff4ff68a822c034b31a6f5911133e0 + url: https://github.com/PCSX2/pcsx2/releases/download/v2.3.95/pcsx2-v2.3.95-linux-appimage-x64-Qt.AppImage + sha256: 73b7c48dc02b192d7bcc7cf30962dca737cad4f312d036d196ab0e10d8d6b9e1 # Dolphin # why from source: AppImage not provided, only Flatpak @@ -597,13 +597,14 @@ modules: # Step 1: Create the Flatpak destination directory - mkdir -p "${FLATPAK_DEST}" # Step 2: Extract and manage library files - - /app/bin/libman.sh "squashfs-root/usr/lib" + - /app/bin/libman.sh "." # Step 3: Move and set up the binary + - rm -rf *.dll.config - mv R*x* "${FLATPAK_DEST}/bin/" - chmod +x "${FLATPAK_DEST}/bin/"R*x* # Step 4: Set up license directory and move license files - mkdir -p "${FLATPAK_DEST}/retrodeck/licenses" - - mv LICENSE.txt "${FLATPAK_DEST}/retrodeck/licenses" + - mv LICENSE.txt THIRDPARTY.md "${FLATPAKc_DEST}/retrodeck/licenses" sources: - type: archive url: https://github.com/RetroDECK/Pancakes-bin/releases/download/1.1.0.1403/pancakes-Release-linux_x64.tar.gz From 35d5b0b8a65ddf1ffa25a852114593e1d9c4cd20 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 8 Jan 2025 13:02:25 +0900 Subject: [PATCH 38/38] MANIFEST: fixed a mv command --- net.retrodeck.retrodeck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 133a45c9..ae88c7c1 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -604,7 +604,7 @@ modules: - chmod +x "${FLATPAK_DEST}/bin/"R*x* # Step 4: Set up license directory and move license files - mkdir -p "${FLATPAK_DEST}/retrodeck/licenses" - - mv LICENSE.txt THIRDPARTY.md "${FLATPAKc_DEST}/retrodeck/licenses" + - mv LICENSE.txt THIRDPARTY.md "${FLATPAK_DEST}/retrodeck/licenses" sources: - type: archive url: https://github.com/RetroDECK/Pancakes-bin/releases/download/1.1.0.1403/pancakes-Release-linux_x64.tar.gz