Compare commits

...

5 commits

Author SHA1 Message Date
Cristi Mitrana aa0145e37a
Merge 33c8fed68b into 5e0ab1f859 2024-05-07 07:56:39 +01:00
retropieuser 5e0ab1f859
Update platforms.cfg for pc98 and add .cmd files
* Update platforms.cfg for pc98 and add .cmd files
2024-05-06 15:53:49 +03:00
cmitu 33c8fed68b autostart: modify EmulationStation spelling 2024-03-11 16:08:37 +00:00
cmitu 218caa5b7e pegasus-fe-dev: separate module with source build support
Since the static binaries provided upstream are no longer working on newer RaspiOS or on 32bit ARM, create a standard scriptmodule to build Pegasus with `pegasus-fe-dev`. The new scriptmodule is meant to work similarly to the `es`/`es-dev` pair, only one can work at a time and they share a set of common functions.

Modified the original scriptmodule and added a theme download function, using @mmatyas's themes. More can be found at [2].

Notes:
 * the `pegasus-fe` launcher doesn't need the previous TTY set-up, it's now handled by `runcommand`.
 * sometimes the `/dev/dri/card0` is not the right card node since the order of the `cardX` inodes is not guaranteed.
   Find the right card node dynamically (see [1]) and tell Qt about it with a minimal config file used in the launcher

[1] https://forums.raspberrypi.com/viewtopic.php?t=351263
[2] https://github.com/mmatyas/pegasus-theme-gallery-db/blob/master/repos.txt
2024-03-11 16:07:45 +00:00
cmitu 3b9a8e440b autostart: add Pegasus as auto-start item
Added Pegasus as alternative to Kodi and EmulationStation. The list of available auto-start front-ends is now dynamic, based on whether Kodi and Pegasus are available.
2024-03-11 16:07:34 +00:00
4 changed files with 171 additions and 16 deletions

View file

@ -164,7 +164,7 @@ oric_fullname="Oric 1"
pc88_exts=".d88 .cmt .m3u .t88"
pc88_fullname="NEC PC-8801"
pc98_exts=".d88 .d98 .88d .98d .fdi .fdd .xdf .hdm .dup .2hd .tfd .hdi .thd .nhd .hdd .zip"
pc98_exts=".2hd .88d .98d .cmd .d88 .d98 .dup .fdi .fdd .hdd .hdi .hdm .nhd .thd .tfd .xdf .zip"
pc98_fullname="NEC PC-9801"
pc_exts=".bat .com .conf .cue .dosz .exe .ins .ima .img .iso .m3u .m3u8 .sh .vhd .zip"

View file

@ -10,7 +10,7 @@
#
rp_module_id="autostart"
rp_module_desc="Auto-start Emulation Station / Kodi on boot"
rp_module_desc="Auto-start EmulationStation / Pegasus / Kodi on boot"
rp_module_section="config"
function _update_hook_autostart() {
@ -42,6 +42,9 @@ _EOF_
kodi)
echo -e "kodi-standalone #auto\nemulationstation #auto" >>"$script"
;;
pegasus)
echo "pegasus-fe #auto" >> "$script"
;;
es|*)
echo "emulationstation #auto" >>"$script"
;;
@ -102,20 +105,29 @@ function remove_autostart() {
function gui_autostart() {
cmd=(dialog --backtitle "$__backtitle" --menu "Choose the desired boot behaviour." 22 76 16)
local has_pegasus=0
local has_kodi=0
command -v pegasus-fe >/dev/null && has_pegasus=1
command -v kodi-standalone >/dev/null && has_kodi=1
while true; do
if isPlatform "x11"; then
local x11_autostart
if [[ -f "$home/.config/autostart/retropie.desktop" ]]; then
options=(1 "Autostart Emulation Station after login (Enabled)")
options=(1 "Autostart EmulationStation after login (Enabled)")
x11_autostart=1
else
options=(1 "Autostart Emulation Station after login (Disabled)")
options=(1 "Autostart EmulationStation after login (Disabled)")
x11_autostart=0
fi
else
options=(
1 "Start Emulation Station at boot"
2 "Start Kodi at boot (exit for Emulation Station)"
1 "Start EmulationStation at boot"
)
[[ "$has_kodi" -eq 1 ]] && options+=(2 "Start Kodi at boot (exit starts EmulationStation)")
[[ "$has_pegasus" -eq 1 ]] && options+=(3 "Start Pegasus at boot")
options+=(
E "Manually edit $configdir/all/autostart.sh"
)
if [[ "$__os_id" == "Raspbian" ]]; then
@ -136,21 +148,25 @@ function gui_autostart() {
if isPlatform "x11"; then
if [[ "$x11_autostart" -eq 0 ]]; then
enable_autostart
printMsgs "dialog" "Emulation Station is set to autostart after login."
printMsgs "dialog" "EmulationStation is set to autostart after login."
else
disable_autostart
printMsgs "dialog" "Autostarting of Emulation Station is disabled."
printMsgs "dialog" "Autostarting of EmulationStation is disabled."
fi
x11_autostart=$((x11_autostart ^ 1))
else
enable_autostart
printMsgs "dialog" "Emulation Station is set to launch at boot."
printMsgs "dialog" "EmulationStation is set to launch at boot."
fi
;;
2)
enable_autostart kodi
printMsgs "dialog" "Kodi is set to launch at boot."
;;
3)
enable_autostart pegasus
printMsgs "dialog" "Pegasus is set to launch at boot."
;;
E)
editFile "$configdir/all/autostart.sh"
;;

