Skip to content

Instantly share code, notes, and snippets.

@albi90
Last active June 19, 2020 17:17
Show Gist options
  • Save albi90/6279255 to your computer and use it in GitHub Desktop.
Save albi90/6279255 to your computer and use it in GitHub Desktop.
howto build node-webkit on armv7 hardfp
sudo apt-get install libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 zlib1g apache2.2-bin bison curl elfutils fakeroot flex g++ gperf libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev metacity patch perl php5-cgi pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg wdiff git-core
cd ~
mkdir .gyp
nano .gyp/include.gypi
paste the following
{
'variables': {
'linux_use_gold_binary' : 0,
'linux_use_gold_flags' : 0,
'target_arch': 'arm',
'disable_nacl': 1, # NaCL does not build for ARM.
'linux_use_tcmalloc': 0, # tcmalloc does not build for ARM.
'armv7': 1, # Optional, for targeting ARMv7.
'arm_thumb': 1, # Optional, for targeting thumb. Combine with armv7 to target thumb2.
'arm_neon': 1, # Optional, to disable NEON. 1 is the default, and most people want to keep it that way.
'verbose': 1,
'arm_float_abi': 'hard',
'use_system_yasm': 0,
'werror' : ''
}
}
-Save
nano arm.env
paste the following
export CXX=g++
export CC=gcc
export AR=ar
export AS=as
export RANLIB=ranlib
export CFLAGS=""
export CCFLAGS=$CFLAGS
export CXXFLAGS=""
export GYP_DEFINES="target_arch=arm"
export GYP_GENERATORS="make"
-Save
source ~/arm.env
create a 3gb swap file (google how tondo this if you dont know)
-Get the src for node-webkit (i wont document that here)
now just run
make nw -j4 BUILDTYPE=Release
note, make sure you have 'arm_float_abi': 'hard' in your include.gypi as chromium will try to make some of the files using softfp.
Also if cross compiling you dont need to put
'linux_use_gold_binary' : 0,
'linux_use_gold_flags' : 0,
in the include.gypi we need this when compiling natively as the gold linker doesent work on arm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment