Some tidying up
This commit is contained in:
@ -5,10 +5,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
This file follows the convention described at
|
This file follows the convention described at
|
||||||
[Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
[Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
### Changed
|
||||||
|
- gentoo90: Build now supports Windows
|
||||||
|
|
||||||
## [0.7.0] - 2017-08-26
|
## [0.7.0] - 2017-08-26
|
||||||
### Changed
|
### Changed
|
||||||
- Upgrade bindgen to 0.29
|
- Upgrade bindgen to 0.29
|
||||||
- Change to MagickWand 7.0; this introduces backward incompatible changes
|
- little-bobby-tables: Change to MagickWand 7.0;
|
||||||
|
this introduces backward incompatible changes...
|
||||||
- `get_quantum` and `set_quantum` now take `Quantum` instead of `u16`
|
- `get_quantum` and `set_quantum` now take `Quantum` instead of `u16`
|
||||||
- `resize_image` no longer takes a `blur_factor` argument
|
- `resize_image` no longer takes a `blur_factor` argument
|
||||||
- `InterpolatePixelMethod` was renamed `PixelInterpolateMethod`
|
- `InterpolatePixelMethod` was renamed `PixelInterpolateMethod`
|
||||||
|
|||||||
@ -80,8 +80,8 @@ There are still many missing functions, so if you find there is something you wo
|
|||||||
```
|
```
|
||||||
$ cd docker
|
$ cd docker
|
||||||
$ docker-compose build
|
$ docker-compose build
|
||||||
$ docker-compose start
|
|
||||||
$ docker-compose run magick-rust
|
$ docker-compose run magick-rust
|
||||||
|
$ cargo clean
|
||||||
$ cargo build
|
$ cargo build
|
||||||
$ cargo test
|
$ cargo test
|
||||||
```
|
```
|
||||||
|
|||||||
26
build.rs
26
build.rs
@ -38,40 +38,32 @@ fn main() {
|
|||||||
env_var_set_default("IMAGE_MAGICK_LIBS", "MagickWand-7");
|
env_var_set_default("IMAGE_MAGICK_LIBS", "MagickWand-7");
|
||||||
}
|
}
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
|
||||||
|
|
||||||
let lib_dirs = find_image_magick_lib_dirs();
|
let lib_dirs = find_image_magick_lib_dirs();
|
||||||
let include_dirs = find_image_magick_include_dirs();
|
|
||||||
|
|
||||||
|
|
||||||
for d in &lib_dirs {
|
for d in &lib_dirs {
|
||||||
if !d.exists() {
|
if !d.exists() {
|
||||||
panic!("ImageMagick library directory does not exist: {}", d.to_string_lossy());
|
panic!("ImageMagick library directory does not exist: {}", d.to_string_lossy());
|
||||||
}
|
}
|
||||||
println!( "cargo:rustc-link-search=native={}", d.to_string_lossy());
|
println!( "cargo:rustc-link-search=native={}", d.to_string_lossy());
|
||||||
}
|
}
|
||||||
|
let include_dirs = find_image_magick_include_dirs();
|
||||||
for d in &include_dirs {
|
for d in &include_dirs {
|
||||||
if !d.exists() {
|
if !d.exists() {
|
||||||
panic!("ImageMagick include directory does not exist: {}", d.to_string_lossy());
|
panic!("ImageMagick include directory does not exist: {}", d.to_string_lossy());
|
||||||
}
|
}
|
||||||
println!("cargo:include={}", d.to_string_lossy());
|
println!("cargo:include={}", d.to_string_lossy());
|
||||||
}
|
}
|
||||||
|
|
||||||
// let version = validate_headers(&[include_dir.clone().into()]);
|
|
||||||
|
|
||||||
println!("cargo:rerun-if-env-changed=IMAGE_MAGICK_LIBS");
|
println!("cargo:rerun-if-env-changed=IMAGE_MAGICK_LIBS");
|
||||||
|
|
||||||
|
let target = env::var("TARGET").unwrap();
|
||||||
let libs_env = env::var("IMAGE_MAGICK_LIBS").ok();
|
let libs_env = env::var("IMAGE_MAGICK_LIBS").ok();
|
||||||
let libs = match libs_env {
|
let libs = match libs_env {
|
||||||
Some(ref v) => v.split(":").map(|x| x.to_owned()).collect(),
|
Some(ref v) => v.split(":").map(|x| x.to_owned()).collect(),
|
||||||
None => {
|
None => {
|
||||||
if target.contains("windows") {
|
if target.contains("windows") {
|
||||||
vec!["CORE_RL_MagickWand_".to_string()]
|
vec!["CORE_RL_MagickWand_".to_string()]
|
||||||
}
|
} else if target.contains("freebsd") {
|
||||||
else if target.contains("freebsd") {
|
|
||||||
vec!["MagickWand-7".to_string()]
|
vec!["MagickWand-7".to_string()]
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
run_pkg_config().libs
|
run_pkg_config().libs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +90,7 @@ fn main() {
|
|||||||
.ctypes_prefix("libc")
|
.ctypes_prefix("libc")
|
||||||
.raw_line("extern crate libc;")
|
.raw_line("extern crate libc;")
|
||||||
.header(gen_h_path.to_str().unwrap())
|
.header(gen_h_path.to_str().unwrap())
|
||||||
/* https://github.com/rust-lang-nursery/rust-bindgen/issues/687 */
|
// https://github.com/rust-lang-nursery/rust-bindgen/issues/687
|
||||||
.hide_type("FP_NAN")
|
.hide_type("FP_NAN")
|
||||||
.hide_type("FP_INFINITE")
|
.hide_type("FP_INFINITE")
|
||||||
.hide_type("FP_ZERO")
|
.hide_type("FP_ZERO")
|
||||||
@ -173,10 +165,12 @@ fn determine_mode<T: AsRef<str>>(libdirs: &Vec<PathBuf>, libs: &[T]) -> &'static
|
|||||||
.filter_map(|e| e.into_string().ok())
|
.filter_map(|e| e.into_string().ok())
|
||||||
.collect::<HashSet<_>>();
|
.collect::<HashSet<_>>();
|
||||||
let can_static = libs.iter().all(|l| {
|
let can_static = libs.iter().all(|l| {
|
||||||
files.contains(&format!("lib{}.a", l.as_ref())) || files.contains(&format!("{}.lib", l.as_ref()))
|
files.contains(&format!("lib{}.a", l.as_ref())) ||
|
||||||
|
files.contains(&format!("{}.lib", l.as_ref()))
|
||||||
});
|
});
|
||||||
let can_dylib = libs.iter().all(|l| {
|
let can_dylib = libs.iter().all(|l| {
|
||||||
files.contains(&format!("lib{}.so", l.as_ref())) || files.contains(&format!("{}.dll", l.as_ref())) ||
|
files.contains(&format!("lib{}.so", l.as_ref())) ||
|
||||||
|
files.contains(&format!("{}.dll", l.as_ref())) ||
|
||||||
files.contains(&format!("lib{}.dylib", l.as_ref()))
|
files.contains(&format!("lib{}.dylib", l.as_ref()))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user