Browse Source

Added instructions, binding.gyp and added the NODE_MODULE macro to specify the entry point.

v1.x
Andreas Botsikas 13 years ago
parent
commit
3738179d76
  1. 20
      Windows.Readme.txt
  2. 30
      binding.gyp
  3. 2
      src/init.cc

20
Windows.Readme.txt

@ -0,0 +1,20 @@
* Disclaimer *
The following instructions target the 32bit platform since by the time this is written, node x64 is unstable. compiling the x64 version should be as easy as downloading the x64 files instead.
* Requirements *
You will need cairo library which is bundled in GTK [1]. Go to http://www.gtk.org/download/win32.php and download the all-in-one bundle (these instructions used the following zip http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip). Unzip the contents in C:\GTK (if you want to change this you must modify the binding.gyp file to reflect your changes).
* Build instructions *
Use node-gyp to build the lib:
node-gyp configure
node-gyp build
* References *
[1] http://cairographics.org/download/

30
binding.gyp

@ -0,0 +1,30 @@
{
'variables': {
# Set the location of GTK all-in-one bundle
'GTK_Root': 'C:/GTK',
},
'targets': [
{
'target_name': 'canvas',
'sources': [
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/init.cc',
'src/PixelArray.cc',
],
'libraries': ['-l<(GTK_Root)/lib/cairo.lib' ],
'include_dirs': [
'<(GTK_Root)/include/cairo',
],
'defines': [
'snprintf=_snprintf',
'_USE_MATH_DEFINES' # for M_PI
],
}
]
}

2
src/init.cc

@ -25,3 +25,5 @@ init (Handle<Object> target) {
Pattern::Initialize(target);
target->Set(String::New("cairoVersion"), String::New(cairo_version_string()));
}
NODE_MODULE(canvas,init);
Loading…
Cancel
Save