Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

v2: CrossOver 완전 제거 — 순정 보틀 + 공식 설치기 + 구성요소 자동 확보

mikey928f5a07109eb3
diff --git a/README.ko.md b/README.ko.md
index bfbe4bb15e5..ceddaeb6205 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -20,35 +20,49 @@ CodeWeavers가 GPL로 공개한 소스(Wine 11.0, CrossOver 26.3 소스 드롭)
함정 하나: 실행 체인에 애플 보호 바이너리(`nohup`, `arch` 등)를 두면 macOS가 `DYLD_*` 변수를 제거해 라이브러리를 못 찾는다.
-## 빠른 시작 (처음부터)
+## 빠른 시작 (처음부터) — CrossOver 불필요
-**0단계 — 구성요소 1회 수집.** [CrossOver 무료 체험판](https://www.codeweavers.com/crossover)을 설치하고, 그 안에서 배틀넷과 게임을 설치하세요 (이 과정에서 빌드에 필요한 D3DMetal·wine-mono·x86_64 dylib도 함께 확보됩니다). CrossOver는 이때 한 번만 필요하고, 세팅 후 삭제해도 됩니다.
+이 레포의 스크립트 밖에서 받는 것은 애플의 무료 Game Porting Toolkit 파일 하나뿐입니다 (무료 Apple ID 필요 — 애플이 재배포를 금지해서 직접 받아야 합니다).
```bash
# 1. 스크립트 받기
git clone https://github.com/BCD1210/soju.git && cd soju
-# 2. GPL 소스에서 엔진 빌드 (30~60분, 소스 ~150MB 다운로드)
+# 2. 런타임 구성요소 확보 (x86_64 dylib + wine-mono, 전부 무료 GPL 릴리스에서)
+scripts/get-components.sh
+
+# 3. GPL 소스에서 엔진 빌드 (30~60분)
scripts/build-engine.sh
-# 3. 보틀 생성 (CrossOver의 배틀넷 보틀을 레지스트리째 복제)
-DEST=~/.battlenet-macos/bottle scripts/setup-bottle.sh
+# 4. 애플 GPTK 설치 (https://developer.apple.com/games/game-porting-toolkit/ 에서
+# dmg 다운로드 후 마운트한 상태로:)
+scripts/get-gptk.sh
+# (CrossOver가 설치돼 있으면 거기서 자동 추출)
+
+# 5. 보틀 생성 + Battle.net 설치 (블리자드 공식 설치기, 완전 자동)
+scripts/create-bottle.sh
-# 4. 플레이
-scripts/play.sh battlenet # 런처 → 로그인 → Play
+# 6. 플레이
+scripts/play.sh battlenet # 런처 → 로그인 → 게임 설치·플레이
scripts/play.sh d2r # 게임 직접 실행 (오프라인)
scripts/play.sh kill # 전부 종료
```
-더블클릭 앱을 원하면 Automator "셸 스크립트 실행"으로 `play.sh battlenet`을 감싸면 됩니다.
+이미 CrossOver 보틀에 게임이 설치돼 있다면 `scripts/setup-bottle.sh`로 복제하세요 (28GB 재다운로드 회피).
+
+**전제조건**: Apple Silicon 맥, Rosetta 2, Xcode CLT, Homebrew, 본인 배틀넷 계정, GPTK용 무료 Apple ID.
+
+### GPTK가 왜 필요한가?
+
+GPTK 안의 `libd3dshared.dylib`는 그래픽만이 아닙니다 — **D2R 로더(안티치트)가 Rosetta 2를 통과하려면 이 파일의 '비네이티브 코드영역 등록' 기능이 필수**입니다. 없으면 AVX를 켜도 실행 직후 멈춥니다. 그래픽 자체는 D3DMetal 없이 순수 오픈소스 vkd3d/MoltenVK로도 돌아갑니다.
### 문제 해결
-- **"Wine Mono Installer" 팝업** → 2단계에서 mono를 못 찾은 것. Cancel 누르고 CrossOver 설치 상태에서 `build-engine.sh` 재실행.
-- **게임이 86MB/0% CPU로 영원히 멈춤** → `ROSETTA_ADVERTISE_AVX=1`이 게임에 전달되지 않은 것. 반드시 `play.sh`로 실행.
-- **라이브러리 로드 실패(gnutls/freetype)** → `nohup`/`arch` 등 애플 서명 바이너리를 거쳐 실행하면 `DYLD_*`가 제거됨. `play.sh`로 실행.
-- **배틀넷 로그인 화면이 가끔 깜빡임(~1분 1회)** → 알려진 외관 이슈, 자동 복구되며 로그인 정상 동작.
-- **BLZBNTBNA00000005** → `play.sh`가 서명 exe를 자동 시드함. `play.sh`로 실행했는지 확인.
+- **"Wine Mono Installer" 팝업** → 2단계 생략됨. `get-components.sh` 후 `build-engine.sh` 재실행.
+- **게임이 86MB/0% CPU로 영원히 멈춤** → AVX 변수 또는 libd3dshared가 게임에 전달되지 않음. 반드시 `play.sh`로 실행하고 4단계 확인.
+- **라이브러리 로드 실패(gnutls/freetype)** → `nohup`/`arch` 등 애플 서명 바이너리를 거치면 `DYLD_*`가 제거됨. `play.sh`로 실행.
+- **배틀넷 로그인 화면이 가끔 깜빡임(~1분 1회)** → 알려진 외관 이슈, 자동 복구됨.
+- **BLZBNTBNA00000005** → `play.sh`가 서명 exe를 자동 시드함.
## 라이선스
diff --git a/README.md b/README.md
index 71a71a20f97..e8095402994 100644
--- a/README.md
+++ b/README.md
@@ -24,35 +24,49 @@ Community Wine builds (Whisky, Kegworks-era engines) stopped working with modern
Plus one trap: never put Apple platform binaries (`nohup`, `arch`, …) in the launch chain — macOS strips `DYLD_*` variables when exec'ing them.
-## Quick start (from zero)
+## Quick start (from zero) — no CrossOver required
-**Step 0 — one-time component harvest.** Install the [CrossOver free trial](https://www.codeweavers.com/crossover), and inside it install Battle.net and your game (this also downloads D3DMetal, wine-mono, and the x86_64 dylibs the build needs). You only need CrossOver once; after setup it can be removed.
+The only thing you download outside this repo's scripts is Apple's free Game Porting Toolkit (one file, needs a free Apple ID) — Apple forbids redistributing it.
```bash
# 1. Get the scripts
git clone https://github.com/BCD1210/soju.git && cd soju
-# 2. Build the engine from GPL sources (30-60 min; downloads ~150 MB source)
+# 2. Fetch runtime components (x86_64 dylibs + wine-mono, all from free GPL releases)
+scripts/get-components.sh
+
+# 3. Build the engine from GPL sources (30-60 min)
scripts/build-engine.sh
-# 3. Create your bottle (clones your CrossOver Battle.net bottle, registry included)
-DEST=~/.battlenet-macos/bottle scripts/setup-bottle.sh
+# 4. Install Apple GPTK payload (download the GPTK dmg from
+# https://developer.apple.com/games/game-porting-toolkit/ , mount it, then:)
+scripts/get-gptk.sh
+# (if you happen to have CrossOver installed, the script auto-extracts from it instead)
+
+# 5. Create a bottle + install Battle.net (official Blizzard installer, fully automatic)
+scripts/create-bottle.sh
-# 4. Play
-scripts/play.sh battlenet # launcher -> log in -> hit Play
+# 6. Play
+scripts/play.sh battlenet # launcher -> log in -> install & play your game
scripts/play.sh d2r # direct game launch (offline)
scripts/play.sh kill # stop everything
```
-Optional: make a double-clickable app that runs `play.sh battlenet` (an Automator "Run Shell Script" app works fine).
+Already have a CrossOver bottle with games installed? `scripts/setup-bottle.sh` clones it (28 GB game re-download avoided).
+
+**Prerequisites**: Apple Silicon Mac, Rosetta 2, Xcode Command Line Tools, Homebrew, your own Battle.net account/games, and a free Apple ID for the GPTK download. Nothing from Apple, Blizzard, or CodeWeavers is redistributed by this repo.
+
+### Why is GPTK needed at all?
+
+`libd3dshared.dylib` (inside GPTK) is not just graphics: D2R's loader requires its *non-native code region registration* to get through Rosetta 2 — without it the game freezes at launch even with AVX advertised. Graphics itself can run on pure open-source vkd3d/MoltenVK if D3DMetal is absent.
### Troubleshooting
-- **"Wine Mono Installer" popup** → the mono import in step 2 didn't find CrossOver; click Cancel and re-run `build-engine.sh` with CrossOver installed.
-- **Game hangs forever at ~86 MB RAM, 0% CPU** → `ROSETTA_ADVERTISE_AVX=1` is not reaching the game. Launch via `play.sh` only.
-- **Libraries not found (gnutls/freetype errors)** → you launched wine through `nohup`/`arch`/another Apple-signed binary, which strips `DYLD_*` vars. Launch via `play.sh`.
-- **Battle.net login webview may flicker (~once a minute)** → known cosmetic issue; it recovers automatically and login works.
-- **BLZBNTBNA00000005** → `play.sh` seeds the signed exe automatically; make sure you launch through it.
+- **"Wine Mono Installer" popup** -> step 2 was skipped; run `get-components.sh` then re-run `build-engine.sh`.
+- **Game hangs forever at ~86 MB RAM, 0% CPU** -> `ROSETTA_ADVERTISE_AVX=1` or `libd3dshared` not reaching the game. Launch via `play.sh` only, and check step 4.
+- **Libraries not found (gnutls/freetype errors)** -> you launched wine through `nohup`/`arch`/another Apple-signed binary, which strips `DYLD_*` vars. Launch via `play.sh`.
+- **Battle.net login webview may flicker (~once a minute)** -> known cosmetic issue; it recovers automatically and login works.
+- **BLZBNTBNA00000005** -> `play.sh` seeds the signed exe automatically; make sure you launch through it.
## What's in the repo
diff --git a/scripts/build-engine.sh b/scripts/build-engine.sh
index e036fa104b7..c37e34d5847 100755
--- a/scripts/build-engine.sh
+++ b/scripts/build-engine.sh
@@ -4,6 +4,7 @@
# 주의: 처음부터 끝까지 한 번에 재실행은 미검증 — 이슈 환영.
#
# 요구: Apple Silicon + Rosetta 2, Xcode CLT, Homebrew(arm64).
+# 사전 실행: scripts/get-components.sh (dylib+mono 자동 확보 — CrossOver 불필요)
set -euo pipefail
WORK="${WORK:-$HOME/.battlenet-macos/build}"
@@ -11,9 +12,7 @@ SRC_URL="https://media.codeweavers.com/pub/crossover/source/crossover-sources-26
FT_URL="https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.gz"
DEPS="$WORK/deps"
ENGINE="${ENGINE:-$HOME/.battlenet-macos/cx26-engine}"
-# x86_64 dylib 공급처(gnutls 스택/MoltenVK): 설치된 CrossOver 또는 Whisky 엔진
-DYLIB_SRC="${DYLIB_SRC:-/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64}"
-CXG="/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64/apple_gptk/external"
+# x86_64 dylib은 get-components.sh가 $DEPS/lib에 미리 받아둔다 (frankea GPL 릴리스)
echo "==> 빌드 도구 설치 (bison 3.x, mingw-w64)"
brew list bison >/dev/null 2>&1 || brew install bison
@@ -36,12 +35,9 @@ tar -xzf "$WORK/ft.tar.gz" -C "$WORK"
--enable-shared --disable-static CC="clang -arch x86_64" \
&& arch -x86_64 make -j"$(sysctl -n hw.ncpu)" && arch -x86_64 make install )
-echo "==> x86_64 의존 dylib 확보 (gnutls 스택, MoltenVK)"
-# gnutls/nettle/gmp/... + libMoltenVK (CrossOver lib64 또는 Whisky 엔진 lib에서 조달)
-for d in libgnutls.30 libnettle.8 libhogweed.6 libgmp.10 libidn2.0 libunistring.5 \
- libtasn1.6 libp11-kit.0 libintl.8 libiconv.2 libMoltenVK; do
- find "$DYLIB_SRC" -name "$d*.dylib" -exec cp -c {} "$DEPS/lib/" \; 2>/dev/null || true
-done
+echo "==> x86_64 의존 dylib 확인 (get-components.sh 산출물)"
+ls "$DEPS/lib/libgnutls.30.dylib" "$DEPS/lib/libMoltenVK.dylib" >/dev/null 2>&1 \
+ || { echo "dylib 없음 — 먼저 scripts/get-components.sh 를 실행하세요"; exit 1; }
echo "==> wine configure (x86_64, new-wow64 i386+x86_64)"
mkdir -p "$WORK/wine-build"; cd "$WORK/wine-build"
@@ -61,17 +57,12 @@ echo "==> 엔진 조립 (dylib 배치 + D3DMetal + rpath + entitlement 서명)"
rm -rf "$ENGINE"; mkdir -p "$ENGINE"
cp -Rc "$WORK/install/usr/local/." "$ENGINE/"
cp -c "$DEPS/lib/"*.dylib "$ENGINE/lib/" 2>/dev/null || true
-# D3DMetal(Apple GPTK, 재배포 불가 → 설치된 CrossOver에서 조달) — 그래픽용
-# 중요: 실물은 lib/external에, x86_64-unix엔 반드시 '심링크'(복사 금지 — @loader_path 어긋나 assertion 루프)
-mkdir -p "$ENGINE/lib/external"
-cp -Rc "$CXG/D3DMetal.framework" "$CXG/libd3dshared.dylib" "$ENGINE/lib/external/" 2>/dev/null || true
-GW="/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64/apple_gptk/wine"
-cp -fc "$GW/x86_64-windows/"{d3d11,d3d12,dxgi}.dll "$ENGINE/lib/wine/x86_64-windows/" 2>/dev/null || true
-( cd "$ENGINE/lib/wine/x86_64-unix" && for f in d3d10.so d3d11.so d3d12.so dxgi.so; do ln -sf ../../external/libd3dshared.dylib "$f"; done )
-# wine-mono 10.4.1 (CrossOver에서 조달) — .NET 앱용
+# D3DMetal/libd3dshared(Apple GPTK)는 별도 단계: scripts/get-gptk.sh 실행
+# (libd3dshared는 게임 로더의 Rosetta 통과에 필수. 그래픽은 없으면 vkd3d로 동작)
+# wine-mono 10.4.1 (get-components.sh가 받아둔 공식 릴리스)
mkdir -p "$ENGINE/share/wine/mono"
-cp -Rc "/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/share/wine/mono/wine-mono-10.4.1" \
- "$ENGINE/share/wine/mono/" 2>/dev/null || true
+cp -Rc "$WORK/mono/wine-mono-10.4.1" "$ENGINE/share/wine/mono/" 2>/dev/null \
+ || echo "경고: mono 없음 — get-components.sh 실행 여부 확인"
# rpath + entitlement 서명 (Rosetta/실행메모리)
cat > "$WORK/ent.plist" <<'PL'
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
diff --git a/scripts/create-bottle.sh b/scripts/create-bottle.sh
new file mode 100755
index 00000000000..14f28d30450
--- /dev/null
+++ b/scripts/create-bottle.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# CrossOver 없이 새 보틀을 만들고 Blizzard 공식 설치기로 Battle.net을 설치한다.
+# 검증: 2026-08-27 — 순정 보틀에서 설치·로그인 화면까지 자동 완료 확인.
+set -euo pipefail
+
+ENGINE="${ENGINE:-$HOME/.battlenet-macos/cx26-engine}"
+export WINEPREFIX="${WINEPREFIX:-$HOME/.battlenet-macos/bottle}"
+export WINEDEBUG="${WINEDEBUG:-fixme-all}"
+export WINEMSYNC=1 ROSETTA_ADVERTISE_AVX=1
+export CX_APPLEGPTK_LIBD3DSHARED_PATH="$ENGINE/lib/external/libd3dshared.dylib"
+export DYLD_FALLBACK_LIBRARY_PATH="$ENGINE/lib:/usr/lib"
+
+[ -x "$ENGINE/bin/wine" ] || { echo "엔진 없음 — build-engine.sh 먼저"; exit 1; }
+[ -f "$CX_APPLEGPTK_LIBD3DSHARED_PATH" ] || { echo "libd3dshared 없음 — get-gptk.sh 먼저"; exit 1; }
+
+WORK="${WORK:-$HOME/.battlenet-macos/build}"; mkdir -p "$WORK"
+
+echo "==> 프리픽스 초기화: $WINEPREFIX"
+"$ENGINE/bin/wine" wineboot -u >/dev/null 2>&1 || true
+"$ENGINE/bin/wineserver" -w
+
+echo "==> Battle.net 설치기 다운로드 (Blizzard 공식)"
+SETUP="$WORK/Battle.net-Setup.exe"
+[ -f "$SETUP" ] || curl -fL "https://downloader.battle.net/download/getInstaller?os=win&installer=Battle.net-Setup.exe" -o "$SETUP"
+
+echo "==> 설치 실행 (몇 분 소요, 자동 진행)"
+"$ENGINE/bin/wine" "$SETUP" --lang=enUS >/dev/null 2>&1 || true
+
+# 설치 완료 대기 (최대 10분)
+for i in $(seq 1 60); do
+ [ -f "$WINEPREFIX/drive_c/Program Files (x86)/Battle.net/Battle.net.exe" ] && break
+ sleep 10
+done
+BN="$WINEPREFIX/drive_c/Program Files (x86)/Battle.net"
+[ -f "$BN/Battle.net.exe" ] || { echo "설치 실패 — 로그: $WINEPREFIX/drive_c/ProgramData/Battle.net/Setup"; exit 1; }
+echo "==> Battle.net 설치 완료"
+
+"$ENGINE/bin/wineserver" -k 2>/dev/null || true
+echo "==> 끝. 이제 실행: scripts/play.sh battlenet"
+echo " (게임은 배틀넷 로그인 후 앱 내에서 설치하면 됩니다)"
diff --git a/scripts/get-components.sh b/scripts/get-components.sh
new file mode 100755
index 00000000000..7d21359441b
--- /dev/null
+++ b/scripts/get-components.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# CrossOver 없이 런타임 구성요소를 확보한다:
+# - x86_64 dylib 스택(gnutls/nettle/MoltenVK 등): frankea/Whisky의 GPL 엔진 릴리스에서
+# - wine-mono: 공식 wine-mono 릴리스에서
+# (D3DMetal/libd3dshared는 Apple GPTK — get-gptk.sh 참고)
+set -euo pipefail
+
+WORK="${WORK:-$HOME/.battlenet-macos/build}"
+DEPS="$WORK/deps"; mkdir -p "$DEPS/lib" "$WORK"
+
+echo "==> x86_64 dylib 스택 다운로드 (frankea/Whisky Libraries, GPL)"
+LIBS_URL="https://github.com/frankea/Whisky/releases/download/v3.1.1/Libraries.tar.gz"
+[ -f "$WORK/whisky-libs.tar.gz" ] || curl -fL "$LIBS_URL" -o "$WORK/whisky-libs.tar.gz"
+mkdir -p "$WORK/whisky-libs"
+tar -xzf "$WORK/whisky-libs.tar.gz" -C "$WORK/whisky-libs"
+cp -f "$WORK/whisky-libs/Libraries/Wine/lib/"*.dylib "$DEPS/lib/" 2>/dev/null
+echo " dylib $(ls "$DEPS/lib"/*.dylib | wc -l | tr -d ' ')개 확보"
+
+echo "==> wine-mono 10.4.1 다운로드 (공식 릴리스)"
+MONO_URL="https://github.com/wine-mono/wine-mono/releases/download/wine-mono-10.4.1/wine-mono-10.4.1-x86.tar.xz"
+[ -f "$WORK/wine-mono.tar.xz" ] || curl -fL "$MONO_URL" -o "$WORK/wine-mono.tar.xz"
+mkdir -p "$WORK/mono"
+tar -xJf "$WORK/wine-mono.tar.xz" -C "$WORK/mono"
+echo " mono 확보: $(ls "$WORK/mono" | head -1)"
+
+echo "==> 완료. build-engine.sh가 이 경로를 자동 사용합니다: $DEPS"
diff --git a/scripts/get-gptk.sh b/scripts/get-gptk.sh
new file mode 100755
index 00000000000..8e6422c8f9e
--- /dev/null
+++ b/scripts/get-gptk.sh
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+# Apple Game Porting Toolkit에서 libd3dshared + D3DMetal.framework를 엔진에 설치한다.
+#
+# 왜 필요한가: libd3dshared는 D2R 로더(안티치트)가 Rosetta 2를 통과하는 데 필수다
+# (비네이티브 코드영역 등록). 그래픽(D3DMetal)도 이걸로 제공된다. Apple이 재배포를
+# 금지하므로 사용자가 직접 받아야 한다 — 무료 Apple 계정이면 된다.
+#
+# 1) https://developer.apple.com/games/game-porting-toolkit/ 에서
+# "Game Porting Toolkit" dmg 다운로드 (Apple ID 로그인 필요, 무료)
+# 2) dmg를 연 상태에서(또는 경로 지정) 이 스크립트 실행:
+# scripts/get-gptk.sh # 마운트된 볼륨 자동 탐색
+# scripts/get-gptk.sh /path/to/GPTK # 직접 경로 지정
+#
+# 대안: CrossOver(체험판 포함)가 설치돼 있으면 거기서 자동 추출한다.
+set -euo pipefail
+
+ENGINE="${ENGINE:-$HOME/.battlenet-macos/cx26-engine}"
+[ -d "$ENGINE/lib" ] || { echo "엔진이 없습니다. 먼저 build-engine.sh 실행."; exit 1; }
+
+find_payload() {
+ local roots=("$@")
+ for r in "${roots[@]}"; do
+ [ -d "$r" ] || continue
+ local f
+ f=$(find "$r" -maxdepth 6 -name "libd3dshared.dylib" 2>/dev/null | head -1)
+ [ -n "$f" ] && { echo "$(dirname "$f")"; return 0; }
+ done
+ return 1
+}
+
+SRC=""
+if [ $# -ge 1 ]; then
+ SRC=$(find_payload "$1") || true
+fi
+if [ -z "$SRC" ]; then
+ # 마운트된 GPTK dmg 자동 탐색
+ SRC=$(find_payload /Volumes/Game* /Volumes/*orting* 2>/dev/null) || true
+fi
+if [ -z "$SRC" ]; then
+ # CrossOver 설치본에서 추출 (대안 경로)
+ SRC=$(find_payload "/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64/apple_gptk") || true
+fi
+if [ -z "$SRC" ]; then
+ echo "libd3dshared.dylib를 찾지 못했습니다."
+ echo "GPTK dmg를 마운트했는지, 또는 경로 인자를 확인하세요."
+ exit 1
+fi
+
+echo "==> GPTK 페이로드: $SRC"
+mkdir -p "$ENGINE/lib/external"
+cp -Rf "$SRC/D3DMetal.framework" "$ENGINE/lib/external/" 2>/dev/null || true
+cp -f "$SRC/libd3dshared.dylib" "$ENGINE/lib/external/"
+# 심링크 배선 (복사 금지! @loader_path 규칙)
+( cd "$ENGINE/lib/wine/x86_64-unix" && for f in d3d10.so d3d11.so d3d12.so dxgi.so; do ln -sf ../../external/libd3dshared.dylib "$f"; done )
+echo "==> 설치 완료: $ENGINE/lib/external"
+echo " (D3DMetal.framework가 없고 libd3dshared만 있어도 게임은 vkd3d 그래픽으로 동작합니다)"