AndreMiras / PyWallet

Cross platform Ethereum Wallet built with Python and Kivy
MIT License
64 stars 27 forks source link

secp256k1 and pkg-config #39

Closed AndreMiras closed 7 years ago

AndreMiras commented 7 years ago

In the secp256k1 recipe, the pkg-config package dependency should be completely skipped. However, it currently seems to be only partly inhibited.

Steps to reproduce, try to install secp256k1 recipe with "pkg-config" not installed on e.g. Ubuntu Xenial, here's the output:

[INFO]:    Building secp256k1 for armeabi-v7a                                                                                                                                                                                                                     [13/1822]
[INFO]:    secp256k1 apparently isn't already in site-packages                                                                                                                                                                                                             [INFO]:    Building compiled components in secp256k1                                                                                                                                                                                                                       [INFO]:    -> directory context /src/.buildozer/android/platform/build/build/other_builds/secp256k1/armeabi-v7a/secp256k1                                                                                                                                                  stty: 'standard input': Inappropriate ioctl for device
[INFO]:    -> running hostpython setup.py build_ext -v
Exception in thread background thread for pid 14782:
Traceback (most recent call last):                     
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()                           
  File "/usr/lib/python2.7/threading.py", line 754, in run         
    self.__target(*self.__args, **self.__kwargs)
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)        
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /src/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT:
'pkg-config' is required to install this package. Please see the README for details.

  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/src/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 905, in <module>
    main()
  File "/src/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 902, in main
    ToolchainCL()
  File "/src/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 508, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/src/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/src/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 190, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 565, in build_recipes
  File "pythonforandroid/recipe.py", line 890, in build_arch
  File "pythonforandroid/recipe.py", line 902, in build_compiled_components
  File "pythonforandroid/logger.py", line 175, in shprint
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 863, in next
    self.wait()
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/root/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /src/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT:
'pkg-config' is required to install this package. Please see the README for details.

  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=pywallet --bootstrap=sdl2 --requirements=hostpython2,kivy,setuptools,openssl,pycryptodome,pysha3,ethash,scrypt,bitcoin,rlp,repoze.lru,PyYAML,https://github.com/ethereum/pyethereum/arch
ive/0ae64823d1bccba9c8148adb462060cb83c08f06.zip,https://github.com/ethereum/pydevp2p/archive/cc68f6d69fa88ffaac6f8483392c37eb9f19d712.zip,gevent,pbkdf2,https://github.com/ethereum/pyethapp/archive/409331e88a397ce5276c430aff4a8866d413e45d.zip,https://gitlab.com/kivym
d/KivyMD/repository/archive.zip?ref=7de5790274a45c4fa2fb9c6fcd875645e536c95b,requests,pyelliptic==1.5.7,cffi,secp256k1,qrcode --arch armeabi-v7a --copy-libs --local-recipes /src/src/python-for-android/recipes --color=always --storage-dir=/src/.buildozer/android/platf
orm/build
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
AndreMiras commented 7 years ago

The fix should be as simple as patching the setup.py file around line 47 to skip the subprocess.check_call(). https://github.com/ludbb/secp256k1-py/blob/0.13.2.4/setup.py#L47