From bf6b8944802cbc3f6df619d5c7e9f5ebfbdc5ee5 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 10 Nov 2015 21:49:45 +0000 Subject: [PATCH] Improve dependency-less documentation Start to comment ever-growing GYP config Add Circle CI config to run packaging tests --- .npmignore | 1 + README.md | 9 ++++++--- binding.gyp | 11 +++++++++-- circle.yml | 5 +++++ docs/changelog.md | 7 +++++++ docs/install.md | 4 ++++ 6 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 circle.yml diff --git a/.npmignore b/.npmignore index f3a5a187..d340fe1a 100644 --- a/.npmignore +++ b/.npmignore @@ -7,6 +7,7 @@ coverage test .travis.yml appveyor.yml +circle.yml mkdocs.yml lib include diff --git a/README.md b/README.md index 01814b42..353ad478 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,14 @@ The typical use case for this high speed Node.js module is to convert large images of many formats to 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) diff --git a/binding.gyp b/binding.gyp index 84e850f8..09d3390c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,11 +1,13 @@ { 'targets': [{ 'target_name': 'sharp', + # Nested variables "pattern" borrowed from http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi 'variables': { 'variables': { 'variables': { 'conditions': [ ['OS != "win"', { + # Build the PKG_CONFIG_PATH environment variable with all possible combinations 'pkg_config_path': '/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': '' @@ -14,6 +16,7 @@ }, 'conditions': [ ['OS != "win"', { + # Which version, if any, of libvips is available globally via pkg-config? 'global_vips_version': '/dev/null || true)' }, { 'global_vips_version': '' @@ -25,6 +28,7 @@ 'runtime_link%': 'shared', 'conditions': [ ['OS != "win"', { + # Does the globally available version of libvips, if any, meet the minimum version requirement? 'use_global_vips': 'th November 2015 diff --git a/docs/install.md b/docs/install.md index cff1ff4b..47678fc6 100644 --- a/docs/install.md +++ b/docs/install.md @@ -25,6 +25,10 @@ Most recent 64-bit Linux-based operating systems should "just work", e.g.: * openSUSE 13.2 * 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, a system-wide installation of the most suitable version of libvips and its dependencies can be achieved by running