macOS 上の nativefier (ElectronPackager) で Windows 向けにパッケージ作業を実行したら以下のエラーが発生しました。 『wine がインストールされていない』と怒られています…
{ Error: Could not find "wine" on your system. Wine is required to use the appCopyright, appVersion, buildVersion, icon, and win32metadata parameters for Windows targets. Make sure that the "wine" executable is in your PATH.
wine のインストール
Homebrew で探すと以下のパッケージが見つかりました。
$ brew info wine wine: stable 2.0.3 (bottled), devel 2.19, HEAD Run Windows applications without a copy of Microsoft Windows https://www.winehq.org/ Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wine.rb ==> Dependencies Build: pkg-config ✘, cmake ✘, makedepend ✘ ==> Requirements Build: xcode ✔ Recommended: x11 ✘ ==> Options --without-win64 Build without 64-bit support --without-x11 Build without x11 support --devel Install development version 2.19 --HEAD Install HEAD version ==> Caveats You may want to get winetricks: brew install winetricks By default Wine uses a native Mac driver. To switch to the X11 driver, use regedit to set the "graphics" key under "HKCU/Software/Wine/Drivers" to "x11" (or use winetricks). For best results with X11, install the latest version of XQuartz: https://www.xquartz.org/
しかし、インストールしようとすると『XQuartz が不足している』というエラーになります。
$ brew install wine Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (caskroom/cask, homebrew/core). ==> Updated Formulae sbt wine: XQuartz is required to install this formula.X11Requirement unsatisfied! You can install with Homebrew-Cask: brew cask install xquartz You can download from: https://xquartz.macosforge.org Error: An unsatisfied requirement failed this build.
XQuarts のインストール
cask で XQuarts をインストールします。
brew cask install xquartz
wine のインストール(やり直し)
XQuarts のインストールが完了したら wine のインストールに再チャンレジします。
brew install wine
これで macOS 上で macOS と Windows の両プラットフォーム向けアプリケーションがパッケージング出来るようになりました。