From 02537720d063e80439bbf70e502a211d5f5385f5 Mon Sep 17 00:00:00 2001 From: supurazako Date: Fri, 24 Apr 2026 12:41:20 +0900 Subject: [PATCH 1/6] change: gcenx/wine/wine-crossover -> gcenx/wine/game-porting-toolkit --- scripts/etrobopkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/etrobopkg b/scripts/etrobopkg index 216436a..46b3d47 100755 --- a/scripts/etrobopkg +++ b/scripts/etrobopkg @@ -843,7 +843,7 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then fi if [ "`wine --version > /dev/null 2>&1; echo $?`" == "127" ] || [ -z "$i386" ]; then if [ "$ETROBO_KERNEL" == "darwin" ]; then - brew install --cask --no-quarantine gcenx/wine/wine-crossover + brew install --cask gcenx/wine/game-porting-toolkit elif [ "$ETROBO_OS" != "win" ]; then if [ -z "$i386" ]; then sudo dpkg --add-architecture i386 From 353eb9cb8486d93d1a188ffe19a6f0666efaebc4 Mon Sep 17 00:00:00 2001 From: supurazako Date: Fri, 24 Apr 2026 12:42:03 +0900 Subject: [PATCH 2/6] change: support wine, wine 64 for mac --- scripts/etrobopkg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/etrobopkg b/scripts/etrobopkg index 46b3d47..984e9ba 100755 --- a/scripts/etrobopkg +++ b/scripts/etrobopkg @@ -832,16 +832,20 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then rm -f NeXTTool.exe ;; "atk1" ) - # install wine(-crossover) if not installed + # install a Wine runtime inside BeerHall if not installed # ToDo: ofcourse we should relocate this code to startetrobo echo "Install Wine(32) to launch sg.exe if necessary" unset i386 + unset beerhall_wine if [ "$ETROBO_KERNEL" == "darwin" ]; then i386="mac" + if [ -x "$HOMEBREW_PREFIX/bin/wine" ] || [ -x "$HOMEBREW_PREFIX/bin/wine64" ]; then + beerhall_wine="available" + fi else i386="`sudo dpkg --print-foreign-architectures | grep i386`" fi - if [ "`wine --version > /dev/null 2>&1; echo $?`" == "127" ] || [ -z "$i386" ]; then + if { [ "$ETROBO_KERNEL" == "darwin" ] && [ -z "$beerhall_wine" ]; } || { [ "$ETROBO_KERNEL" != "darwin" ] && [ "`wine --version > /dev/null 2>&1; echo $?`" == "127" ]; } || [ -z "$i386" ]; then if [ "$ETROBO_KERNEL" == "darwin" ]; then brew install --cask gcenx/wine/game-porting-toolkit elif [ "$ETROBO_OS" != "win" ]; then @@ -882,7 +886,7 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then # install usbutils and libusb-dev if not installed # ToDo: ofcourse we should relocate this code to startetrobo if [ "$ETROBO_KERNEL" == "darwin" ]; then - if [ "`lsusb -V > /dev/null 2>&1; echo $?`" == "127" ]; then + if [ ! -x "$HOMEBREW_PREFIX/bin/lsusb" ] || [ ! -f "$HOMEBREW_PREFIX/lib/libusb-0.1.4.dylib" ] || [ ! -f "$HOMEBREW_PREFIX/include/usb.h" ]; then brew install libusb libusb-compat usbutils fi elif [ "$ETROBO_KERNEL" == "debian" ]; then From 7b49f6ccb687eef3e87942e97fd2a8476c64875e Mon Sep 17 00:00:00 2001 From: supurazako Date: Sun, 26 Apr 2026 00:49:10 +0900 Subject: [PATCH 3/6] fix:NXT macOS build with wine64 and cygpath wrappers --- scripts/etrobopkg | 8 ++++++++ scripts/maccygpath | 26 ++++++++++++++++++++++++++ scripts/startetrobo | 7 ++++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 scripts/maccygpath diff --git a/scripts/etrobopkg b/scripts/etrobopkg index 984e9ba..97c384c 100755 --- a/scripts/etrobopkg +++ b/scripts/etrobopkg @@ -811,14 +811,22 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then | sed -E 's/¥/\\/g' \ | sed -E 's/(^WINECONSOLE := wineconsole$)/\1 > \/dev\/null 2>\&1/' \ | sed -E 's/^\t(WINECONSOLE := \/Applications\/Wine.app\/Contents\/MacOS\/startwine wineconsole$)/\t# \1/' \ + | sed -E '/^ifeq \(\$\(UNAME\), Darwin\)$/,/^else$/ s/(^\t# WINECONSOLE := .*wineconsole$)/\tWINECONSOLE := wine64 > \/dev\/null 2>\&1/' \ + | sed -E 's/(^\t\$\(WINECONSOLE\) \$\(TOPPERS_OSEK_ROOT_SG\)\/sg\/sg )(.*)$/\1.exe\2/' \ | sed -E 's/(^\tLAUNCHER := $)/\1$(WINECONSOLE)/' \ + | sed -E '/^[[:space:]]*-os=ECC2 .* -template=/a\ + @test -f .\/kernel_cfg.c -a -f .\/kernel_id.h || { echo "ERROR: sg.exe did not generate kernel_cfg.c/kernel_id.h." \>\&2; exit 1; }' \ > nxtOSEK/ecrobot/ecrobot.mak iconv -f SHIFT_JIS -t UTF-8 nxtOSEK/ecrobot/ecrobot++.mak.org \ | sed -E 's/μ/u/g' \ | sed -E 's/¥/\\/g' \ | sed -E 's/(^WINECONSOLE := wineconsole$)/\1 > \/dev\/null 2>\&1/' \ | sed -E 's/^\t(WINECONSOLE := \/Applications\/Wine.app\/Contents\/MacOS\/startwine wineconsole$)/\t# \1/' \ + | sed -E '/^ifeq \(\$\(UNAME\), Darwin\)$/,/^else$/ s/(^\t# WINECONSOLE := .*wineconsole$)/\tWINECONSOLE := wine64 > \/dev\/null 2>\&1/' \ + | sed -E 's/(^\t\$\(WINECONSOLE\) \$\(TOPPERS_OSEK_ROOT_SG\)\/sg\/sg )(.*)$/\1.exe\2/' \ | sed -E 's/(^\tLAUNCHER := $)/\1$(WINECONSOLE)/' \ + | sed -E '/^[[:space:]]*-os=ECC2 .* -template=/a\ + @test -f .\/kernel_cfg.c -a -f .\/kernel_id.h || { echo "ERROR: sg.exe did not generate kernel_cfg.c/kernel_id.h." \>\&2; exit 1; }' \ > nxtOSEK/ecrobot/ecrobot++.mak ;; "nexttool" ) diff --git a/scripts/maccygpath b/scripts/maccygpath new file mode 100755 index 0000000..30e9cdd --- /dev/null +++ b/scripts/maccygpath @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# cygpath wrapper for nxtOSEK running on macOS +# Wine expects Windows-style host paths, and nxtOSEK asks for `cygpath -m -w`. +# + +mixed="" +for arg in "$@"; do + if [[ "$arg" == -* ]]; then + if [[ "$arg" == *m* ]]; then + mixed="yes" + fi + continue + fi + + if [[ "$arg" != /* ]]; then + arg="$(cd "$(dirname "$arg")" && pwd)/$(basename "$arg")" + fi + + if [[ -n "$mixed" ]]; then + printf 'Z:%s\n' "$arg" + else + win_path="${arg//\//\\}" + printf 'Z:%s\n' "$win_path" + fi +done diff --git a/scripts/startetrobo b/scripts/startetrobo index 92dc6f3..6bc8c44 100755 --- a/scripts/startetrobo +++ b/scripts/startetrobo @@ -518,8 +518,13 @@ fi if [ "$ETROBO_ENV_MODE" == "NXT" ]; then if [ "$host" == "win" ]; then cp -f "$ETROBO_ROOT/scripts/fakewineconsole" "$ETROBO_ROOT/scripts/wineconsole" + cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" + elif [ "$host" == "mac" ]; then + # macOS Wine needs Windows-style paths for sg.exe input files. + cp -f "$ETROBO_ROOT/scripts/maccygpath" "$ETROBO_ROOT/scripts/cygpath" + else + cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" fi - cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" else rm -f "$ETROBO_ROOT/scripts/wineconsole" rm -f "$ETROBO_ROOT/scripts/cygpath" From a5f58e82f11a8726b84595fa49371949a16f74f4 Mon Sep 17 00:00:00 2001 From: supurazako Date: Sun, 26 Apr 2026 09:18:57 +0900 Subject: [PATCH 4/6] fix: correct sg.exe sed substitution in etrobopkg --- scripts/etrobopkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/etrobopkg b/scripts/etrobopkg index 97c384c..9aa17d8 100755 --- a/scripts/etrobopkg +++ b/scripts/etrobopkg @@ -812,7 +812,7 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then | sed -E 's/(^WINECONSOLE := wineconsole$)/\1 > \/dev\/null 2>\&1/' \ | sed -E 's/^\t(WINECONSOLE := \/Applications\/Wine.app\/Contents\/MacOS\/startwine wineconsole$)/\t# \1/' \ | sed -E '/^ifeq \(\$\(UNAME\), Darwin\)$/,/^else$/ s/(^\t# WINECONSOLE := .*wineconsole$)/\tWINECONSOLE := wine64 > \/dev\/null 2>\&1/' \ - | sed -E 's/(^\t\$\(WINECONSOLE\) \$\(TOPPERS_OSEK_ROOT_SG\)\/sg\/sg )(.*)$/\1.exe\2/' \ + | sed -E 's#(\$\(TOPPERS_OSEK_ROOT_SG\)/sg/sg)( )#\1.exe\2#' \ | sed -E 's/(^\tLAUNCHER := $)/\1$(WINECONSOLE)/' \ | sed -E '/^[[:space:]]*-os=ECC2 .* -template=/a\ @test -f .\/kernel_cfg.c -a -f .\/kernel_id.h || { echo "ERROR: sg.exe did not generate kernel_cfg.c/kernel_id.h." \>\&2; exit 1; }' \ @@ -823,7 +823,7 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then | sed -E 's/(^WINECONSOLE := wineconsole$)/\1 > \/dev\/null 2>\&1/' \ | sed -E 's/^\t(WINECONSOLE := \/Applications\/Wine.app\/Contents\/MacOS\/startwine wineconsole$)/\t# \1/' \ | sed -E '/^ifeq \(\$\(UNAME\), Darwin\)$/,/^else$/ s/(^\t# WINECONSOLE := .*wineconsole$)/\tWINECONSOLE := wine64 > \/dev\/null 2>\&1/' \ - | sed -E 's/(^\t\$\(WINECONSOLE\) \$\(TOPPERS_OSEK_ROOT_SG\)\/sg\/sg )(.*)$/\1.exe\2/' \ + | sed -E 's#(\$\(TOPPERS_OSEK_ROOT_SG\)/sg/sg)( )#\1.exe\2#' \ | sed -E 's/(^\tLAUNCHER := $)/\1$(WINECONSOLE)/' \ | sed -E '/^[[:space:]]*-os=ECC2 .* -template=/a\ @test -f .\/kernel_cfg.c -a -f .\/kernel_id.h || { echo "ERROR: sg.exe did not generate kernel_cfg.c/kernel_id.h." \>\&2; exit 1; }' \ From 6362ab98403706301de53998e2fd40b85a66ab0c Mon Sep 17 00:00:00 2001 From: supurazako Date: Mon, 27 Apr 2026 00:53:36 +0900 Subject: [PATCH 5/6] fix: remove hard-code usbutils deps --- scripts/etrobopkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/etrobopkg b/scripts/etrobopkg index 9aa17d8..5cf063f 100755 --- a/scripts/etrobopkg +++ b/scripts/etrobopkg @@ -894,7 +894,7 @@ if [ "$1" != "env" ] && [ "$1" != "unset" ]; then # install usbutils and libusb-dev if not installed # ToDo: ofcourse we should relocate this code to startetrobo if [ "$ETROBO_KERNEL" == "darwin" ]; then - if [ ! -x "$HOMEBREW_PREFIX/bin/lsusb" ] || [ ! -f "$HOMEBREW_PREFIX/lib/libusb-0.1.4.dylib" ] || [ ! -f "$HOMEBREW_PREFIX/include/usb.h" ]; then + if [ ! -x "$HOMEBREW_PREFIX/bin/lsusb" ] || [ ! -f "$HOMEBREW_PREFIX/include/usb.h" ] || ! ls "$HOMEBREW_PREFIX"/lib/libusb*.dylib > /dev/null 2>&1; then brew install libusb libusb-compat usbutils fi elif [ "$ETROBO_KERNEL" == "debian" ]; then From 8a37b96423c55cf4302912e12f9937f89009018a Mon Sep 17 00:00:00 2001 From: supurazako Date: Mon, 27 Apr 2026 00:54:10 +0900 Subject: [PATCH 6/6] change: remove macsygpath --- scripts/maccygpath | 26 -------------------------- scripts/startetrobo | 7 +------ 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100755 scripts/maccygpath diff --git a/scripts/maccygpath b/scripts/maccygpath deleted file mode 100755 index 30e9cdd..0000000 --- a/scripts/maccygpath +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# -# cygpath wrapper for nxtOSEK running on macOS -# Wine expects Windows-style host paths, and nxtOSEK asks for `cygpath -m -w`. -# - -mixed="" -for arg in "$@"; do - if [[ "$arg" == -* ]]; then - if [[ "$arg" == *m* ]]; then - mixed="yes" - fi - continue - fi - - if [[ "$arg" != /* ]]; then - arg="$(cd "$(dirname "$arg")" && pwd)/$(basename "$arg")" - fi - - if [[ -n "$mixed" ]]; then - printf 'Z:%s\n' "$arg" - else - win_path="${arg//\//\\}" - printf 'Z:%s\n' "$win_path" - fi -done diff --git a/scripts/startetrobo b/scripts/startetrobo index 6bc8c44..92dc6f3 100755 --- a/scripts/startetrobo +++ b/scripts/startetrobo @@ -518,13 +518,8 @@ fi if [ "$ETROBO_ENV_MODE" == "NXT" ]; then if [ "$host" == "win" ]; then cp -f "$ETROBO_ROOT/scripts/fakewineconsole" "$ETROBO_ROOT/scripts/wineconsole" - cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" - elif [ "$host" == "mac" ]; then - # macOS Wine needs Windows-style paths for sg.exe input files. - cp -f "$ETROBO_ROOT/scripts/maccygpath" "$ETROBO_ROOT/scripts/cygpath" - else - cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" fi + cp -f "$ETROBO_ROOT/scripts/fakecygpath" "$ETROBO_ROOT/scripts/cygpath" else rm -f "$ETROBO_ROOT/scripts/wineconsole" rm -f "$ETROBO_ROOT/scripts/cygpath"