-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2835 from T-Dynamos/coincurve
recipes: new recipe `coincurve`
- Loading branch information
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
from pythonforandroid.recipe import PythonRecipe | ||
|
||
|
||
class CoincurveRecipe(PythonRecipe): | ||
version = "19.0.1" | ||
url = "https://github.com/ofek/coincurve/archive/v{version}.tar.gz" | ||
call_hostpython_via_targetpython = False | ||
depends = ["setuptools", "libffi", "cffi", "libsecp256k1", "asn1crypto"] | ||
patches = ["coincurve.patch"] | ||
|
||
def get_recipe_env(self, arch=None, with_flags_in_cc=True): | ||
env = super(CoincurveRecipe, self).get_recipe_env(arch, with_flags_in_cc) | ||
libsecp256k1 = self.get_recipe("libsecp256k1", self.ctx) | ||
libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch) | ||
env["CFLAGS"] += " -I" + os.path.join(libsecp256k1_dir, "include") | ||
env["LDFLAGS"] += " -lsecp256k1" | ||
return env | ||
|
||
|
||
recipe = CoincurveRecipe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
diff '--color=auto' -uNr coincurve-19.0.1/setup.py coincurve-19.0.1.patch/setup.py | ||
--- coincurve-19.0.1/setup.py 2024-03-02 10:40:59.000000000 +0530 | ||
+++ coincurve-19.0.1.patch/setup.py 2024-03-10 09:51:58.034737104 +0530 | ||
@@ -47,6 +47,7 @@ | ||
|
||
|
||
def download_library(command): | ||
+ return | ||
if command.dry_run: | ||
return | ||
libdir = absolute('libsecp256k1') | ||
@@ -189,6 +190,7 @@ | ||
absolute('libsecp256k1/configure'), | ||
'--disable-shared', | ||
'--enable-static', | ||
+ '--host=%s' % os.environ['TOOLCHAIN_PREFIX'], | ||
'--disable-dependency-tracking', | ||
'--with-pic', | ||
'--enable-module-extrakeys', | ||
@@ -269,13 +271,7 @@ | ||
# ABI?: py_limited_api=True, | ||
) | ||
|
||
- extension.extra_compile_args = [ | ||
- subprocess.check_output(['pkg-config', '--cflags-only-I', 'libsecp256k1']).strip().decode('utf-8') # noqa S603 | ||
- ] | ||
- extension.extra_link_args = [ | ||
- subprocess.check_output(['pkg-config', '--libs-only-L', 'libsecp256k1']).strip().decode('utf-8'), # noqa S603 | ||
- subprocess.check_output(['pkg-config', '--libs-only-l', 'libsecp256k1']).strip().decode('utf-8'), # noqa S603 | ||
- ] | ||
+ extension.extra_link_args = ["-lsecp256k1"] | ||
|
||
if os.name == 'nt' or sys.platform == 'win32': | ||
# Apparently, the linker on Windows interprets -lxxx as xxx.lib, not libxxx.lib | ||
@@ -340,7 +336,7 @@ | ||
license='MIT OR Apache-2.0', | ||
|
||
python_requires='>=3.8', | ||
- install_requires=['asn1crypto', 'cffi>=1.3.0'], | ||
+ install_requires=[], | ||
|
||
packages=find_packages(exclude=('_cffi_build', '_cffi_build.*', 'libsecp256k1', 'tests')), | ||
package_data=package_data, | ||
diff '--color=auto' -uNr coincurve-19.0.1/setup_support.py coincurve-19.0.1.patch/setup_support.py | ||
--- coincurve-19.0.1/setup_support.py 2024-03-02 10:40:59.000000000 +0530 | ||
+++ coincurve-19.0.1.patch/setup_support.py 2024-03-10 08:53:45.650056659 +0530 | ||
@@ -56,6 +56,7 @@ | ||
|
||
|
||
def _find_lib(): | ||
+ return True | ||
if 'COINCURVE_IGNORE_SYSTEM_LIB' in os.environ: | ||
return False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters