見出し画像

Game Porting Toolkitのビルドに失敗する

短かいまとめ


Game Porting Toolkitをビルドしようとしたら失敗した
エラーを知らべたらCommand Line Tools(CL Tools)のバージョン上げたせいっぽい
ダウングレードしてみたらビルドできた

長い解説

M2 Mac miniにしてGame Porting Toolkit(GPT)使えるようになったのでインストールしてみた
最新はGame Porting Toolkit 1.1らしいのでダウンロードしてビルド方法を確認した
HomebrewからRosetta経由でビルド&インストール→再配布ライブラリをコピーしろ…フムフム

  • Rosetta 2でビルド?

Read Meにはx86_64版のHomebrewが必要とかなんとか…?

% arch -x86_64 zsh
% arch
i386
% uname -m
x86_64

なるほど。Rosetta内でシェルが動かせるのか

  • Command Line Toolsが古い

Xcodeを最新にした時にCommand Line Tools(CL Tools)も更新したつもりだったがどうも古い状態のままだったらしいく
古いCL Toolsを削除してインストールしろと出てきた 参照1 参照2

  • エラーが出てビルドに失敗

なんかエラーが出た…
しかも微妙なところで

x86_64-w64-mingw32-gcc -c -o dlls/cryptext/cryptext_main.cross.o /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/cryptext/cryptext_main.c \
-I dlls/cryptext -I /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/cryptext -I \
include -I /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/include -I \
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/include/msvcrt -D__WINESRC__ -D_UCRT \
-D__WINE_PE_BUILD -Wall -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \
-Wignored-qualifiers -Winit-self -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes \
-Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \
-Wabsolute-value -Wno-format -Wformat-overflow -Wnonnull -mcx16 -gdwarf-4 -Wformat -g -O2
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:629:11: error: unknown type name 'SecTrustSettingsDomain'
const SecTrustSettingsDomain domains[] = {
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:630:9: error: use of undeclared identifier 'kSecTrustSettingsDomainSystem'
kSecTrustSettingsDomainSystem,
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:631:9: error: use of undeclared identifier 'kSecTrustSettingsDomainAdmin'
kSecTrustSettingsDomainAdmin,
^
x86_64-w64-mingw32-gcc -c -o dlls/ctapi32/ctapi32.cross.o /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/ctapi32/ctapi32.c \
-I dlls/ctapi32 -I /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/ctapi32 -I \
include -I /private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/include -I \
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/include/msvcrt -D__WINESRC__ -D_UCRT \
-D__WINE_PE_BUILD -Wall -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \
-Wignored-qualifiers -Winit-self -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes \
-Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \
-Wabsolute-value -Wno-format -Wformat-overflow -Wnonnull -mcx16 -gdwarf-4 -Wformat -g -O2
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:632:9: error: use of undeclared identifier 'kSecTrustSettingsDomainUser'
kSecTrustSettingsDomainUser
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:640:18: warning: this function declaration is not a prototype [-Wstrict-prototypes]
status = SecTrustSettingsCopyCertificates(domains[domain], &certs);
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:641:23: error: use of undeclared identifier 'noErr'
if (status == noErr)
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:647:31: warning: this function declaration is not a prototype [-Wstrict-prototypes]
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:647:51: error: use of undeclared identifier 'kSecFormatX509Cert'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240415-1272-rufzkv/wine/dlls/crypt32/unixlib.c:647:95: error: use of undeclared identifier 'noErr'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
2 warnings and 7 errors generated.
make: *** [dlls/crypt32/unixlib.o] Error 1
make: *** Waiting for unfinished jobs....

  • エラーを調査

Apple Developer Forumsがヒット
どうも CL Tools 15.1でビルドできなかったらしい…
さっきインストールしたCL Tools は 15.3…

==> Formula
Tap: apple/apple
Path: /usr/local/Homebrew/Library/Taps/apple/homebrew-apple/Formula/game-porting-toolkit.rb
==> Configuration
HOMEBREW_VERSION: 4.2.18
ORIGIN: https://github.com/Homebrew/brew
HEAD: 9edabf02ce29e54d0b717baa757cff38ad0c0e25
Last commit: 13 hours ago
Core tap JSON: 15 Apr 08:57 UTC
Core cask tap JSON: 15 Apr 08:30 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.1.4 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit westmere
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.4.1-x86_64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: true
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++

  • Command Line Toolsをデグレード

CL Tools 15 beta 2をダウンロードして
CL Tools 15.3を削除して
ダウンロードした 15 beta 2 をインストール
再度GPTをインストールしてみたところ
無事インストールできた
(なんか証明書回りに不具合がありそうなのはシラネ…)
ビルドに32分もかかってる…

==> Summary

🍺  /usr/local/Cellar/game-porting-toolkit/1.1: 3,636 files, 1.2GB, built in 32 minutes 40 seconds

==> Running `brew cleanup game-porting-toolkit`...


この記事が気に入ったらサポートをしてみませんか?