Installation Amazon Linux AMI(EC 2)

1808 ワード

Installation Amazon Linux AMI(EC 2)
The Amazon Linux AMI commes with old packages、e.g.Cairo 1.8.8.Here's one way to get node-canvas up and running from source.
Remove the old package:
$ sudo yum erase cairo
Set up some env vars(add to~/.bashrc):
export PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'  
export LD_LIBRARY_PATH='/usr/local/lib':$LD_LIBRARY_PATH  
Get&build various source package in order:
libpng
$ curl http://optimate.dl.sourceforge.net/project/libpng/libpng15/1.5.17/libpng-1.5.17.tar.gz -o libpng.tar.gz  
$ tar -zxf libpng.tar.gz && cd libpng-1.5.17/
$ ./configure --prefix=/usr/local   
$ make 
$ sudo make install  
jpeg
$ curl http://www.ijg.org/files/jpegsrc.v8d.tar.gz -o jpegsrc.tar.gz
$ tar -zxf jpegsrc.tar.gz && cd jpeg-8d/
$ ./configure --disable-dependency-tracking --prefix=/usr/local  
$ make
$ sudo make install
pixman
$ curl http://www.cairographics.org/releases/pixman-0.28.2.tar.gz -o pixman.tar.gz  
$ tar -zxf pixman.tar.gz && cd pixman-0.28.2/  
$ ./configure --prefix=/usr/local   
$ make 
$ sudo make install  
freetype
$ curl http://download.savannah.gnu.org/releases/freetype/freetype-2.4.11.tar.gz -o freetype.tar.gz  
$ tar -zxf freetype.tar.gz && cd freetype-2.4.11/  
$ ./configure --prefix=/usr/local   
$ make 
$ sudo make install 
cairo
$ curl http://cairographics.org/releases/cairo-1.12.14.tar.xz -o cairo.tar.xz  
$ tar -xJf cairo.tar.xz && cd cairo-1.12.14/  
$ ./configure --disable-dependency-tracking --without-x --prefix=/usr/local 
$ make 
$ sudo make install 
Now npm install canvas shoul d build&run just fine.