Skip to content

Commit

Permalink
Merge pull request #120 from porschemad911/portmaster-compat
Browse files Browse the repository at this point in the history
Refactor OpenGL check in portmaster_compatibility.sh
  • Loading branch information
r3claimer authored Apr 17, 2024
2 parents 9e1fe82 + 01f9dbb commit f77f211
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions packages/apps/portmaster/scripts/portmaster_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@
. /etc/profile

if [[ "${UI_SERVICE}" =~ "weston.service"|"*sway*" ]]; then
case "${QUIRK_DEVICE}" in
"Hardkernel ODROID-GO-Ultra"|"Powkiddy RGB10 MAX 3 Pro"|"Hardkernel ODROID-N2*")
#Fixing ports on S922X, exclude FNA games
for port in /storage/roms/ports/*.sh; do
if ! grep -q FNA "$port"; then
sed -i '/get_controls/c\get_controls && export SDL_VIDEO_GL_DRIVER=/usr/lib/egl/libGL.so.1 SDL_VIDEO_EGL_DRIVER=/usr/lib/egl/libEGL.so.1' "$port"
echo Fixing: "$port";
fi
done;
;;
*)
#Remove gl4es libs on devices that support OpenGL and sed any port that refrences it
if [[ $(glxinfo | grep -i "opengl renderer") =~ "Panfrost" ]]; then
#Remove gl4es libs on devices that support OpenGL and sed any port that references it
rm -rf /storage/roms/ports/*/lib*/libEGL*
rm -rf /storage/roms/ports/*/lib*/libGL*
for port in /storage/roms/ports/*.sh; do
Expand All @@ -33,6 +23,17 @@ case "${QUIRK_DEVICE}" in
sed -i '/get_controls && export/c\get_controls' "$port"
echo Fixing: "$port";
done;
;;
esac
else
case "${QUIRK_DEVICE}" in
"Hardkernel ODROID-GO-Ultra"|"Powkiddy RGB10 MAX 3 Pro"|"Hardkernel ODROID-N2*")
#Fixing ports on S922X, exclude FNA games
for port in /storage/roms/ports/*.sh; do
if ! grep -q FNA "$port"; then
sed -i '/get_controls/c\get_controls && export SDL_VIDEO_GL_DRIVER=/usr/lib/egl/libGL.so.1 SDL_VIDEO_EGL_DRIVER=/usr/lib/egl/libEGL.so.1' "$port"
echo Fixing: "$port";
fi
done;
;;
esac
fi
fi

0 comments on commit f77f211

Please sign in to comment.