Created
September 12, 2012 06:12
-
-
Save fengmk2/3704641 to your computer and use it in GitHub Desktop.
package installed before node-canvas, must be sudo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
####### package installed before node-canvas, must be sudo | |
PKG_CONFIG="http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz" | |
PIXMAN="http://www.cairographics.org/releases/pixman-0.22.0.tar.gz" | |
CAIRO="http://cairographics.org/releases/cairo-1.12.0.tar.gz" | |
LIBPNG="http://files.directadmin.com/services/custombuild/libpng-1.2.40.tar.gz" | |
PREFIX=${1-/usr} | |
require() { | |
echo "... checking for $1" | |
if test `which $1`; then | |
echo "... found" | |
else | |
echo "... not found" | |
exit 1 | |
fi | |
} | |
fetch() { | |
local tarball=`basename $1` | |
echo "... downloading $tarball" | |
local dir=${tarball/.tar.gz/} | |
curl -# -L $1 -o $tarball \ | |
&& echo "... unpacking" \ | |
&& tar -zxf $tarball \ | |
&& echo "... removing tarball" \ | |
&& rm -fr $tarball \ | |
&& install $dir | |
} | |
install() { | |
local dir=$1 | |
echo "... installing $1" | |
cd $dir \ | |
&& ./configure --disable-dependency-tracking --prefix=$PREFIX --libdir=/usr/lib64 \ | |
&& make \ | |
&& make install \ | |
&& echo "... removing $dir" \ | |
&& cd .. && rm -fr $dir | |
} | |
yum install freetype.x86_64 | |
yum install freetype-devel.x86_64 | |
yum install fontconfig.x86_64 | |
yum install fontconfig-devel.x86_64 | |
yum install fonts-chinese.noarch | |
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig | |
echo "... installing to $PREFIX" | |
require curl | |
require tar | |
test `which pkg-config` || fetch $PKG_CONFIG | |
require 'pkg-config' | |
fetch $LIBPNG | |
fetch $PIXMAN | |
fetch $CAIRO | |
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig |
Author
fengmk2
commented
Sep 12, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment