-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes pyleveldb recipe #1699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AndreMiras
merged 1 commit into
kivy:master
from
AndreMiras:feature/fix_pyleveldb_recipe
Feb 10, 2019
Merged
Fixes pyleveldb recipe #1699
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,13 @@ | ||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe | ||
from pythonforandroid.toolchain import current_directory | ||
import sh | ||
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe | ||
|
||
|
||
class PyLevelDBRecipe(CompiledComponentsPythonRecipe): | ||
class PyLevelDBRecipe(CppCompiledComponentsPythonRecipe): | ||
version = '0.193' | ||
url = 'https://pypi.python.org/packages/source/l/leveldb/leveldb-{version}.tar.gz' | ||
depends = ['snappy', 'leveldb', ('hostpython2', 'hostpython3'), 'setuptools'] | ||
patches = ['bindings-only.patch'] | ||
call_hostpython_via_targetpython = False # Due to setuptools | ||
site_packages_name = 'leveldb' | ||
|
||
def build_arch(self, arch): | ||
with current_directory(self.get_build_dir(arch.arch)): | ||
# Remove source in this pypi package | ||
sh.rm('-rf', 'leveldb', 'leveldb.egg-info', 'snappy') | ||
# Use source from leveldb recipe | ||
sh.ln('-s', self.get_recipe('leveldb', self.ctx).get_build_dir(arch.arch), 'leveldb') | ||
# Build and install python bindings | ||
super(PyLevelDBRecipe, self).build_arch(arch) | ||
|
||
def get_recipe_env(self, arch): | ||
env = super(PyLevelDBRecipe, self).get_recipe_env(arch) | ||
# Copy environment from leveldb recipe | ||
env.update(self.get_recipe('leveldb', self.ctx).get_recipe_env(arch)) | ||
# Set linker to use the correct gcc | ||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' | ||
env['LDFLAGS'] += ' -lleveldb' | ||
return env | ||
|
||
|
||
recipe = PyLevelDBRecipe() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side note: That is my biggest concern, because we make dependant of
gnustl_shared
(which, as far as I know, is Deprecated inndk r18
)...so all recipes that depend ongnustl_shared
will fail with newer ndks...but ,we have all relevant code concentrated inCppCompiledComponentsPythonRecipe
😉Related to:
Support for NDK 19
(#1613)See also: https://developer.android.com/ndk/guides/cpp-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know!