From 06bb62ccda3e572e1de15bf5620f093d27a974e5 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 12 Aug 2019 15:43:41 +0100 Subject: [PATCH] successful build with Python 3.7.1 --- recipes/aiohttp/__init__.py | 20 +++++ recipes/appdirs/__init__.py | 6 +- recipes/argparse/__init__.py | 2 +- recipes/asn1crypto/__init__.py | 6 +- recipes/async_timeout/__init__.py | 20 +++++ recipes/attrs/__init__.py | 7 +- recipes/base58/__init__.py | 8 +- recipes/cffi/__init__.py | 14 ++-- recipes/{slowaes => chardet}/__init__.py | 14 ++-- recipes/click/__init__.py | 2 +- recipes/coincurve/__init__.py | 51 +++++++++++++ recipes/coincurve/cross_compile.patch | 12 +++ recipes/coincurve/drop_setup_requires.patch | 12 +++ recipes/coincurve/find_lib.patch | 13 ++++ recipes/coincurve/no_download.patch | 13 ++++ recipes/colorama/__init__.py | 6 +- recipes/constantly/__init__.py | 2 +- recipes/cryptography/__init__.py | 18 ++--- recipes/cryptography/getentropy.patch | 12 +-- recipes/distribute/__init__.py | 2 +- recipes/{dnspython => distro}/__init__.py | 14 ++-- recipes/docopt/__init__.py | 6 +- recipes/ecdsa/__init__.py | 6 +- recipes/enum34/__init__.py | 6 +- recipes/envparse/__init__.py | 2 +- recipes/flask/__init__.py | 2 +- recipes/{txjson-rpc => hachoir}/__init__.py | 14 ++-- recipes/host_cffi/__init__.py | 4 +- recipes/host_setuptools/__init__.py | 32 ++++---- recipes/hostlibffi/__init__.py | 5 +- recipes/hostopenssl/__init__.py | 13 ++-- recipes/hostpycparser/__init__.py | 26 +++++++ recipes/hostpython3/__init__.py | 2 +- recipes/idna/__init__.py | 6 +- recipes/incremental/__init__.py | 2 +- recipes/ipaddress/__init__.py | 2 +- recipes/itsdangerous/__init__.py | 2 +- recipes/jinja2/__init__.py | 2 +- recipes/jsonschema/__init__.py | 6 +- recipes/keyring/__init__.py | 8 +- recipes/lbry/__init__.py | 75 +++++++++++-------- recipes/lbryschema/__init__.py | 2 +- recipes/lbryum/__init__.py | 2 +- recipes/libffi/__init__.py | 3 +- recipes/libsecp256k1/__init__.py | 39 ++++++++++ recipes/markupsafe/__init__.py | 2 +- recipes/miniupnpc/__init__.py | 2 +- recipes/msgpack/__init__.py | 20 +++++ recipes/multidict/__init__.py | 20 +++++ recipes/netifaces/__init__.py | 27 +++++++ recipes/openssl/__init__.py | 4 +- recipes/pbkdf2/__init__.py | 6 +- recipes/pil/__init__.py | 2 +- recipes/protobuf/__init__.py | 8 +- recipes/pyasn1-modules/__init__.py | 2 +- recipes/pyasn1/__init__.py | 2 +- recipes/pycparser/__init__.py | 22 ++++-- recipes/pycrypto/__init__.py | 2 +- recipes/pygithub/__init__.py | 2 +- recipes/pyjwt/__init__.py | 2 +- recipes/{jsonrpclib => pylru}/__init__.py | 15 ++-- recipes/pyopenssl/__init__.py | 2 +- recipes/python2/__init__.py | 4 +- recipes/python3/ModulesSetup | 4 +- recipes/python3/ModulesSetup.openssl | 8 ++ recipes/python3/__init__.py | 43 ++++++++++- recipes/pyyaml/__init__.py | 8 +- recipes/qrcode/__init__.py | 2 +- recipes/requests/__init__.py | 2 +- recipes/service_identity/__init__.py | 2 +- recipes/setuptools/__init__.py | 8 +- recipes/setuptools_scm/__init__.py | 20 +++++ recipes/six/__init__.py | 8 +- recipes/sqlite3/Makefile | 10 +++ recipes/sqlite3/__init__.py | 21 ++++++ recipes/torba/__init__.py | 44 +++++++++++ recipes/treq/__init__.py | 2 +- recipes/twisted/__init__.py | 34 --------- .../twisted/remove_portmap_extension.patch | 14 ---- recipes/txrequests/__init__.py | 20 ----- .../{functools32 => vcversioner}/__init__.py | 14 ++-- recipes/werkzeug/__init__.py | 2 +- recipes/wsgiref/__init__.py | 2 +- recipes/{jsonrpc => yarl}/__init__.py | 14 ++-- recipes/zope_interface/__init__.py | 20 ----- toolchain.py | 22 ++++-- 86 files changed, 677 insertions(+), 312 deletions(-) create mode 100644 recipes/aiohttp/__init__.py create mode 100644 recipes/async_timeout/__init__.py rename recipes/{slowaes => chardet}/__init__.py (56%) create mode 100644 recipes/coincurve/__init__.py create mode 100644 recipes/coincurve/cross_compile.patch create mode 100644 recipes/coincurve/drop_setup_requires.patch create mode 100644 recipes/coincurve/find_lib.patch create mode 100644 recipes/coincurve/no_download.patch rename recipes/{dnspython => distro}/__init__.py (56%) rename recipes/{txjson-rpc => hachoir}/__init__.py (56%) create mode 100644 recipes/hostpycparser/__init__.py create mode 100644 recipes/libsecp256k1/__init__.py create mode 100644 recipes/msgpack/__init__.py create mode 100644 recipes/multidict/__init__.py create mode 100644 recipes/netifaces/__init__.py rename recipes/{jsonrpclib => pylru}/__init__.py (55%) create mode 100644 recipes/python3/ModulesSetup.openssl create mode 100644 recipes/setuptools_scm/__init__.py create mode 100644 recipes/sqlite3/Makefile create mode 100644 recipes/sqlite3/__init__.py create mode 100644 recipes/torba/__init__.py delete mode 100644 recipes/twisted/__init__.py delete mode 100644 recipes/twisted/remove_portmap_extension.patch delete mode 100644 recipes/txrequests/__init__.py rename recipes/{functools32 => vcversioner}/__init__.py (55%) rename recipes/{jsonrpc => yarl}/__init__.py (56%) delete mode 100644 recipes/zope_interface/__init__.py diff --git a/recipes/aiohttp/__init__.py b/recipes/aiohttp/__init__.py new file mode 100644 index 0000000..97882a8 --- /dev/null +++ b/recipes/aiohttp/__init__.py @@ -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() diff --git a/recipes/appdirs/__init__.py b/recipes/appdirs/__init__.py index 12ff802..fcee1cb 100644 --- a/recipes/appdirs/__init__.py +++ b/recipes/appdirs/__init__.py @@ -5,7 +5,7 @@ import sh, os class AppdirsRecipe(PythonRecipe): version = "1.4.3" url = "https://pypi.python.org/packages/source/a/appdirs/appdirs-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class AppdirsRecipe(PythonRecipe): 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') + 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 = AppdirsRecipe() diff --git a/recipes/argparse/__init__.py b/recipes/argparse/__init__.py index ce0cefd..5a0d30c 100644 --- a/recipes/argparse/__init__.py +++ b/recipes/argparse/__init__.py @@ -13,7 +13,7 @@ class ArgparseRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/asn1crypto/__init__.py b/recipes/asn1crypto/__init__.py index e939160..6d8ce8d 100644 --- a/recipes/asn1crypto/__init__.py +++ b/recipes/asn1crypto/__init__.py @@ -5,7 +5,7 @@ import sh, os class Asn1CryptoRecipe(PythonRecipe): version = "0.24.0" url = "https://pypi.python.org/packages/source/a/asn1crypto/asn1crypto-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class Asn1CryptoRecipe(PythonRecipe): 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') + 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 = Asn1CryptoRecipe() diff --git a/recipes/async_timeout/__init__.py b/recipes/async_timeout/__init__.py new file mode 100644 index 0000000..e60f568 --- /dev/null +++ b/recipes/async_timeout/__init__.py @@ -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() diff --git a/recipes/attrs/__init__.py b/recipes/attrs/__init__.py index 57a0687..1680fac 100644 --- a/recipes/attrs/__init__.py +++ b/recipes/attrs/__init__.py @@ -3,7 +3,7 @@ from os.path import join import sh, os class AttrsRecipe(PythonRecipe): - version = "18.1.0" + version = "18.2.0" url = "https://pypi.python.org/packages/source/a/attrs/attrs-{version}.tar.gz" depends = ["python", "setuptools"] @@ -13,8 +13,9 @@ class AttrsRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') - 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() diff --git a/recipes/base58/__init__.py b/recipes/base58/__init__.py index f8fbc4f..bcb7680 100644 --- a/recipes/base58/__init__.py +++ b/recipes/base58/__init__.py @@ -3,9 +3,9 @@ from os.path import join import sh, os class Base58Recipe(PythonRecipe): - version = "0.2.2" + version = "1.0.0" url = "https://pypi.python.org/packages/source/b/base58/base58-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class Base58Recipe(PythonRecipe): 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') + 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 = Base58Recipe() diff --git a/recipes/cffi/__init__.py b/recipes/cffi/__init__.py index 480a433..5532599 100644 --- a/recipes/cffi/__init__.py +++ b/recipes/cffi/__init__.py @@ -6,7 +6,7 @@ import sh class CffiRecipe(CythonRecipe): name = "cffi" - version = "1.11.5" + version = "1.12.1" url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz" library = "libcffi.a" depends = ["host_cffi", "libffi", "setuptools", "pycparser"] @@ -32,16 +32,16 @@ class CffiRecipe(CythonRecipe): 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') + dest_dir = join(self.ctx.dist_dir, "root", "python3") + build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages') shprint(hostpython, "setup.py", "build_ext", _env=build_env) shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) # hack: copy _cffi_backend.so from hostpython - so_file = "_cffi_backend.so" - egg_name = "cffi-1.11.5-py2.7-macosx-10.4-x86_64.egg" # harded - needs to change - dest_dir = join(self.ctx.dist_dir, "root", "python", "lib", "python2.7", "site-packages", egg_name) - src_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7", "site-packages", egg_name) + so_file = "_cffi_backend.cpython-37m-darwin.so" + 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", "python3", "lib", "python3.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)) diff --git a/recipes/slowaes/__init__.py b/recipes/chardet/__init__.py similarity index 56% rename from recipes/slowaes/__init__.py rename to recipes/chardet/__init__.py index 2f626d2..2ee21d6 100644 --- a/recipes/slowaes/__init__.py +++ b/recipes/chardet/__init__.py @@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class SlowaesRecipe(PythonRecipe): - version = "0.1a1" - url = "https://pypi.python.org/packages/source/s/slowaes/slowaes-{version}.tar.gz" - depends = ["python", "setuptools"] +class ChardetRecipe(PythonRecipe): + version = "3.0.4" + url = "https://pypi.python.org/packages/source/c/chardet/chardet-{version}.tar.gz" + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class SlowaesRecipe(PythonRecipe): 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') + 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 = SlowaesRecipe() +recipe = ChardetRecipe() diff --git a/recipes/click/__init__.py b/recipes/click/__init__.py index ff0c8ee..21dfeaa 100644 --- a/recipes/click/__init__.py +++ b/recipes/click/__init__.py @@ -14,7 +14,7 @@ class ClickRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') cmd = sh.Command("sed") shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env) diff --git a/recipes/coincurve/__init__.py b/recipes/coincurve/__init__.py new file mode 100644 index 0000000..038a719 --- /dev/null +++ b/recipes/coincurve/__init__.py @@ -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() diff --git a/recipes/coincurve/cross_compile.patch b/recipes/coincurve/cross_compile.patch new file mode 100644 index 0000000..190aa86 --- /dev/null +++ b/recipes/coincurve/cross_compile.patch @@ -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), \ No newline at end of file diff --git a/recipes/coincurve/drop_setup_requires.patch b/recipes/coincurve/drop_setup_requires.patch new file mode 100644 index 0000000..9994b3f --- /dev/null +++ b/recipes/coincurve/drop_setup_requires.patch @@ -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={ diff --git a/recipes/coincurve/find_lib.patch b/recipes/coincurve/find_lib.patch new file mode 100644 index 0000000..3d3c41d --- /dev/null +++ b/recipes/coincurve/find_lib.patch @@ -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: diff --git a/recipes/coincurve/no_download.patch b/recipes/coincurve/no_download.patch new file mode 100644 index 0000000..fcf4d20 --- /dev/null +++ b/recipes/coincurve/no_download.patch @@ -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') diff --git a/recipes/colorama/__init__.py b/recipes/colorama/__init__.py index b3728f4..73b1abd 100644 --- a/recipes/colorama/__init__.py +++ b/recipes/colorama/__init__.py @@ -5,7 +5,7 @@ import sh, os class ColoramaRecipe(PythonRecipe): version = "0.3.7" url = "https://pypi.python.org/packages/source/c/colorama/colorama-{version}.tar.gz" - depends = ["python"] + depends = ["python3"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class ColoramaRecipe(PythonRecipe): 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') + 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 = ColoramaRecipe() diff --git a/recipes/constantly/__init__.py b/recipes/constantly/__init__.py index 8aaa965..b76b41d 100644 --- a/recipes/constantly/__init__.py +++ b/recipes/constantly/__init__.py @@ -13,7 +13,7 @@ class ConstantlyRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/cryptography/__init__.py b/recipes/cryptography/__init__.py index 42fe487..cdbae4f 100644 --- a/recipes/cryptography/__init__.py +++ b/recipes/cryptography/__init__.py @@ -7,34 +7,34 @@ import sh class CryptographyRecipe(CythonRecipe): name = "cryptography" - version = "2.2.2" + version = "2.6" url = "https://pypi.python.org/packages/source/c/cryptography/cryptography-{version}.tar.gz" library = "libcryptography.a" depends = ["host_setuptools", "host_cffi", "setuptools", "asn1crypto", - "cffi", "enum34", "idna", "ipaddress", "six"] + "cffi", "idna", "six"] cythonize = False def prebuild_arch(self, arch): if self.has_marker("patched"): return self.apply_patch("getentropy.patch") - self.apply_patch("osrandom.patch") + #self.apply_patch("osrandom.patch") self.set_marker("patched") def get_recipe_env(self, arch): env = super(CryptographyRecipe, self).get_recipe_env(arch) r = self.get_recipe('openssl', self.ctx) 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['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \ + env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.7' + \ ' -I' + join(openssl_dir, 'include') + \ ' -I' + join(self.ctx.dist_dir, "include", arch.arch, "libffi") env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \ ' -L' + openssl_dir + \ - ' -lpython2.7' + \ + ' -lpython3.7m' + \ ' -lssl' + r.version + \ ' -lcrypto' + r.version return env @@ -51,8 +51,8 @@ class CryptographyRecipe(CythonRecipe): hostpython = sh.Command(self.ctx.hostpython) build_env = arch.get_env() - dest_dir = join(self.ctx.dist_dir, "root", "python") - pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + dest_dir = join(self.ctx.dist_dir, "root", "python3") + pythonpath = join(dest_dir, 'lib', 'python3.7', 'site-packages') build_env['PYTHONPATH'] = pythonpath args = [hostpython, "setup.py", "install", "--prefix", dest_dir] shprint(*args, _env=build_env) diff --git a/recipes/cryptography/getentropy.patch b/recipes/cryptography/getentropy.patch index 97b8a84..2929ee9 100644 --- a/recipes/cryptography/getentropy.patch +++ b/recipes/cryptography/getentropy.patch @@ -1,6 +1,6 @@ ---- cryptography-2.2.2/src/_cffi_src/openssl/src/osrandom_engine.c 2018-03-27 15:12:05.000000000 +0100 -+++ cryptography-2.2.2-patch/src/_cffi_src/openssl/src/osrandom_engine.c 2018-06-02 05:21:49.000000000 +0100 -@@ -205,14 +205,10 @@ +--- a/src/_cffi_src/openssl/src/osrandom_engine.c 2019-01-22 17:41:49.000000000 +0100 ++++ b/src/_cffi_src/openssl/src/osrandom_engine.c 2019-08-12 11:47:03.000000000 +0100 +@@ -243,14 +243,10 @@ #if !defined(__APPLE__) getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS; #else @@ -19,14 +19,14 @@ } #endif return 1; -@@ -228,22 +224,7 @@ +@@ -266,22 +262,7 @@ return dev_urandom_read(buffer, size); #endif case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS: - while (size > 0) { - /* OpenBSD and macOS restrict maximum buffer size to 256. */ -- len = size > 256 ? 256 : (size_t)size; -- res = getentropy(buffer, len); +- len = size > 256 ? 256 : size; +- res = getentropy(buffer, (size_t)len); - if (res < 0) { - ERR_Cryptography_OSRandom_error( - CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES, diff --git a/recipes/distribute/__init__.py b/recipes/distribute/__init__.py index fc82a11..4345aa4 100644 --- a/recipes/distribute/__init__.py +++ b/recipes/distribute/__init__.py @@ -14,7 +14,7 @@ class DistributeRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/dnspython/__init__.py b/recipes/distro/__init__.py similarity index 56% rename from recipes/dnspython/__init__.py rename to recipes/distro/__init__.py index 96de195..bf12093 100644 --- a/recipes/dnspython/__init__.py +++ b/recipes/distro/__init__.py @@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class DnsPythonRecipe(PythonRecipe): - version = "1.12.0" - url = "http://www.dnspython.org/kits/{version}/dnspython-{version}.zip" - depends = ["python", "setuptools"] +class DistroRecipe(PythonRecipe): + version = "1.4.0" + url = "https://pypi.python.org/packages/source/d/distro/distro-{version}.tar.gz" + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class DnsPythonRecipe(PythonRecipe): 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') + 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 = DnsPythonRecipe() +recipe = DistroRecipe() diff --git a/recipes/docopt/__init__.py b/recipes/docopt/__init__.py index f6d9638..c194263 100644 --- a/recipes/docopt/__init__.py +++ b/recipes/docopt/__init__.py @@ -5,7 +5,7 @@ import sh, os class DocoptRecipe(PythonRecipe): version = "0.6.2" url = "https://pypi.python.org/packages/source/d/docopt/docopt-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class DocoptRecipe(PythonRecipe): 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') + 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 = DocoptRecipe() diff --git a/recipes/ecdsa/__init__.py b/recipes/ecdsa/__init__.py index 062f443..d2e21b4 100644 --- a/recipes/ecdsa/__init__.py +++ b/recipes/ecdsa/__init__.py @@ -5,7 +5,7 @@ import sh, os class EcdsaRecipe(PythonRecipe): version = "0.13" url = "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class EcdsaRecipe(PythonRecipe): 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') + 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 = EcdsaRecipe() diff --git a/recipes/enum34/__init__.py b/recipes/enum34/__init__.py index 9635622..4cc2d81 100644 --- a/recipes/enum34/__init__.py +++ b/recipes/enum34/__init__.py @@ -5,7 +5,7 @@ import sh, os class Enum34Recipe(PythonRecipe): version = "1.1.6" url = "https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class Enum34Recipe(PythonRecipe): 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') + 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 = Enum34Recipe() diff --git a/recipes/envparse/__init__.py b/recipes/envparse/__init__.py index 66965b0..1ca1f72 100644 --- a/recipes/envparse/__init__.py +++ b/recipes/envparse/__init__.py @@ -13,7 +13,7 @@ class EnvparseRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/flask/__init__.py b/recipes/flask/__init__.py index 60bd798..6e973af 100644 --- a/recipes/flask/__init__.py +++ b/recipes/flask/__init__.py @@ -14,7 +14,7 @@ class FlaskRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') cmd = sh.Command("sed") shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env) diff --git a/recipes/txjson-rpc/__init__.py b/recipes/hachoir/__init__.py similarity index 56% rename from recipes/txjson-rpc/__init__.py rename to recipes/hachoir/__init__.py index c1210f1..8b5a862 100644 --- a/recipes/txjson-rpc/__init__.py +++ b/recipes/hachoir/__init__.py @@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class TxJsonRpcRecipe(PythonRecipe): - version = "0.5" - url = "https://pypi.python.org/packages/source/t/txJSON-RPC/txJSON-RPC-{version}.tar.gz" - depends = ["python", "setuptools"] +class HachoirRecipe(PythonRecipe): + version = "3.0a5" + url = "https://pypi.python.org/packages/source/h/hachoir/hachoir-{version}.tar.gz" + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class TxJsonRpcRecipe(PythonRecipe): 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') + 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 = TxJsonRpcRecipe() +recipe = HachoirRecipe() diff --git a/recipes/host_cffi/__init__.py b/recipes/host_cffi/__init__.py index 1a8aa5f..e9d6b9f 100644 --- a/recipes/host_cffi/__init__.py +++ b/recipes/host_cffi/__init__.py @@ -19,10 +19,10 @@ Cflags: -I${includedir} class HostCffiRecipe(Recipe): name = "host_cffi" - version = "1.11.5" + version = "1.12.1" archs = ["x86_64"] 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): sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip() diff --git a/recipes/host_setuptools/__init__.py b/recipes/host_setuptools/__init__.py index c3f5fa0..c5353e4 100644 --- a/recipes/host_setuptools/__init__.py +++ b/recipes/host_setuptools/__init__.py @@ -6,39 +6,35 @@ import fnmatch import shutil -class HostSetuptools(Recipe): - depends = ["openssl", "hostpython"] +class HostSetuptoolsRecipe(Recipe): + depends = ["openssl", "hostpython3"] + name = "setuptools" archs = ["x86_64"] - #url = "setuptools" - version = "18.5" - url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz" + version = "41.0.1" + url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip" cythonize = False ''' def prebuild_arch(self, arch): - dest_dir = join( - self.ctx.dist_dir, 'hostpython', - 'lib', 'python2.7', 'site-packages') - #hostpython = sh.Command(self.ctx.hostpython) - #sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py") - #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 # python package installations using setuptools will raise exceptions. # Setuptools version 28.3.0 site_packages_path = join( - self.ctx.dist_dir, 'hostpython', - 'lib', 'python2.7', 'site-packages') + self.ctx.dist_dir, 'hostpython3', + 'lib', 'python3.7', 'site-packages') os.chdir(site_packages_path) with open('setuptools.pth', 'r') as f: setuptools_egg_path = f.read().strip('./').strip('\n') unzip = sh.Command('unzip') - shprint(unzip, setuptools_egg_path) + shprint(unzip, '-o', setuptools_egg_path) os.remove(setuptools_egg_path) os.remove('setuptools.pth') os.remove('easy-install.pth') shutil.rmtree('EGG-INFO') - ''' - + ''' def install(self): import sh from toolchain import shprint @@ -47,6 +43,6 @@ class HostSetuptools(Recipe): build_dir = self.get_build_dir(arch.arch) chdir(build_dir) 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() diff --git a/recipes/hostlibffi/__init__.py b/recipes/hostlibffi/__init__.py index 52e10ca..bf4a307 100644 --- a/recipes/hostlibffi/__init__.py +++ b/recipes/hostlibffi/__init__.py @@ -5,8 +5,9 @@ import logging logger = logging.getLogger(__name__) -class LibffiRecipe(Recipe): +class HostlibffiRecipe(Recipe): version = "3.2.1" + name = "hostlibffi" url = "ftp://sourceware.org/pub/libffi/libffi-{version}.tar.gz" library = "build/Release-{arch.sdk}/libffi.a" include_per_arch = True @@ -63,4 +64,4 @@ class LibffiRecipe(Recipe): def postbuild_arch(self, arch): pass -recipe = LibffiRecipe() +recipe = HostlibffiRecipe() diff --git a/recipes/hostopenssl/__init__.py b/recipes/hostopenssl/__init__.py index 8af912d..3d77878 100644 --- a/recipes/hostopenssl/__init__.py +++ b/recipes/hostopenssl/__init__.py @@ -9,17 +9,18 @@ def ensure_dir(filename): makedirs(filename) 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" archs = ["x86_64"] libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" def build_x86_64(self): - arch = self.archs[0] + arch = self.archs[0] sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip() 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", "--openssldir={}".format(dist_dir), "--prefix={}".format(dist_dir)) @@ -28,9 +29,9 @@ class HostOpenSSLRecipe(Recipe): shprint(sh.make, "-j4", "build_libs") def install_include(self): - arch = self.archs[0] - print("Custom include file install...") - print("Dist dir = {}".format(self.ctx.dist_dir)) + arch = self.archs[0] + print("Custom include file install...") + print("Dist dir = {}".format(self.ctx.dist_dir)) dest_dir = join(self.ctx.dist_dir,"hostopenssl","include") if exists(dest_dir): shutil.rmtree(dest_dir) diff --git a/recipes/hostpycparser/__init__.py b/recipes/hostpycparser/__init__.py new file mode 100644 index 0000000..fcc888f --- /dev/null +++ b/recipes/hostpycparser/__init__.py @@ -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() diff --git a/recipes/hostpython3/__init__.py b/recipes/hostpython3/__init__.py index c47bb79..d6346ea 100644 --- a/recipes/hostpython3/__init__.py +++ b/recipes/hostpython3/__init__.py @@ -74,7 +74,7 @@ class Hostpython3Recipe(Recipe): "-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include")) ]) 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", "x86_64", "openssl")) return build_env diff --git a/recipes/idna/__init__.py b/recipes/idna/__init__.py index 1e477b2..db03209 100644 --- a/recipes/idna/__init__.py +++ b/recipes/idna/__init__.py @@ -5,7 +5,7 @@ import sh, os class IdnaRecipe(PythonRecipe): version = "2.6" url = "https://pypi.python.org/packages/source/i/idna/idna-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class IdnaRecipe(PythonRecipe): 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') + 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 = IdnaRecipe() diff --git a/recipes/incremental/__init__.py b/recipes/incremental/__init__.py index f0e7461..66989ff 100644 --- a/recipes/incremental/__init__.py +++ b/recipes/incremental/__init__.py @@ -13,7 +13,7 @@ class IncrementalRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/ipaddress/__init__.py b/recipes/ipaddress/__init__.py index c3b3d52..1aa6abb 100644 --- a/recipes/ipaddress/__init__.py +++ b/recipes/ipaddress/__init__.py @@ -13,7 +13,7 @@ class IpaddressRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/itsdangerous/__init__.py b/recipes/itsdangerous/__init__.py index e5a3182..5ebcd4e 100644 --- a/recipes/itsdangerous/__init__.py +++ b/recipes/itsdangerous/__init__.py @@ -14,7 +14,7 @@ class ItsDangerousRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') cmd = sh.Command("sed") shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env) diff --git a/recipes/jinja2/__init__.py b/recipes/jinja2/__init__.py index 75d1a18..7fc89d7 100644 --- a/recipes/jinja2/__init__.py +++ b/recipes/jinja2/__init__.py @@ -14,7 +14,7 @@ class Jinja2Recipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') cmd = sh.Command("sed") shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env) diff --git a/recipes/jsonschema/__init__.py b/recipes/jsonschema/__init__.py index 84522bb..a3d1506 100644 --- a/recipes/jsonschema/__init__.py +++ b/recipes/jsonschema/__init__.py @@ -5,7 +5,7 @@ import sh, os class JsonschemaRecipe(PythonRecipe): version = "2.6.0" url = "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-{version}.tar.gz" - depends = ["python", "setuptools", "functools32"] + depends = ["python3", "setuptools", "vcversioner"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class JsonschemaRecipe(PythonRecipe): 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') + 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 = JsonschemaRecipe() diff --git a/recipes/keyring/__init__.py b/recipes/keyring/__init__.py index ab02d6c..ec03df8 100644 --- a/recipes/keyring/__init__.py +++ b/recipes/keyring/__init__.py @@ -5,16 +5,16 @@ import sh, os class KeyringRecipe(PythonRecipe): version = "10.4.0" url = "https://pypi.python.org/packages/source/k/keyring/keyring-{version}.tar.gz" - depends = ["python", "setuptools"] - + depends = ["python3", "setuptools_scm"] + 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') + 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 = KeyringRecipe() diff --git a/recipes/lbry/__init__.py b/recipes/lbry/__init__.py index 4a425ae..1261883 100644 --- a/recipes/lbry/__init__.py +++ b/recipes/lbry/__init__.py @@ -3,49 +3,62 @@ from os.path import join import sh, os class LbryRecipe(PythonRecipe): - version = "v0.20.0rc10" - url = "https://github.com/lbryio/lbry/archive/{version}.tar.gz" + version = "v0.38.6" + url = "https://github.com/lbryio/lbry-sdk/archive/{version}.tar.gz" + + + + # all other dependencies defined in torba recipe depends = [ - "python", - "setuptools", - "twisted", - "cryptography", + "torba", + "aiohttp", + #"aioupnp", "appdirs", - "argparse", - "docopt", - "base58", "colorama", - "dnspython", + "distro", + "base58", + "cffi", + "cryptography", + "protobuf", + "msgpack", "ecdsa", - "envparse", - "jsonrpc", - "jsonrpclib", - "keyring", - "lbryschema", - "lbryum", - "miniupnpc", - "pbkdf2", "pyyaml", - "pygithub", - "qrcode", - "requests", - "service_identity", - "six", - "slowaes", - "txjson-rpc", - "wsgiref", - "zope_interface", - "treq" + "docopt", + "hachoir", + + # Do we still need these? + "keyring" ] + 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): 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) + dest_dir = join(self.ctx.dist_dir, "root", "python3") + build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages') + shprint(hostpython, "lbry/setup.py", "install", "--prefix", dest_dir, _env=build_env) recipe = LbryRecipe() diff --git a/recipes/lbryschema/__init__.py b/recipes/lbryschema/__init__.py index a228d06..8ecfcd1 100644 --- a/recipes/lbryschema/__init__.py +++ b/recipes/lbryschema/__init__.py @@ -13,7 +13,7 @@ class LbrySchemaRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/lbryum/__init__.py b/recipes/lbryum/__init__.py index fc56507..6a1b126 100644 --- a/recipes/lbryum/__init__.py +++ b/recipes/lbryum/__init__.py @@ -13,7 +13,7 @@ class LbryumRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/libffi/__init__.py b/recipes/libffi/__init__.py index 0147f75..307ce83 100644 --- a/recipes/libffi/__init__.py +++ b/recipes/libffi/__init__.py @@ -33,7 +33,8 @@ class LibffiRecipe(Recipe): shprint(sh.touch, "generate-darwin-source-and-headers.py") python27 = sh.Command("python2.7") 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", "ARCHS={}".format(arch.arch), "-sdk", arch.sdk, diff --git a/recipes/libsecp256k1/__init__.py b/recipes/libsecp256k1/__init__.py new file mode 100644 index 0000000..4ce6963 --- /dev/null +++ b/recipes/libsecp256k1/__init__.py @@ -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() diff --git a/recipes/markupsafe/__init__.py b/recipes/markupsafe/__init__.py index ca3dcf2..0b01dd1 100644 --- a/recipes/markupsafe/__init__.py +++ b/recipes/markupsafe/__init__.py @@ -14,7 +14,7 @@ class MarkupSafeRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') cmd = sh.Command("sed") shprint(cmd, "-i", "", "s/,.*Feature//g", "./setup.py", _env=build_env) diff --git a/recipes/miniupnpc/__init__.py b/recipes/miniupnpc/__init__.py index 4992d1e..d42c32c 100644 --- a/recipes/miniupnpc/__init__.py +++ b/recipes/miniupnpc/__init__.py @@ -18,7 +18,7 @@ class MiniupnpcRecipe(CythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/msgpack/__init__.py b/recipes/msgpack/__init__.py new file mode 100644 index 0000000..53adbf3 --- /dev/null +++ b/recipes/msgpack/__init__.py @@ -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() diff --git a/recipes/multidict/__init__.py b/recipes/multidict/__init__.py new file mode 100644 index 0000000..35f98aa --- /dev/null +++ b/recipes/multidict/__init__.py @@ -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() diff --git a/recipes/netifaces/__init__.py b/recipes/netifaces/__init__.py new file mode 100644 index 0000000..8b5aafa --- /dev/null +++ b/recipes/netifaces/__init__.py @@ -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() diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index 090a8cc..1d0082d 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2l" + version = "1.1.1b" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" depends = ["hostopenssl"] libraries = ["libssl.a", "libcrypto.a"] @@ -35,7 +35,7 @@ class OpensslRecipe(Recipe): target, _env=build_env) 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)), "Makefile") sh.sed("-ie", "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;! ", diff --git a/recipes/pbkdf2/__init__.py b/recipes/pbkdf2/__init__.py index ce3fc5d..0129035 100644 --- a/recipes/pbkdf2/__init__.py +++ b/recipes/pbkdf2/__init__.py @@ -5,7 +5,7 @@ import sh, os class Pbkdf2Recipe(PythonRecipe): version = "1.3" url = "https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class Pbkdf2Recipe(PythonRecipe): 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') + 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 = Pbkdf2Recipe() diff --git a/recipes/pil/__init__.py b/recipes/pil/__init__.py index f2e159c..6d0c015 100644 --- a/recipes/pil/__init__.py +++ b/recipes/pil/__init__.py @@ -47,7 +47,7 @@ class PillowRecipe(Recipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "-m", "easy_install", "--prefix", dest_dir, "-Z", "./", diff --git a/recipes/protobuf/__init__.py b/recipes/protobuf/__init__.py index bc04bd0..b3d1f84 100644 --- a/recipes/protobuf/__init__.py +++ b/recipes/protobuf/__init__.py @@ -3,9 +3,9 @@ from os.path import join import sh, os class ProtobufRecipe(PythonRecipe): - version = "3.2.0" + version = "3.6.1" url = "https://pypi.python.org/packages/source/p/protobuf/protobuf-{version}.tar.gz" - depends = ["python", "setuptools", "six"] + depends = ["python3", "setuptools", "six"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,9 +13,9 @@ class ProtobufRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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['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) recipe = ProtobufRecipe() diff --git a/recipes/pyasn1-modules/__init__.py b/recipes/pyasn1-modules/__init__.py index ada572c..a4b5437 100644 --- a/recipes/pyasn1-modules/__init__.py +++ b/recipes/pyasn1-modules/__init__.py @@ -13,7 +13,7 @@ class Pyasn1ModulesRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/pyasn1/__init__.py b/recipes/pyasn1/__init__.py index 45a2f22..2b79aaa 100644 --- a/recipes/pyasn1/__init__.py +++ b/recipes/pyasn1/__init__.py @@ -13,7 +13,7 @@ class Pyasn1Recipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/pycparser/__init__.py b/recipes/pycparser/__init__.py index d2d8a68..3879226 100644 --- a/recipes/pycparser/__init__.py +++ b/recipes/pycparser/__init__.py @@ -6,27 +6,39 @@ import sh class PycparserRecipe(PythonRecipe): - version = "2.18" + version = "2.19" + name = "pycparser" url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz" - depends = ["python"] + depends = ["python3"] + ''' def install(self): arch = list(self.filtered_archs)[0] build_dir = self.get_build_dir(arch.arch) os.chdir(build_dir) # 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): os.makedirs(scripts_dir) hostpython = sh.Command(self.ctx.hostpython) build_env = arch.get_env() - dest_dir = join(self.ctx.dist_dir, "root", "python") - pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + dest_dir = join(self.ctx.dist_dir, "root", "python3") + pythonpath = join(dest_dir, 'lib', 'python3.7', 'site-packages') build_env['PYTHONPATH'] = pythonpath build_env['PYTHONHOME'] = '/usr' args = [hostpython, "setup.py", "install", "--prefix", dest_dir] shprint(*args, _env=build_env) #args = [hostpython, "setup.py", "install"] #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() diff --git a/recipes/pycrypto/__init__.py b/recipes/pycrypto/__init__.py index 989120c..4bf16db 100644 --- a/recipes/pycrypto/__init__.py +++ b/recipes/pycrypto/__init__.py @@ -36,7 +36,7 @@ class PycryptoRecipe(CythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/pygithub/__init__.py b/recipes/pygithub/__init__.py index 6c54686..6e72313 100644 --- a/recipes/pygithub/__init__.py +++ b/recipes/pygithub/__init__.py @@ -13,7 +13,7 @@ class PyGithubRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/pyjwt/__init__.py b/recipes/pyjwt/__init__.py index 2f6212b..6a1092c 100644 --- a/recipes/pyjwt/__init__.py +++ b/recipes/pyjwt/__init__.py @@ -13,7 +13,7 @@ class PyJWTRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/jsonrpclib/__init__.py b/recipes/pylru/__init__.py similarity index 55% rename from recipes/jsonrpclib/__init__.py rename to recipes/pylru/__init__.py index 08f89f5..ee0d392 100644 --- a/recipes/jsonrpclib/__init__.py +++ b/recipes/pylru/__init__.py @@ -2,10 +2,11 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class JsonrpclibRecipe(PythonRecipe): - version = "0.1.7" - url = "https://pypi.python.org/packages/source/j/jsonrpclib/jsonrpclib-{version}.tar.gz" - depends = ["python", "setuptools"] +class PylruRecipe(PythonRecipe): + version = "1.1.0" + name = "pylru" + url = "https://pypi.python.org/packages/source/p/pylru/pylru-{version}.tar.gz" + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +14,8 @@ class JsonrpclibRecipe(PythonRecipe): 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') + 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 = JsonrpclibRecipe() +recipe = PylruRecipe() diff --git a/recipes/pyopenssl/__init__.py b/recipes/pyopenssl/__init__.py index f7eaa62..0a9385d 100644 --- a/recipes/pyopenssl/__init__.py +++ b/recipes/pyopenssl/__init__.py @@ -13,7 +13,7 @@ class PyOpenSSLRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/python2/__init__.py b/recipes/python2/__init__.py index 2a9a3d4..ddb1496 100644 --- a/recipes/python2/__init__.py +++ b/recipes/python2/__init__.py @@ -38,8 +38,8 @@ class PythonRecipe(Recipe): 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.backup', '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=.*#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") diff --git a/recipes/python3/ModulesSetup b/recipes/python3/ModulesSetup index ef5923f..e60c3c0 100644 --- a/recipes/python3/ModulesSetup +++ b/recipes/python3/ModulesSetup @@ -19,7 +19,7 @@ _datetime _datetimemodule.c _elementtree _elementtree.c \ -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI -_hashlib _hashopenssl.c -lssl -DUSE_SSL +#_hashlib _hashopenssl.c -lssl -DUSE_SSL _heapq _heapqmodule.c _json _json.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/statement.c \ _sqlite/util.c -_ssl _ssl.c -lssl -DUSE_SSL +#_ssl _ssl.c -lssl -DUSE_SSL _struct _struct.c array arraymodule.c audioop audioop.c diff --git a/recipes/python3/ModulesSetup.openssl b/recipes/python3/ModulesSetup.openssl new file mode 100644 index 0000000..da7d43c --- /dev/null +++ b/recipes/python3/ModulesSetup.openssl @@ -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 \ No newline at end of file diff --git a/recipes/python3/__init__.py b/recipes/python3/__init__.py index 318c679..2da7897 100644 --- a/recipes/python3/__init__.py +++ b/recipes/python3/__init__.py @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) class Python3Recipe(Recipe): version = "3.7.1" url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz" - depends = ["hostpython3", "libffi", "openssl"] + depends = ["hostpython3", "libffi", "openssl", "sqlite3"] library = "libpython3.7m.a" pbx_libraries = ["libz", "libbz2", "libsqlite3"] @@ -31,6 +31,39 @@ class Python3Recipe(Recipe): self.copy_file("ModulesSetup", "Modules/Setup.local") self.append_file("ModulesSetup.mobile", "Modules/Setup.local") 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") def get_build_env(self, arch): @@ -49,11 +82,16 @@ class Python3Recipe(Recipe): elif py_arch == "arm64": py_arch = "aarch64" 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, "CC={}".format(build_env["CC"]), "LD={}".format(build_env["LD"]), "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", "ac_cv_file__dev_ptmx=yes", "ac_cv_file__dev_ptc=no", @@ -82,6 +120,7 @@ class Python3Recipe(Recipe): "ac_cv_func_sched_setscheduler=no", "ac_cv_func_sched_setparam=no", "ac_cv_func_clock_gettime=no", + "--with-openssl={}".format(openssl_build_dir), "--host={}-apple-ios".format(py_arch), "--build=x86_64-apple-darwin", "--prefix={}".format(prefix), diff --git a/recipes/pyyaml/__init__.py b/recipes/pyyaml/__init__.py index 2e58384..803305d 100644 --- a/recipes/pyyaml/__init__.py +++ b/recipes/pyyaml/__init__.py @@ -4,9 +4,9 @@ import sh from toolchain import PythonRecipe, shprint class PyYamlRecipe(PythonRecipe): - version = "3.12" + version = "4.2b1" url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz" - depends = ["python"] + depends = ["python3"] def install(self): arch = list(self.filtered_archs)[0] @@ -14,8 +14,8 @@ class PyYamlRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) build_env = arch.get_env() - dest_dir = os.path.join(self.ctx.dist_dir, "root", "python") - build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python2.7', 'site-packages') + dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3") + build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.7', 'site-packages') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) recipe = PyYamlRecipe() diff --git a/recipes/qrcode/__init__.py b/recipes/qrcode/__init__.py index 59ea1ac..3ce9a74 100644 --- a/recipes/qrcode/__init__.py +++ b/recipes/qrcode/__init__.py @@ -13,7 +13,7 @@ class QrcodeRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/requests/__init__.py b/recipes/requests/__init__.py index d8fba04..ed5b89c 100644 --- a/recipes/requests/__init__.py +++ b/recipes/requests/__init__.py @@ -13,7 +13,7 @@ class RequestsRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/service_identity/__init__.py b/recipes/service_identity/__init__.py index 16a04e7..3ad682b 100644 --- a/recipes/service_identity/__init__.py +++ b/recipes/service_identity/__init__.py @@ -13,7 +13,7 @@ class ServiceIdentityRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/setuptools/__init__.py b/recipes/setuptools/__init__.py index f491a11..c6d727e 100644 --- a/recipes/setuptools/__init__.py +++ b/recipes/setuptools/__init__.py @@ -3,14 +3,14 @@ from toolchain import CythonRecipe class SetuptoolsRecipe(CythonRecipe): name = "setuptools" - version = "18.5" - url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz" - depends = ["python", "host_setuptools"] + version = "41.0.1" + url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip" + depends = ["python3", "host_setuptools"] cythonize = False def get_recipe_env(self, 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 def install(self): diff --git a/recipes/setuptools_scm/__init__.py b/recipes/setuptools_scm/__init__.py new file mode 100644 index 0000000..5519526 --- /dev/null +++ b/recipes/setuptools_scm/__init__.py @@ -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() diff --git a/recipes/six/__init__.py b/recipes/six/__init__.py index 8c79f4b..73b505c 100644 --- a/recipes/six/__init__.py +++ b/recipes/six/__init__.py @@ -3,9 +3,9 @@ from os.path import join import sh, os class SixRecipe(PythonRecipe): - version = "1.11.0" + version = "1.9.0" url = "https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz" - depends = ["python", "setuptools"] + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class SixRecipe(PythonRecipe): 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') + 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 = SixRecipe() diff --git a/recipes/sqlite3/Makefile b/recipes/sqlite3/Makefile new file mode 100644 index 0000000..6cb2980 --- /dev/null +++ b/recipes/sqlite3/Makefile @@ -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 diff --git a/recipes/sqlite3/__init__.py b/recipes/sqlite3/__init__.py new file mode 100644 index 0000000..564b314 --- /dev/null +++ b/recipes/sqlite3/__init__.py @@ -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() diff --git a/recipes/torba/__init__.py b/recipes/torba/__init__.py new file mode 100644 index 0000000..dfc5470 --- /dev/null +++ b/recipes/torba/__init__.py @@ -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() diff --git a/recipes/treq/__init__.py b/recipes/treq/__init__.py index 7ebbc22..5632118 100644 --- a/recipes/treq/__init__.py +++ b/recipes/treq/__init__.py @@ -13,7 +13,7 @@ class TreqRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/twisted/__init__.py b/recipes/twisted/__init__.py deleted file mode 100644 index 79b4696..0000000 --- a/recipes/twisted/__init__.py +++ /dev/null @@ -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() diff --git a/recipes/twisted/remove_portmap_extension.patch b/recipes/twisted/remove_portmap_extension.patch deleted file mode 100644 index a1f46fa..0000000 --- a/recipes/twisted/remove_portmap_extension.patch +++ /dev/null @@ -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")), - ] - - diff --git a/recipes/txrequests/__init__.py b/recipes/txrequests/__init__.py deleted file mode 100644 index 93a21b5..0000000 --- a/recipes/txrequests/__init__.py +++ /dev/null @@ -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() diff --git a/recipes/functools32/__init__.py b/recipes/vcversioner/__init__.py similarity index 55% rename from recipes/functools32/__init__.py rename to recipes/vcversioner/__init__.py index ea5be50..fefa402 100644 --- a/recipes/functools32/__init__.py +++ b/recipes/vcversioner/__init__.py @@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class Functools32Recipe(PythonRecipe): - version = "3.2.3-2" - url = "https://pypi.python.org/packages/source/f/functools32/functools32-{version}.tar.gz" - depends = ["python", "setuptools"] +class VcversionerRecipe(PythonRecipe): + version = "2.16.0.0" + url = "https://pypi.python.org/packages/source/v/vcversioner/vcversioner-{version}.tar.gz" + depends = ["python3", "setuptools"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class Functools32Recipe(PythonRecipe): 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') + 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 = Functools32Recipe() +recipe = VcversionerRecipe() diff --git a/recipes/werkzeug/__init__.py b/recipes/werkzeug/__init__.py index a5bf9d7..ca0e21a 100644 --- a/recipes/werkzeug/__init__.py +++ b/recipes/werkzeug/__init__.py @@ -14,7 +14,7 @@ class WerkzeugRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/wsgiref/__init__.py b/recipes/wsgiref/__init__.py index 85ede68..0eb077d 100644 --- a/recipes/wsgiref/__init__.py +++ b/recipes/wsgiref/__init__.py @@ -13,7 +13,7 @@ class WsgiRefRecipe(PythonRecipe): os.chdir(build_dir) hostpython = sh.Command(self.ctx.hostpython) 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') shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env) diff --git a/recipes/jsonrpc/__init__.py b/recipes/yarl/__init__.py similarity index 56% rename from recipes/jsonrpc/__init__.py rename to recipes/yarl/__init__.py index 6261b51..6bb0214 100644 --- a/recipes/jsonrpc/__init__.py +++ b/recipes/yarl/__init__.py @@ -2,10 +2,10 @@ from toolchain import PythonRecipe, shprint from os.path import join import sh, os -class JsonrpcRecipe(PythonRecipe): - version = "1.2" - url = "https://pypi.python.org/packages/source/j/jsonrpc/jsonrpc-{version}.tar.gz" - depends = ["python", "setuptools"] +class YarlRecipe(PythonRecipe): + version = "1.3.0" + url = "https://pypi.python.org/packages/source/y/yarl/yarl-{version}.tar.gz" + depends = ["python3", "setuptools", "idna"] def install(self): arch = list(self.filtered_archs)[0] @@ -13,8 +13,8 @@ class JsonrpcRecipe(PythonRecipe): 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') + 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 = JsonrpcRecipe() +recipe = YarlRecipe() diff --git a/recipes/zope_interface/__init__.py b/recipes/zope_interface/__init__.py deleted file mode 100644 index b115b23..0000000 --- a/recipes/zope_interface/__init__.py +++ /dev/null @@ -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() diff --git a/toolchain.py b/toolchain.py index 2d9b4db..0e1c462 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ 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. """ +import contextlib import sys from sys import stdout from os.path import join, dirname, realpath, exists, isdir, basename @@ -236,7 +237,7 @@ class Arch(object): ] + include_dirs) env["LDFLAGS"] = " ".join([ "-arch", self.arch, - "--sysroot", self.sysroot, + #"--sysroot", self.sysroot, "-L{}/{}".format(self.ctx.dist_dir, "lib"), "-lsqlite3", self.version_min @@ -248,7 +249,8 @@ class Arch64Simulator(Arch): sdk = "iphonesimulator" arch = "x86_64" 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() @@ -256,7 +258,8 @@ class Arch64IOS(Arch): sdk = "iphoneos" arch = "arm64" 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() @@ -1498,7 +1501,7 @@ Xcode: "PYTHONOPTIMIZE": "2", # "PIP_INSTALL_TARGET": ctx.site_packages_dir } - pip_path = sh.which("pip") + pip_path = sh.which("pip3") pip_args = [] if len(sys.argv) > 2 and sys.argv[2] == "install": pip_args = ["--isolated", "--ignore-installed", "--prefix", ctx.python_prefix] @@ -1568,3 +1571,12 @@ Xcode: command(images_xcassets, args.image) 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) \ No newline at end of file