Skip to content

Commit

Permalink
Added fallback for finding ld on MinGW Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 10, 2019
1 parent 845377d commit 3fbea03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 3fbea03

Please sign in to comment.