Improve dependency-less documentation

Start to comment ever-growing GYP config

Add Circle CI config to run packaging tests
This commit is contained in:
Lovell Fuller 2015-11-10 21:49:45 +00:00
parent ee8fcb6109
commit bf6b894480
6 changed files with 32 additions and 5 deletions

View File

@ -7,6 +7,7 @@ coverage
test test
.travis.yml .travis.yml
appveyor.yml appveyor.yml
circle.yml
mkdocs.yml mkdocs.yml
lib lib
include include

View File

@ -4,11 +4,14 @@ The typical use case for this high speed Node.js module
is to convert large images of many formats to is to convert large images of many formats to
smaller, web-friendly JPEG, PNG and WebP images of varying dimensions. smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
`npm install sharp` Resizing an image is typically 4x faster than using the
quickest ImageMagick and GraphicsMagick settings.
A pre-built version of libvips is provided for Windows and most Linux systems. 64-bit Windows and recent Linux systems do not require
the installation of any external runtime dependencies.
Installation of libvips on OS X is as simple as `brew install homebrew/science/vips`. Use with OS X is as simple as running `brew install homebrew/science/vips`
to install the libvips dependency.
[![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master) [![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master)

View File

@ -1,11 +1,13 @@
{ {
'targets': [{ 'targets': [{
'target_name': 'sharp', 'target_name': 'sharp',
# Nested variables "pattern" borrowed from http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
'variables': { 'variables': {
'variables': { 'variables': {
'variables': { 'variables': {
'conditions': [ 'conditions': [
['OS != "win"', { ['OS != "win"', {
# Build the PKG_CONFIG_PATH environment variable with all possible combinations
'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' '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'
}, { }, {
'pkg_config_path': '' 'pkg_config_path': ''
@ -14,6 +16,7 @@
}, },
'conditions': [ 'conditions': [
['OS != "win"', { ['OS != "win"', {
# Which version, if any, of libvips is available globally via pkg-config?
'global_vips_version': '<!(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --modversion vips 2>/dev/null || true)' 'global_vips_version': '<!(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --modversion vips 2>/dev/null || true)'
}, { }, {
'global_vips_version': '' 'global_vips_version': ''
@ -25,6 +28,7 @@
'runtime_link%': 'shared', 'runtime_link%': 'shared',
'conditions': [ 'conditions': [
['OS != "win"', { ['OS != "win"', {
# Does the globally available version of libvips, if any, meet the minimum version requirement?
'use_global_vips': '<!(GLOBAL_VIPS_VERSION="<(global_vips_version)" node -e "require(\'./binding\').use_global_vips()")' 'use_global_vips': '<!(GLOBAL_VIPS_VERSION="<(global_vips_version)" node -e "require(\'./binding\').use_global_vips()")'
}, { }, {
'use_global_vips': '' 'use_global_vips': ''
@ -44,6 +48,7 @@
], ],
'conditions': [ 'conditions': [
['use_global_vips == "true"', { ['use_global_vips == "true"', {
# Use pkg-config for include and lib
'include_dirs': ['<!(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags vips glib-2.0)'], 'include_dirs': ['<!(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags vips glib-2.0)'],
'conditions': [ 'conditions': [
['runtime_link == "static"', { ['runtime_link == "static"', {
@ -53,6 +58,7 @@
}] }]
] ]
}, { }, {
# Attempt to download pre-built libvips and install locally within node_modules
'include_dirs': [ 'include_dirs': [
'<(module_root_dir)/include', '<(module_root_dir)/include',
'<(module_root_dir)/include/glib-2.0', '<(module_root_dir)/include/glib-2.0',
@ -108,10 +114,10 @@
'-O3' '-O3'
], ],
'xcode_settings': { 'xcode_settings': {
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7', 'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CPLUSPLUSFLAGS': [ 'OTHER_CPLUSPLUSFLAGS': [
'-std=c++11',
'-stdlib=libc++',
'-fexceptions', '-fexceptions',
'-Wall', '-Wall',
'-O3' '-O3'
@ -134,6 +140,7 @@
], ],
'conditions': [ 'conditions': [
['OS == "win"', { ['OS == "win"', {
# Windows lacks support for rpath
'copies': [{ 'copies': [{
'destination': '<(module_root_dir)/build/Release', 'destination': '<(module_root_dir)/build/Release',
'files': [ 'files': [

5
circle.yml Normal file
View File

@ -0,0 +1,5 @@
machine:
services:
- docker
test:
override: ./packaging/test.sh

View File

@ -1,5 +1,12 @@
# Changelog # Changelog
### v0.12 - "*look*"
#### v0.12.0 - TBD
* Bundle pre-compiled libvips and its dependencies for 64-bit Linux and Windows.
[#42](https://github.com/lovell/sharp/issues/42)
### v0.11 - "*knife*" ### v0.11 - "*knife*"
#### v0.11.4 - 5<sup>th</sup> November 2015 #### v0.11.4 - 5<sup>th</sup> November 2015

View File

@ -25,6 +25,10 @@ Most recent 64-bit Linux-based operating systems should "just work", e.g.:
* openSUSE 13.2 * openSUSE 13.2
* Archlinux 2015.06.01 * Archlinux 2015.06.01
Preference will be given to an existing globally-installed (via `pkg-config`)
version of libvips that meets the minimum version requirement.
This allows the use of newer versions of libvips with older versions of sharp.
For older and 32-bit Linux-based operating systems, For older and 32-bit Linux-based operating systems,
a system-wide installation of the most suitable version of a system-wide installation of the most suitable version of
libvips and its dependencies can be achieved by running libvips and its dependencies can be achieved by running