2019-03-30 21:58:45 +01:00
|
|
|
from pythonforandroid.recipe import PythonRecipe
|
|
|
|
from pythonforandroid.toolchain import current_directory
|
|
|
|
from os.path import join
|
2017-08-13 03:24:00 +02:00
|
|
|
import sh
|
|
|
|
|
|
|
|
|
|
|
|
class ZopeInterfaceRecipe(PythonRecipe):
|
|
|
|
call_hostpython_via_targetpython = False
|
|
|
|
name = 'zope_interface'
|
|
|
|
version = '4.1.3'
|
|
|
|
url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
|
|
|
|
site_packages_name = 'zope.interface'
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = ['setuptools']
|
2017-08-13 03:24:00 +02:00
|
|
|
patches = ['no_tests.patch']
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
def build_arch(self, arch):
|
2022-12-02 21:15:34 +01:00
|
|
|
super().build_arch(arch)
|
2019-03-30 21:58:45 +01:00
|
|
|
# The zope.interface module lacks of the __init__.py file in one of his
|
|
|
|
# folders (once is installed), that leads into an ImportError.
|
|
|
|
# Here we intentionally apply a patch to solve that, so, in case that
|
|
|
|
# this is solved in the future an error will be triggered
|
2022-12-02 21:15:34 +01:00
|
|
|
zope_install = join(self.ctx.get_site_packages_dir(arch), 'zope')
|
2019-03-30 21:58:45 +01:00
|
|
|
self.apply_patch('fix-init.patch', arch.arch, build_dir=zope_install)
|
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
def prebuild_arch(self, arch):
|
2022-12-02 21:15:34 +01:00
|
|
|
super().prebuild_arch(arch)
|
2017-08-13 03:24:00 +02:00
|
|
|
with current_directory(self.get_build_dir(arch.arch)):
|
2022-12-02 21:15:34 +01:00
|
|
|
sh.rm(
|
|
|
|
'-rf',
|
|
|
|
'src/zope/interface/tests',
|
|
|
|
'src/zope/interface/common/tests',
|
|
|
|
)
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
recipe = ZopeInterfaceRecipe()
|