-
Notifications
You must be signed in to change notification settings - Fork 0
Multi Platform Build
Don't expect that you can build app for all platforms on one platform.
-
If your app has native dependencies, it can be compiled only on the target platform. prebuild is a solution, but most node modules don't provide prebuilt binaries.
-
OS Code Signing works only on MacOS. Cannot be fixed.
Don't think that mentioned issues are major, you should use build servers — e.g. AppVeyor to build Windows app and Travis to build MacOS/Linux apps.
See sample appveyor.yml to build Electron app for Windows. And sample .travis.yml to build Electron app for MacOS.
By default build for current platform and current arch. Use CLI flags --mac, --win, --linux to specify platforms. And --ia32, --x64 to specify arch.
For example, to build app for MacOS, Windows and Linux:
build -mwl
Build performed in parallel, so, it is highly recommended to not use npm task per platform (e.g. npm run dist:mac && npm run dist:win32), but specify multiple platforms/targets in one build command.
You don't need to clean dist output before build — output directory is cleaned automatically.
Use brew to install required packages.
brew install wine --without-x11
brew install mono
brew install gnu-tar graphicsmagick xz
To build rpm: brew install rpm.
To build app in distributable format for Linux:
sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils
To build rpm: sudo apt-get install --no-install-recommends -y rpm.
To build pacman: sudo apt-get install --no-install-recommends -y bsdtar.
-
Install Wine (1.8+ is required):
sudo add-apt-repository ppa:ubuntu-wine/ppa -y sudo apt-get update sudo apt-get install --no-install-recommends -y wine1.8 -
Install Mono (4.2+ is required):
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list sudo apt-get update sudo apt-get install --no-install-recommends -y mono-devel ca-certificates-mono
sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
Trusty is required — default Travis Linux dist is outdated and icnsutils version is non-functional.
sudo: required
dist: trustyUse Docker.