[msys2]: support libsecp256k1

This commit is contained in:
The MMGen Project 2019-11-14 17:19:32 +00:00
commit c260fbf9aa
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 22 additions and 20 deletions

View file

@ -38,7 +38,7 @@ class my_build_ext(build_ext):
def build_extension(self,ext):
build_ext.build_extension(self,ext)
ext_src = self.get_ext_fullpath(ext.name)
ext_dest = os.path.join('mmgen','secp256k1.so')
ext_dest = os.path.join('mmgen',os.path.basename(ext_src))
try: os.unlink(ext_dest)
except: pass
os.chmod(ext_src,0o755)
@ -54,10 +54,9 @@ class my_install_data(install_data):
module1 = Extension(
name = 'mmgen.secp256k1',
sources = ['extmod/secp256k1mod.c'],
libraries = ['secp256k1'],
library_dirs = ['/usr/local/lib',r'c:\msys\local\lib'],
# mingw32 needs this, Linux can use it, but it breaks mingw64
include_dirs = ['/usr/local/include',r'c:\msys\local\include'],
libraries = ['secp256k1'] + ([],['gmp'])[have_msys2],
library_dirs = ['/usr/local/lib',r'C:\msys64\mingw64\lib',r'C:\msys64\usr\lib'],
include_dirs = ['/usr/local/include',r'C:\msys64\mingw64\include',r'C:\msys64\usr\include'],
)
@ -73,7 +72,7 @@ setup(
platforms = 'Linux, MS Windows, Raspberry Pi/Raspbian, Orange Pi/Armbian',
keywords = g.keywords,
cmdclass = { 'build_ext': my_build_ext, 'install_data': my_install_data },
ext_modules = [] if have_msys2 else [module1],
ext_modules = [module1],
data_files = [('share/mmgen', [
'data_files/mmgen.cfg', # source files must have 0644 mode
'data_files/mn_wordlist.c',

View file

@ -268,26 +268,29 @@ t_alts="
$gentest_py --coin=xmr --use-internal-keccak-module 2 $rounds_min
$gentest_py --coin=zec 2 $rounds
$gentest_py --coin=zec --type=zcash_z 2 $rounds_mid
# verification against external libraries and tools:
# pycoin
$gentest_py --all --type=legacy 2:pycoin $rounds
$gentest_py --all --type=compressed 2:pycoin $rounds
$gentest_py --all --type=segwit 2:pycoin $rounds
$gentest_py --all --type=bech32 2:pycoin $rounds
$gentest_py --all --type=legacy --testnet=1 2:pycoin $rounds
$gentest_py --all --type=compressed --testnet=1 2:pycoin $rounds
$gentest_py --all --type=segwit --testnet=1 2:pycoin $rounds
$gentest_py --all --type=bech32 --testnet=1 2:pycoin $rounds
# keyconv
$gentest_py --all --type=legacy 2:keyconv $rounds
$gentest_py --all --type=compressed 2:keyconv $rounds
$gentest_py --all --coin=xmr 2:moneropy $rounds_min # very slow, be patient!
"
[ "$MSYS2" ] || { # no pycoin (libsecp256k1), zcash-mini (golang), ethkey (?)
t_alts="$t_alts
$gentest_py --all --type=legacy 2:pycoin $rounds
$gentest_py --all --type=compressed 2:pycoin $rounds
$gentest_py --all --type=segwit 2:pycoin $rounds
$gentest_py --all --type=bech32 2:pycoin $rounds
$gentest_py --all --type=legacy --testnet=1 2:pycoin $rounds
$gentest_py --all --type=compressed --testnet=1 2:pycoin $rounds
$gentest_py --all --type=segwit --testnet=1 2:pycoin $rounds
$gentest_py --all --type=bech32 --testnet=1 2:pycoin $rounds
[ "$MSYS2" ] || { # no moneropy (pysha3), zcash-mini (golang), ethkey (?)
t_alts+="
# moneropy
$gentest_py --all --coin=xmr 2:moneropy $rounds_min # very slow, be patient!
# zcash-mini
$gentest_py --all 2:zcash-mini $rounds_mid
# ethkey
$gentest_py --all 2:ethkey $rounds
"
}