Update to Python 2.7.13 and add recipes required for lbry #1

Merged
akinwale merged 3 commits from ios-build-experiment into master 2018-06-02 22:35:58 +02:00
59 changed files with 1238 additions and 26 deletions
Showing only changes of commit a1a7ae7d54 - Show all commits

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = AppdirsRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class ArgparseRecipe(PythonRecipe):
version = "1.2.1"
url = "https://pypi.python.org/packages/source/a/argparse/argparse-{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 = ArgparseRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = Asn1CryptoRecipe()

20
recipes/attrs/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class AttrsRecipe(PythonRecipe):
version = "18.1.0"
url = "https://pypi.python.org/packages/source/a/attrs/attrs-{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 = AttrsRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Base58Recipe(PythonRecipe):
version = "0.2.2"
url = "https://pypi.python.org/packages/source/b/base58/base58-{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 = Base58Recipe()

41
recipes/cffi/__init__.py Normal file
View file

@ -0,0 +1,41 @@
from toolchain import CythonRecipe, shprint
from os.path import join
import os
import sh
class CffiRecipe(CythonRecipe):
name = "cffi"
version = "1.11.5"
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
library = "libcffi.a"
depends = ["host_cffi", "libffi", "setuptools", "pycparser"]
cythonize = False
def get_recipe_env(self, arch):
env = super(CffiRecipe, self).get_recipe_env(arch)
env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
env["LDFLAGS"] = " ".join([
env.get('CFLAGS', '')
])
return env
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")
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")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = CffiRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = ColoramaRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class ConstantlyRecipe(PythonRecipe):
version = "15.1.0"
url = "https://pypi.python.org/packages/source/c/constantly/constantly-{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 = ConstantlyRecipe()

View file

@ -0,0 +1,60 @@
from os.path import join
from toolchain import CythonRecipe, PythonRecipe, Recipe
from toolchain import shprint
import os
import sh
class CryptographyRecipe(CythonRecipe):
name = "cryptography"
version = "2.2.2"
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"]
cythonize = False
def prebuild_arch(self, arch):
if self.has_marker("patched"):
return
self.apply_patch("getentropy.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)
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python")
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.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' + \
' -lssl' + r.version + \
' -lcrypto' + r.version
return env
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")
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')
build_env['PYTHONPATH'] = pythonpath
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
shprint(*args, _env=build_env)
recipe = CryptographyRecipe()

View file

@ -0,0 +1,45 @@
--- 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 @@
#if !defined(__APPLE__)
getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
#else
- if (&getentropy != NULL) {
- getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
- } else {
- getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_FALLBACK;
- int fd = dev_urandom_fd();
- if (fd < 0) {
- return 0;
- }
+ getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_FALLBACK;
+ int fd = dev_urandom_fd();
+ if (fd < 0) {
+ return 0;
}
#endif
return 1;
@@ -228,22 +224,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);
- if (res < 0) {
- ERR_Cryptography_OSRandom_error(
- CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES,
- CRYPTOGRAPHY_OSRANDOM_R_GETENTROPY_FAILED,
- __FILE__, __LINE__
- );
- return 0;
- }
- buffer += len;
- size -= len;
- }
- return 1;
+ return 0;
}
__builtin_unreachable();
}

View file

@ -0,0 +1,16 @@
--- cryptography-2.2.2/src/_cffi_src/openssl/src/osrandom_engine.h 2018-03-27 15:12:05.000000000 +0100
+++ cryptography-2.2.2-patch/src/_cffi_src/openssl/src/osrandom_engine.h 2018-06-02 05:06:04.000000000 +0100
@@ -11,13 +11,6 @@
#include <sys/syscall.h>
#endif
- #ifdef __APPLE__
- #include <sys/random.h>
- /* To support weak linking we need to declare this as a weak import even if
- * it's not present in sys/random (e.g. macOS < 10.12). */
- extern int getentropy(void *buffer, size_t size) __attribute((weak_import));
- #endif
-
#ifdef __linux__
/* for SYS_getrandom */
#include <sys/syscall.h>

View file

@ -0,0 +1,20 @@
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"]
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 = DnsPythonRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = DocoptRecipe()

