Compare commits

...

1 commit

Author SHA1 Message Date
Akinwale Ariwodola
06bb62ccda successful build with Python 3.7.1 2019-08-12 15:43:41 +01:00
86 changed files with 677 additions and 312 deletions

View 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()

View file

@ -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()

View file

@ -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)

View file

@ -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()

View 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()

View file

@ -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()

View file

@ -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()

View file

@ -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))

View file

@ -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()

View file

@ -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)

View 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()

View 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),

View 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={

View 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:

View 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')

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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,

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -9,7 +9,8 @@ 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"]
@ -19,7 +20,7 @@ class HostOpenSSLRecipe(Recipe):
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))

View 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()

View file

@ -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

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -5,7 +5,7 @@ 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]
@ -13,8 +13,8 @@ class KeyringRecipe(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 = KeyringRecipe()

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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,

View 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()

View file

@ -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)

View file

@ -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)

View 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()

View 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()

View 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()

View file

@ -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;! ",

View file

@ -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()

View file

@ -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", "./",

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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")

View file

@ -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

View 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

View file

@ -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),

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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):

View 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()

View file

@ -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()

10
recipes/sqlite3/Makefile Normal file
View 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

View 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
View 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()

View file

@ -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)

View file

@ -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()

View file

@ -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")),
]

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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)