Compare commits
33 commits
master
...
recipe-set
Author | SHA1 | Date | |
---|---|---|---|
|
58a0bb7ba2 | ||
|
55e8785a53 | ||
|
4b364991fc | ||
|
67e8a0fb52 | ||
|
263f89bb8c | ||
|
e0f7ec5197 | ||
|
0404d269b4 | ||
|
da5040d5cd | ||
|
b392c61ae5 | ||
|
1eed3853d5 | ||
|
38230677fb | ||
|
d65c85b0a8 | ||
|
7188aa1904 | ||
|
cd626b1fb7 | ||
|
7ff865e274 | ||
|
cba2e7a30b | ||
|
2cb3124e35 | ||
|
26a76b65e5 | ||
|
bad28e3735 | ||
|
11f84ec830 | ||
|
d0ba2dd4dd | ||
|
1c37a80b81 | ||
|
d4cb02ccf1 | ||
|
bbd1dadb16 | ||
|
02e9e08b5a | ||
|
638e355df0 | ||
|
3375a52195 | ||
|
c34f792a17 | ||
|
228c4c320d | ||
|
7ff3e7982f | ||
|
805c52bd6d | ||
|
0b696d6557 | ||
|
8481f19564 |
21 changed files with 568 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,6 +2,8 @@
|
|||
*.pyc
|
||||
*.pyo
|
||||
*.swp
|
||||
.project
|
||||
.pydevproject
|
||||
freetype-*
|
||||
build/*
|
||||
dist/*
|
||||
|
|
|
@ -87,6 +87,7 @@ For a complete list of available commands, type::
|
|||
|
||||
$ ./toolchain.py
|
||||
|
||||
|
||||
Create the Xcode project
|
||||
------------------------
|
||||
|
||||
|
@ -109,6 +110,7 @@ Then click on `Play`, and enjoy.
|
|||
the `<title>-ios/YourApp` directory. Don't make changes in the -ios
|
||||
directory directly.
|
||||
|
||||
|
||||
Configuring your App
|
||||
--------------------
|
||||
|
||||
|
@ -123,6 +125,7 @@ launch environment.
|
|||
the 'export_orientation' function in 'main.m'. The XCode orientation
|
||||
settings should be set to support all.
|
||||
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
|
@ -132,6 +135,7 @@ Fatal error: "stdio.h" file not found
|
|||
You must build with bitcode disabled (Xcode setting ENABLE_BITCODE should be No).
|
||||
We don't support bitcode. You need to go to the project setting, and disable bitcode.
|
||||
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
|
@ -146,6 +150,7 @@ We also have an IRC channel:
|
|||
* Port : 6667, 6697 (SSL only)
|
||||
* Channel : #kivy
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
|
@ -165,6 +170,7 @@ IRC channel:
|
|||
* Port : 6667, 6697 (SSL only)
|
||||
* Channel : #kivy-dev
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
|
26
recipes/autobahn/__init__.py
Normal file
26
recipes/autobahn/__init__.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class AutobahnRecipe(PythonRecipe):
|
||||
name = "autobahn"
|
||||
version = "0.16.0"
|
||||
url = "https://github.com/crossbario/autobahn-python/archive/v{version}.zip"
|
||||
depends = ["twisted", "six", "txaio"]
|
||||
|
||||
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")
|
||||
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 = AutobahnRecipe()
|
68
recipes/cffi/__init__.py
Normal file
68
recipes/cffi/__init__.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
from os.path import join
|
||||
from toolchain import CythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class CffiRecipe(CythonRecipe):
|
||||
depends = ["host_cffi"]
|
||||
name = "cffi"
|
||||
version = "1.8.3"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/0a/f3/"
|
||||
"686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a/"
|
||||
"cffi-{version}.tar.gz"
|
||||
)
|
||||
library = "libcffi.a"
|
||||
depends = ["libffi", "host_setuptools", "pycparser"]
|
||||
cythonize = False
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = super(CffiRecipe, self).get_recipe_env(arch)
|
||||
env["CC"] += " -I{}".format(
|
||||
join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
|
||||
return env
|
||||
|
||||
def install(self):
|
||||
arch = [arch for arch in self.filtered_archs if arch.arch == 'x86_64'][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)
|
||||
|
||||
# install cffi in hostpython
|
||||
#
|
||||
# XXX: installs, module import works, but FFI fails to instanciate:
|
||||
#
|
||||
# myhost:kivy-ios user$ ./dist/hostpython/bin/python
|
||||
# Could not find platform dependent libraries <exec_prefix>
|
||||
# Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
|
||||
# Python 2.7.1 (r271:86832, Nov 4 2016, 10:41:44)
|
||||
# [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
|
||||
# Type "help", "copyright", "credits" or "license" for more information.
|
||||
# >>> import cffi
|
||||
# >>> cffi.api.FFI()
|
||||
# Traceback (most recent call last):
|
||||
# File "<stdin>", line 1, in <module>
|
||||
# File "/.../kivy-ios/dist/hostpython/lib/python2.7/site-packages/cffi/api.py", line 56, in __init__
|
||||
# import _cffi_backend as backend
|
||||
# ImportError: dynamic module does not define init function (init_cffi_backend)
|
||||
#
|
||||
#r = self.get_recipe('hostlibffi', self.ctx)
|
||||
#build_env = r.get_recipe_env(arch)
|
||||
#args = [hostpython, "setup.py", "install"]
|
||||
#shprint(*args, _env=build_env)
|
||||
|
||||
# install cffi in root site packages
|
||||
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 = CffiRecipe()
|
49
recipes/cryptography/__init__.py
Normal file
49
recipes/cryptography/__init__.py
Normal file
|
@ -0,0 +1,49 @@
|
|||
from os.path import join
|
||||
from toolchain import CythonRecipe, PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class CryptographyRecipe(PythonRecipe):
|
||||
name = "cryptography"
|
||||
version = "1.5.2"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/03/1a/"
|
||||
"60984cb85cc38c4ebdfca27b32a6df6f1914959d8790f5a349608c78be61/"
|
||||
"cryptography-{version}.tar.gz"
|
||||
)
|
||||
# library = "libcryptography.a"
|
||||
depends = ["host_setuptools", "host_cffi", "cffi", "six", "idna", "pyasn1",
|
||||
"enum34", "setuptools"]
|
||||
cythonize = False
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = super(CryptographyRecipe, self).get_recipe_env(arch)
|
||||
env["CC"] += " -I{}".format(
|
||||
join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
|
||||
env["CFLAGS"] += " -I{}".format(
|
||||
join(self.ctx.dist_dir, "include", arch.arch, "openssl", "openssl"))
|
||||
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,
|
||||
"--old-and-unmanageable"]
|
||||
shprint(*args, _env=build_env)
|
||||
#args = [hostpython, "setup.py", "install"]
|
||||
#shprint(*args, _env=build_env)
|
||||
|
||||
recipe = CryptographyRecipe()
|
||||
|
26
recipes/enum34/__init__.py
Normal file
26
recipes/enum34/__init__.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class Enum34Recipe(PythonRecipe):
|
||||
version = "1.1.6"
|
||||
url = "https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
|
||||
# url = 'https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz'
|
||||
depends = ["python", "host_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")
|
||||
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 = Enum34Recipe()
|
66
recipes/host_cffi/__init__.py
Normal file
66
recipes/host_cffi/__init__.py
Normal file
|
@ -0,0 +1,66 @@
|
|||
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.8.3"
|
||||
archs = ["x86_64"]
|
||||
url = (
|
||||
"https://pypi.python.org/packages/0a/f3/"
|
||||
"686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a/"
|
||||
"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()
|
|
@ -28,7 +28,9 @@ class HostSetuptools(Recipe):
|
|||
shprint(unzip, setuptools_egg_path)
|
||||
os.remove(setuptools_egg_path)
|
||||
os.remove('setuptools.pth')
|
||||
os.remove('easy-install.pth')
|
||||
# XXX: setuptools egg is referenced in easy-install.pth, check removal
|
||||
# after unpacking setuptools if necessary
|
||||
#os.remove('easy-install.pth')
|
||||
shutil.rmtree('EGG-INFO')
|
||||
|
||||
recipe = HostSetuptools()
|
||||
|
|
|
@ -24,7 +24,7 @@ class HostpythonRecipe(Recipe):
|
|||
return
|
||||
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
|
||||
self.apply_patch("ssize-t-max.patch")
|
||||
self.apply_patch("dynload.patch")
|
||||
# self.apply_patch("dynload.patch")
|
||||
self.apply_patch("static-_sqlite3.patch")
|
||||
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
||||
if "openssl.build_all" in self.ctx.state:
|
||||
|
|
29
recipes/idna/__init__.py
Normal file
29
recipes/idna/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class IdnaRecipe(PythonRecipe):
|
||||
version = "2.1"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/fb/84/"
|
||||
"8c27516fbaa8147acd2e431086b473c453c428e24e8fb99a1d89ce381851/"
|
||||
"idna-{version}.tar.gz"
|
||||
)
|
||||
depends = ["python", "host_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")
|
||||
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 = IdnaRecipe()
|
29
recipes/ipaddress/__init__.py
Normal file
29
recipes/ipaddress/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class IPAddressRecipe(PythonRecipe):
|
||||
version = "1.0.17"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/bb/26/"
|
||||
"3b64955ff73f9e3155079b9ed31812afdfa5333b5c76387454d651ef593a/"
|
||||
"ipaddress-{version}.tar.gz"
|
||||
)
|
||||
depends = ["python", "host_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")
|
||||
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 = IPAddressRecipe()
|
29
recipes/pyasn1/__init__.py
Normal file
29
recipes/pyasn1/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class Pyasn1Recipe(PythonRecipe):
|
||||
version = "0.1.9"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/f7/83/"
|
||||
"377e3dd2e95f9020dbd0dfd3c47aaa7deebe3c68d3857a4e51917146ae8b/"
|
||||
"pyasn1-{version}.tar.gz"
|
||||
)
|
||||
depends = ["ipaddress"]
|
||||
|
||||
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")
|
||||
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 = Pyasn1Recipe()
|
35
recipes/pycparser/__init__.py
Normal file
35
recipes/pycparser/__init__.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class PycparserRecipe(PythonRecipe):
|
||||
version = "2.14"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/6d/31/"
|
||||
"666614af3db0acf377876d48688c5d334b6e493b96d21aa7d332169bee50/"
|
||||
"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
|
||||
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()
|
29
recipes/pyopenssl/__init__.py
Normal file
29
recipes/pyopenssl/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class PyOpenSSLRecipe(PythonRecipe):
|
||||
version = "16.1.0"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/15/1e/"
|
||||
"79c75db50e57350a7cefb70b110255757e9abd380a50ebdc0cfd853b7450/"
|
||||
"pyOpenSSL-{version}.tar.gz"
|
||||
)
|
||||
depends = ["openssl", "cryptography"]
|
||||
|
||||
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")
|
||||
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 = PyOpenSSLRecipe()
|
|
@ -7,7 +7,7 @@ import os
|
|||
class PythonRecipe(Recipe):
|
||||
version = "2.7.1"
|
||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
||||
depends = ["hostpython", "libffi", ]
|
||||
depends = ["hostpython", "libffi"]
|
||||
optional_depends = ["openssl"]
|
||||
library = "libpython2.7.a"
|
||||
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
|
||||
|
@ -33,7 +33,6 @@ class PythonRecipe(Recipe):
|
|||
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
|
||||
if "openssl.build_all" in self.ctx.state:
|
||||
self.append_file("ModulesSetup.openssl", "Modules/Setup.local")
|
||||
|
||||
self.set_marker("patched")
|
||||
|
||||
def build_arch(self, arch):
|
||||
|
|
32
recipes/setuptools/__init__.py
Normal file
32
recipes/setuptools/__init__.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from toolchain import CythonRecipe
|
||||
|
||||
|
||||
class SetuptoolsRecipe(CythonRecipe):
|
||||
name = "setuptools"
|
||||
version = "4.3.2"
|
||||
url = 'https://pypi.python.org/packages/f1/92/12c7251039b274c30106c3e0babdcb040cbd13c3ad4b3f0ef9a7c217e36a/setuptools-30.2.0.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_python_package(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",
|
||||
self.ctx.install_dir, "--old-and-unmanageable")
|
||||
# "--single-version-externally-managed", "--root", "/", "-O2")
|
||||
|
||||
|
||||
|
||||
|
||||
recipe = SetuptoolsRecipe()
|
||||
|
29
recipes/six/__init__.py
Normal file
29
recipes/six/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class SixRecipe(PythonRecipe):
|
||||
version = "1.10.0"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/b3/b2/"
|
||||
"238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/"
|
||||
"six-{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")
|
||||
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 = SixRecipe()
|
12
recipes/twisted/__init__.py
Normal file
12
recipes/twisted/__init__.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from toolchain import CythonRecipe
|
||||
|
||||
|
||||
class TwistedRecipe(CythonRecipe):
|
||||
name = "twisted"
|
||||
version = "16.1.1"
|
||||
url = "https://github.com/twisted/twisted/archive/twisted-{version}.zip"
|
||||
depends = ["pyopenssl", "zope_interface"]
|
||||
cythonize = False
|
||||
|
||||
|
||||
recipe = TwistedRecipe()
|
29
recipes/txaio/__init__.py
Normal file
29
recipes/txaio/__init__.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from os.path import join
|
||||
from toolchain import PythonRecipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class TxaioRecipe(PythonRecipe):
|
||||
version = "2.5.1"
|
||||
url = (
|
||||
"https://pypi.python.org/packages/45/e1/"
|
||||
"f7d88767d65dbfc20d4b4aa0dad657dbbe8ca629ead2bef24da04630a12a/"
|
||||
"txaio-{version}.tar.gz"
|
||||
)
|
||||
depends = ["host_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")
|
||||
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 = TxaioRecipe()
|
13
recipes/zope_interface/__init__.py
Normal file
13
recipes/zope_interface/__init__.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from toolchain import CythonRecipe
|
||||
|
||||
|
||||
class ZopeInterfaceRecipe(CythonRecipe):
|
||||
name = "zope"
|
||||
version = "4.3.2"
|
||||
url = 'http://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
|
||||
depends = ["python", "host_setuptools"]
|
||||
cythonize = False
|
||||
|
||||
|
||||
recipe = ZopeInterfaceRecipe()
|
||||
|
65
toolchain.py
65
toolchain.py
|
@ -118,7 +118,9 @@ class JsonStore(object):
|
|||
with io.open(self.filename, 'w', encoding='utf-8') as fd:
|
||||
fd.write(unicode(json.dumps(self.data, ensure_ascii=False)))
|
||||
|
||||
|
||||
class Arch(object):
|
||||
|
||||
def __init__(self, ctx):
|
||||
super(Arch, self).__init__()
|
||||
self.ctx = ctx
|
||||
|
@ -135,7 +137,6 @@ class Arch(object):
|
|||
d.format(arch=self))
|
||||
for d in self.ctx.include_dirs]
|
||||
|
||||
|
||||
def get_env(self):
|
||||
include_dirs = [
|
||||
"-I{}/{}".format(
|
||||
|
@ -196,7 +197,6 @@ class Arch(object):
|
|||
return env
|
||||
|
||||
|
||||
|
||||
class ArchSimulator(Arch):
|
||||
sdk = "iphonesimulator"
|
||||
arch = "i386"
|
||||
|
@ -227,7 +227,7 @@ class Arch64IOS(Arch):
|
|||
triple = "aarch64-apple-darwin13"
|
||||
version_min = "-miphoneos-version-min=7.0"
|
||||
sysroot = sh.xcrun("--sdk", "iphoneos", "--show-sdk-path").strip()
|
||||
|
||||
|
||||
|
||||
class Graph(object):
|
||||
# Taken from python-for-android/depsort
|
||||
|
@ -375,19 +375,60 @@ class Context(object):
|
|||
|
||||
|
||||
class Recipe(object):
|
||||
version = None
|
||||
"""Base recipe for compiling and installing dependency libraries and
|
||||
packages to kivy iOS build.
|
||||
"""
|
||||
|
||||
url = None
|
||||
"""Either folder name relative to recipe or download URL.
|
||||
"""
|
||||
|
||||
version = None
|
||||
"""Gets formatted with ``url`` if download URL.
|
||||
"""
|
||||
|
||||
archs = []
|
||||
"""Architectures this recipe applies, empty list means all.
|
||||
"""
|
||||
|
||||
depends = []
|
||||
"""Dependency recipes.
|
||||
"""
|
||||
|
||||
optional_depends = []
|
||||
"""???
|
||||
"""
|
||||
|
||||
library = None
|
||||
"""???
|
||||
"""
|
||||
|
||||
libraries = []
|
||||
"""???
|
||||
"""
|
||||
|
||||
include_dir = None
|
||||
"""Include directory for compilation"""
|
||||
|
||||
include_per_arch = False
|
||||
"""???
|
||||
"""
|
||||
|
||||
frameworks = []
|
||||
"""OS X frameworks.
|
||||
"""
|
||||
|
||||
sources = []
|
||||
"""???
|
||||
"""
|
||||
|
||||
pbx_frameworks = []
|
||||
"""???
|
||||
"""
|
||||
|
||||
pbx_libraries = []
|
||||
"""???
|
||||
"""
|
||||
|
||||
# API available for recipes
|
||||
def download_file(self, url, filename, cwd=None):
|
||||
|
@ -396,6 +437,7 @@ class Recipe(object):
|
|||
"""
|
||||
if not url:
|
||||
return
|
||||
|
||||
def report_hook(index, blksize, size):
|
||||
if size <= 0:
|
||||
progression = '{0} bytes'.format(index * blksize)
|
||||
|
@ -414,6 +456,7 @@ class Recipe(object):
|
|||
urlcleanup()
|
||||
|
||||
print('Downloading {0}'.format(url))
|
||||
print("filename", filename)
|
||||
urlretrieve(url, filename, report_hook)
|
||||
return filename
|
||||
|
||||
|
@ -638,7 +681,7 @@ class Recipe(object):
|
|||
shutil.copytree(src_dir, dest_dir)
|
||||
return
|
||||
ensure_dir(build_dir)
|
||||
self.extract_file(self.archive_fn, build_dir)
|
||||
self.extract_file(self.archive_fn, build_dir)
|
||||
|
||||
@cache_execution
|
||||
def build(self, arch):
|
||||
|
@ -812,7 +855,7 @@ class Recipe(object):
|
|||
@classmethod
|
||||
def get_recipe(cls, name, ctx):
|
||||
if not hasattr(cls, "recipes"):
|
||||
cls.recipes = {}
|
||||
cls.recipes = {}
|
||||
|
||||
if '==' in name:
|
||||
name, version = name.split('==')
|
||||
|
@ -850,7 +893,8 @@ class PythonRecipe(Recipe):
|
|||
"""Automate the installation of a Python package into the target
|
||||
site-packages.
|
||||
|
||||
It will works with the first filtered_archs, and the name of the recipe.
|
||||
It will works with the first filtered_archs, and the name of the
|
||||
recipe.
|
||||
"""
|
||||
arch = self.filtered_archs[0]
|
||||
if name is None:
|
||||
|
@ -1047,7 +1091,6 @@ def update_pbxproj(filename):
|
|||
fn = join(ctx.dist_dir, "sources", name)
|
||||
project.add_folder(fn, parent=g_classes)
|
||||
|
||||
|
||||
if project.modified:
|
||||
project.backup()
|
||||
project.save()
|
||||
|
@ -1055,13 +1098,13 @@ def update_pbxproj(filename):
|
|||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
|
||||
|
||||
class ToolchainCL(object):
|
||||
def __init__(self):
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Tool for managing the iOS / Python toolchain",
|
||||
usage="""toolchain <command> [<args>]
|
||||
|
||||
|
||||
Available commands:
|
||||
build Build a recipe (compile a library for the required target
|
||||
architecture)
|
||||
|
@ -1177,7 +1220,7 @@ Xcode:
|
|||
parser.add_argument("name", help="Name of your project")
|
||||
parser.add_argument("directory", help="Directory where your project live")
|
||||
args = parser.parse_args(sys.argv[2:])
|
||||
|
||||
|
||||
from cookiecutter.main import cookiecutter
|
||||
ctx = Context()
|
||||
template_dir = join(curdir, "tools", "templates")
|
||||
|
|
Loading…
Reference in a new issue