Permalink
Browse files

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

  • Loading branch information...
1 parent df8c181 commit beba8274d66fa1f43fe3fee240d806b979607aa4 @jviereck jviereck committed with tj Nov 23, 2012
Showing with 26 additions and 12 deletions.
  1. +5 −4 binding.gyp
  2. +9 −8 install
  3. +6 −0 util/cairo_include.sh
  4. +6 −0 util/lib_lookup.sh
View
@@ -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)'
]
}]
]
View
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
View
@@ -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
View
@@ -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

0 comments on commit beba827

Please sign in to comment.