Skip to content

Commit

Permalink
Merge pull request #202 from kloptops/main
Browse files Browse the repository at this point in the history
Fix muOS and ArkOS issues.
  • Loading branch information
kloptops authored Dec 14, 2024
2 parents 1d867a0 + 7719847 commit 4725b80
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PortMaster/PortMaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CUR_TTY=/dev/tty0

cd "$controlfolder"

exec > >(tee "$controlfolder/log.txt") 2>&1
> "$controlfolder/log.txt" && exec > >(tee "$controlfolder/log.txt") 2>&1

export TERM=linux
$ESUDO chmod 666 $CUR_TTY
Expand Down
2 changes: 1 addition & 1 deletion PortMaster/mod_muOS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ GODOT_OPTS="--resolution ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f"

pm_platform_helper() {
# Help keep XongleBongles sanity below
printf "%s" "$(basename "$0")" > /run/muos/system/foreground_process
printf "%s" "$(basename "$1")" > /run/muos/system/foreground_process
}
6 changes: 5 additions & 1 deletion PortMaster/pugwash
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ class PortMasterGUI(pySDL2gui.GUI, harbourmaster.Callback):
if not is_process_running(f"love.{capabilities['primary_arch']}"):
break

sdl2.SDL_Delay(500)
sdl2.SDL_Delay(100)

if is_process_running(f"love.{capabilities['primary_arch']}"):
subprocess.check_output(["pkill", "-f", f"love.{capabilities['primary_arch']}"])
Expand All @@ -641,6 +641,10 @@ class PortMasterGUI(pySDL2gui.GUI, harbourmaster.Callback):

sdl2.SDL_SetHint(sdl2.SDL_HINT_RENDER_SCALE_QUALITY, b"2")

# Quickly present something, helps on ArkOS.
renderer.clear()
renderer.present()

self.text_data = {}
self.changed_keys = set()
formatter = StringFormatter(self.text_data)
Expand Down
2 changes: 1 addition & 1 deletion PortMaster/pylibs/harbourmaster/harbour.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ def _install_portmaster(self, download_file, do_delete=False):
if move_bash and dest_file.name.lower().endswith('.sh'):
move_bash_dir = self.platform.MOVE_PM_BASH_DIR
if move_bash_dir is None or not move_bash_dir.is_dir():
move_bash_dir = self.ports_dir
move_bash_dir = self.tools_dir

self.callback.message(f"- moving {dest_file} to {move_bash_dir / dest_file.name}")
shutil.move(dest_file, move_bash_dir / dest_file.name)
Expand Down
23 changes: 23 additions & 0 deletions PortMaster/pylibs/harbourmaster/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,29 @@ class PlatformArkOS(PlatformGCD_PortMaster, PlatformBase):
MOVE_PM_BASH = True
ES_NAME = 'emulationstation'

def __init__(self, hm):
super().__init__(hm)

# Fix a whoopsie :D
BAD_SCRIPT = self.hm.ports_dir / "PortMaster.sh"
GOOD_SCRIPT = self.hm.tools_dir / "PortMaster.sh"

if not BAD_SCRIPT.is_file():
return

if not GOOD_SCRIPT.is_file():
logger.info(f"MV: {BAD_SCRIPT} -> {GOOD_SCRIPT}")
shutil.move(BAD_SCRIPT, GOOD_SCRIPT)
return

if "pmsplash" not in GOOD_SCRIPT.read_text():
logger.info(f"MV: {BAD_SCRIPT} -> {GOOD_SCRIPT}")
shutil.move(BAD_SCRIPT, GOOD_SCRIPT)
return

logger.info(f"RM: {BAD_SCRIPT}")
BAD_SCRIPT.unlink()

def gamelist_file(self):
return self.hm.ports_dir / 'gamelist.xml'

Expand Down
1 change: 1 addition & 0 deletions PortMaster/trimui/PortMaster.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ echo "Starting PortMaster." > $CUR_TTY
chmod -R +x .

rm -f "$controlfolder/.pugwash-reboot"
printf "\033c" > $CUR_TTY

while true; do
./pugwash --debug
Expand Down
8 changes: 5 additions & 3 deletions PortMaster/utils/pmsplash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
# Source love2d runtime
source $controlfolder/runtimes/"love_11.5"/love.txt

# SO IT CAN BE STOPPED, MUAHAHAHAHAHA
export PMSPLASH_STOP="$controlfolder/utils/pmsplash/stopsplash"

[ -f "$PMSPLASH_STOP" ] && $ESUDO rm -f "$PMSPLASH_STOP"

# Run the splash
$LOVE_RUN "$controlfolder/utils/pmsplash" &

# So it can be waited.
export PMSPLASH_PID=$!

# SO IT CAN BE STOPPED, MUAHAHAHAHAHA
export PMSPLASH_STOP="$controlfolder/utils/pmsplash/stopsplash"

0 comments on commit 4725b80

Please sign in to comment.