20
recipes/ecdsa/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = EcdsaRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = Enum34Recipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class EnvparseRecipe(PythonRecipe):
version = "0.2.0"
url = "https://pypi.python.org/packages/source/e/envparse/envparse-{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 = EnvparseRecipe()

View file

@ -0,0 +1,20 @@
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"]
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 = Functools32Recipe()

View file

@ -0,0 +1,62 @@
from os.path import join
from toolchain import Recipe
from toolchain import shprint
import os
import sh
libffi_tpl = """
prefix=%PREFIX%
exec_prefix=${prefix}
libdir=${exec_prefix}/build/Release
includedir=${libdir}/build_macosx-x86_64/include
Name: libffi
Description: Library supporting Foreign Function Interfaces
Version: %VERSION%
Libs: -L${libdir} -lffi
Cflags: -I${includedir}
"""
class HostCffiRecipe(Recipe):
name = "host_cffi"
version = "1.11.5"
archs = ["x86_64"]
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
depends = ["libffi", "host_setuptools", "pycparser"]
def get_recipe_env(self, arch):
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
env = super(HostCffiRecipe, self).get_recipe_env(arch)
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
env["LDFLAGS"] = " ".join([
"-undefined dynamic_lookup",
#"-shared",
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
])
env["CFLAGS"] = " ".join([
"--sysroot={}".format(sdk_path),
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
])
return env
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
build_dir = self.get_build_dir(arch.arch)
build_env = self.get_recipe_env(arch)
os.chdir(build_dir)
# generate a fake libffi pkg-config to let cffi use it
hostlibffi = Recipe.get_recipe("hostlibffi", self.ctx)
with open("libffi.pc", "w") as fd:
tpl = libffi_tpl.replace("%PREFIX%",
hostlibffi.get_build_dir(arch.arch))
tpl = tpl.replace("%VERSION%", hostlibffi.version)
fd.write(tpl)
build_env["PKG_CONFIG"] = "/usr/local/bin/pkg-config"
build_env["PKG_CONFIG_PATH"] = build_dir
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
shprint(hostpython, "setup.py", "install", _env=build_env)
recipe = HostCffiRecipe()

View file

@ -9,12 +9,19 @@ import shutil
class HostSetuptools(Recipe): class HostSetuptools(Recipe):
depends = ["openssl", "hostpython"] depends = ["openssl", "hostpython"]
archs = ["x86_64"] archs = ["x86_64"]
url = "setuptools" #url = "setuptools"
version = "18.5"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz"
cythonize = False
'''
def prebuild_arch(self, arch): def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython) dest_dir = join(
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py") self.ctx.dist_dir, 'hostpython',
shprint(hostpython, "./ez_setup.py") '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")
# Extract setuptools egg and remove .pth files. Otherwise subsequent # Extract setuptools egg and remove .pth files. Otherwise subsequent
# python package installations using setuptools will raise exceptions. # python package installations using setuptools will raise exceptions.
# Setuptools version 28.3.0 # Setuptools version 28.3.0
@ -30,5 +37,16 @@ class HostSetuptools(Recipe):
os.remove('setuptools.pth') os.remove('setuptools.pth')
os.remove('easy-install.pth') os.remove('easy-install.pth')
shutil.rmtree('EGG-INFO') shutil.rmtree('EGG-INFO')
'''
def install(self):
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", "{}/hostpython".format(self.ctx.dist_dir))
recipe = HostSetuptools() recipe = HostSetuptools()

View file

@ -54,3 +54,5 @@ future_builtins future_builtins.c
# ctypes # ctypes
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c
# scproxy
_scproxy -framework SystemConfiguration -framework CoreFoundation _scproxy.c

View file

