Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
06bb62ccda |
86 changed files with 677 additions and 312 deletions
20
recipes/aiohttp/__init__.py
Normal file
20
recipes/aiohttp/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class AiohttpRecipe(PythonRecipe):
|
||||||
|
version = "3.5.4"
|
||||||
|
url = "https://pypi.python.org/packages/source/a/aiohttp/aiohttp-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools", "attrs", "chardet", "multidict", "async_timeout", "yarl"]
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = AiohttpRecipe()
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class AppdirsRecipe(PythonRecipe):
|
class AppdirsRecipe(PythonRecipe):
|
||||||
version = "1.4.3"
|
version = "1.4.3"
|
||||||
url = "https://pypi.python.org/packages/source/a/appdirs/appdirs-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/a/appdirs/appdirs-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class AppdirsRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = AppdirsRecipe()
|
recipe = AppdirsRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ArgparseRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class Asn1CryptoRecipe(PythonRecipe):
|
class Asn1CryptoRecipe(PythonRecipe):
|
||||||
version = "0.24.0"
|
version = "0.24.0"
|
||||||
url = "https://pypi.python.org/packages/source/a/asn1crypto/asn1crypto-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/a/asn1crypto/asn1crypto-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class Asn1CryptoRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = Asn1CryptoRecipe()
|
recipe = Asn1CryptoRecipe()
|
||||||
|
|
20
recipes/async_timeout/__init__.py
Normal file
20
recipes/async_timeout/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class AsyncTimeoutRecipe(PythonRecipe):
|
||||||
|
version = "3.0.1"
|
||||||
|
url = "https://pypi.python.org/packages/source/a/async-timeout/async-timeout-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = AsyncTimeoutRecipe()
|
|
@ -3,7 +3,7 @@ from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class AttrsRecipe(PythonRecipe):
|
class AttrsRecipe(PythonRecipe):
|
||||||
version = "18.1.0"
|
version = "18.2.0"
|
||||||
url = "https://pypi.python.org/packages/source/a/attrs/attrs-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/a/attrs/attrs-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python", "setuptools"]
|
||||||
|
|
||||||
|
@ -13,8 +13,9 @@ class AttrsRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
build_env['PYTHONUSERBASE'] = join(self.ctx.dist_dir, "root", "python3");
|
||||||
|
shprint(hostpython, "setup.py", "install", "--user", _env=build_env)
|
||||||
|
|
||||||
recipe = AttrsRecipe()
|
recipe = AttrsRecipe()
|
||||||
|
|
|
@ -3,9 +3,9 @@ from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class Base58Recipe(PythonRecipe):
|
class Base58Recipe(PythonRecipe):
|
||||||
version = "0.2.2"
|
version = "1.0.0"
|
||||||
url = "https://pypi.python.org/packages/source/b/base58/base58-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/b/base58/base58-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class Base58Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = Base58Recipe()
|
recipe = Base58Recipe()
|
||||||
|
|
|
@ -6,7 +6,7 @@ import sh
|
||||||
|
|
||||||
class CffiRecipe(CythonRecipe):
|
class CffiRecipe(CythonRecipe):
|
||||||
name = "cffi"
|
name = "cffi"
|
||||||
version = "1.11.5"
|
version = "1.12.1"
|
||||||
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
|
||||||
library = "libcffi.a"
|
library = "libcffi.a"
|
||||||
depends = ["host_cffi", "libffi", "setuptools", "pycparser"]
|
depends = ["host_cffi", "libffi", "setuptools", "pycparser"]
|
||||||
|
@ -32,16 +32,16 @@ class CffiRecipe(CythonRecipe):
|
||||||
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
|
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
# hack: copy _cffi_backend.so from hostpython
|
# hack: copy _cffi_backend.so from hostpython
|
||||||
so_file = "_cffi_backend.so"
|
so_file = "_cffi_backend.cpython-37m-darwin.so"
|
||||||
egg_name = "cffi-1.11.5-py2.7-macosx-10.4-x86_64.egg" # harded - needs to change
|
egg_name = "cffi-1.12.1-py3.7-macosx-10.14-x86_64.egg" # harded - needs to change
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python", "lib", "python2.7", "site-packages", egg_name)
|
dest_dir = join(self.ctx.dist_dir, "root", "python3", "lib", "python3.7", "site-packages", egg_name)
|
||||||
src_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7", "site-packages", egg_name)
|
src_dir = join(self.ctx.dist_dir, "hostpython3", "lib", "python3.7", "site-packages", egg_name)
|
||||||
sh.cp(join(src_dir, so_file), join(dest_dir, so_file))
|
sh.cp(join(src_dir, so_file), join(dest_dir, so_file))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class SlowaesRecipe(PythonRecipe):
|
class ChardetRecipe(PythonRecipe):
|
||||||
version = "0.1a1"
|
version = "3.0.4"
|
||||||
url = "https://pypi.python.org/packages/source/s/slowaes/slowaes-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/c/chardet/chardet-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class SlowaesRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = SlowaesRecipe()
|
recipe = ChardetRecipe()
|
|
@ -14,7 +14,7 @@ class ClickRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
cmd = sh.Command("sed")
|
cmd = sh.Command("sed")
|
||||||
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
||||||
|
|
51
recipes/coincurve/__init__.py
Normal file
51
recipes/coincurve/__init__.py
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
from toolchain import Recipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import os
|
||||||
|
import sh
|
||||||
|
|
||||||
|
|
||||||
|
class CoincurveRecipe(Recipe):
|
||||||
|
name = "coincurve"
|
||||||
|
version = "7.1.0"
|
||||||
|
url = "https://github.com/ofek/coincurve/archive/{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools", "libffi", "cffi", "libsecp256k1"]
|
||||||
|
cythonize = False
|
||||||
|
|
||||||
|
def prebuild_arch(self, arch):
|
||||||
|
if self.has_marker("patched"):
|
||||||
|
return
|
||||||
|
|
||||||
|
self.apply_patch("cross_compile.patch")
|
||||||
|
self.apply_patch("drop_setup_requires.patch")
|
||||||
|
self.apply_patch("find_lib.patch")
|
||||||
|
self.apply_patch("no_download.patch")
|
||||||
|
|
||||||
|
# remove "tests_require=['pytest>=2.8.7']," string
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#tests_require=\[\'pytest>=2.8.7\'\],##g',
|
||||||
|
join(self.get_build_dir(arch.arch), "setup.py"))
|
||||||
|
|
||||||
|
self.set_marker("patched")
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
|
||||||
|
libsecp256k1 = self.get_recipe('libsecp256k1', self.ctx)
|
||||||
|
libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch)
|
||||||
|
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
build_env['CFLAGS'] = '{} -I{}'.format(build_env['CFLAGS'], os.path.join(libsecp256k1_dir, 'include'))
|
||||||
|
build_env['LDFLAGS'] = '{} -miphoneos-version-min=8.0 -L{}'.format(build_env['LDFLAGS'], os.path.join(libsecp256k1_dir, '.libs'))
|
||||||
|
|
||||||
|
print('*******{}'.format(build_env['CFLAGS']))
|
||||||
|
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
||||||
|
recipe = CoincurveRecipe()
|
12
recipes/coincurve/cross_compile.patch
Normal file
12
recipes/coincurve/cross_compile.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index c224fb2..bf925bd 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -182,6 +182,7 @@ class build_clib(_build_clib):
|
||||||
|
'--disable-dependency-tracking',
|
||||||
|
'--with-pic',
|
||||||
|
'--enable-module-recovery',
|
||||||
|
+ "--host=%s" % os.environ['TOOLCHAIN_PREFIX'],
|
||||||
|
'--disable-jni',
|
||||||
|
'--prefix',
|
||||||
|
os.path.abspath(self.build_clib),
|
12
recipes/coincurve/drop_setup_requires.patch
Normal file
12
recipes/coincurve/drop_setup_requires.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index c224fb2..466e789 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -250,7 +250,6 @@ else:
|
||||||
|
def has_c_libraries(self):
|
||||||
|
return not has_system_lib()
|
||||||
|
setup_kwargs = dict(
|
||||||
|
- setup_requires=['cffi>=1.3.0', 'pytest-runner>=2.6.2'],
|
||||||
|
ext_package='coincurve',
|
||||||
|
cffi_modules=['_cffi_build/build.py:ffi'],
|
||||||
|
cmdclass={
|
13
recipes/coincurve/find_lib.patch
Normal file
13
recipes/coincurve/find_lib.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/setup_support.py b/setup_support.py
|
||||||
|
index e7a4f2e..72f0c4d 100644
|
||||||
|
--- a/setup_support.py
|
||||||
|
+++ b/setup_support.py
|
||||||
|
@@ -68,6 +69,8 @@ def build_flags(library, type_, path):
|
||||||
|
|
||||||
|
|
||||||
|
def _find_lib():
|
||||||
|
+ # we're picking up the recipe one
|
||||||
|
+ return True
|
||||||
|
from cffi import FFI
|
||||||
|
ffi = FFI()
|
||||||
|
try:
|
13
recipes/coincurve/no_download.patch
Normal file
13
recipes/coincurve/no_download.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index c224fb2..d5f6d1a 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -51,6 +51,8 @@ if [int(i) for i in setuptools_version.split('.', 2)[:2]] < [3, 3]:
|
||||||
|
|
||||||
|
|
||||||
|
def download_library(command):
|
||||||
|
+ # we will use the custom libsecp256k1 recipe
|
||||||
|
+ return
|
||||||
|
if command.dry_run:
|
||||||
|
return
|
||||||
|
libdir = absolute('libsecp256k1')
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class ColoramaRecipe(PythonRecipe):
|
class ColoramaRecipe(PythonRecipe):
|
||||||
version = "0.3.7"
|
version = "0.3.7"
|
||||||
url = "https://pypi.python.org/packages/source/c/colorama/colorama-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/c/colorama/colorama-{version}.tar.gz"
|
||||||
depends = ["python"]
|
depends = ["python3"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class ColoramaRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = ColoramaRecipe()
|
recipe = ColoramaRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ConstantlyRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -7,34 +7,34 @@ import sh
|
||||||
|
|
||||||
class CryptographyRecipe(CythonRecipe):
|
class CryptographyRecipe(CythonRecipe):
|
||||||
name = "cryptography"
|
name = "cryptography"
|
||||||
version = "2.2.2"
|
version = "2.6"
|
||||||
url = "https://pypi.python.org/packages/source/c/cryptography/cryptography-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/c/cryptography/cryptography-{version}.tar.gz"
|
||||||
library = "libcryptography.a"
|
library = "libcryptography.a"
|
||||||
depends = ["host_setuptools", "host_cffi", "setuptools", "asn1crypto",
|
depends = ["host_setuptools", "host_cffi", "setuptools", "asn1crypto",
|
||||||
"cffi", "enum34", "idna", "ipaddress", "six"]
|
"cffi", "idna", "six"]
|
||||||
cythonize = False
|
cythonize = False
|
||||||
|
|
||||||
def prebuild_arch(self, arch):
|
def prebuild_arch(self, arch):
|
||||||
if self.has_marker("patched"):
|
if self.has_marker("patched"):
|
||||||
return
|
return
|
||||||
self.apply_patch("getentropy.patch")
|
self.apply_patch("getentropy.patch")
|
||||||
self.apply_patch("osrandom.patch")
|
#self.apply_patch("osrandom.patch")
|
||||||
self.set_marker("patched")
|
self.set_marker("patched")
|
||||||
|
|
||||||
def get_recipe_env(self, arch):
|
def get_recipe_env(self, arch):
|
||||||
env = super(CryptographyRecipe, self).get_recipe_env(arch)
|
env = super(CryptographyRecipe, self).get_recipe_env(arch)
|
||||||
r = self.get_recipe('openssl', self.ctx)
|
r = self.get_recipe('openssl', self.ctx)
|
||||||
openssl_dir = r.get_build_dir(arch.arch)
|
openssl_dir = r.get_build_dir(arch.arch)
|
||||||
target_python = Recipe.get_recipe('python', self.ctx).get_build_dir(arch.arch)
|
target_python = Recipe.get_recipe('python3', self.ctx).get_build_dir(arch.arch)
|
||||||
|
|
||||||
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python")
|
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python3")
|
||||||
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
|
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
|
||||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \
|
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.7' + \
|
||||||
' -I' + join(openssl_dir, 'include') + \
|
' -I' + join(openssl_dir, 'include') + \
|
||||||
' -I' + join(self.ctx.dist_dir, "include", arch.arch, "libffi")
|
' -I' + join(self.ctx.dist_dir, "include", arch.arch, "libffi")
|
||||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
||||||
' -L' + openssl_dir + \
|
' -L' + openssl_dir + \
|
||||||
' -lpython2.7' + \
|
' -lpython3.7m' + \
|
||||||
' -lssl' + r.version + \
|
' -lssl' + r.version + \
|
||||||
' -lcrypto' + r.version
|
' -lcrypto' + r.version
|
||||||
return env
|
return env
|
||||||
|
@ -51,8 +51,8 @@ class CryptographyRecipe(CythonRecipe):
|
||||||
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
pythonpath = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
build_env['PYTHONPATH'] = pythonpath
|
build_env['PYTHONPATH'] = pythonpath
|
||||||
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
|
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
|
||||||
shprint(*args, _env=build_env)
|
shprint(*args, _env=build_env)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- cryptography-2.2.2/src/_cffi_src/openssl/src/osrandom_engine.c 2018-03-27 15:12:05.000000000 +0100
|
--- a/src/_cffi_src/openssl/src/osrandom_engine.c 2019-01-22 17:41:49.000000000 +0100
|
||||||
+++ cryptography-2.2.2-patch/src/_cffi_src/openssl/src/osrandom_engine.c 2018-06-02 05:21:49.000000000 +0100
|
+++ b/src/_cffi_src/openssl/src/osrandom_engine.c 2019-08-12 11:47:03.000000000 +0100
|
||||||
@@ -205,14 +205,10 @@
|
@@ -243,14 +243,10 @@
|
||||||
#if !defined(__APPLE__)
|
#if !defined(__APPLE__)
|
||||||
getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
|
getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
|
||||||
#else
|
#else
|
||||||
|
@ -19,14 +19,14 @@
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
@@ -228,22 +224,7 @@
|
@@ -266,22 +262,7 @@
|
||||||
return dev_urandom_read(buffer, size);
|
return dev_urandom_read(buffer, size);
|
||||||
#endif
|
#endif
|
||||||
case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS:
|
case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS:
|
||||||
- while (size > 0) {
|
- while (size > 0) {
|
||||||
- /* OpenBSD and macOS restrict maximum buffer size to 256. */
|
- /* OpenBSD and macOS restrict maximum buffer size to 256. */
|
||||||
- len = size > 256 ? 256 : (size_t)size;
|
- len = size > 256 ? 256 : size;
|
||||||
- res = getentropy(buffer, len);
|
- res = getentropy(buffer, (size_t)len);
|
||||||
- if (res < 0) {
|
- if (res < 0) {
|
||||||
- ERR_Cryptography_OSRandom_error(
|
- ERR_Cryptography_OSRandom_error(
|
||||||
- CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES,
|
- CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES,
|
||||||
|
|
|
@ -14,7 +14,7 @@ class DistributeRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class DnsPythonRecipe(PythonRecipe):
|
class DistroRecipe(PythonRecipe):
|
||||||
version = "1.12.0"
|
version = "1.4.0"
|
||||||
url = "http://www.dnspython.org/kits/{version}/dnspython-{version}.zip"
|
url = "https://pypi.python.org/packages/source/d/distro/distro-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class DnsPythonRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = DnsPythonRecipe()
|
recipe = DistroRecipe()
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class DocoptRecipe(PythonRecipe):
|
class DocoptRecipe(PythonRecipe):
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
url = "https://pypi.python.org/packages/source/d/docopt/docopt-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/d/docopt/docopt-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class DocoptRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = DocoptRecipe()
|
recipe = DocoptRecipe()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class EcdsaRecipe(PythonRecipe):
|
class EcdsaRecipe(PythonRecipe):
|
||||||
version = "0.13"
|
version = "0.13"
|
||||||
url = "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class EcdsaRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = EcdsaRecipe()
|
recipe = EcdsaRecipe()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class Enum34Recipe(PythonRecipe):
|
class Enum34Recipe(PythonRecipe):
|
||||||
version = "1.1.6"
|
version = "1.1.6"
|
||||||
url = "https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class Enum34Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = Enum34Recipe()
|
recipe = Enum34Recipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class EnvparseRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class FlaskRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
cmd = sh.Command("sed")
|
cmd = sh.Command("sed")
|
||||||
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
||||||
|
|
|
@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class TxJsonRpcRecipe(PythonRecipe):
|
class HachoirRecipe(PythonRecipe):
|
||||||
version = "0.5"
|
version = "3.0a5"
|
||||||
url = "https://pypi.python.org/packages/source/t/txJSON-RPC/txJSON-RPC-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/h/hachoir/hachoir-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class TxJsonRpcRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = TxJsonRpcRecipe()
|
recipe = HachoirRecipe()
|
|
@ -19,10 +19,10 @@ Cflags: -I${includedir}
|
||||||
|
|
||||||
class HostCffiRecipe(Recipe):
|
class HostCffiRecipe(Recipe):
|
||||||
name = "host_cffi"
|
name = "host_cffi"
|
||||||
version = "1.11.5"
|
version = "1.12.1"
|
||||||
archs = ["x86_64"]
|
archs = ["x86_64"]
|
||||||
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
|
||||||
depends = ["libffi", "host_setuptools", "pycparser"]
|
depends = ["hostlibffi", "host_setuptools", "pycparser"]
|
||||||
|
|
||||||
def get_recipe_env(self, arch):
|
def get_recipe_env(self, arch):
|
||||||
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
|
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
|
||||||
|
|
|
@ -6,39 +6,35 @@ import fnmatch
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
class HostSetuptools(Recipe):
|
class HostSetuptoolsRecipe(Recipe):
|
||||||
depends = ["openssl", "hostpython"]
|
depends = ["openssl", "hostpython3"]
|
||||||
|
name = "setuptools"
|
||||||
archs = ["x86_64"]
|
archs = ["x86_64"]
|
||||||
#url = "setuptools"
|
version = "41.0.1"
|
||||||
version = "18.5"
|
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip"
|
||||||
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz"
|
|
||||||
cythonize = False
|
cythonize = False
|
||||||
|
|
||||||
'''
|
'''
|
||||||
def prebuild_arch(self, arch):
|
def prebuild_arch(self, arch):
|
||||||
dest_dir = join(
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
self.ctx.dist_dir, 'hostpython',
|
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
||||||
'lib', 'python2.7', 'site-packages')
|
shprint(hostpython, "./ez_setup.py")
|
||||||
#hostpython = sh.Command(self.ctx.hostpython)
|
|
||||||
#sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
|
||||||
#shprint(hostpython, "./ez_setup.py")
|
|
||||||
# Extract setuptools egg and remove .pth files. Otherwise subsequent
|
# Extract setuptools egg and remove .pth files. Otherwise subsequent
|
||||||
# python package installations using setuptools will raise exceptions.
|
# python package installations using setuptools will raise exceptions.
|
||||||
# Setuptools version 28.3.0
|
# Setuptools version 28.3.0
|
||||||
site_packages_path = join(
|
site_packages_path = join(
|
||||||
self.ctx.dist_dir, 'hostpython',
|
self.ctx.dist_dir, 'hostpython3',
|
||||||
'lib', 'python2.7', 'site-packages')
|
'lib', 'python3.7', 'site-packages')
|
||||||
os.chdir(site_packages_path)
|
os.chdir(site_packages_path)
|
||||||
with open('setuptools.pth', 'r') as f:
|
with open('setuptools.pth', 'r') as f:
|
||||||
setuptools_egg_path = f.read().strip('./').strip('\n')
|
setuptools_egg_path = f.read().strip('./').strip('\n')
|
||||||
unzip = sh.Command('unzip')
|
unzip = sh.Command('unzip')
|
||||||
shprint(unzip, setuptools_egg_path)
|
shprint(unzip, '-o', setuptools_egg_path)
|
||||||
os.remove(setuptools_egg_path)
|
os.remove(setuptools_egg_path)
|
||||||
os.remove('setuptools.pth')
|
os.remove('setuptools.pth')
|
||||||
os.remove('easy-install.pth')
|
os.remove('easy-install.pth')
|
||||||
shutil.rmtree('EGG-INFO')
|
shutil.rmtree('EGG-INFO')
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
import sh
|
import sh
|
||||||
from toolchain import shprint
|
from toolchain import shprint
|
||||||
|
@ -47,6 +43,6 @@ class HostSetuptools(Recipe):
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
chdir(build_dir)
|
chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", "{}/hostpython".format(self.ctx.dist_dir))
|
shprint(hostpython, "setup.py", "install", "--prefix", "{}/hostpython3".format(self.ctx.dist_dir))
|
||||||
|
|
||||||
recipe = HostSetuptools()
|
recipe = HostSetuptoolsRecipe()
|
||||||
|
|
|
@ -5,8 +5,9 @@ import logging
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class LibffiRecipe(Recipe):
|
class HostlibffiRecipe(Recipe):
|
||||||
version = "3.2.1"
|
version = "3.2.1"
|
||||||
|
name = "hostlibffi"
|
||||||
url = "ftp://sourceware.org/pub/libffi/libffi-{version}.tar.gz"
|
url = "ftp://sourceware.org/pub/libffi/libffi-{version}.tar.gz"
|
||||||
library = "build/Release-{arch.sdk}/libffi.a"
|
library = "build/Release-{arch.sdk}/libffi.a"
|
||||||
include_per_arch = True
|
include_per_arch = True
|
||||||
|
@ -63,4 +64,4 @@ class LibffiRecipe(Recipe):
|
||||||
def postbuild_arch(self, arch):
|
def postbuild_arch(self, arch):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
recipe = LibffiRecipe()
|
recipe = HostlibffiRecipe()
|
||||||
|
|
|
@ -9,7 +9,8 @@ def ensure_dir(filename):
|
||||||
makedirs(filename)
|
makedirs(filename)
|
||||||
|
|
||||||
class HostOpenSSLRecipe(Recipe):
|
class HostOpenSSLRecipe(Recipe):
|
||||||
version = "1.0.2l"
|
version = "1.1.1b"
|
||||||
|
url_version = '1.1.1b'
|
||||||
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
||||||
archs = ["x86_64"]
|
archs = ["x86_64"]
|
||||||
libraries = ["libssl.a", "libcrypto.a"]
|
libraries = ["libssl.a", "libcrypto.a"]
|
||||||
|
@ -19,7 +20,7 @@ class HostOpenSSLRecipe(Recipe):
|
||||||
arch = self.archs[0]
|
arch = self.archs[0]
|
||||||
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
|
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
|
||||||
dist_dir = join(self.ctx.dist_dir,"hostopenssl")
|
dist_dir = join(self.ctx.dist_dir,"hostopenssl")
|
||||||
print("OpenSSL for host to be installed at: {}").format(dist_dir)
|
print("OpenSSL for host to be installed at: {}".format(dist_dir))
|
||||||
sh.perl(join(self.build_dir, "Configure"), "darwin64-x86_64-cc",
|
sh.perl(join(self.build_dir, "Configure"), "darwin64-x86_64-cc",
|
||||||
"--openssldir={}".format(dist_dir),
|
"--openssldir={}".format(dist_dir),
|
||||||
"--prefix={}".format(dist_dir))
|
"--prefix={}".format(dist_dir))
|
||||||
|
|
26
recipes/hostpycparser/__init__.py
Normal file
26
recipes/hostpycparser/__init__.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
from toolchain import Recipe, shprint
|
||||||
|
from os.path import join, exists
|
||||||
|
import sh
|
||||||
|
import os
|
||||||
|
import fnmatch
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
class HostPycparserRecipe(Recipe):
|
||||||
|
depends = ["hostpython3"]
|
||||||
|
archs = ["x86_64"]
|
||||||
|
version = "2.19"
|
||||||
|
name = "hostpycparser"
|
||||||
|
url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz"
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
import sh
|
||||||
|
from toolchain import shprint
|
||||||
|
from os import chdir
|
||||||
|
arch = self.filtered_archs[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", "{}/hostpython3".format(self.ctx.dist_dir))
|
||||||
|
|
||||||
|
recipe = HostPycparserRecipe()
|
|
@ -74,7 +74,7 @@ class Hostpython3Recipe(Recipe):
|
||||||
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
||||||
])
|
])
|
||||||
if "openssl.build_all" in self.ctx.state:
|
if "openssl.build_all" in self.ctx.state:
|
||||||
build_env["LDFLAGS"] += " -L{}".format(join(self.ctx.dist_dir, "lib"))
|
build_env["LDFLAGS"] += " -L{}".format(join(self.ctx.dist_dir, "hostopenssl", "lib"))
|
||||||
build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include",
|
build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include",
|
||||||
"x86_64", "openssl"))
|
"x86_64", "openssl"))
|
||||||
return build_env
|
return build_env
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class IdnaRecipe(PythonRecipe):
|
class IdnaRecipe(PythonRecipe):
|
||||||
version = "2.6"
|
version = "2.6"
|
||||||
url = "https://pypi.python.org/packages/source/i/idna/idna-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/i/idna/idna-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class IdnaRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = IdnaRecipe()
|
recipe = IdnaRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class IncrementalRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class IpaddressRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ItsDangerousRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
cmd = sh.Command("sed")
|
cmd = sh.Command("sed")
|
||||||
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Jinja2Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
cmd = sh.Command("sed")
|
cmd = sh.Command("sed")
|
||||||
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class JsonschemaRecipe(PythonRecipe):
|
class JsonschemaRecipe(PythonRecipe):
|
||||||
version = "2.6.0"
|
version = "2.6.0"
|
||||||
url = "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools", "functools32"]
|
depends = ["python3", "setuptools", "vcversioner"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class JsonschemaRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = JsonschemaRecipe()
|
recipe = JsonschemaRecipe()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class KeyringRecipe(PythonRecipe):
|
class KeyringRecipe(PythonRecipe):
|
||||||
version = "10.4.0"
|
version = "10.4.0"
|
||||||
url = "https://pypi.python.org/packages/source/k/keyring/keyring-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/k/keyring/keyring-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools_scm"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class KeyringRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = KeyringRecipe()
|
recipe = KeyringRecipe()
|
||||||
|
|
|
@ -3,49 +3,62 @@ from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class LbryRecipe(PythonRecipe):
|
class LbryRecipe(PythonRecipe):
|
||||||
version = "v0.20.0rc10"
|
version = "v0.38.6"
|
||||||
url = "https://github.com/lbryio/lbry/archive/{version}.tar.gz"
|
url = "https://github.com/lbryio/lbry-sdk/archive/{version}.tar.gz"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# all other dependencies defined in torba recipe
|
||||||
depends = [
|
depends = [
|
||||||
"python",
|
"torba",
|
||||||
"setuptools",
|
"aiohttp",
|
||||||
"twisted",
|
#"aioupnp",
|
||||||
"cryptography",
|
|
||||||
"appdirs",
|
"appdirs",
|
||||||
"argparse",
|
|
||||||
"docopt",
|
|
||||||
"base58",
|
|
||||||
"colorama",
|
"colorama",
|
||||||
"dnspython",
|
"distro",
|
||||||
|
"base58",
|
||||||
|
"cffi",
|
||||||
|
"cryptography",
|
||||||
|
"protobuf",
|
||||||
|
"msgpack",
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"envparse",
|
|
||||||
"jsonrpc",
|
|
||||||
"jsonrpclib",
|
|
||||||
"keyring",
|
|
||||||
"lbryschema",
|
|
||||||
"lbryum",
|
|
||||||
"miniupnpc",
|
|
||||||
"pbkdf2",
|
|
||||||
"pyyaml",
|
"pyyaml",
|
||||||
"pygithub",
|
"docopt",
|
||||||
"qrcode",
|
"hachoir",
|
||||||
"requests",
|
|
||||||
"service_identity",
|
# Do we still need these?
|
||||||
"six",
|
"keyring"
|
||||||
"slowaes",
|
|
||||||
"txjson-rpc",
|
|
||||||
"wsgiref",
|
|
||||||
"zope_interface",
|
|
||||||
"treq"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def prebuild_arch(self, arch):
|
||||||
|
setup = "lbry/setup.py"
|
||||||
|
|
||||||
|
# Remove aioupnp requirement?
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#aioupnp==0.0.13##g',
|
||||||
|
join(self.get_build_dir(arch.arch), setup))
|
||||||
|
|
||||||
|
# Remove certifi requirement since we'll be including our own cacert.pem
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#certifi>=2018.11.29##g',
|
||||||
|
join(self.get_build_dir(arch.arch), setup))
|
||||||
|
|
||||||
|
# Use cryptography 2.6
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#cryptography==2.5#cryptography==2.6#g',
|
||||||
|
join(self.get_build_dir(arch.arch), setup))
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "lbry/setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = LbryRecipe()
|
recipe = LbryRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class LbrySchemaRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class LbryumRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@ class LibffiRecipe(Recipe):
|
||||||
shprint(sh.touch, "generate-darwin-source-and-headers.py")
|
shprint(sh.touch, "generate-darwin-source-and-headers.py")
|
||||||
python27 = sh.Command("python2.7")
|
python27 = sh.Command("python2.7")
|
||||||
shprint(python27, "_generate-darwin-source-and-headers.py", "--only-ios")
|
shprint(python27, "_generate-darwin-source-and-headers.py", "--only-ios")
|
||||||
shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild,
|
shprint(sh.xcodebuild,
|
||||||
|
#self.ctx.concurrent_xcodebuild,
|
||||||
"ONLY_ACTIVE_ARCH=NO",
|
"ONLY_ACTIVE_ARCH=NO",
|
||||||
"ARCHS={}".format(arch.arch),
|
"ARCHS={}".format(arch.arch),
|
||||||
"-sdk", arch.sdk,
|
"-sdk", arch.sdk,
|
||||||
|
|
39
recipes/libsecp256k1/__init__.py
Normal file
39
recipes/libsecp256k1/__init__.py
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
from toolchain import Recipe, shprint, current_directory
|
||||||
|
from os.path import join, exists
|
||||||
|
from multiprocessing import cpu_count
|
||||||
|
import os
|
||||||
|
import sh
|
||||||
|
|
||||||
|
|
||||||
|
class LibSecp256k1Recipe(Recipe):
|
||||||
|
name = "libsecp256k1"
|
||||||
|
version = "b0452e6"
|
||||||
|
url = "https://github.com/bitcoin-core/secp256k1/archive/{version}.zip"
|
||||||
|
#library = "libsecp256k1.a"
|
||||||
|
|
||||||
|
def build_arch(self, arch):
|
||||||
|
env = arch.get_env()
|
||||||
|
env['PATH'] = '/bin:/usr/bin:/usr/local/bin'
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
with current_directory(self.get_build_dir(arch.arch)):
|
||||||
|
host = arch.arch
|
||||||
|
if host == 'arm64':
|
||||||
|
host = 'arm'
|
||||||
|
|
||||||
|
if not exists('configure'):
|
||||||
|
shprint(sh.Command('./autogen.sh'), _env=env)
|
||||||
|
shprint(
|
||||||
|
sh.Command('./configure'),
|
||||||
|
'--host=' + host,
|
||||||
|
'--prefix=' + dest_dir,
|
||||||
|
'--enable-shared',
|
||||||
|
'--enable-module-recovery',
|
||||||
|
'--enable-experimental',
|
||||||
|
'--enable-module-ecdh',
|
||||||
|
_env=env)
|
||||||
|
shprint(sh.make, '-j' + str(cpu_count()), _env=env)
|
||||||
|
#libs = ['.libs/libsecp256k1.so']
|
||||||
|
#self.install_libs(arch, libs)
|
||||||
|
|
||||||
|
|
||||||
|
recipe = LibSecp256k1Recipe()
|
|
@ -14,7 +14,7 @@ class MarkupSafeRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
cmd = sh.Command("sed")
|
cmd = sh.Command("sed")
|
||||||
shprint(cmd, "-i", "", "s/,.*Feature//g", "./setup.py", _env=build_env)
|
shprint(cmd, "-i", "", "s/,.*Feature//g", "./setup.py", _env=build_env)
|
||||||
|
|
|
@ -18,7 +18,7 @@ class MiniupnpcRecipe(CythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
20
recipes/msgpack/__init__.py
Normal file
20
recipes/msgpack/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class MsgpackRecipe(PythonRecipe):
|
||||||
|
version = "0.6.1"
|
||||||
|
url = "https://pypi.python.org/packages/source/m/msgpack/msgpack-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = MsgpackRecipe()
|
20
recipes/multidict/__init__.py
Normal file
20
recipes/multidict/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class MultidictRecipe(PythonRecipe):
|
||||||
|
version = "4.5.2"
|
||||||
|
url = "https://pypi.python.org/packages/source/m/multidict/multidict-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = MultidictRecipe()
|
27
recipes/netifaces/__init__.py
Normal file
27
recipes/netifaces/__init__.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
from toolchain import CythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import os
|
||||||
|
import sh
|
||||||
|
|
||||||
|
|
||||||
|
class NetifacesRecipe(CythonRecipe):
|
||||||
|
name = "netifaces"
|
||||||
|
version = "0.10.7"
|
||||||
|
url = "https://pypi.python.org/packages/source/n/netifaces/netifaces-{version}.tar.gz"
|
||||||
|
library = "libnetifaces.a"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
cythonize = False
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
build_env['CFLAGS'] = '{} -isysroot {}'.format(build_env['CFLAGS'], arch.sysroot)
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
||||||
|
recipe = NetifacesRecipe()
|
|
@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc',
|
||||||
|
|
||||||
|
|
||||||
class OpensslRecipe(Recipe):
|
class OpensslRecipe(Recipe):
|
||||||
version = "1.0.2l"
|
version = "1.1.1b"
|
||||||
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
||||||
depends = ["hostopenssl"]
|
depends = ["hostopenssl"]
|
||||||
libraries = ["libssl.a", "libcrypto.a"]
|
libraries = ["libssl.a", "libcrypto.a"]
|
||||||
|
@ -35,7 +35,7 @@ class OpensslRecipe(Recipe):
|
||||||
target,
|
target,
|
||||||
_env=build_env)
|
_env=build_env)
|
||||||
if target == 'iphoneos-cross':
|
if target == 'iphoneos-cross':
|
||||||
sh.sed("-ie", "s!^CFLAG=.*!CFLAG={} {}!".format(build_env['CFLAGS'],
|
sh.sed("-ie", "s!^CNF_CFLAGS=.*!CNF_CFLAGS={} {}!".format(build_env['CFLAGS'],
|
||||||
" ".join(options_iphoneos)),
|
" ".join(options_iphoneos)),
|
||||||
"Makefile")
|
"Makefile")
|
||||||
sh.sed("-ie", "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;! ",
|
sh.sed("-ie", "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;! ",
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sh, os
|
||||||
class Pbkdf2Recipe(PythonRecipe):
|
class Pbkdf2Recipe(PythonRecipe):
|
||||||
version = "1.3"
|
version = "1.3"
|
||||||
url = "https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class Pbkdf2Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = Pbkdf2Recipe()
|
recipe = Pbkdf2Recipe()
|
||||||
|
|
|
@ -47,7 +47,7 @@ class PillowRecipe(Recipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = self.get_pil_env(arch)
|
build_env = self.get_pil_env(arch)
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "-m", "easy_install",
|
shprint(hostpython, "-m", "easy_install",
|
||||||
"--prefix", dest_dir, "-Z", "./",
|
"--prefix", dest_dir, "-Z", "./",
|
||||||
|
|
|
@ -3,9 +3,9 @@ from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class ProtobufRecipe(PythonRecipe):
|
class ProtobufRecipe(PythonRecipe):
|
||||||
version = "3.2.0"
|
version = "3.6.1"
|
||||||
url = "https://pypi.python.org/packages/source/p/protobuf/protobuf-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/p/protobuf/protobuf-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools", "six"]
|
depends = ["python3", "setuptools", "six"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,9 +13,9 @@ class ProtobufRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PATH'] = ''
|
build_env['PATH'] = ''
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = ProtobufRecipe()
|
recipe = ProtobufRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Pyasn1ModulesRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Pyasn1Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -6,27 +6,39 @@ import sh
|
||||||
|
|
||||||
|
|
||||||
class PycparserRecipe(PythonRecipe):
|
class PycparserRecipe(PythonRecipe):
|
||||||
version = "2.18"
|
version = "2.19"
|
||||||
|
name = "pycparser"
|
||||||
url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz"
|
||||||
depends = ["python"]
|
depends = ["python3"]
|
||||||
|
|
||||||
|
'''
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
# manually create expected directory in build directory
|
# manually create expected directory in build directory
|
||||||
scripts_dir = join("build", "scripts-2.7")
|
scripts_dir = join("build", "scripts-3.7")
|
||||||
if not os.path.exists(scripts_dir):
|
if not os.path.exists(scripts_dir):
|
||||||
os.makedirs(scripts_dir)
|
os.makedirs(scripts_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
pythonpath = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
build_env['PYTHONPATH'] = pythonpath
|
build_env['PYTHONPATH'] = pythonpath
|
||||||
build_env['PYTHONHOME'] = '/usr'
|
build_env['PYTHONHOME'] = '/usr'
|
||||||
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
|
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
|
||||||
shprint(*args, _env=build_env)
|
shprint(*args, _env=build_env)
|
||||||
#args = [hostpython, "setup.py", "install"]
|
#args = [hostpython, "setup.py", "install"]
|
||||||
#shprint(*args, _env=build_env)
|
#shprint(*args, _env=build_env)
|
||||||
|
'''
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = PycparserRecipe()
|
recipe = PycparserRecipe()
|
||||||
|
|
|
@ -36,7 +36,7 @@ class PycryptoRecipe(CythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class PyGithubRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class PyJWTRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,11 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class JsonrpclibRecipe(PythonRecipe):
|
class PylruRecipe(PythonRecipe):
|
||||||
version = "0.1.7"
|
version = "1.1.0"
|
||||||
url = "https://pypi.python.org/packages/source/j/jsonrpclib/jsonrpclib-{version}.tar.gz"
|
name = "pylru"
|
||||||
depends = ["python", "setuptools"]
|
url = "https://pypi.python.org/packages/source/p/pylru/pylru-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +14,8 @@ class JsonrpclibRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = JsonrpclibRecipe()
|
recipe = PylruRecipe()
|
|
@ -13,7 +13,7 @@ class PyOpenSSLRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@ class PythonRecipe(Recipe):
|
||||||
self.copy_file("ModulesSetup.openssl", "Modules/Setup.openssl")
|
self.copy_file("ModulesSetup.openssl", "Modules/Setup.openssl")
|
||||||
r = Recipe.get_recipe('openssl', self.ctx)
|
r = Recipe.get_recipe('openssl', self.ctx)
|
||||||
openssl_build_dir = r.get_build_dir(arch.arch)
|
openssl_build_dir = r.get_build_dir(arch.arch)
|
||||||
shprint(sh.sed, '-i.backup', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), "Modules/Setup.openssl")
|
shprint(sh.sed, '-i.bak', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), "Modules/Setup.openssl")
|
||||||
shprint(sh.sed, '-i.backup', 's#^SSL_LIBS=.*#SSL_LIBS={}#'.format(join(self.ctx.dist_dir, "lib")), "Modules/Setup.openssl")
|
shprint(sh.sed, '-i.bak', 's#^SSL_LIBS=.*#SSL_LIBS={}#'.format(join(self.ctx.dist_dir, "lib")), "Modules/Setup.openssl")
|
||||||
os.system('cat Modules/Setup.openssl >> Modules/Setup.local')
|
os.system('cat Modules/Setup.openssl >> Modules/Setup.local')
|
||||||
sh.rm("Modules/Setup.openssl")
|
sh.rm("Modules/Setup.openssl")
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ _datetime _datetimemodule.c
|
||||||
_elementtree _elementtree.c \
|
_elementtree _elementtree.c \
|
||||||
-I$(srcdir)/Modules/expat
|
-I$(srcdir)/Modules/expat
|
||||||
-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
|
-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
|
||||||
_hashlib _hashopenssl.c -lssl -DUSE_SSL
|
#_hashlib _hashopenssl.c -lssl -DUSE_SSL
|
||||||
_heapq _heapqmodule.c
|
_heapq _heapqmodule.c
|
||||||
_json _json.c
|
_json _json.c
|
||||||
_lsprof _lsprof.o rotatingtree.c
|
_lsprof _lsprof.o rotatingtree.c
|
||||||
|
@ -47,7 +47,7 @@ _sqlite3 -I$(srcdir)/Modules/_sqlite -DMODULE_NAME='\"sqlite3\"' -DSQLITE_OMIT_L
|
||||||
_sqlite/row.c \
|
_sqlite/row.c \
|
||||||
_sqlite/statement.c \
|
_sqlite/statement.c \
|
||||||
_sqlite/util.c
|
_sqlite/util.c
|
||||||
_ssl _ssl.c -lssl -DUSE_SSL
|
#_ssl _ssl.c -lssl -DUSE_SSL
|
||||||
_struct _struct.c
|
_struct _struct.c
|
||||||
array arraymodule.c
|
array arraymodule.c
|
||||||
audioop audioop.c
|
audioop audioop.c
|
||||||
|
|
8
recipes/python3/ModulesSetup.openssl
Normal file
8
recipes/python3/ModulesSetup.openssl
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
SSL=
|
||||||
|
SSL_LIBS=
|
||||||
|
_ssl _ssl.c \
|
||||||
|
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
|
||||||
|
-L$(SSL_LIBS) -lssl -lcrypto
|
||||||
|
_hashlib _hashopenssl.c \
|
||||||
|
-I$(SSL)/include -I$(SSL)/include/openssl \
|
||||||
|
-L$(SSL_LIBS) -lssl -lcrypto
|
|
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||||
class Python3Recipe(Recipe):
|
class Python3Recipe(Recipe):
|
||||||
version = "3.7.1"
|
version = "3.7.1"
|
||||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
|
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
|
||||||
depends = ["hostpython3", "libffi", "openssl"]
|
depends = ["hostpython3", "libffi", "openssl", "sqlite3"]
|
||||||
library = "libpython3.7m.a"
|
library = "libpython3.7m.a"
|
||||||
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
|
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
|
||||||
|
|
||||||
|
@ -31,6 +31,39 @@ class Python3Recipe(Recipe):
|
||||||
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
||||||
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
|
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
|
||||||
self.apply_patch("xcompile.patch")
|
self.apply_patch("xcompile.patch")
|
||||||
|
if "openssl.build_all" in self.ctx.state:
|
||||||
|
self.copy_file("ModulesSetup.openssl", "Modules/Setup.openssl")
|
||||||
|
r = Recipe.get_recipe('openssl', self.ctx)
|
||||||
|
openssl_build_dir = r.get_build_dir(arch.arch)
|
||||||
|
shprint(sh.sed, '-i.bak', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), "Modules/Setup.openssl")
|
||||||
|
shprint(sh.sed, '-i.bak', 's#^SSL_LIBS=.*#SSL_LIBS={}#'.format(join(self.ctx.dist_dir, "lib")), "Modules/Setup.openssl")
|
||||||
|
os.system('cat Modules/Setup.openssl >> Modules/Setup.local')
|
||||||
|
sh.rm("Modules/Setup.openssl")
|
||||||
|
|
||||||
|
# Replace sqlite3 paths in setup.py
|
||||||
|
# /usr/local/include/sqlite3
|
||||||
|
r = Recipe.get_recipe('sqlite3', self.ctx)
|
||||||
|
sqlite3_build_dir = r.get_build_dir(arch.arch)
|
||||||
|
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#/usr/local/include/sqlite3#{}#g'.format(sqlite3_build_dir),
|
||||||
|
join(self.get_build_dir(arch.arch), "setup.py"))
|
||||||
|
|
||||||
|
# sqlite_inc_paths = []
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#sqlite_inc_paths = \[\]#sqlite_inc_paths = \[\'{}\'\]#g'.format(sqlite3_build_dir),
|
||||||
|
join(self.get_build_dir(arch.arch), "setup.py"))
|
||||||
|
|
||||||
|
# sqlite_lib_dir
|
||||||
|
# os.path.join(sqlite_incdir, '..', 'lib64')
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#os.path.join(sqlite_incdir, \'..\', \'lib64\')#\'{}\'#g'.format(sqlite3_build_dir),
|
||||||
|
join(self.get_build_dir(arch.arch), "setup.py"))
|
||||||
|
|
||||||
|
|
||||||
self.set_marker("patched")
|
self.set_marker("patched")
|
||||||
|
|
||||||
def get_build_env(self, arch):
|
def get_build_env(self, arch):
|
||||||
|
@ -49,11 +82,16 @@ class Python3Recipe(Recipe):
|
||||||
elif py_arch == "arm64":
|
elif py_arch == "arm64":
|
||||||
py_arch = "aarch64"
|
py_arch = "aarch64"
|
||||||
prefix = join(self.ctx.dist_dir, "root", "python3")
|
prefix = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
|
||||||
|
# openssl bits
|
||||||
|
r = Recipe.get_recipe('openssl', self.ctx)
|
||||||
|
openssl_build_dir = r.get_build_dir(arch.arch)
|
||||||
|
|
||||||
shprint(configure,
|
shprint(configure,
|
||||||
"CC={}".format(build_env["CC"]),
|
"CC={}".format(build_env["CC"]),
|
||||||
"LD={}".format(build_env["LD"]),
|
"LD={}".format(build_env["LD"]),
|
||||||
"CFLAGS={}".format(build_env["CFLAGS"]),
|
"CFLAGS={}".format(build_env["CFLAGS"]),
|
||||||
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
|
"LDFLAGS={} -miphoneos-version-min=8.0 -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
|
||||||
# "--without-pymalloc",
|
# "--without-pymalloc",
|
||||||
"ac_cv_file__dev_ptmx=yes",
|
"ac_cv_file__dev_ptmx=yes",
|
||||||
"ac_cv_file__dev_ptc=no",
|
"ac_cv_file__dev_ptc=no",
|
||||||
|
@ -82,6 +120,7 @@ class Python3Recipe(Recipe):
|
||||||
"ac_cv_func_sched_setscheduler=no",
|
"ac_cv_func_sched_setscheduler=no",
|
||||||
"ac_cv_func_sched_setparam=no",
|
"ac_cv_func_sched_setparam=no",
|
||||||
"ac_cv_func_clock_gettime=no",
|
"ac_cv_func_clock_gettime=no",
|
||||||
|
"--with-openssl={}".format(openssl_build_dir),
|
||||||
"--host={}-apple-ios".format(py_arch),
|
"--host={}-apple-ios".format(py_arch),
|
||||||
"--build=x86_64-apple-darwin",
|
"--build=x86_64-apple-darwin",
|
||||||
"--prefix={}".format(prefix),
|
"--prefix={}".format(prefix),
|
||||||
|
|
|
@ -4,9 +4,9 @@ import sh
|
||||||
from toolchain import PythonRecipe, shprint
|
from toolchain import PythonRecipe, shprint
|
||||||
|
|
||||||
class PyYamlRecipe(PythonRecipe):
|
class PyYamlRecipe(PythonRecipe):
|
||||||
version = "3.12"
|
version = "4.2b1"
|
||||||
url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz"
|
||||||
depends = ["python"]
|
depends = ["python3"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -14,8 +14,8 @@ class PyYamlRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python")
|
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = PyYamlRecipe()
|
recipe = PyYamlRecipe()
|
||||||
|
|
|
@ -13,7 +13,7 @@ class QrcodeRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class RequestsRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ServiceIdentityRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ from toolchain import CythonRecipe
|
||||||
|
|
||||||
class SetuptoolsRecipe(CythonRecipe):
|
class SetuptoolsRecipe(CythonRecipe):
|
||||||
name = "setuptools"
|
name = "setuptools"
|
||||||
version = "18.5"
|
version = "41.0.1"
|
||||||
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip"
|
||||||
depends = ["python", "host_setuptools"]
|
depends = ["python3", "host_setuptools"]
|
||||||
cythonize = False
|
cythonize = False
|
||||||
|
|
||||||
def get_recipe_env(self, arch):
|
def get_recipe_env(self, arch):
|
||||||
env = super(SetuptoolsRecipe, self).get_recipe_env(arch)
|
env = super(SetuptoolsRecipe, self).get_recipe_env(arch)
|
||||||
env["PYTHONPATH"] = self.get_build_dir(arch.arch) + "/iosbuild/lib/python2.7/site-packages"
|
env["PYTHONPATH"] = self.get_build_dir(arch.arch) + "/iosbuild/lib/python3.7/site-packages"
|
||||||
return env
|
return env
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
|
|
20
recipes/setuptools_scm/__init__.py
Normal file
20
recipes/setuptools_scm/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class SetuptoolsScmRecipe(PythonRecipe):
|
||||||
|
version = "3.3.3"
|
||||||
|
url = "https://pypi.python.org/packages/source/s/setuptools_scm/setuptools_scm-{version}.tar.gz"
|
||||||
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = SetuptoolsScmRecipe()
|
|
@ -3,9 +3,9 @@ from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class SixRecipe(PythonRecipe):
|
class SixRecipe(PythonRecipe):
|
||||||
version = "1.11.0"
|
version = "1.9.0"
|
||||||
url = "https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class SixRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = SixRecipe()
|
recipe = SixRecipe()
|
||||||
|
|
10
recipes/sqlite3/Makefile
Normal file
10
recipes/sqlite3/Makefile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
CFLAGS=-DSQLITE_ENABLE_FTS4 -Wno-everything
|
||||||
|
|
||||||
|
sqlite3: static
|
||||||
|
cp sqlite3.a libsqlite3.a
|
||||||
|
|
||||||
|
compile:
|
||||||
|
$(CC) $(CFLAGS) -c -o sqlite3.o sqlite3.c
|
||||||
|
|
||||||
|
static: compile
|
||||||
|
$(AR) rc sqlite3.a sqlite3.o
|
21
recipes/sqlite3/__init__.py
Normal file
21
recipes/sqlite3/__init__.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
from toolchain import Recipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import os
|
||||||
|
import sh
|
||||||
|
|
||||||
|
|
||||||
|
class Sqlite3Recipe(Recipe):
|
||||||
|
name = "sqlite3"
|
||||||
|
version = '3.24.0'
|
||||||
|
# Don't forget to change the URL when changing the version
|
||||||
|
url = 'https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip'
|
||||||
|
library = "libsqlite3.a"
|
||||||
|
|
||||||
|
def prebuild_arch(self, arch):
|
||||||
|
self.copy_file("Makefile", "Makefile")
|
||||||
|
|
||||||
|
def build_arch(self, arch):
|
||||||
|
env = arch.get_env()
|
||||||
|
shprint(sh.make, "sqlite3", _env=env)
|
||||||
|
|
||||||
|
recipe = Sqlite3Recipe()
|
44
recipes/torba/__init__.py
Normal file
44
recipes/torba/__init__.py
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
from toolchain import PythonRecipe, shprint
|
||||||
|
from os.path import join
|
||||||
|
import sh, os
|
||||||
|
|
||||||
|
class TorbaRecipe(PythonRecipe):
|
||||||
|
version = "v0.38.6"
|
||||||
|
url = "https://github.com/lbryio/lbry-sdk/archive/{version}.tar.gz"
|
||||||
|
|
||||||
|
depends = [
|
||||||
|
"python3",
|
||||||
|
"setuptools",
|
||||||
|
"aiohttp",
|
||||||
|
"cffi",
|
||||||
|
"coincurve",
|
||||||
|
"pbkdf2",
|
||||||
|
"cryptography",
|
||||||
|
"attrs",
|
||||||
|
"pylru"
|
||||||
|
]
|
||||||
|
|
||||||
|
def prebuild_arch(self, arch):
|
||||||
|
# Use coincurve 7.1.0
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#coincurve==11.0.0#coincurve==7.1.0#g',
|
||||||
|
join(self.get_build_dir(arch.arch), "torba/setup.py"))
|
||||||
|
|
||||||
|
# Use cryptography 2.6
|
||||||
|
shprint(sh.sed,
|
||||||
|
'-i.bak',
|
||||||
|
's#cryptography==2.5#cryptography==2.6#g',
|
||||||
|
join(self.get_build_dir(arch.arch), "torba/setup.py"))
|
||||||
|
|
||||||
|
def install(self):
|
||||||
|
arch = list(self.filtered_archs)[0]
|
||||||
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
|
os.chdir(build_dir)
|
||||||
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
|
build_env = arch.get_env()
|
||||||
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
|
shprint(hostpython, "torba/setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
recipe = TorbaRecipe()
|
|
@ -13,7 +13,7 @@ class TreqRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
from toolchain import CythonRecipe, shprint
|
|
||||||
from os.path import join
|
|
||||||
import os
|
|
||||||
import sh
|
|
||||||
|
|
||||||
|
|
||||||
class TwistedRecipe(CythonRecipe):
|
|
||||||
name = "twisted"
|
|
||||||
version = "16.6.0"
|
|
||||||
url = "https://github.com/twisted/twisted/archive/twisted-{version}.tar.gz"
|
|
||||||
library = "libtwisted.a"
|
|
||||||
depends = ["python", "setuptools", "constantly", "incremental", "zope_interface"]
|
|
||||||
optional_depends = ["pyopenssl"]
|
|
||||||
cythonize = False
|
|
||||||
|
|
||||||
def prebuild_arch(self, arch):
|
|
||||||
if self.has_marker("patched"):
|
|
||||||
return
|
|
||||||
self.apply_patch("remove_portmap_extension.patch")
|
|
||||||
|
|
||||||
self.set_marker("patched")
|
|
||||||
|
|
||||||
def install(self):
|
|
||||||
arch = list(self.filtered_archs)[0]
|
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
|
||||||
os.chdir(build_dir)
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
|
||||||
build_env = arch.get_env()
|
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
|
||||||
|
|
||||||
|
|
||||||
recipe = TwistedRecipe()
|
|
|
@ -1,14 +0,0 @@
|
||||||
--- twisted-twisted-16.6.0/src/twisted/python/_setup.py 2016-11-17 09:10:00.000000000 +0100
|
|
||||||
+++ twisted-twisted-16.6.0-patch/src/twisted/python/_setup.py 2018-06-02 08:05:51.000000000 +0100
|
|
||||||
@@ -187,11 +187,6 @@
|
|
||||||
sources=["src/twisted/python/_sendmsg.c"],
|
|
||||||
condition=lambda _: not _PY3 and sys.platform != "win32"),
|
|
||||||
|
|
||||||
- ConditionalExtension(
|
|
||||||
- "twisted.runner.portmap",
|
|
||||||
- sources=["src/twisted/runner/portmap.c"],
|
|
||||||
- condition=lambda builder: not _PY3 and
|
|
||||||
- builder._check_header("rpc/rpc.h")),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
from toolchain import PythonRecipe, shprint
|
|
||||||
from os.path import join
|
|
||||||
import sh, os
|
|
||||||
|
|
||||||
class TxRequestsRecipe(PythonRecipe):
|
|
||||||
version = "0.9.5"
|
|
||||||
url = "https://pypi.python.org/packages/source/t/txrequests/txrequests-{version}.tar.gz"
|
|
||||||
depends = ["python", "setuptools", "requests", "twisted"]
|
|
||||||
|
|
||||||
def install(self):
|
|
||||||
arch = list(self.filtered_archs)[0]
|
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
|
||||||
os.chdir(build_dir)
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
|
||||||
build_env = arch.get_env()
|
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
|
||||||
|
|
||||||
recipe = TxRequestsRecipe()
|
|
|
@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class Functools32Recipe(PythonRecipe):
|
class VcversionerRecipe(PythonRecipe):
|
||||||
version = "3.2.3-2"
|
version = "2.16.0.0"
|
||||||
url = "https://pypi.python.org/packages/source/f/functools32/functools32-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/v/vcversioner/vcversioner-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class Functools32Recipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = Functools32Recipe()
|
recipe = VcversionerRecipe()
|
|
@ -14,7 +14,7 @@ class WerkzeugRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class WsgiRefRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint
|
||||||
from os.path import join
|
from os.path import join
|
||||||
import sh, os
|
import sh, os
|
||||||
|
|
||||||
class JsonrpcRecipe(PythonRecipe):
|
class YarlRecipe(PythonRecipe):
|
||||||
version = "1.2"
|
version = "1.3.0"
|
||||||
url = "https://pypi.python.org/packages/source/j/jsonrpc/jsonrpc-{version}.tar.gz"
|
url = "https://pypi.python.org/packages/source/y/yarl/yarl-{version}.tar.gz"
|
||||||
depends = ["python", "setuptools"]
|
depends = ["python3", "setuptools", "idna"]
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -13,8 +13,8 @@ class JsonrpcRecipe(PythonRecipe):
|
||||||
os.chdir(build_dir)
|
os.chdir(build_dir)
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
build_env = arch.get_env()
|
build_env = arch.get_env()
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||||
|
|
||||||
recipe = JsonrpcRecipe()
|
recipe = YarlRecipe()
|
|
@ -1,20 +0,0 @@
|
||||||
from toolchain import PythonRecipe, shprint
|
|
||||||
from os.path import join
|
|
||||||
import sh, os
|
|
||||||
|
|
||||||
class ZopeInterfaceRecipe(PythonRecipe):
|
|
||||||
version = "4.5.0"
|
|
||||||
url = "https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz"
|
|
||||||
depends = ["python", "setuptools"]
|
|
||||||
|
|
||||||
def install(self):
|
|
||||||
arch = list(self.filtered_archs)[0]
|
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
|
||||||
os.chdir(build_dir)
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
|
||||||
build_env = arch.get_env()
|
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
|
||||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
|
||||||
|
|
||||||
recipe = ZopeInterfaceRecipe()
|
|
22
toolchain.py
22
toolchain.py
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Tool for compiling iOS toolchain
|
Tool for compiling iOS toolchain
|
||||||
================================
|
================================
|
||||||
|
@ -6,6 +6,7 @@ Tool for compiling iOS toolchain
|
||||||
This tool intend to replace all the previous tools/ in shell script.
|
This tool intend to replace all the previous tools/ in shell script.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import contextlib
|
||||||
import sys
|
import sys
|
||||||
from sys import stdout
|
from sys import stdout
|
||||||
from os.path import join, dirname, realpath, exists, isdir, basename
|
from os.path import join, dirname, realpath, exists, isdir, basename
|
||||||
|
@ -236,7 +237,7 @@ class Arch(object):
|
||||||
] + include_dirs)
|
] + include_dirs)
|
||||||
env["LDFLAGS"] = " ".join([
|
env["LDFLAGS"] = " ".join([
|
||||||
"-arch", self.arch,
|
"-arch", self.arch,
|
||||||
"--sysroot", self.sysroot,
|
#"--sysroot", self.sysroot,
|
||||||
"-L{}/{}".format(self.ctx.dist_dir, "lib"),
|
"-L{}/{}".format(self.ctx.dist_dir, "lib"),
|
||||||
"-lsqlite3",
|
"-lsqlite3",
|
||||||
self.version_min
|
self.version_min
|
||||||
|
@ -248,7 +249,8 @@ class Arch64Simulator(Arch):
|
||||||
sdk = "iphonesimulator"
|
sdk = "iphonesimulator"
|
||||||
arch = "x86_64"
|
arch = "x86_64"
|
||||||
triple = "x86_64-apple-darwin13"
|
triple = "x86_64-apple-darwin13"
|
||||||
version_min = "-miphoneos-version-min=8.0"
|
#version_min = "-miphoneos-version-min=8.0"
|
||||||
|
version_min = ""
|
||||||
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()
|
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()
|
||||||
|
|
||||||
|
|
||||||
|
@ -256,7 +258,8 @@ class Arch64IOS(Arch):
|
||||||
sdk = "iphoneos"
|
sdk = "iphoneos"
|
||||||
arch = "arm64"
|
arch = "arm64"
|
||||||
triple = "aarch64-apple-darwin13"
|
triple = "aarch64-apple-darwin13"
|
||||||
version_min = "-miphoneos-version-min=8.0"
|
#version_min = "-miphoneos-version-min=8.0"
|
||||||
|
version_min = ""
|
||||||
sysroot = sh.xcrun("--sdk", "iphoneos", "--show-sdk-path").strip()
|
sysroot = sh.xcrun("--sdk", "iphoneos", "--show-sdk-path").strip()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1498,7 +1501,7 @@ Xcode:
|
||||||
"PYTHONOPTIMIZE": "2",
|
"PYTHONOPTIMIZE": "2",
|
||||||
# "PIP_INSTALL_TARGET": ctx.site_packages_dir
|
# "PIP_INSTALL_TARGET": ctx.site_packages_dir
|
||||||
}
|
}
|
||||||
pip_path = sh.which("pip")
|
pip_path = sh.which("pip3")
|
||||||
pip_args = []
|
pip_args = []
|
||||||
if len(sys.argv) > 2 and sys.argv[2] == "install":
|
if len(sys.argv) > 2 and sys.argv[2] == "install":
|
||||||
pip_args = ["--isolated", "--ignore-installed", "--prefix", ctx.python_prefix]
|
pip_args = ["--isolated", "--ignore-installed", "--prefix", ctx.python_prefix]
|
||||||
|
@ -1568,3 +1571,12 @@ Xcode:
|
||||||
command(images_xcassets, args.image)
|
command(images_xcassets, args.image)
|
||||||
|
|
||||||
ToolchainCL()
|
ToolchainCL()
|
||||||
|
|
||||||
|
@contextlib.contextmanager
|
||||||
|
def current_directory(new_dir):
|
||||||
|
cur_dir = getcwd()
|
||||||
|
logger.info(''.join(('-> directory context ', new_dir)))
|
||||||
|
chdir(new_dir)
|
||||||
|
yield
|
||||||
|
logger.info(''.join(('<- directory context ', cur_dir)))
|
||||||
|
chdir(cur_dir)
|
Loading…
Reference in a new issue