Commit graph

36 commits

Author SHA1 Message Date
asonix 7f9ac00d4b support 7.1 2021-06-19 14:09:47 -05:00
asonix 530b745181 Merge branch 'master' of https://github.com/nlfiedler/magick-rust 2021-06-19 12:45:24 -05:00
Nathan Fiedler 9422825322 fix: in Rust 1.51 panic! takes only string literals
Seems that Rust 2021 will require that panic! macro takes only a string
literal, so format! and variables are out.

cargo test passes
2021-03-27 11:22:50 -07:00
liyunde 480421aa65 fix path_separator on windows can not build 2021-03-11 14:25:32 +08:00
asonix d82484e7de Set environment variable with magickcore config flags 2020-10-11 13:18:19 -05:00
asonix e387f40bf0 Add quantum depth 2020-10-10 17:46:38 -05:00
asonix e9f0ed4bb8 Fix builds 2020-10-10 17:40:25 -05:00
Nathan Fiedler 43edd76429 Update to latest bindgen release
The behavior around size_t changed so added a flag to temporarily avoid the
issue until it becomes a real problem later on.

cargo test passes
2020-05-21 08:17:08 -07:00
Nikola Pajkovsky 92b12900ab fix multiple redefined values on linux build
841  | pub const FP_ZERO: u32 = 2;
     | --------------------------- previous definition of the value `FP_ZERO` here
...
8117 | pub const FP_ZERO: _bindgen_ty_2 = 2;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_ZERO` redefined here

Signed-off-by: Nikola Pajkovsky <nikola.pajkovsky@livesporttv.cz>
2020-05-21 11:42:08 +02:00
Atul Bhosale f286c631b9
Format code using 'cargo fmt' 2019-08-17 21:48:01 +05:30
Nathan Fiedler bd34f145a2 Ran cargo fmt on the code base, looks better
cargo test passes
2018-10-06 15:38:33 -07:00
Nathan Fiedler 8a4fced836 Update to latest release of bindgen
Note that all of the enum definitions changed (again?), and now they are
flattened into the 'bindings' namespace. This breaks the API in a way that
is relatively easy to fix, albeit annoying. Attempts to change the enum
generation using default_enum_style() resulted in endless compiler errors.

cargo test passes
2018-10-06 15:37:41 -07:00
gentoo90 9b780bc5f1 Hide more types to fix build (#29) 2017-12-22 21:49:32 +02:00
Nathan Fiedler c2e519f19f Some tidying up 2017-10-08 17:10:56 -07:00
gentoo90 66a2f0cef4 Parametrize build via environment variables
build.rs now recognizes next environment variables:
IMAGE_MAGICK_DIR - installation directory
IMAGE_MAGICK_LIB_DIRS - list of lib dirs split by ":"
IMAGE_MAGICK_INCLUDE_DIRS - list of include dirs split by ":"
IMAGE_MAGICK_LIBS - list of the libs to link to
IMAGE_MAGICK_STATIC - if set to value other than 0, link statically
2017-10-06 20:24:51 +03:00
little-bobby-tables e5a5472b1e update build.rs 2017-08-19 16:01:51 +07:00
Nathan Fiedler 14f78e3734 Fix pkg-config invocation in build.rs
It seems that pkg-config ignores the --max-version option when combined with
certain other options. As such, that check was not really working. Since the
pkg-config Rust crate always passes those certain other options, it is
necessary to invoke the pkg-config command directly from build.rs instead.

cargo test passes
2017-07-10 21:32:59 -07:00
Nathan Fiedler acabbafa08 Downgrade rust-bindgen to 0.25.5
There is an issue when building on Linux when using 0.26.0 or higher, so
keep to a version that still works on Mac and Linux.

cargo test passes
2017-07-08 21:30:42 -07:00
Nathan Fiedler 1436145cb5 Tag new release with small API addition
Also, update bindgen version and format some of the comments and
documentation.

cargo test passes
2017-07-07 20:38:01 -07:00
Pete Gadomski d39972da88 Split the pkg-config version and flags checks
Apparently, on RHEL 6.7, pkg-config doesn't let you check versions and
output flags in the same command run.
2017-04-10 08:13:36 -06:00
Nathan Fiedler e7054d3e35 Use the rust-bindgen crate properly
Using the changes from @gadomski along with some additional work, to get the
generated bindings working again. Works on macOS and FreeBSD 11. A couple of
hacks are needed for FreeBSD, but nothing too serious.

Changed to use the libc prefix, and changed to use the generated enums.

Fixes #22, #15, and #14

cargo test passes
2017-04-08 16:03:58 -07:00
Pete Gadomski 4507d07c9c Update to the bingen crate 2017-04-07 06:24:00 -06:00
Nathan Fiedler b22e97c908 Hack the MagickWand bindings
Using rust-bindgen to generate the bindings for the MagickWand library is
extremely difficult with the new versions of rust-bindgen. The old versions
of the generated bindings will be used for now, and nothing will be
generated at build time.

cargo test passes
2017-04-06 19:58:58 -07:00
Nathan Fiedler 2eccf1e91b Ensure pkg-config present when generating bindings
Not all systems have pkg-config installed by default.

cargo test passes
2016-10-20 08:51:25 -07:00
Nathan Fiedler b63f25c550 Enforce MagickWand version in build.rs
It is very easy to overlook the version of MagickWand mentioned in the
README, so make sure the build system enforces it.

Fixes #19

cargo test passes
2016-10-16 11:00:06 -07:00
Nathan Fiedler dd4becddd7 Hack to get build working on FreeBSD again
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
2016-09-20 20:03:28 -07:00
Pete Gadomski 7563231707 Remove /usr/local/lib from rustc link search
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.
2016-08-25 07:54:49 -06:00
Nathan Fiedler eec7998d25 Use new rust-bindgen crate for faster builds
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
2016-08-14 21:23:05 -07:00
Nathan Fiedler 96071ca377 Use Result.expect() in the suitable cases 2016-07-14 19:12:27 -07:00
Mattis Marjak df6f812cf9 fix ldflags in build.rs 2016-05-17 22:18:17 +03:00
Mattis Marjak c08a093dc3 cross-compile support for build.rs 2016-05-16 18:57:06 +03:00
Mattis Marjak 85a4b97b70 place generated files in OUT_DIR 2016-05-11 16:52:15 +03:00
Nathan Fiedler 3732fd5747 Report missing MagickWand-config in build.rs
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
2016-03-23 18:00:52 -07:00
Nathan Fiedler 856a9e7c78 Handle building on macos a little better
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
2016-03-22 20:56:09 -07:00
Nathan Fiedler 04e1052266 Automatically build ImageMagick bindings
Leave the generated bindings out of the source repository and instead
have Cargo automatically build them if they are missing. This allows the
version of MagickWand to be incorporated into the bindings
automatically. For instance, in Homebrew the version is 6.Q16, while on
FreeBSD 10.2 it is 6.9, and only be generating the bindings for each
system can we ensure a smooth compilation process.
2016-01-25 19:58:43 -08:00
Nathan Fiedler 0474886c14 Include path to MagickWand for easier building 2015-12-23 11:34:51 -08:00