Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptation for MSYS2 #257

merged 2 commits into from Aug 11, 2015

Adaptation for MSYS2 #257

merged 2 commits into from Aug 11, 2015


Copy link

@eonj eonj commented Aug 11, 2015

MSYS2 is a POSIX-complaint environment for Windows. It provides PE binaries built from MinGW-w64 compilers, through pacman which MSYS2 team successfully ported.

I installed mingw-w64-i686-python3, mingw-w64-i686-pip3, mingw-w64-imagemagick using MSYS2 pacman, then run pip3 install wand. It was successful but import wand.image did not work. It was because ImageMagick binaries were installed as /mingw32/bin/libMagick(Core|Wand)-6.Q16HDRI-2.dll (with no $MAGICK_HOME) in my case. As current Wand searches for CORE_RL_(wand|magick)_<suffix>(.dll) on Windows and libMagickWand<suffix>(.so) for almost others, Wand couldn't find the binaries in my case.

This PR includes two commit of changeset over wand/ The former one changes the structure of ImageMagick library probing procedure. find_library(), now renamed library_paths(), became a generator function that iterates for possible library paths. Then load_library() checks if each path is loadable, via ctypes.CDLL(). The latter one, finally appends more example for library path that succeeds in case of MSYS2.

Manually tested in:

  • Windows 7 Professional K SP1, x86, MSYS2(MINGW32 shell), Python 3.4
  • Ubuntu 14.04.2 kernel 3.13.0-48-generic, x86_64, Python2.7

Thanks to @dahlia who provided proper feedback for me to write these changes.

- Now find_library() has the suffices and iterates for library path candidates
- Rename: library_paths()
dahlia added a commit that referenced this pull request Aug 11, 2015
@dahlia dahlia merged commit eea5673 into emcconville:master Aug 11, 2015
Copy link

dahlia commented Aug 11, 2015

Thanks for your effort. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants