Skip to content

Commit 9efee20

Browse files
authored
Merge pull request kivy#1677 from opacam/fix-zope-interface
Fix zope_interface and add python3 compatibility
2 parents 3ecbe4d + b938e59 commit 9efee20

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

pythonforandroid/recipes/zope_interface/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pythonforandroid.recipe import PythonRecipe
22
from pythonforandroid.toolchain import current_directory
3+
from os.path import join
34
import sh
45

56

@@ -9,10 +10,18 @@ class ZopeInterfaceRecipe(PythonRecipe):
910
version = '4.1.3'
1011
url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
1112
site_packages_name = 'zope.interface'
12-
13-
depends = [('python2', 'python3crystax')]
13+
depends = ['setuptools']
1414
patches = ['no_tests.patch']
1515

16+
def build_arch(self, arch):
17+
super(ZopeInterfaceRecipe, self).build_arch(arch)
18+
# The zope.interface module lacks of the __init__.py file in one of his
19+
# folders (once is installed), that leads into an ImportError.
20+
# Here we intentionally apply a patch to solve that, so, in case that
21+
# this is solved in the future an error will be triggered
22+
zope_install = join(self.ctx.get_site_packages_dir(arch.arch), 'zope')
23+
self.apply_patch('fix-init.patch', arch.arch, build_dir=zope_install)
24+
1625
def prebuild_arch(self, arch):
1726
super(ZopeInterfaceRecipe, self).prebuild_arch(arch)
1827
with current_directory(self.get_build_dir(arch.arch)):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The zope.interface module lacks of the __init__.py file in `zope` folder
2+
(once is installed), this patch creates that missing file. This seems to be
3+
caused during the installation process because that file exists in source
4+
files.
5+
diff -Naurp zope.orig/__init__.py zope/__init__.py
6+
--- zope.orig/__init__.py 1970-01-01 01:00:00.000000000 +0100
7+
+++ zope/__init__.py 2019-02-05 11:29:22.666757227 +0100
8+
@@ -0,0 +1 @@
9+
+

0 commit comments

Comments
 (0)