Add support for Windows #19

Requires VIPS_HOME environment variable
This commit is contained in:
Lovell Fuller 2015-04-05 22:42:14 +01:00
parent ce6813329b
commit f1ad1216ca
3 changed files with 54 additions and 10 deletions

View File

@ -83,6 +83,15 @@ The _gettext_ dependency of _libvips_ [can lead](https://github.com/lovell/sharp
brew link gettext --force
### Windows
Requires x86 32-bit Node.js or io.js (use `iojs.exe` rather than `node.exe`).
The WebP format is currently unsupported.
1. [Download](http://www.vips.ecs.soton.ac.uk/supported/current/win32/) and unzip `vips-dev.x.y.z.zip`.
2. Set the `VIPS_HOME` environment variable to the full path of the `vips-dev-x.y.z` directory.
3. Add `vips-dev-x.y.z\bin` to `PATH`.
### Heroku
[Alessandro Tagliapietra](https://github.com/alex88) maintains an [Heroku buildpack for libvips](https://github.com/alex88/heroku-buildpack-vips) and its dependencies.

View File

@ -8,15 +8,50 @@
'src/resize.cc',
'src/sharp.cc'
],
'variables': {
'PKG_CONFIG_PATH': '<!(which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR || true):$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'
},
'libraries': [
'<!(PKG_CONFIG_PATH="<(PKG_CONFIG_PATH)" pkg-config --libs vips)'
],
'include_dirs': [
'<!(PKG_CONFIG_PATH="<(PKG_CONFIG_PATH)" pkg-config --cflags vips glib-2.0)',
'<!(node -e "require(\'nan\')")'
'conditions': [
['OS=="win"', {
'library_dirs': [
'$(VIPS_HOME)/lib'
],
'libraries': [
'libvips.dll.a',
'glib-2.0.lib',
'gobject-2.0.lib',
'gthread-2.0.lib',
'gmodule-2.0.lib',
'liblcms2.dll.a',
'libxml2.lib',
'intl.lib',
'libjpeg.dll.a',
'libexif.dll.a',
'libpng.lib',
'libtiff.dll.a',
'libMagickWand-6.Q16.dll.a',
'libMagickCore-6.Q16.dll.a',
'pango-1.0.lib',
'pangoft2-1.0.lib',
'libgsf-1.dll.a',
'libopenslide.dll.a',
'libfftw3.dll.a'
],
'include_dirs': [
'$(VIPS_HOME)/include',
'$(VIPS_HOME)/include/glib-2.0',
'$(VIPS_HOME)/lib/glib-2.0/include',
'<!(node -e "require(\'nan\')")'
]
}, {
'variables': {
'PKG_CONFIG_PATH': '<!(which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR || true):$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'
},
'libraries': [
'<!(PKG_CONFIG_PATH="<(PKG_CONFIG_PATH)" pkg-config --libs vips)'
],
'include_dirs': [
'<!(PKG_CONFIG_PATH="<(PKG_CONFIG_PATH)" pkg-config --cflags vips glib-2.0)',
'<!(node -e "require(\'nan\')")'
]
}]
],
'cflags_cc': [
'-std=c++0x',

View File

@ -722,9 +722,9 @@ describe('Input/output', function() {
sharp(fixtures.inputJpg)
.resize(320, 240)
.toBuffer(function(err) {
sharp.queue.removeListener('change', queueListener);
if (err) throw err;
assert.strictEqual(2, eventCounter);
sharp.queue.removeListener('change', queueListener);
done();
});
});