Repository: PortsMaster/PortMaster-New
Pull request #1345: New Runtime for Ren'Py 8.1.3 and Butterfly Soup using it
Author: login: all-yall
Created: 2025-02-28T01:09:14Z | Merged: 2025-03-07T11:13:44Z

# New Runtime for Ren'Py 8.1.3 and Butterfly Soup using it

Butterfly Soup is a visual novel made using Ren'Py that tells a coming of age story. [See the store page here.](https://brianna-lei.itch.io/butterfly-soup)

## Submission Requirements
### CFW Tests
Ensure your game has been tested on all major CFWs:
- [x] AmberELEC
- [x] ArkOS
- [x] ROCKNIX
- [X] muOS

### Resolution Tests
Test all major resolutions:
- [ ] 480x320
- [X] 640x480
- [x] 720x720 (RGB30)
- [x] Higher resolutions (e.g., 1280x720)



## Compilation Instructions for the Runtime
```
# this script will allow you to build renpy on ubuntu 20 on aarch64
# dynamically linking sdl2. It is assumed that this is a 
# throw-away environment! 
# This script should be run as root.
#
# This script was originally run on commit d60cc55
# of renpy_build. This is an old commit, and it will try to start
# from the latest commit. Once its pulled all the repos, checkout the 8.1.3 version of the sdl2 and renpy libs.
# after that continue as norma

# install required packages 
sudo apt install vim git sudo curl clang make libreadline-dev libsqlite3-dev libassimp-dev texinfo help2man libzstd-dev libsdl2-dev

# need the correct version of cmake 
mkdir cmake
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-aarch64.sh
bash cmake*.sh --skip-license --prefix=/root/cmake
export PATH="/root/cmake/bin:$PATH"

# need the correct version of autoconf
git clone git://git.sv.gnu.org/autoconf
cd autoconf
./configure && make && make install
cp build-aux /usr/share/autoconf
cd ..
export PATH="/root/autoconf/bin:$PATH"

# need the correct version of ccache
wget https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz
tar xf ccache*
cd ccache-4.5.1
cmake -DREDIS_STORAGE_BACKEND=OFF . && make && make install
cd ..
export PATH="/root/ccache-4.5.1:$PATH"


# update assimp header files to be expected version.
# yes, this is very gross and bad, but we are assuming this is 
# in a partitioned environment.
wget https://github.com/assimp/assimp/archive/refs/tags/v5.2.2.zip
unzip v5.2.2.zip
mv /usr/include/assimp/config.h assimp-5.2.2/include/assimp/
rm /usr/include/assimp/ -r
mv assimp-5.2.2/include/assimp/ /usr/include/


# setup correct python version
curl -fsSL https://pyenv.run | bash

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"
eval "$(pyenv virtualenv-init -)"

pyenv install 3.10.16
pyenv global 3.10.16

git clone https://github.com/renpy/renpy-build.git
cd renpy-build

# download requesite tar files
cd tars
wget wget https://cubism.live2d.com/sdk-native/bin/CubismSdkForNative-4-r.6.2.zip
cd ..

./prepare.sh
source tmp/virtualenv.py3/bin/activate

# this does the following;
# * corrects some file names (x86_64 -> aarch64)
# * disables steam stuff so that we don't need that tar file
# * set sdl2 and sdl2_image to dynamically link
cat > patch_file <<EOF
diff --git a/nightly/git.sh b/nightly/git.sh
index 018d915..aa8d99a 100644
--- a/nightly/git.sh
+++ b/nightly/git.sh
@@ -20,10 +20,10 @@ update () {
     fi
 }

-update $(git remote get-url origin)
-update https://github.com/renpy/renpy renpy
-update https://github.com/renpy/pygame_sdl2 pygame_sdl2
-update https://github.com/renpy/renpyweb renpyweb
+#update $(git remote get-url origin)
+#update https://github.com/renpy/renpy renpy
+#update https://github.com/renpy/pygame_sdl2 pygame_sdl2
+#update https://github.com/renpy/renpyweb renpyweb

 rm -Rf "$BASE/renpy/module/gen"
 rm -Rf "$BASE/renpy/module/gen3"
diff --git a/tasks/__init__.py b/tasks/__init__.py
index 947df64..5ed837b 100644
--- a/tasks/__init__.py
+++ b/tasks/__init__.py
@@ -57,9 +57,9 @@ from . import pythonlib
 from . import renpython

 from . import renpysh
-from . import renios
+#from . import renios

 from . import nvdrs
 from . import sevenzip

-from . import web
+#from . import web
diff --git a/tasks/librenpy.py b/tasks/librenpy.py
index 1337f68..8cf7944 100644
--- a/tasks/librenpy.py
+++ b/tasks/librenpy.py
@@ -20,7 +20,7 @@ def gen_static2(c: Context):
 def gen_static3(c: Context):

     c.chdir("{{ renpy }}/module")
-    c.env("RENPY_DEPS_INSTALL", "/usr::/usr/lib/x86_64-linux-gnu/")
+    c.env("RENPY_DEPS_INSTALL", "/usr::/usr/lib/x86_64-linux-gnu/::/usr/lib/aarch64-linux-gnu/")
     c.env("RENPY_STATIC", "1")
     c.run("{{ hostpython }} setup.py generate")

diff --git a/tasks/pythonlib.py b/tasks/pythonlib.py
index b10134d..9bb5296 100644
--- a/tasks/pythonlib.py
+++ b/tasks/pythonlib.py
@@ -524,7 +524,7 @@ def python3(c: Context):
                 dest.parent.mkdir(parents=True, exist_ok=True)
                 shutil.copy(fn, dest)

-    # used_rules.add("steamapi")
+    used_rules.add("steamapi")

     if rules - used_rules:
         if c.platform != "web":
diff --git a/tasks/renpython.py b/tasks/renpython.py
index 179b6c7..02d6be7 100644
--- a/tasks/renpython.py
+++ b/tasks/renpython.py
@@ -45,7 +45,9 @@ def build_android(c: Context):
 def link_linux(c: Context):

     c.run("""
-    {{ CC }} {{ LDFLAGS }}
+    {{ CC }}
+    {{ LDFLAGS }}
+    -L/sdl
     -shared
     -Wl,-Bsymbolic
EOF

git apply patch_file

./build.py --platforms linux --archs aarch64
rm tmp/install.linux-aarch64/libSDL2*
# one more time, but now it won't grab the SDL2 .a files
./build.py --platforms linux --archs aarch64
```



