From f4183a0c9e487f3ae3bc568d57eac46b340c5936 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 2 Sep 2024 09:43:47 +0000 Subject: [PATCH] macOS: fix include and library paths for extmod build --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e402d36a..9b117bc2 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ # https://github.com/mmgen/mmgen-wallet # https://gitlab.com/mmgen/mmgen-wallet -import os,platform +import sys, os from pathlib import Path from subprocess import run,PIPE from setuptools import setup,Extension @@ -49,7 +49,7 @@ def build_libsecp256k1(): class my_build_ext(build_ext): def build_extension(self,ext): - if platform.system() == 'Windows': + if sys.platform == 'win32': build_libsecp256k1() build_ext.build_extension(self,ext) @@ -58,6 +58,8 @@ setup( ext_modules = [Extension( name = 'mmgen.proto.secp256k1.secp256k1', sources = ['extmod/secp256k1mod.c'], - libraries = ['gmp','secp256k1'] if platform.system() == 'Windows' else ['secp256k1'] + libraries = ['gmp', 'secp256k1'] if sys.platform == 'win32' else ['secp256k1'], + include_dirs = ['/usr/local/include'] if sys.platform == 'darwin' else [], + library_dirs = ['/usr/local/lib'] if sys.platform == 'darwin' else [], )] )