@ -22,11 +22,11 @@ class HostpythonRecipe(Recipe):
def prebuild_arch(self, arch): def prebuild_arch(self, arch):
if self.has_marker("patched"): if self.has_marker("patched"):
return return
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
self.apply_patch("ssize-t-max.patch") self.apply_patch("ssize-t-max.patch")
self.apply_patch("dynload.patch") #self.apply_patch("dynload.patch")
self.apply_patch("static-_sqlite3.patch") self.apply_patch("static-_sqlite3.patch")
self.copy_file("ModulesSetup", "Modules/Setup.local") self.copy_file("ModulesSetup", "Modules/Setup.local")
self.copy_file(join(self.build_dir, "Mac/Modules/_scproxy.c"), "Modules/_scproxy.c")
if "openssl.build_all" in self.ctx.state: if "openssl.build_all" in self.ctx.state:
self.append_file("ModulesSetup.openssl", "Modules/Setup.local") self.append_file("ModulesSetup.openssl", "Modules/Setup.local")
self.set_marker("patched") self.set_marker("patched")
@ -58,13 +58,14 @@ class HostpythonRecipe(Recipe):
"-lffi", "-lffi",
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib")) "-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
]) ])
build_env["CFLAGS"] = " ".join([ build_env["CFLAGS"] = " ".join([
"--sysroot={}".format(sdk_path), "--sysroot={}".format(sdk_path),
"-arch x86_64", "-arch x86_64",
"-mmacosx-version-min=10.12", "-mmacosx-version-min=10.12",
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include")) "-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
]) ])
if "openssl.build_all" in self.ctx.state: if "openssl.build_all" in self.ctx.state:
build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "hostopenssl", "include")) build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "hostopenssl", "include"))
build_env["LDFLAGS"] += " -L{}".format(join(self.ctx.dist_dir, "hostopenssl", "lib")) build_env["LDFLAGS"] += " -L{}".format(join(self.ctx.dist_dir, "hostopenssl", "lib"))
@ -72,9 +73,10 @@ class HostpythonRecipe(Recipe):
configure = sh.Command(join(self.build_dir, "configure")) configure = sh.Command(join(self.build_dir, "configure"))
shprint(configure, shprint(configure,
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")), "--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
"--disable-toolbox-glue", "--disable-toolbox-glue"
"--without-gcc", "--without-gcc",
_env=build_env) _env=build_env)
shprint(sh.make, self.ctx.concurrent_make, _env=build_env)
shprint(sh.make, "-C", self.build_dir, self.ctx.concurrent_make, "python", "Parser/pgen", shprint(sh.make, "-C", self.build_dir, self.ctx.concurrent_make, "python", "Parser/pgen",
_env=build_env) _env=build_env)
shutil.move("python", "hostpython") shutil.move("python", "hostpython")
@ -107,6 +109,12 @@ class HostpythonRecipe(Recipe):
shutil.copy( shutil.copy(
join(build_dir, "Parser", "pgen"), join(build_dir, "Parser", "pgen"),
join(self.ctx.dist_dir, "hostpython", "bin", "pgen")) join(self.ctx.dist_dir, "hostpython", "bin", "pgen"))
shutil.copy(
join(build_dir, "build", "lib.macosx-10.4-x86_64-2.7", "_sysconfigdata.py"),
join(pylib_dir, "_sysconfigdata.py"))
shutil.copy(
join(build_dir, "build", "lib.macosx-10.4-x86_64-2.7", "_sysconfigdata.pyc"),
join(pylib_dir, "_sysconfigdata.pyc"))
recipe = HostpythonRecipe() recipe = HostpythonRecipe()

View file

@ -1,10 +0,0 @@
'''
Stub functions for _scproxy on OsX
No proxy is supported yet.
'''
def _get_proxy_settings():
return {'exclude_simple': 1}
def _get_proxies():
return {}

20
recipes/idna/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = IdnaRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class IncrementalRecipe(PythonRecipe):
version = "17.5.0"
url = "https://pypi.python.org/packages/source/i/incremental/incremental-{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 = IncrementalRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class IpaddressRecipe(PythonRecipe):
version = "1.0.22"
url = "https://pypi.python.org/packages/source/i/ipaddress/ipaddress-{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 = IpaddressRecipe()

View file

@ -0,0 +1,20 @@
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"]
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 = JsonrpcRecipe()

View file

@ -0,0 +1,20 @@
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"]
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 = JsonrpclibRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = JsonschemaRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = KeyringRecipe()

51
recipes/lbry/__init__.py Normal file
View file