Diff:
diff --git a/ports/butterflysoup/Butterfly Soup.sh b/ports/butterflysoup/Butterfly Soup.sh
new file mode 100755
index 0000000000..06682122b0
--- /dev/null
+++ b/ports/butterflysoup/Butterfly Soup.sh	
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+
+if [ -d "/opt/system/Tools/PortMaster/" ]; then
+  controlfolder="/opt/system/Tools/PortMaster"
+elif [ -d "/opt/tools/PortMaster/" ]; then
+  controlfolder="/opt/tools/PortMaster"
+elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
+  controlfolder="$XDG_DATA_HOME/PortMaster"
+else
+  controlfolder="/roms/ports/PortMaster"
+fi
+
+source $controlfolder/control.txt
+[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
+get_controls
+
+# Variables 
+PORTEXEC="renpy/startRENPY"
+GAMEDIR="/$directory/ports/butterflysoup"
+RUNTIME="renpy_8.1.3"
+RENPYDIR="$GAMEDIR/renpy"
+GAMEFILES="$GAMEDIR/gamefiles"
+RENPY_RUNTIME="$controlfolder/libs/${RUNTIME}.squashfs"
+
+cd "$GAMEDIR"
+
+if [ ! -f "$controlfolder/libs/${RUNTIME}.squashfs" ]; then
+  # Check for runtime if not downloaded via PM
+  if [ ! -f "$controlfolder/harbourmaster" ]; then
+    pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info."
+    sleep 5
+    exit 1
+  fi
+
+  $ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${RUNTIME}.squashfs"
+fi
+
+> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
+
+
+$ESUDO mkdir -p "$RENPYDIR"
+
+# Mounting Renpy and gamefiles
+$ESUDO umount "$RENPYDIR/game" || true
+$ESUDO umount "$RENPYDIR" || true
+$ESUDO mount  "$RENPY_RUNTIME" "$RENPYDIR"
+sleep 2
+$ESUDO mount --bind "$GAMEFILES" "$RENPYDIR/game"
+
+# Apply Patches
+if [ ! -e "$GAMEDIR/patched" ]; then
+  cp "$GAMEDIR/patches/overrides.rpy" "$GAMEFILES/"
+  touch "$GAMEDIR/patched"
+fi
+
+# Exports
+export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
+export PYTHONHOME="$GAMEDIR/renpy"
+export PYTHONPATH="$GAMEDIR/renpy/lib/python3.9"
+
+# If using gl4es
+if [ -f "${controlfolder}/libgl_${CFW_NAME}.txt" ]; then 
+  source "${controlfolder}/libgl_${CFW_NAME}.txt"
+else
+  source "${controlfolder}/libgl_default.txt"
+fi
+
+if [[ "$LIBGL_FB" != "" ]]; then
+  export SDL_VIDEO_GL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libGL.so.1"
+  export SDL_VIDEO_EGL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libEGL.so.1"
+fi
+
+pm_platform_helper "$GAMEDIR/renpy/lib/py3-linux-aarch64/startRENPY"
+$GPTOKEYB2 "$PORTEXEC" -c "butterflysoup.gptk"  &
+bash "./$PORTEXEC"
+
+if [[ "$PM_CAN_MOUNT" != "N" ]]; then
+    $ESUDO umount "$RENPYDIR/game"
+    $ESUDO umount "$RENPYDIR"
+fi
+
+pm_finish
diff --git a/ports/butterflysoup/README.md b/ports/butterflysoup/README.md
new file mode 100644
index 0000000000..f2735854f1
--- /dev/null
+++ b/ports/butterflysoup/README.md
@@ -0,0 +1,23 @@
+# Port of Butterfly Soup
+## Controls
+
+| Button | Action |
+|--|--| 
+|A|Confirm/Next|
+|B|Cancel|
+|X|None  |
+|Y|Toggle Overlay|
+|D-Pad|Navigation|
+|Start|Toggle Menu|
+|L1|Back|
+|R1/L2|Skip (need to hold)|
+
+## Notes
+Sometimes the menu navigations is a little janky, but move around enough and
+you can get where you want to go.
+
+## Thanks To;
+* [Brianna Lei](https://linktr.ee/confettibri) for making a wonderfully sweet game (Once again please support her!)
+* [Portmaster](https://portmaster.games/) and their framework and community
+* [renpy](https://www.renpy.org/) for being a great visual novel engine
+* [gl4es](https://github.com/ptitSeb/gl4es) for being an essential library
diff --git a/ports/butterflysoup/butterflysoup/butterflysoup.gptk b/ports/butterflysoup/butterflysoup/butterflysoup.gptk
new file mode 100644
index 0000000000..5966506651
--- /dev/null
+++ b/ports/butterflysoup/butterflysoup/butterflysoup.gptk
@@ -0,0 +1,25 @@
+[controls]
+
+back = esc
+start = esc
+
+a = enter
+b = esc
+x = mouse_middle
+y = h
+
+l1 = pageup
+l2 = pageup
+
+r1 = pagedown
+r2 = pagedown
+
+up = up
+down = down 
+left = left
+right = right
+
+left_analog_up = up
+left_analog_down = down 
+left_analog_left = left
+left_analog_right = right
diff --git a/ports/butterflysoup/butterflysoup/gamefiles/.gitkeep b/ports/butterflysoup/butterflysoup/gamefiles/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/ports/butterflysoup/butterflysoup/gl4es.aarch64/libEGL.so.1 b/ports/butterflysoup/butterflysoup/gl4es.aarch64/libEGL.so.1
new file mode 100644
index 0000000000..863418b02b
Binary files /dev/null and b/ports/butterflysoup/butterflysoup/gl4es.aarch64/libEGL.so.1 differ
diff --git a/ports/butterflysoup/butterflysoup/gl4es.aarch64/libGL.so.1 b/ports/butterflysoup/butterflysoup/gl4es.aarch64/libGL.so.1
new file mode 100644
index 0000000000..b2fe743db1
Binary files /dev/null and b/ports/butterflysoup/butterflysoup/gl4es.aarch64/libGL.so.1 differ
diff --git a/ports/butterflysoup/butterflysoup/licenses/LICENSE-gl4es.txt b/ports/butterflysoup/butterflysoup/licenses/LICENSE-gl4es.txt
new file mode 100644
index 0000000000..f34587f4f2
--- /dev/null
+++ b/ports/butterflysoup/butterflysoup/licenses/LICENSE-gl4es.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2016-2018 Sebastien Chevalier
+Copyright (c) 2013-2016 Ryan Hileman
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/ports/butterflysoup/butterflysoup/patches/overrides.rpy b/ports/butterflysoup/butterflysoup/patches/overrides.rpy
new file mode 100755
index 0000000000..bf340e24de
--- /dev/null
+++ b/ports/butterflysoup/butterflysoup/patches/overrides.rpy
@@ -0,0 +1,2 @@
+init python: 
+    renpy.game.preferences.pad_enabled = False
diff --git a/ports/butterflysoup/gameinfo.xml b/ports/butterflysoup/gameinfo.xml
new file mode 100644
index 0000000000..698afe8604
--- /dev/null
+++ b/ports/butterflysoup/gameinfo.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gameList>
+  <game>
+    <path>./Butterfly Soup.sh</path>
+    <name>Butterfly Soup</name>
+    <desc>A visual novel about gay asian girls playing baseball and falling in love.</desc>
+    <releasedate>20170916T000000</releasedate>
+    <developer>Brianna Lei</developer>
+    <publisher>Brianna Lei</publisher>
+    <image>./butterflysoup/screenshot.png</image>
+  </game>
+</gameList>
diff --git a/ports/butterflysoup/port.json b/ports/butterflysoup/port.json
new file mode 100644
index 0000000000..9466d00846
--- /dev/null
+++ b/ports/butterflysoup/port.json
@@ -0,0 +1,42 @@
+{
+  "version": 4,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": null,
+    "rtr": false,
+    "exp": false,
+    "runtime": [
+      "renpy_8.1.3.squashfs"
+    ],
+    "store": [
+      {
+        "name": "Itch.io",
+        "url": "https://brianna-lei.itch.io/butterfly-soup"
+      }
+    ],
+    "availability": "free",
+    "reqs": [
+      "!lowres"
+    ],
+    "arch": [
+      "aarch64"
+    ],
+    "min_glibc": ""
+  }
+}
diff --git a/ports/butterflysoup/screenshot.png b/ports/butterflysoup/screenshot.png
new file mode 100644
index 0000000000..4eac9ac433
Binary files /dev/null and b/ports/butterflysoup/screenshot.png differ
diff --git a/runtimes/renpy_8.1.3.aarch64.squashfs b/runtimes/renpy_8.1.3.aarch64.squashfs
new file mode 100644
index 0000000000..8c10c669f0
Binary files /dev/null and b/runtimes/renpy_8.1.3.aarch64.squashfs differ
diff --git a/runtimes/runtimes.json b/runtimes/runtimes.json
index a4297167c1..c757c8cec8 100644
--- a/runtimes/runtimes.json
+++ b/runtimes/runtimes.json
@@ -112,6 +112,13 @@
             "x86_64": "pyxel_2.2.8_python_3.11_x86_64.squashfs"
         }
     },
+    "renpy_8.1.3.squashfs": {
+        "name": "Ren'Py 8.1.3",
+        "default": "aarch64",
+        "arch": {
+            "aarch64": "renpy_8.1.3.aarch64.squashfs",
+        }
+    },
     "renpy_8.3.4.squashfs": {
         "name": "Ren'Py 8.3.4",
         "default": "aarch64",


Reviews:
user: login: kloptops
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T05:35:22Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T05:37:26Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T05:45:57Z
user: login: kloptops
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T05:47:54Z
user: login: kloptops
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T06:08:13Z
user: login: cdeletre
body: Just minor change requests. Overall it looks clean.
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-03-03T14:35:06Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T02:32:54Z
user: login: Cebion
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T06:39:56Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T01:48:46Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T03:05:26Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T03:11:50Z
user: login: all-yall
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T03:12:48Z
user: login: kloptops
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T06:00:36Z
user: login: Cebion
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-07T11:13:37Z

Review comments:
diff_hunk: @@ -0,0 +1,80 @@
+#!/bin/bash
+# PORTMASTER: butterflysoup.zip, Butterfly Soup.sh
path: ports/butterflysoup/Butterfly Soup.sh
user: login: kloptops
body: This can be removed:
```suggestion
```
created_at: 2025-03-02T05:26:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,80 @@
+#!/bin/bash
+# PORTMASTER: butterflysoup.zip, Butterfly Soup.sh
+
+# Prelude
+XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+
+if [ -d "/opt/system/Tools/PortMaster/" ]; then
+  controlfolder="/opt/system/Tools/PortMaster"
+elif [ -d "/opt/tools/PortMaster/" ]; then
+  controlfolder="/opt/tools/PortMaster"
+elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
+  controlfolder="$XDG_DATA_HOME/PortMaster"
+else
+  controlfolder="/roms/ports/PortMaster"
+fi
+
+source $controlfolder/control.txt
+[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
+get_controls
+
+# Variables 
+PORTEXEC="renpy/startRENPY"
+GAMEDIR="/$directory/ports/butterflysoup"
+RUNTIME="renpy_8.1.3"
+RENPYDIR="$GAMEDIR/renpy/"
path: ports/butterflysoup/Butterfly Soup.sh
user: login: kloptops
body: This should be without a slash at the end, it is causing double slashes in paths:
```suggestion
RENPYDIR="$GAMEDIR/renpy"
```
created_at: 2025-03-02T05:27:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": "A visual novel about gay asian girls playing baseball and falling in love.",
path: ports/butterflysoup/port.json
user: login: kloptops
body: This is only necessary if you want to include markdown for the websites version of the description.
```suggestion
    "desc_md": null,
```
created_at: 2025-03-02T05:31:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": null,
path: ports/butterflysoup/port.json
user: login: kloptops
body: You can add a proper url here.
```suggestion
    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
```
created_at: 2025-03-02T05:33:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,29 @@
+# Port of Butterfly Soup
+## Controls
+
+| Button | Action |
+|--|--| 
+|A|Confirm/Next|
+|B|Cancel|
+|X|None  |
+|Y|Toggle Overlay|
+|D-Pad|Navigation|
+|Start|Toggle Menu|
+|L1|Back|
+|R1/L2|Skip (need to hold)|
+
+## What is this?
+This is a port of the game [Butterfly Soup](https://brianna-lei.itch.io/butterfly-soup) 
+using the framework [Portmaster](https://portmaster.games/). This does not include
path: ports/butterflysoup/README.md
user: login: kloptops
body: Probably don't need to explain what PortMaster is on the PortMaster website. :D
created_at: 2025-03-02T05:34:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,29 @@
+# Port of Butterfly Soup
+## Controls
+
+| Button | Action |
+|--|--| 
+|A|Confirm/Next|
+|B|Cancel|
+|X|None  |
+|Y|Toggle Overlay|
+|D-Pad|Navigation|
+|Start|Toggle Menu|
+|L1|Back|
+|R1/L2|Skip (need to hold)|
+
+## What is this?
+This is a port of the game [Butterfly Soup](https://brianna-lei.itch.io/butterfly-soup) 
+using the framework [Portmaster](https://portmaster.games/). This does not include
path: ports/butterflysoup/README.md
user: login: all-yall
body: True, its an artifact of it initially being in a separate repo :laughing:, definitely will remove
created_at: 2025-03-02T05:37:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": null,
path: ports/butterflysoup/port.json
user: login: all-yall
body: Does this replace the `inst` field or is it along with?
Never mind, i think I understand now.
created_at: 2025-03-02T05:45:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": null,
path: ports/butterflysoup/port.json
user: login: kloptops
body: `"inst"` gets shown in the PortMaster app on device, `"inst_md"` supports markdown and is used on the PortMaster website so you can add things like embedded urls.
created_at: 2025-03-02T05:47:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Prelude
+XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+
+if [ -d "/opt/system/Tools/PortMaster/" ]; then
+  controlfolder="/opt/system/Tools/PortMaster"
+elif [ -d "/opt/tools/PortMaster/" ]; then
+  controlfolder="/opt/tools/PortMaster"
+elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
+  controlfolder="$XDG_DATA_HOME/PortMaster"
+else
+  controlfolder="/roms/ports/PortMaster"
+fi
+
+source $controlfolder/control.txt
+[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
+get_controls
+
+# Variables 
+PORTEXEC="renpy/startRENPY"
+GAMEDIR="/$directory/ports/butterflysoup"
+RUNTIME="renpy_8.1.3"
+RENPYDIR="$GAMEDIR/renpy"
+GAMEFILES="$GAMEDIR/gamefiles"
+RENPY_RUNTIME="$controlfolder/libs/${RUNTIME}.squashfs"
+
+cd "$GAMEDIR"
+
+if [ ! -f "$controlfolder/libs/${RUNTIME}.squashfs" ]; then
+  # Check for runtime if not downloaded via PM
+  if [ ! -f "$controlfolder/harbourmaster" ]; then
+    pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info."
+    sleep 5
+    exit 1
+  fi
+
+  $ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${RUNTIME}.squashfs"
+fi
+
+> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
+
+
+$ESUDO mkdir -p "$RENPYDIR"
+
+# Mounting Renpy and gamefiles
+$ESUDO umount "$RENPYDIR/game" || true
+$ESUDO umount "$RENPYDIR" || true
+$ESUDO mount  "$RENPY_RUNTIME" "$RENPYDIR"
+sleep 2
+$ESUDO mount --bind "$GAMEFILES" "$RENPYDIR/game"
+
+# Apply Patches
+if [ ! -e "$GAMEDIR/patched" ]; then
+  cp "$GAMEDIR/patches/overrides.rpy" "$GAMEFILES/"
+  touch "$GAMEDIR/patched"
+fi
+
+# Exports
+export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
+export PYTHONHOME="$GAMEDIR/renpy"
+export PYTHONPATH="$GAMEDIR/renpy/lib/python3.9"
+
+# If using gl4es
+if [ -f "${controlfolder}/libgl_${CFW_NAME}.txt" ]; then 
+  source "${controlfolder}/libgl_${CFW_NAME}.txt"
+else
+  source "${controlfolder}/libgl_default.txt"
+fi
+
+if [[ "$LIBGL_FB" != "" ]]; then
+  export SDL_VIDEO_GL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libGL.so.1"
+  export SDL_VIDEO_EGL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libEGL.so.1"
+fi
+
+pm_platform_helper "$GAMEDIR/renpy/lib/py3-linux-aarch64/startRENPY"
+$GPTOKEYB2 "startRENPY" -c "butterflysoup.gptk"  &
+bash "./$PORTEXEC"
+pm_finish
path: ports/butterflysoup/Butterfly Soup.sh
user: login: cdeletre
body: Same remark as in PR1332 for Damian, better to clean-up on exit

```suggestion

if [[ "$PM_CAN_MOUNT" != "N" ]]; then
    $ESUDO umount "$RENPYDIR/game"
    $ESUDO umount "$RENPYDIR"
fi

pm_finish
```
created_at: 2025-03-03T14:21:29Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Prelude
+XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+
+if [ -d "/opt/system/Tools/PortMaster/" ]; then
+  controlfolder="/opt/system/Tools/PortMaster"
+elif [ -d "/opt/tools/PortMaster/" ]; then
+  controlfolder="/opt/tools/PortMaster"
+elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
+  controlfolder="$XDG_DATA_HOME/PortMaster"
+else
+  controlfolder="/roms/ports/PortMaster"
+fi
+
+source $controlfolder/control.txt
+[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
+get_controls
+
+# Variables 
+PORTEXEC="renpy/startRENPY"
+GAMEDIR="/$directory/ports/butterflysoup"
+RUNTIME="renpy_8.1.3"
+RENPYDIR="$GAMEDIR/renpy"
+GAMEFILES="$GAMEDIR/gamefiles"
+RENPY_RUNTIME="$controlfolder/libs/${RUNTIME}.squashfs"
+
+cd "$GAMEDIR"
+
+if [ ! -f "$controlfolder/libs/${RUNTIME}.squashfs" ]; then
+  # Check for runtime if not downloaded via PM
+  if [ ! -f "$controlfolder/harbourmaster" ]; then
+    pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info."
+    sleep 5
+    exit 1
+  fi
+
+  $ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${RUNTIME}.squashfs"
+fi
+
+> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
+
+
+$ESUDO mkdir -p "$RENPYDIR"
+
+# Mounting Renpy and gamefiles
+$ESUDO umount "$RENPYDIR/game" || true
+$ESUDO umount "$RENPYDIR" || true
+$ESUDO mount  "$RENPY_RUNTIME" "$RENPYDIR"
+sleep 2
+$ESUDO mount --bind "$GAMEFILES" "$RENPYDIR/game"
+
+# Apply Patches
+if [ ! -e "$GAMEDIR/patched" ]; then
+  cp "$GAMEDIR/patches/overrides.rpy" "$GAMEFILES/"
+  touch "$GAMEDIR/patched"
+fi
+
+# Exports
+export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
+export PYTHONHOME="$GAMEDIR/renpy"
+export PYTHONPATH="$GAMEDIR/renpy/lib/python3.9"
+
+# If using gl4es
+if [ -f "${controlfolder}/libgl_${CFW_NAME}.txt" ]; then 
+  source "${controlfolder}/libgl_${CFW_NAME}.txt"
+else
+  source "${controlfolder}/libgl_default.txt"
+fi
+
+if [[ "$LIBGL_FB" != "" ]]; then
+  export SDL_VIDEO_GL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libGL.so.1"
+  export SDL_VIDEO_EGL_DRIVER="$GAMEDIR/gl4es.$DEVICE_ARCH/libEGL.so.1"
+fi
+
+pm_platform_helper "$GAMEDIR/renpy/lib/py3-linux-aarch64/startRENPY"
+$GPTOKEYB2 "startRENPY" -c "butterflysoup.gptk"  &
path: ports/butterflysoup/Butterfly Soup.sh
user: login: cdeletre
body: ```suggestion
$GPTOKEYB2 "$PORTEXEC" -c "butterflysoup.gptk"  &
```
created_at: 2025-03-03T14:24:12Z
author_association: COLLABORATOR
path: ports/butterflysoup/screenshot.png
user: login: cdeletre
body: Can you please update with this size optimized png ? I've used pngquant tool to reduce it
![screenshot-fs8](https://github.com/user-attachments/assets/3f014370-f51b-4e11-80ef-d85f1e0806e2)

We try to minimize the screenshot size as we have 900+ ports which result in easily 50MB+ of screenshot to download.

created_at: 2025-03-03T14:30:06Z
author_association: COLLABORATOR
path: ports/butterflysoup/cover.png
user: login: cdeletre
body: I think lower resolution cover is still good. @kloptops what do you think ?

![cover-fs8](https://github.com/user-attachments/assets/3239aaf7-e410-4256-b2d0-22a8200b3913)

created_at: 2025-03-03T14:34:04Z
author_association: COLLABORATOR
path: ports/butterflysoup/cover.png
user: login: all-yall
body: lgtm, I'll replace it
created_at: 2025-03-04T02:32:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,85 @@
+#!/bin/bash
+
+# Prelude
path: ports/butterflysoup/Butterfly Soup.sh
user: login: Cebion
body: ```suggestion
```
Not in our standard header =)
created_at: 2025-03-04T06:33:59Z
author_association: COLLABORATOR
path: ports/butterflysoup/cover.png
user: login: Cebion
body: Could you please set the most illustrative pic (in-game rather than main menu screenshot) in the cover as many contexts consider only the first pic as their main image source? So for cover we use Screenshots with box art / logo mixes for example but only a cover does not help I'm afraid.

created_at: 2025-03-04T06:35:51Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gameList>
+  <game>
+    <path>./Butterfly Soup</path>
+    <name>Butterfly Soup</name>
+    <desc>A visual novel about gay asian girls playing baseball and falling in love.</desc>
+    <releasedate>20170916T000000</releasedate>
+    <developer>Brianna Lei</developer>
+    <publisher>Brianna Lei</publisher>
+    <image>./cover.png</image>
path: ports/butterflysoup/gameinfo.xml
user: login: Cebion
body: https://portmaster.games/metadata-editor.html
Has to have the path eg ./2048/cover.png
created_at: 2025-03-04T06:37:16Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gameList>
+  <game>
+    <path>./Butterfly Soup</path>
path: ports/butterflysoup/gameinfo.xml
user: login: Cebion
body: ```suggestion
    <path>./Butterfly Soup.sh</path>
```
created_at: 2025-03-04T06:37:33Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": {
+      "screenshot": "screenshot.png",
path: ports/butterflysoup/port.json
user: login: Cebion
body: Where do these come from?

https://portmaster.games/port-json.html

created_at: 2025-03-04T06:39:04Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": {
+      "screenshot": "screenshot.png",
+      "covers": [],
+      "thumbnail": null,
+      "video": null
+    },
+    "rtr": true,
+    "exp": false,
+    "runtime": "renpy_8.1.3.squashfs",
+    "reqs": [],
+    "arch": [
+      "aarch64"
path: ports/butterflysoup/port.json
user: login: Cebion
body: Runetimes don't use architectures in combination.
created_at: 2025-03-04T06:39:36Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": {
+      "screenshot": "screenshot.png",
path: ports/butterflysoup/port.json
user: login: all-yall
body: I think I may have gotten it from the doom3 port when looking for examples. Going forward I'll just use the generator with no modifications.
created_at: 2025-03-05T01:48:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": {
+      "screenshot": "screenshot.png",
+      "covers": [],
+      "thumbnail": null,
+      "video": null
+    },
+    "rtr": true,
+    "exp": false,
+    "runtime": "renpy_8.1.3.squashfs",
+    "reqs": [],
+    "arch": [
+      "aarch64"
path: ports/butterflysoup/port.json
user: login: all-yall
body: In that case the online editor needs to be updated because its giving me this style as well. Its also what was in the Milk Inside port. In place of the array should I set it to null? or remove the field entirely?
created_at: 2025-03-07T03:05:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+{
+  "version": 3,
+  "name": "butterflysoup.zip",
+  "items": [
+    "Butterfly Soup.sh",
+    "butterflysoup"
+  ],
+  "items_opt": [],
+  "attr": {
+    "title": "Butterfly Soup",
+    "porter": [
+      "all_yall"
+    ],
+    "desc": "A visual novel about gay asian girls playing baseball and falling in love.",
+    "desc_md": null,
+    "inst": "Get the game from itch.io here; https://brianna-lei.itch.io/butterfly-soup (Please consider buying!). Put the contents of the `game` directory into the gamefiles directory in the port.",
+    "inst_md": "Get the game from [Brianna Lei's itch.io](https://brianna-lei.itch.io/butterfly-soup). Place the contents of the `game/` directory into the `port/butterflysoup/gamefiles/` directory.",
+    "genres": [
+      "visual novel"
+    ],
+    "image": {
+      "screenshot": "screenshot.png",
+      "covers": [],
+      "thumbnail": null,
+      "video": null
+    },
+    "rtr": true,
+    "exp": false,
+    "runtime": "renpy_8.1.3.squashfs",
+    "reqs": [],
+    "arch": [
+      "aarch64"
path: ports/butterflysoup/port.json
user: login: all-yall
body: (I still have this issue in  new review, though fixed everything else)
created_at: 2025-03-07T03:11:50Z
author_association: CONTRIBUTOR
path: ports/butterflysoup/cover.png
user: login: all-yall
body: Ahh, understood. I think I'll go with using the screenshot everywhere then, as I'm not sure how to make a nice looking cover graphic that some games have
created_at: 2025-03-07T03:12:48Z
author_association: CONTRIBUTOR

PR comments:
user: login: all-yall
created_at: 2025-02-28T01:10:04Z
body: Working on getting testing done on other platforms, but wanted to open the pull request now
author_association: CONTRIBUTOR
user: login: kloptops
created_at: 2025-03-01T12:23:00Z
body: Probably worthwhile to PR this with your port that uses it. So we can ensure the port and the runtime work on all the platforms and devices? 😄 
author_association: CONTRIBUTOR
user: login: all-yall
created_at: 2025-03-01T20:43:22Z
body: Sounds good, I'll add it to the PR once the game is ready

author_association: CONTRIBUTOR
user: login: all-yall
created_at: 2025-03-04T04:42:15Z
body: Cool, think I addressed everything. I'll make sure to take the feedback into any future prs as well.
author_association: CONTRIBUTOR
user: login: all-yall
created_at: 2025-03-07T03:13:46Z
body: I Re-generated the port.json using the tool again to verify that I would hopefully not have any more easily fixable issues in that file. This time it should be lacking any hand-edited bits save the name of the runtime.
author_association: CONTRIBUTOR