Due to a bug in rust-bindgen, use the bindings as generated on the Mac
for the same version of MagickWand as found on FreeBSD. That is, when
build.rs is invoked on a FreeBSD system, it will use the Mac-generated
bindings.rs rather than pulling down rust-bindgen and invoking it to
generate the bindings on the fly. See issue #385 in the rust-bindgen
project for details.
cargo test passes
If /usr/local/lib is in the search path, a Homebrew installed libJPEG
can end up conflicting with the system libJPEG as such:
```
$ otool -L /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO:
... snip ...
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib (compatibility version 1.0.0, current version 1.0.0)
... snip ...
```
```
$ cargo clean && cargo test
... snip ...
Doc-tests magick_rust
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
```
Removing the /usr/local/lib link search path allows successful
compilation and testing on my OSX 10.11.6, with jpeg 8d installed into
/usr/local/lib via Homebrew. I realize this might be a problem with my
setup and not a universal issue, but as Homebrew is so common I thought
I'd submit this patch anyways.
Rather than cloning the bindgen repository and building from source, use
the packaged crate. The result is the rebuilds are much, much faster.
Also, had to make numerous changes for the new version of bindgen.
cargo test passes
This method goes down to `MagickGetImagesBlob`, which allows for
creating animated gifs.
I didn't abstract out common operations between the two in the interest
of not overly polluting the codebase. However, this new method is almost
identical to `write_image_blob` so you could probably abstract something
out of there.
The test image that was meant to be rotated was generated incorrectly.
It now corresponds to the following ImageMagick command:
$ convert in -rotate 90 -orient left-bottom out
cargo test passes
Since build.rs requires MagickWand-config, make an effort to determine
if the executable is available or not, and panic with a clear course of
action. Otherwise the error is rather cryptic.
Fixes#3
cargo test passes
First, only add the special environment variable when building on Mac OS
X. Second, look for the path to ensure the Xcode command line tools are
installed, and panic if that is not the case.
cargo test passes