Skip to content

Commit 2f4cf91

Browse files
authored
Merge pull request #1757 from goffi-contrib/protobuf_runtime_fix
[protobuf_cpp] fixed runtime issues
2 parents 84142eb + 486983d commit 2f4cf91

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pythonforandroid/recipes/protobuf_cpp/__init__.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def build_arch(self, arch):
9898
# Install python bindings
9999
self.install_python_package(arch)
100100

101+
# Create __init__.py which is missing (cf. https://github.com/protocolbuffers/protobuf/issues/1296
102+
# and https://stackoverflow.com/questions/13862562/google-protocol-buffers-not-found-when-trying-to-freeze-python-app)
103+
open(join(self.ctx.get_site_packages_dir(), 'google', '__init__.py'), 'a').close()
104+
101105
def install_python_package(self, arch):
102106
env = self.get_recipe_env(arch)
103107

@@ -132,11 +136,10 @@ def get_recipe_env(self, arch):
132136
env['CXXFLAGS'] += ' -frtti'
133137
env['CXXFLAGS'] += ' -fexceptions'
134138
env['LDFLAGS'] += (
139+
' -lgnustl_shared -landroid -llog' +
135140
' -L' + self.ctx.ndk_dir +
136141
'/sources/cxx-stl/gnu-libstdc++/' + self.ctx.toolchain_version +
137142
'/libs/' + arch.arch)
138-
env['LIBS'] = env.get('LIBS', '') + ' -lgnustl_shared -landroid -llog'
139-
140143
return env
141144

142145

0 commit comments

Comments
 (0)