试了试在Mac OS下安装IO.js,决定编译试试。
看了看官网列举的条件
gcc
and g++ 4.8
or newer, orclang
and clang++ 3.3
or newer1.Clone代码
git clone git@github.com:iojs/io.js.git
无奈的是很慢,因为很大
Cloning into 'io.js'...
remote: Counting objects: 141542, done.
remote: Compressing objects: 100% (119/119), done.
Receiving objects: 13% (19198/141542), 15.54 MiB | 118.00 KiB/s
Receiving objects: 13% (19254/141542), 15.69 MiB | 107.00 KiB/s
Receiving objects: 25% (35386/141542), 44.27 MiB | 144.00 KiB/s
Receiving objects: 27% (39541/141542), 52.86 MiB | 88.00 KiB/s KiB/s
2.编译
$ ./configure
生成了一堆参数
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'host_arch': 'x64',
'icu_small': 'false',
'node_install_npm': 'true',
'node_prefix': '',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_dtrace': 'true',
'node_use_etw': 'false',
'node_use_mdb': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'openssl_no_asm': 0,
'python': '/Users/fdhuang/py27/bin/python',
'target_arch': 'x64',
'uv_library': 'static_library',
'uv_parent_path': '/deps/uv/',
'uv_use_dtrace': 'true',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 0,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_random_seed': 0,
'v8_use_snapshot': 'false',
'want_separate_host_toolset': 0}}
creating ./config.gypi
creating ./config.mk
然后
$ make
直到
ln -fs out/Release/iojs iojs
接着
$ [sudo] make install
发现直接把node给替换掉了。。。
ln -fs out/Release/iojs iojs
/Users/fdhuang/py27/bin/python tools/install.py install '' '/usr/local'
installing /usr/local/bin/iojs
symlinking iojs -> /usr/local/bin/node
3.运行所有的测试
$ make test
发现io.js的构造系统好强悍
/Applications/Xcode-Beta.app/Contents/Developer/usr/bin/make -C out BUILDTYPE=Release V=1
make[1]: Nothing to be done for `all'.
ln -fs out/Release/iojs iojs
/Users/fdhuang/py27/bin/python tools/test.py --mode=release message parallel sequential -J
围观我的Github Idea墙, 也许,你会遇到心仪的项目