Browse Source

Tune intstall and make node-gyp expect to have build in sub directory

v1.x
Julian Viereck 12 years ago
committed by TJ Holowaychuk
parent
commit
beba8274d6
  1. 9
      binding.gyp
  2. 17
      install
  3. 6
      util/cairo_include.sh
  4. 6
      util/lib_lookup.sh

9
binding.gyp

@ -13,7 +13,7 @@
'with_jpeg%': '<!(./util/has_lib.sh jpeg)',
'with_gif%': '<!(./util/has_lib.sh gif)',
'with_pango%': '<!(./util/has_lib.sh pangocairo)',
'with_freetype%': '<!(./util/has_cairo_freetype.sh)'
'with_freetype%': 'true'
}
}]
],
@ -45,8 +45,9 @@
]
}, { # 'OS!="win"'
'libraries': [
'-lpixman-1',
'-lcairo'
'<!@(./util/lib_lookup.sh pixman-1)',
'<!@(./util/lib_lookup.sh cairo)'
'<!@(./util/lib_lookup.sh libpng)'
]
}],
['with_freetype=="true"', {
@ -63,7 +64,7 @@
'include_dirs': [ # tried to pass through cflags but failed.
# Need to include the header files of cairo AND freetype.
# Looking up the includes of cairo does both.
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)'
'<!@(./util/cairo_include.sh)'
]
}]
]

17
install

@ -4,8 +4,7 @@ PKG_CONFIG="http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz"
PIXMAN="http://www.cairographics.org/releases/pixman-0.28.0.tar.gz"
CAIRO="http://cairographics.org/releases/cairo-1.12.8.tar.xz"
FREETYPE="http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz"
LIBPNG="ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.40.tar.gz"
PREFIX=${1-/usr/local}
LIBPNG="ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.13.tar.gz"
require() {
echo "... checking for $1"
@ -31,13 +30,11 @@ fetch() {
fetch_xz() {
local tarball=`basename $1`
echo "... downloading $tarball"
local dir=${tarball/.tar.xz/}
echo "... downloading $tarball";
curl -# -L $1 -o $tarball \
&& echo "... unpacking" \
&& tar -xJf $tarball \
&& echo "... removing tarball" \
&& rm -fr $tarball \
&& install $dir
}
@ -47,16 +44,20 @@ install() {
cd $dir \
&& ./configure --disable-dependency-tracking --prefix=$PREFIX \
&& make \
&& make install \
&& echo "... removing $dir" \
&& cd .. && rm -fr $dir
&& make install
}
mkdir -p build_cairo
PREFIX=$(cd "$(dirname "$0")"; pwd)/build_cairo
cd build_cairo
echo "... installing to $PREFIX"
require curl
require tar
test `which pkg-config` || fetch $PKG_CONFIG
require 'pkg-config'
fetch $LIBPNG
fetch $FREETYPE
fetch $FREETYPE
fetch $PIXMAN
fetch_xz $CAIRO

6
util/cairo_include.sh

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Make pkg-config lookup include files from the build directory.
export PKG_CONFIG_PATH=$(cd "$(dirname "$0")"; pwd)/../build_cairo/lib/pkgconfig;
pkg-config cairo --cflags-only-I | sed s/-I//g

6
util/lib_lookup.sh

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Make pkg-config lookup include files from the build directory.
export PKG_CONFIG_PATH=$(cd "$(dirname "$0")"; pwd)/../build_cairo/lib/pkgconfig;
pkg-config $1 --libs
Loading…
Cancel
Save