Merge pull request #138 from gyk/fix/msys2

Remove Windows-specific invocation of MagickCore-config
This commit is contained in:
Nathan Fiedler
2024-09-18 21:17:50 -07:00
committed by GitHub
3 changed files with 14 additions and 25 deletions

View File

@ -1,4 +1,4 @@
name: Run tests on Windows name: Run tests on Windows (MSYS2)
on: on:
workflow_dispatch: workflow_dispatch:
@ -14,12 +14,12 @@ jobs:
- name: Install dependencies - name: Install dependencies
shell: C:\msys64\usr\bin\bash.exe --login '{0}' shell: C:\msys64\usr\bin\bash.exe --login '{0}'
run: | run: |
export PATH="/mingw64/bin:$PATH" export PATH="/ucrt64/bin:$PATH"
pacman --noconfirm -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-pkg-config pacman --noconfirm -S mingw-w64-ucrt-x86_64-imagemagick mingw-w64-ucrt-x86_64-pkg-config
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
cache-on-failure: true cache-on-failure: true
- name: Test - name: Test
run: | run: |
$env:PATH = "C:\msys64\usr\bin;C:\msys64\mingw64\bin;$env:PATH" $env:PATH = "C:\msys64\usr\bin;C:\msys64\ucrt64\bin;$env:PATH"
cargo test -- --skip background --skip negate_image cargo test -- --skip test_set_background_color

View File

@ -113,25 +113,14 @@ impl bindgen::callbacks::ParseCallbacks for RemoveEnumVariantSuffixes {
} }
fn main() { fn main() {
let check_cppflags = if cfg!(all(target_os = "windows", not(target_env = "msvc"))) { let check_cppflags = Command::new("MagickCore-config")
// Resolve bash from directories listed in the PATH environment variable in the .arg("--cppflags")
// order they appear. .output()
Command::new("cmd") .or_else(|_| {
.arg("/C") Command::new("pkg-config")
.arg("bash") .args(["--cflags", "MagickCore"])
.arg("MagickCore-config") .output()
.arg("--cppflags") });
.output()
} else {
Command::new("MagickCore-config")
.arg("--cppflags")
.output()
.or_else(|_| {
Command::new("pkg-config")
.args(["--cflags", "MagickCore"])
.output()
})
};
if let Ok(ok_cppflags) = check_cppflags { if let Ok(ok_cppflags) = check_cppflags {
let cppflags = ok_cppflags.stdout; let cppflags = ok_cppflags.stdout;
let cppflags = String::from_utf8(cppflags).unwrap(); let cppflags = String::from_utf8(cppflags).unwrap();

View File

@ -93,7 +93,7 @@ impl PixelWand {
set_get_unchecked!( set_get_unchecked!(
get_color_count, set_color_count, PixelGetColorCount, PixelSetColorCount, usize get_color_count, set_color_count, PixelGetColorCount, PixelSetColorCount, usize
get_index, set_index, PixelGetIndex, PixelSetIndex, f32 get_index, set_index, PixelGetIndex, PixelSetIndex, bindings::Quantum
get_fuzz, set_fuzz, PixelGetFuzz, PixelSetFuzz, f64 get_fuzz, set_fuzz, PixelGetFuzz, PixelSetFuzz, f64
); );