@@ -276,8 +276,6 @@ jobs:
276276 NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/characters.zh-CN.json=config/characters.zh-CN.json"
277277 NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/characters.zh-TW.json=config/characters.zh-TW.json"
278278 NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/core_config.json=config/core_config.json"
279- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/prompts_chara.py=config/prompts_chara.py"
280- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/prompts_sys.py=config/prompts_sys.py"
281279 NUITKA_OPTS="$NUITKA_OPTS --include-data-files=config/user_preferences.json=config/user_preferences.json"
282280
283281 # Data directories
@@ -361,19 +359,26 @@ jobs:
361359 NUITKA_OPTS="$NUITKA_OPTS --enable-plugin=dill-compat"
362360 NUITKA_OPTS="$NUITKA_OPTS --assume-yes-for-downloads"
363361
364- # Steam files (include if present in repo)
362+ # Steam files (include if present in repo).
363+ # PR #1264 moved native libs into steamworks/; runtime still loads them
364+ # from the exe sibling dir (see steamworks/__init__.py), so dest stays at root.
365+ # Gate by RUNNER_OS: all platforms' libs are checked into the repo, but
366+ # feeding a Linux ELF .so to a macOS Nuitka build trips an arch-mismatch FATAL.
365367 NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steam_appid.txt=steam_appid.txt"
366- if [ -f "libsteam_api.dylib" ]; then
367- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=libsteam_api.dylib=libsteam_api.dylib"
368- fi
369- if [ -f "SteamworksPy.dylib" ]; then
370- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=SteamworksPy.dylib=SteamworksPy.dylib"
371- fi
372- if [ -f "libsteam_api.so" ]; then
373- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=libsteam_api.so=libsteam_api.so"
374- fi
375- if [ -f "SteamworksPy.so" ]; then
376- NUITKA_OPTS="$NUITKA_OPTS --include-data-files=SteamworksPy.so=SteamworksPy.so"
368+ if [[ "$RUNNER_OS" == "macOS" ]]; then
369+ if [ -f "steamworks/libsteam_api.dylib" ]; then
370+ NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.dylib=libsteam_api.dylib"
371+ fi
372+ if [ -f "steamworks/SteamworksPy.dylib" ]; then
373+ NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.dylib=SteamworksPy.dylib"
374+ fi
375+ elif [[ "$RUNNER_OS" == "Linux" ]]; then
376+ if [ -f "steamworks/libsteam_api.so" ]; then
377+ NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.so=libsteam_api.so"
378+ fi
379+ if [ -f "steamworks/SteamworksPy.so" ]; then
380+ NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.so=SteamworksPy.so"
381+ fi
377382 fi
378383
379384 echo "=== Nuitka options ==="
@@ -402,8 +407,6 @@ jobs:
402407 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/characters.zh-CN.json=config/characters.zh-CN.json
403408 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/characters.zh-TW.json=config/characters.zh-TW.json
404409 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/core_config.json=config/core_config.json
405- set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/prompts_chara.py=config/prompts_chara.py
406- set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/prompts_sys.py=config/prompts_sys.py
407410 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=config/user_preferences.json=config/user_preferences.json
408411 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-dir=assets=assets
409412 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-dir=templates=templates
@@ -430,9 +433,13 @@ jobs:
430433 set NUITKA_OPTS=%NUITKA_OPTS% --nofollow-import-to=plugin.plugins
431434 set NUITKA_OPTS=%NUITKA_OPTS% --include-package=utils
432435 set NUITKA_OPTS=%NUITKA_OPTS% --include-package=steamworks
433- set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steam_api64.dll=steam_api64.dll
434- set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steam_api64.lib=steam_api64.lib
435- set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=SteamworksPy64.dll=SteamworksPy64.dll
436+ rem PR #1264 moved native libs into steamworks/; runtime still loads them
437+ rem from the exe sibling dir (see steamworks/__init__.py), so dest stays at root.
438+ rem Guard with `if exist` to mirror the Unix branch — keeps the build
439+ rem soft on incidental missing libs instead of fataling in Nuitka.
440+ if exist "steamworks\steam_api64.dll" set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steamworks/steam_api64.dll=steam_api64.dll
441+ if exist "steamworks\steam_api64.lib" set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steamworks/steam_api64.lib=steam_api64.lib
442+ if exist "steamworks\SteamworksPy64.dll" set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steamworks/SteamworksPy64.dll=SteamworksPy64.dll
436443 set NUITKA_OPTS=%NUITKA_OPTS% --include-data-files=steam_appid.txt=steam_appid.txt
437444 set NUITKA_OPTS=%NUITKA_OPTS% --nofollow-import-to=audiolab
438445 set NUITKA_OPTS=%NUITKA_OPTS% --nofollow-import-to=pyrnnoise
0 commit comments