@ -0,0 +1,51 @@
from toolchain import PythonRecipe, shprint
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"
depends = [
"python",
"setuptools",
"twisted",
"cryptography",
"appdirs",
"argparse",
"docopt",
"base58",
"colorama",
"dnspython",
"ecdsa",
"envparse",
"jsonrpc",
"jsonrpclib",
"keyring",
"lbryschema",
"lbryum",
"miniupnpc",
"pbkdf2",
"pyyaml",
"pygithub",
"qrcode",
"requests",
"service_identity",
"six",
"slowaes",
"txjson-rpc",
"wsgiref",
"zope_interface",
"treq"
]
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 = LbryRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class LbrySchemaRecipe(PythonRecipe):
version = "v0.0.16rc2"
url = "https://github.com/lbryio/lbryschema/archive/{version}.tar.gz"
depends = ["python", "setuptools", "ecdsa", "jsonschema", "protobuf"]
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 = LbrySchemaRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class LbryumRecipe(PythonRecipe):
version = "v3.2.2rc1"
url = "https://github.com/lbryio/lbryum/archive/{version}.tar.gz"
depends = ["python", "setuptools", "appdirs", "ecdsa", "jsonrpclib", "keyring", "lbryschema"]
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 = LbryumRecipe()

View file

@ -0,0 +1,26 @@
from toolchain import CythonRecipe, shprint
from os.path import join
import os
import sh
class MiniupnpcRecipe(CythonRecipe):
name = "miniupnpc"
version = "1.9"
url = "https://pypi.python.org/packages/source/m/miniupnpc/miniupnpc-{version}.tar.gz"
library = "libminiupnpc.a"
depends = ["python", "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()
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 = MiniupnpcRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
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"]
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 = Pbkdf2Recipe()

View file

@ -0,0 +1,21 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class ProtobufRecipe(PythonRecipe):
version = "3.2.0"
url = "https://pypi.python.org/packages/source/p/protobuf/protobuf-{version}.tar.gz"
depends = ["python", "setuptools", "six"]
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['PATH'] = ''
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = ProtobufRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1ModulesRecipe(PythonRecipe):
version = "0.2.1"
url = "https://pypi.python.org/packages/source/p/pyasn1-modules/pyasn1-modules-{version}.tar.gz"
depends = ["python", "setuptools", "pyasn1"]
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 = Pyasn1ModulesRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1Recipe(PythonRecipe):
version = "0.4.3"
url = "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-{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 = Pyasn1Recipe()

View file

@ -0,0 +1,32 @@
from os.path import join
from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class PycparserRecipe(PythonRecipe):
version = "2.18"
url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz"
depends = ["python"]
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")
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')
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)
recipe = PycparserRecipe()

View file

@ -13,7 +13,6 @@ class PycryptoRecipe(CythonRecipe):
include_per_arch = True include_per_arch = True
library="libpycrypto.a" library="libpycrypto.a"
def build_arch(self, arch): def build_arch(self, arch):
build_env = arch.get_env() build_env = arch.get_env()
self.apply_patch('hash_SHA2_template.c.patch', target_dir=self.build_dir + '/src') self.apply_patch('hash_SHA2_template.c.patch', target_dir=self.build_dir + '/src')

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class PyGithubRecipe(PythonRecipe):
version = "1.34"
url = "https://pypi.python.org/packages/source/p/pygithub/PyGithub-{version}.tar.gz"
depends = ["python", "setuptools", "pyjwt"]
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 = PyGithubRecipe()

20
recipes/pyjwt/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class PyJWTRecipe(PythonRecipe):
version = "1.6.4"
url = "https://pypi.python.org/packages/source/p/pyjwt/PyJWT-{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 = PyJWTRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class PyOpenSSLRecipe(PythonRecipe):
version = "17.4.0"
url = "https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-{version}.tar.gz"
depends = ["python", "setuptools", "cryptography", "six"]
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 = PyOpenSSLRecipe()

View file

@ -52,3 +52,8 @@ pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Mo
# Future (used by numpy) # Future (used by numpy)
future_builtins future_builtins.c future_builtins future_builtins.c
# Ctypes
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -I$(srcdir)/../../build/include/ffi
# scproxy
# _scproxy -framework SystemConfiguration -framework CoreFoundation _scproxy.c

View file

@ -1,2 +0,0 @@
# Ctypes
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -I$(srcdir)/../../build/include/ffi

View file

@ -23,15 +23,14 @@ class PythonRecipe(Recipe):
# common to all archs # common to all archs
if self.has_marker("patched"): if self.has_marker("patched"):
return return
self.copy_file("ModulesSetup", "Modules/Setup.local")
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
self.apply_patch("ssize-t-max.patch") self.apply_patch("ssize-t-max.patch")
self.apply_patch("dynload.patch") self.apply_patch("dynload.patch")
self.apply_patch("static-_sqlite3.patch") self.apply_patch("static-_sqlite3.patch")
self.copy_file("ModulesSetup", "Modules/Setup.local")
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
self.apply_patch("xcompile.patch") self.apply_patch("xcompile.patch")
self.apply_patch("setuppath.patch") self.apply_patch("setuppath.patch")
self.apply_patch("posixmodule.patch") self.apply_patch("posixmodule.patch")
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
if "openssl.build_all" in self.ctx.state: if "openssl.build_all" in self.ctx.state:
self.append_file("ModulesSetup.openssl", "Modules/Setup.local") self.append_file("ModulesSetup.openssl", "Modules/Setup.local")

View file

@ -4,7 +4,7 @@ import sh
from toolchain import PythonRecipe, shprint from toolchain import PythonRecipe, shprint
class PyYamlRecipe(PythonRecipe): class PyYamlRecipe(PythonRecipe):
version = "3.11" version = "3.12"
url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz" url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz"
depends = ["python"] depends = ["python"]

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class QrcodeRecipe(PythonRecipe):
version = "5.2.2"
url = "https://pypi.python.org/packages/source/q/qrcode/qrcode-{version}.tar.gz"
depends = ["python", "setuptools", "colorama", "six"]
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 = QrcodeRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class RequestsRecipe(PythonRecipe):
version = "2.9.1"
url = "https://pypi.python.org/packages/source/r/requests/requests-{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 = RequestsRecipe()

View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class ServiceIdentityRecipe(PythonRecipe):
version = "16.0.0"
url = "https://pypi.python.org/packages/source/s/service_identity/service_identity-{version}.tar.gz"
depends = ["python", "setuptools", "attrs", "pyasn1", "pyasn1-modules", "pyopenssl"]
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 = ServiceIdentityRecipe()

View file

@ -0,0 +1,31 @@
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"]
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"
return env
def install(self):
import sh
from toolchain import shprint
from os import chdir
arch = self.filtered_archs[0]
build_env = arch.get_env()
build_dir = self.get_build_dir(arch.arch)
chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
shprint(hostpython, "setup.py", "install", "--prefix", self.ctx.install_dir, "--old-and-unmanageable")
# "--single-version-externally-managed", "--root", "/", "-O2")
recipe = SetuptoolsRecipe()

20
recipes/six/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class SixRecipe(PythonRecipe):
version = "1.11.0"
url = "https://pypi.python.org/packages/source/s/six/six-{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 = SixRecipe()

View file

@ -0,0 +1,20 @@
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"]
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 = SlowaesRecipe()

20
recipes/treq/__init__.py Normal file
View file

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class TreqRecipe(PythonRecipe):
version = "17.8.0"
url = "https://pypi.python.org/packages/source/t/treq/treq-{version}.tar.gz"
depends = ["python", "setuptools", "six", "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 = TreqRecipe()

View file

@ -0,0 +1,34 @@
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

@ -0,0 +1,14 @@
--- 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

@ -0,0 +1,20 @@
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"]
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 = TxJsonRpcRecipe()

View file

@ -0,0 +1,20 @@
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

@ -0,0 +1,20 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class WsgiRefRecipe(PythonRecipe):
version = "0.1.2"
url = "https://pypi.python.org/packages/source/w/wsgiref/wsgiref-{version}.zip"
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 = WsgiRefRecipe()

View file

@ -0,0 +1,20 @@
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()