View file

@ -0,0 +1,79 @@
#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
rp_module_id="pegasus-fe-dev"
rp_module_desc="Pegasus: A cross platform, customizable graphical frontend (lastest master)"
rp_module_help="Pegasus is a cross platform, customizable graphical frontend for launching emulators and managing your game collection.\nThis package provides source installation on platforms not covered by the upstream project pre-built binaries (i.e. ARM 64bit)."
rp_module_licence="GPL3 https://raw.githubusercontent.com/mmatyas/pegasus-frontend/master/LICENSE.md"
rp_module_section="exp"
rp_module_repo="git https://github.com/mmatyas/pegasus-frontend master"
rp_module_flags="!mali frontend"
function depends_pegasus-fe-dev() {
if [[ "$__os_debian_ver" -lt 11 ]]; then
md_ret_errors+=("Pegasus (dev) requires Debian 11 (bullseye) or later. Please install the 'pegasus-fe' package instead.")
return 1
fi
if [[ -n "$__os_ubuntu_ver" ]] && compareVersions "$__os_ubuntu_ver" lt 22.04; then
md_ret_errors+=("Pegasus (dev) requires Ubuntu 22.04 or later. Please install the 'pegasus-fe' package instead.")
return 1
fi
local depends=(
fontconfig
gstreamer1.0-alsa
gstreamer1.0-libav
gstreamer1.0-plugins-good
libqt5multimedia5-plugins
libsdl2-dev
pkg-config
policykit-1
qml-module-qtgraphicaleffects qml-module-qtmultimedia qml-module-qtqml
qml-module-qtqml-models2
qml-module-qtquick-controls qml-module-qtquick-controls2
qml-module-qtquick-layouts qml-module-qtquick-templates2
qml-module-qtquick-window2 qml-module-qtquick2
qml-module-qt-labs-qmlmodels qml-module-qtquick-shapes
)
# Qt build dependencies
depends+=(qtbase5-private-dev qtdeclarative5-dev qtmultimedia5-dev libqt5svg5-dev qttools5-dev)
getDepends "${depends[@]}"
}
function sources_pegasus-fe-dev() {
gitPullOrClone
# on KMS, apply a patch to fix lanching games
isPlatform "kms" && applyPatch "$md_build/etc/rpi4/kms_launch_fix.diff"
}
function build_pegasus-fe-dev() {
rm -fr release && mkdir -p release
pushd release
qmake .. QMAKE_CXXFLAGS+="$__cxxflags" QMAKE_LIBS_LIBDL=-ldl USE_SDL_GAMEPAD=1 USE_SDL_POWER=1 INSTALLDIR="$md_inst"
make
md_ret_require=(
"$md_build/release/src/app/pegasus-fe"
)
}
function install_pegasus-fe-dev() {
make -C release install
_add_launcher_pegasus-fe
}
function remove_pegasus-fe-dev() {
remove_pegasus-fe
}
function configure_pegasus-fe-dev() {
configure_pegasus-fe
}

View file

@ -10,7 +10,8 @@
#
rp_module_id="pegasus-fe"
rp_module_desc="Pegasus: A cross platform, customizable graphical frontend (latest alpha release)"
rp_module_desc="Pegasus: A cross platform, customizable graphical frontend (latest pre-built release)"
rp_module_help="Pegasus is a cross platform, customizable graphical frontend for launching emulators and managing your game collection.\nThis package installs the upstream pre-built binaries. Use this package on RaspiOS Buster or PC/x86 installations"
rp_module_licence="GPL3 https://raw.githubusercontent.com/mmatyas/pegasus-frontend/master/LICENSE.md"
rp_module_section="exp"
rp_module_flags="!mali frontend"
@ -25,7 +26,11 @@ function depends_pegasus-fe() {
libsdl2-dev
policykit-1
)
# show an error on 64bit ARMs, since there are no pre-built packages for it
if isPlatform "arm" && hasFlag "64bit"; then
md_ret_errors+=("There are no pre-build binaries for 64bit ARM systems! Try installing Pegasus with the ${md_id}-dev package")
return 1
fi
getDepends "${depends[@]}"
}
@ -43,7 +48,7 @@ function install_bin_pegasus-fe() {
isPlatform "x11" && platform="x11"
isPlatform "rpi" && platform="$__platform"
if [[ -z "${platform}" ]]; then
md_ret_errors+=("Sorry, Pegasus is not yet available for this platform. Consider reporting this on the forum!")
md_ret_errors+=("Sorry, Pegasus has no pre-built binaries for this platform. Consider installing the ${md_id}-dev package or reporting this on the RetroPie forum!")
return
fi
@ -62,7 +67,11 @@ function install_bin_pegasus-fe() {
printMsgs "console" "Download URL: ${asset_url}"
downloadAndExtract "${asset_url}" "$md_inst"
# create launcher script
_add_launcher_pegasus-fe
}
function _add_launcher_pegasus-fe() {
# create launcher script
cat > /usr/bin/pegasus-fe << _EOF_
#!/bin/bash
@ -71,19 +80,59 @@ if [[ \$(id -u) -eq 0 ]]; then
exit 1
fi
# save current tty/vt number for use with X so it can be launched on the correct tty
tty=\$(tty)
export TTY="\${tty:8:1}"
_EOF_
# on KMS platforms, add some additional setup commands
if isPlatform "kms"; then
cat >> /usr/bin/pegasus-fe << _EOF_
# KMS setup
export QT_QPA_EGLFS_FORCE888=1 # improve gradients
export QT_QPA_EGLFS_KMS_ATOMIC=1 # use the atomic DRM API on Pi 4
export QT_QPA_PLATFORM=eglfs
export QT_QPA_QT_QPA_EGLFS_INTEGRATION=eglfs_kms
# find the right DRI card
for i in \$(find /sys/devices/platform -name "card?"); do
node=\${i:0-1}
case "\$i" in
*gpu*) card=\$node ;;
esac
done
echo Using DRI card at /dev/dri/card\${card}
file="/tmp/pegasus_\$\$.eglfs.json"
echo "{ \"device\": \"/dev/dri/card\${card}\" }" > "\$file"
export QT_QPA_EGLFS_KMS_CONFIG="\$file"
_EOF_
fi
cat >> /usr/bin/pegasus-fe << _EOF_
clear
"$md_inst/pegasus-fe" "\$@"
rm -f "/tmp/pegasus_\$\$.eglfs.json"
_EOF_
chmod +x /usr/bin/pegasus-fe
}
function _update_themes_pegasus-fe() {
# add some themes to Pegasus
echo Installing themes
declare themes=(
"mmatyas/pegasus-theme-9999999-in-1"
"mmatyas/pegasus-theme-es2-simple"
"mmatyas/pegasus-theme-flixnet"
"mmatyas/pegasus-theme-secretary"
)
local theme
pushd "$home/.config/pegasus-frontend/themes" || return
for theme in ${themes[@]}; do
local path=${theme//"mmatyas/pegasus-theme-"/}
gitPullOrClone "$path" "https://github.com/$theme"
done
popd
}
function remove_pegasus-fe() {
rm -f /usr/bin/pegasus-fe
}
@ -94,4 +143,15 @@ function configure_pegasus-fe() {
# create external directories
mkUserDir "$md_conf_root/all/pegasus-fe/scripts"
mkUserDir "$md_conf_root/all/pegasus-fe/themes"
[[ "$md_mode" == "remove" ]] && return
# remove the other Pegasus package if it's installed
if [[ "$md_id" == "pegasus-fe-dev" ]]; then
rmDirExists "$rootdir/$md_type/pegasus-fe"
else
rmDirExists "$rootdir/$md_type/pegasus-fe-dev"
fi
# update themes
_update_themes_pegasus-fe
}