setup.py: add workaround for MSYS2 UCRT64 env path bug

MMGen now uses UCRT64 as the default MSYS2 configuration (see
doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md).
This commit is contained in:
The MMGen Project 2023-05-21 11:34:17 +00:00
commit ebb77548b7
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 6 additions and 1 deletions

View file

@ -1 +1 @@
13.3.dev57
13.3.dev58

View file

@ -20,9 +20,14 @@ def build_libsecp256k1():
print(f'Fixing broken library filename: {old.name!r} -> {new.name!r}')
shutil.copy2(old,new)
def fix_broken_aclocal_path():
os.environ['ACLOCAL_PATH'] = '/ucrt64/share/aclocal:/usr/share/aclocal'
import platform
if platform.system() == 'Windows':
fix_broken_libpython_fn()
if os.getenv('MSYSTEM') == 'UCRT64':
fix_broken_aclocal_path()
if not os.path.exists(cache_path):
os.makedirs(cache_path)