Skip to content

Instantly share code, notes, and snippets.

@adriengibrat

adriengibrat/how to

Forked from albi90/how to
Last active Aug 29, 2015
Embed
What would you like to do?
Compiling node-webkit on raspberry pi
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': 0, # Optional, for targeting ARMv7.
'armv6': 1, # Optional, for targeting ARMv6.
'arm_thumb': 0, # Optional, for targeting thumb. Combine with armv7 to target thumb2.
'arm_neon': 0, # Optional, to disable NEON. 1 is the default, and most people want to keep it that way.
'arm_fpu': 'vfp', # Optional, to select which version of vfp to use if NEON is off. Default is vfpv3.
'verbose': 1,
'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="-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
export CCFLAGS=$CFLAGS
export CXXFLAGS="-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include/ -I/usr/include/pango-1.0 -I/usr/include/cairo/ -I/usr/include/librsvg-2 -O3 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
export GYP_DEFINES="target_arch=arm disable_nacl=1 linux_use_tcmalloc=0 armv6=1 arm_thumb=0 use_libjpeg_turbo=0"
export GYP_GENERATORS='make'
-Save
source arm.env
sudo nano /etc/dphys-swapfile
overwrite the file contients with
CONF_MAXSWAP=3072
CONF_SWAPSIZE=3072
-Save
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
-Get the src for node-webkit (i wont document that here)
cd src/third_party/ffmpeg
nano ffmpeg.gyp and replace "armv7-a" with "armv6", "vfp16-d3" with "vfp" and remove mtune=cortex-a8 and mthumb options.
./configure --arch=armel --target-os=linux --enable-gpl
cp config.h chromium/config/Chromium/linux/arm/
cd ../../
nano third_party/node/deps/v8/SConstruct
-change
'all': {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
},
-to
'all': {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv6'],
'CXXFLAGS': ['-fno-rtti', '-fno-exceptions', '-march=armv6'],
},
-change
'armeabi:softfp' : {
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
'vfp3:on': {
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
},
'simulator:none': {
'CCFLAGS': ['-mfloat-abi=softfp'],
}
},
-to
'armeabi:softfp' : {
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0']
# 'vfp3:on': {
# 'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
# },
# 'simulator:none': {
# 'CCFLAGS': ['-mfloat-abi=softfp'],
# }
},
-Save
nano build/common.gypi
-change
['OS=="linux" and target_arch=="arm" and chromeos==0', {
# Set some defaults for arm/linux chrome builds
'linux_breakpad%': 0,
'linux_use_tcmalloc%': 0,
# sysroot needs to be an absolute path otherwise it generates
# incorrect results when passed to pkg-config
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
}], # OS=="linux" and target_arch=="arm" and chromeos==0
-to
['OS=="linux" and target_arch=="arm" and chromeos==0', {
# Set some defaults for arm/linux chrome builds
'linux_breakpad%': 0,
'linux_use_tcmalloc%': 0,
# sysroot needs to be an absolute path otherwise it generates
# incorrect results when passed to pkg-config
#'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
}], # OS=="linux" and target_arch=="arm" and chromeos==0
now just run
make nw -j4 BUILDTYPE=Release
the compile will take about 3 days so you better have a good magazine to read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.