mirror of
https://github.com/RetroPie/RetroPie-Setup.git
synced 2024-06-02 19:48:01 -04:00
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
This commit is contained in:
parent
3b9a8e440b
commit
218caa5b7e
79
scriptmodules/supplementary/pegasus-fe-dev.sh
Normal file
79
scriptmodules/supplementary/pegasus-fe-dev.sh
Normal 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
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue