Skip to content

Commit

Permalink
Merge pull request #4019 from radarhere/msys2
Browse files Browse the repository at this point in the history
Added fallback for finding ld on MinGW Cygwin
  • Loading branch information
hugovk committed Aug 11, 2019
2 parents 845377d + 3fbea03 commit 6de118a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions setup.py
Expand Up @@ -118,6 +118,18 @@ class RequiredDependencyException(Exception):
PLATFORM_MINGW = "mingw" in ccompiler.get_default_compiler()
PLATFORM_PYPY = hasattr(sys, "pypy_version_info")

if sys.platform == "win32" and PLATFORM_MINGW:
from distutils import cygwinccompiler

cygwin_versions = cygwinccompiler.get_versions()
if cygwin_versions[1] is None:
# ld version is None
# distutils cygwinccompiler might fetch the ld path from gcc
# Try the normal path instead
cygwin_versions = list(cygwin_versions)
cygwin_versions[1] = cygwinccompiler._find_exe_version("ld -v")
cygwinccompiler.get_versions = lambda: tuple(cygwin_versions)


def _dbg(s, tp=None):
if DEBUG:
Expand Down
8 changes: 6 additions & 2 deletions winbuild/appveyor_install_msys2_deps.sh
Expand Up @@ -3,12 +3,16 @@
mkdir /var/cache/pacman/pkg
pacman -S --noconfirm mingw32/mingw-w64-i686-python3-pip \
mingw32/mingw-w64-i686-python3-setuptools \
mingw32/mingw-w64-i686-python3-pytest \
mingw32/mingw-w64-i686-python3-pytest-cov \
mingw32/mingw-w64-i686-python2-pip \
mingw32/mingw-w64-i686-python2-setuptools \
mingw32/mingw-w64-i686-python2-pytest \
mingw32/mingw-w64-i686-python2-pytest-cov \
mingw-w64-i686-libjpeg-turbo \
mingw-w64-i686-libimagequant

C:/msys64/mingw32/bin/python3 -m pip install --upgrade pip

/mingw32/bin/pip install pytest pytest-cov olefile
/mingw32/bin/pip3 install pytest pytest-cov olefile
/mingw32/bin/pip install olefile
/mingw32/bin/pip3 install olefile

0 comments on commit 6de118a

Please sign in to comment.