2015-02-25 13:37:52 +01:00
|
|
|
from toolchain import CythonRecipe, shprint
|
2015-02-18 03:01:22 +01:00
|
|
|
from os.path import join
|
|
|
|
import sh
|
|
|
|
|
|
|
|
|
2015-02-25 13:37:52 +01:00
|
|
|
class PyobjusRecipe(CythonRecipe):
|
2015-02-18 03:01:22 +01:00
|
|
|
version = "master"
|
|
|
|
url = "https://github.com/kivy/pyobjus/archive/{version}.zip"
|
|
|
|
library = "libpyobjus.a"
|
|
|
|
depends = ["python"]
|
2015-02-25 13:37:52 +01:00
|
|
|
pre_build_ext = True
|
2015-02-18 03:01:22 +01:00
|
|
|
|
2015-02-25 13:37:52 +01:00
|
|
|
def get_recipe_env(self, arch):
|
|
|
|
env = super(PyobjusRecipe, self).get_recipe_env(arch)
|
|
|
|
env["CC"] += " -I{}".format(
|
2015-02-18 03:01:22 +01:00
|
|
|
join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
|
2015-02-25 13:37:52 +01:00
|
|
|
return env
|
2015-02-18 03:01:22 +01:00
|
|
|
|
2015-02-25 13:37:52 +01:00
|
|
|
def cythonize_build(self):
|
|
|
|
super(PyobjusRecipe, self).cythonize_build()
|
2015-02-18 03:01:22 +01:00
|
|
|
shprint(sh.sed,
|
|
|
|
"-i.bak",
|
|
|
|
"s/ffi\///g",
|
|
|
|
"pyobjus/pyobjus.c")
|
|
|
|
|
|
|
|
recipe = PyobjusRecipe()
|
|
|
|
|
|
|
|
|