Skip to content

Commit

Permalink
Merge pull request nlfiedler#138 from gyk/fix/msys2
Browse files Browse the repository at this point in the history
Remove Windows-specific invocation of MagickCore-config
  • Loading branch information
nlfiedler authored Sep 19, 2024
2 parents f796041 + eaf8c33 commit dfd8df0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-msys2.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests on Windows
name: Run tests on Windows (MSYS2)

on:
workflow_dispatch:
Expand All @@ -14,12 +14,12 @@ jobs:
- name: Install dependencies
shell: C:\msys64\usr\bin\bash.exe --login '{0}'
run: |
export PATH="/mingw64/bin:$PATH"
pacman --noconfirm -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-pkg-config
export PATH="/ucrt64/bin:$PATH"
pacman --noconfirm -S mingw-w64-ucrt-x86_64-imagemagick mingw-w64-ucrt-x86_64-pkg-config
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Test
run: |
$env:PATH = "C:\msys64\usr\bin;C:\msys64\mingw64\bin;$env:PATH"
cargo test -- --skip background --skip negate_image
$env:PATH = "C:\msys64\usr\bin;C:\msys64\ucrt64\bin;$env:PATH"
cargo test -- --skip test_set_background_color
27 changes: 8 additions & 19 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,14 @@ impl bindgen::callbacks::ParseCallbacks for RemoveEnumVariantSuffixes {
}

fn main() {
let check_cppflags = if cfg!(all(target_os = "windows", not(target_env = "msvc"))) {
// Resolve bash from directories listed in the PATH environment variable in the
// order they appear.
Command::new("cmd")
.arg("/C")
.arg("bash")
.arg("MagickCore-config")
.arg("--cppflags")
.output()
} else {
Command::new("MagickCore-config")
.arg("--cppflags")
.output()
.or_else(|_| {
Command::new("pkg-config")
.args(["--cflags", "MagickCore"])
.output()
})
};
let check_cppflags = Command::new("MagickCore-config")
.arg("--cppflags")
.output()
.or_else(|_| {
Command::new("pkg-config")
.args(["--cflags", "MagickCore"])
.output()
});
if let Ok(ok_cppflags) = check_cppflags {
let cppflags = ok_cppflags.stdout;
let cppflags = String::from_utf8(cppflags).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/wand/pixel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl PixelWand {

set_get_unchecked!(
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
);

Expand Down

0 comments on commit dfd8df0

Please sign in to comment.