Permalink
Browse files

Added instructions, binding.gyp and added the NODE_MODULE macro to sp…

…ecify the entry point.
  • Loading branch information...
1 parent f47422f commit 3738179d76126bbd8d95e52aaa6bbcb04a75fd7e @andreasbotsikas andreasbotsikas committed May 9, 2012
Showing with 52 additions and 0 deletions.
  1. +20 −0 Windows.Readme.txt
  2. +30 −0 binding.gyp
  3. +2 −0 src/init.cc
View
@@ -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/
View
@@ -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
+ ],
+ }
+ ]
+}
View
@@ -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);

0 comments on commit 3738179

Please sign in to comment.