From 953a430d44fca21bbf8c464b02767cc6d3d76ef5 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Tue, 25 Oct 2022 12:51:41 -0400 Subject: [PATCH 1/5] qt: Fix qt6 compile --- src/qt/qt_mediamenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_mediamenu.cpp b/src/qt/qt_mediamenu.cpp index 7308f8f91..bea1af22f 100644 --- a/src/qt/qt_mediamenu.cpp +++ b/src/qt/qt_mediamenu.cpp @@ -491,7 +491,7 @@ void MediaMenu::updateImageHistory(int index, int slot, ui::MediaType type) { menu = cdromMenus[index]; children = menu->children(); imageHistoryUpdatePos = dynamic_cast(children[cdromImageHistoryPos[slot]]); - fi = mhm.getImageForSlot(index, slot, type); + fi.setFile(mhm.getImageForSlot(index, slot, type)); menu_icon = fi.isDir() ? QApplication::style()->standardIcon(QStyle::SP_DirIcon) : ProgSettings::loadIcon("/cdrom.ico"); imageHistoryUpdatePos->setIcon(menu_icon); break; @@ -501,7 +501,7 @@ void MediaMenu::updateImageHistory(int index, int slot, ui::MediaType type) { menu = floppyMenus[index]; children = menu->children(); imageHistoryUpdatePos = dynamic_cast(children[floppyImageHistoryPos[slot]]); - fi = mhm.getImageForSlot(index, slot, type); + fi.setFile(mhm.getImageForSlot(index, slot, type)); break; default: pclog("History not yet implemented for media type %s\n", qPrintable(mhm.mediaTypeToString(type))); From 7dc9dd5c090fa375ab6c8c3d4f28da30decfc1e3 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 25 Oct 2022 14:27:32 -0300 Subject: [PATCH 2/5] Jenkins: Update AppImage generation flow to appimage-builder v1.1.0, and add lib dependency report feature to build script --- .ci/AppImageBuilder.yml | 24 +++++++-------- .ci/build.sh | 66 +++++++++++++++++++++++++---------------- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/.ci/AppImageBuilder.yml b/.ci/AppImageBuilder.yml index be2a7f1c1..094a67796 100644 --- a/.ci/AppImageBuilder.yml +++ b/.ci/AppImageBuilder.yml @@ -72,19 +72,17 @@ AppDir: files: exclude: - etc - - lib/udev - - opt/libc/usr/share - - usr/[a-km-rt-zA-Z]* - - usr/lib/*/libasound.so.* - - usr/lib/*.a - - usr/lib/cmake - - usr/lib/pkgconfig - - usr/s[a-gi-zA-Z]* - - usr/share/[a-hj-ln-zA-Z]* - - usr/share/i[a-bd-zA-Z]* - - usr/share/m[a-df-zA-Z]* - - usr/share/metainfo/*.metainfo.xml + - usr/[a-km-rt-zA-Z]* # * except lib, local, share + - usr/lib/*/libasound.so.* # using our own ALSA can cause issues, and the API is pretty stable anyway + - usr/lib/*.a # produced by library compilation + - usr/lib/cmake # produced by library compilation + - usr/lib/pkgconfig # produced by library compilation + - usr/s[a-gi-zA-Z]* # s* except share + - usr/share/[a-hj-ln-zA-Z]* # * except icons, metainfo + - usr/share/i[a-bd-zA-Z]* # i* except icons + - usr/share/m[a-df-zA-Z]* # m* except metainfo + - usr/share/metainfo/*.metainfo.xml # metainfo for libraries - var AppImage: arch: !ENV '${arch_appimage}' - file_name: '-n' # nasty hack to disable metainfo validation + file_name: !ENV '${appimage_path}' diff --git a/.ci/build.sh b/.ci/build.sh index 320451a83..a8d3e7e62 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -136,6 +136,7 @@ package_name= arch= tarball_name= skip_archive=0 +dep_report=0 strip=0 cmake_flags= while [ $# -gt 0 ] @@ -154,6 +155,11 @@ do skip_archive=1 ;; + -p) + shift + dep_report=1 + ;; + -s) shift tarball_name="$1" @@ -166,19 +172,23 @@ do ;; *) - if echo $1 | grep -q " " - then - cmake_flag="\"$1\"" - else - cmake_flag="$1" - fi - if [ -z "$cmake_flags" ] - then - cmake_flags="$cmake_flag" - else - cmake_flags="$cmake_flags $cmake_flag" - fi - shift + # Consume remaining arguments as CMake flags. + while [ $# -gt 0 ] + do + if echo $1 | grep -q " " + then + cmake_flag="\"$1\"" + else + cmake_flag="$1" + fi + if [ -z "$cmake_flags" ] + then + cmake_flags="$cmake_flag" + else + cmake_flags="$cmake_flags $cmake_flag" + fi + shift + done ;; esac done @@ -609,6 +619,7 @@ else # Establish general dependencies. pkgs="cmake ninja-build pkg-config git wget p7zip-full extra-cmake-modules wayland-protocols tar gzip file appstream" + [ $dep_report -ne 0 ] && pkgs="$pkgs pax-utils" if [ "$(dpkg --print-architecture)" = "$arch_deb" ] then pkgs="$pkgs build-essential" @@ -957,7 +968,7 @@ else sdl_ss=ON fi - # Build SDL2 with video systems (and some dependencies) only if the SDL interface is used. + # Build SDL2 with video systems (and dependencies) only if the SDL interface is used. sdl_ui=OFF grep -qiE "^QT:BOOL=ON" build/CMakeCache.txt || sdl_ui=ON @@ -1088,7 +1099,7 @@ else # Generate modified AppImage metadata to suit build requirements. cat << EOF > AppImageBuilder-generated.yml -# This file is generated automatically by .ci/build.sh and will be +# This file is automatically generated by .ci/build.sh and will be # overwritten if edited. Please edit .ci/AppImageBuilder.yml instead. EOF while IFS= read line @@ -1096,7 +1107,7 @@ EOF # Skip blank or comment lines. echo "$line" | grep -qE '^(#|$)' && continue - # Parse "# if OPTION VALUE" condition lines. + # Parse "# if OPTION:TYPE=VALUE" CMake condition lines. condition=$(echo "$line" | grep -oP '# if \K(.+)') if [ -n "$condition" ] then @@ -1109,7 +1120,7 @@ EOF done < .ci/AppImageBuilder.yml # Download appimage-builder if necessary. - appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v0.9.2/appimage-builder-0.9.2-35e3eab-x86_64.AppImage" + appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" appimage_builder_binary="$cache_dir/$(basename "$appimage_builder_url")" if [ ! -e "$appimage_builder_binary" ] then @@ -1125,18 +1136,23 @@ EOF ln -s "$cache_dir/appimage-builder-cache" appimage-builder-cache # Run appimage-builder in extract-and-run mode for Docker compatibility. + # --appdir is a workaround for https://github.com/AppImageCrafters/appimage-builder/issues/270 project="$project" project_id="$project_id" project_version="$project_version" project_icon="$project_icon" arch_deb="$arch_deb" \ - arch_appimage="$arch_appimage" APPIMAGE_EXTRACT_AND_RUN=1 ./appimage-builder.AppImage --recipe AppImageBuilder-generated.yml + arch_appimage="$arch_appimage" appimage_path="$cwd/$package_name.AppImage" APPIMAGE_EXTRACT_AND_RUN=1 ./appimage-builder.AppImage \ + --recipe AppImageBuilder-generated.yml --appdir "$(grep -oP '^\s+path: \K(.+)' AppImageBuilder-generated.yml)" status=$? - # Rename AppImage to the final name if the build succeeded. - if [ $status -eq 0 ] + # Remove appimage-builder binary on failure, just in case it's corrupted. + [ $status -ne 0 ] && rm -f "$appimage_builder_binary" + + # Generate library dependency report if requested. + if [ $dep_report -ne 0 ] then - mv "$project-"*".AppImage" "$cwd/$package_name.AppImage" - status=$? - else - # Remove appimage-builder binary just in case it's corrupted. - rm -f "$appimage_builder_binary" + echo '[-] Library dependency report:' + + # Run lddtree with AppImage lib directories included in the search path. + LD_LIBRARY_PATH=$(find "$(pwd)/archive_tmp" -type d -name lib -o -name lib64 | while read dir; do find "$dir" -type d; done | tr '\n' ':') \ + lddtree "archive_tmp/usr/local/bin/$project" 2>&1 | tee depreport.txt fi fi From e7a078b10a1ac751a69b3655929daad3968f0136 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 25 Oct 2022 16:13:52 -0300 Subject: [PATCH 3/5] Jenkins: Fix AppImage missing icons and a .desktop in the correct paths, closes #2358 --- .ci/AppImageBuilder.yml | 15 ++++++++++----- .ci/build.sh | 13 ++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.ci/AppImageBuilder.yml b/.ci/AppImageBuilder.yml index 094a67796..05a7b8fcb 100644 --- a/.ci/AppImageBuilder.yml +++ b/.ci/AppImageBuilder.yml @@ -72,15 +72,20 @@ AppDir: files: exclude: - etc - - usr/[a-km-rt-zA-Z]* # * except lib, local, share + - usr/[!ls]* # * except lib, local, share - usr/lib/*/libasound.so.* # using our own ALSA can cause issues, and the API is pretty stable anyway - usr/lib/*.a # produced by library compilation - usr/lib/cmake # produced by library compilation - usr/lib/pkgconfig # produced by library compilation - - usr/s[a-gi-zA-Z]* # s* except share - - usr/share/[a-hj-ln-zA-Z]* # * except icons, metainfo - - usr/share/i[a-bd-zA-Z]* # i* except icons - - usr/share/m[a-df-zA-Z]* # m* except metainfo + - usr/s[!h]* # s* except share + - usr/share/[!aim]* # * except applications, icons, metainfo + - usr/share/a[!p]* # a* except applications + - usr/share/ap[!p]* # ap* except applications + - usr/share/app[!l]* # app* except applications + - usr/share/i[!c]* # i* except icons + - usr/share/icons/[!h]* # * except hicolor + - usr/share/icons/h[!i]* # h* except hicolor + - usr/share/m[!e]* # m* except metainfo - usr/share/metainfo/*.metainfo.xml # metainfo for libraries - var AppImage: diff --git a/.ci/build.sh b/.ci/build.sh index a8d3e7e62..6d982a042 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1035,11 +1035,18 @@ else metainfo_base=archive_tmp/usr/share/metainfo mkdir -p "$metainfo_base" cp -p "src/unix/assets/$project_id."*".xml" "$metainfo_base/$project_id.appdata.xml" + applications_base=archive_tmp/usr/share/applications + mkdir -p "$applications_base" + cp -p "src/unix/assets/$project_id.desktop" "$applications_base/" # Archive icons. - icon_base=archive_tmp/usr/share/icons - mkdir -p "$icon_base" - cp -rp src/unix/assets/[0-9]*x[0-9]* "$icon_base/" + icon_base=archive_tmp/usr/share/icons/hicolor + for icon_size in src/unix/assets/[0-9]*x[0-9]* + do + icon_dir="$icon_base/$(basename "$icon_size")" + mkdir -p "$icon_dir" + cp -rp "$icon_size" "$icon_dir/apps" + done project_icon=$(ls "$icon_base/"[0-9]*x[0-9]*/* | head -1 | grep -oP '/\K([^/]+)(?=\.[^\.]+$)') # Archive executable, while also stripping it if requested. From 8096a3095eeb725df45839a69aaa3757e18c4978 Mon Sep 17 00:00:00 2001 From: Alexander Babikov <2708460+lemondrops@users.noreply.github.com> Date: Tue, 25 Oct 2022 23:46:16 +0500 Subject: [PATCH 4/5] Fix Amstrad/Olivetti internal mice not working by explicitly defining the number of buttons --- src/machine/m_amstrad.c | 1 + src/machine/m_xt_olivetti.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 63efbed50..023f94d5b 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -2410,6 +2410,7 @@ machine_amstrad_init(const machine_t *model, int type) if (mouse_type == MOUSE_TYPE_INTERNAL) { /* Tell mouse driver about our internal mouse. */ mouse_reset(); + mouse_set_buttons(2); mouse_set_poll(ms_poll, ams); } diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 1d53a588e..2271035b8 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -426,6 +426,7 @@ m24_kbd_init(m24_kbd_t *kbd) /* Tell mouse driver about our internal mouse. */ mouse_reset(); + mouse_set_buttons(2); mouse_set_poll(ms_poll, kbd); keyboard_set_table(scancode_xt); From 4ac0ae037378cbb746ee20e9dd1493d9f88f898f Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 25 Oct 2022 19:21:00 -0300 Subject: [PATCH 5/5] Jenkins: Workaround for MacPorts upgrade dependency issues, and fix macOS architecture switching when building for x86_64h --- .ci/build.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 6d982a042..58d5e50c7 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -555,8 +555,8 @@ then # Switch into the correct architecture if required. case $arch in - x86_64*) arch_mac="i386";; - *) arch_mac="$arch";; + x86_64*) arch_mac="i386"; arch_cmd="x86_64";; + *) arch_mac="$arch"; arch_cmd="$arch";; esac if [ "$(arch)" != "$arch" -a "$(arch)" != "$arch_mac" ] then @@ -566,7 +566,7 @@ then args= [ $strip -ne 0 ] && args="-t $args" [ $skip_archive -ne 0 ] && args="-n $args" - arch -"$arch" zsh -lc 'exec "'"$0"'" -b "'"$package_name"'" "'"$arch"'" '"$args""$cmake_flags" + arch -"$arch_cmd" zsh -lc 'exec "'"$0"'" -b "'"$package_name"'" "'"$arch"'" '"$args""$cmake_flags" exit $? fi echo [-] Using architecture [$(arch)] @@ -599,7 +599,21 @@ then sudo sed -i -e 's/-no-feature-vulkan/-feature-vulkan/g' "$qt5_portfile" sudo sed -i -e 's/configure.env-append MAKE=/configure.env-append VULKAN_SDK=${prefix} MAKE=/g' "$qt5_portfile" fi - sudo "$macports/bin/port" install $(cat .ci/dependencies_macports.txt) + while : + do + # Attempt to install dependencies. + sudo "$macports/bin/port" install $(cat .ci/dependencies_macports.txt) 2>&1 | tee macports.log + + # Stop if no port version activation errors were found. + stuck_dep=$(grep " cannot be built while another version of " macports.log | cut -d" " -f2) + [ -z $stuck_dep ] && break + + # Deactivate the stuck dependency and try again. + sudo "$macports/bin/port" -f deactivate $stuck_dep + done + + # Remove MacPorts error detection log. + rm -f macports.log # Save build tag to skip this later. Doing it here (once everything is # in place) is important to avoid potential issues with retried builds.