-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[CORE UPDATE - PART IV] Fix cryptography+cffi #1545
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9485875
Fix openssl dependant recipe: cryptography+cffi
opacam e1bb75f
Update cryptography recipe and grants python3 support
opacam 05fea3b
Merge branch 'master' of https://github.com/kivy/python-for-android i…
opacam ee9c61c
Fix dependency graph error
opacam 84b01f0
Move libraries from LDFLAGS to LIBS for cryptography recipe
opacam 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,24 +1,21 @@ | ||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe | ||
from os.path import join | ||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe | ||
|
||
|
||
class CryptographyRecipe(CompiledComponentsPythonRecipe): | ||
name = 'cryptography' | ||
version = '2.3.1' | ||
version = '2.4.2' | ||
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz' | ||
depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'asn1crypto', 'six', 'setuptools', 'enum34', 'ipaddress', 'cffi'] | ||
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setuptools', | ||
'enum34', 'ipaddress', 'cffi'] | ||
call_hostpython_via_targetpython = False | ||
|
||
def get_recipe_env(self, arch): | ||
env = super(CryptographyRecipe, self).get_recipe_env(arch) | ||
r = self.get_recipe('openssl', self.ctx) | ||
openssl_dir = r.get_build_dir(arch.arch) | ||
# Set linker to use the correct gcc | ||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' | ||
env['CFLAGS'] += ' -I' + join(openssl_dir, 'include') | ||
env['LDFLAGS'] += ' -L' + openssl_dir + \ | ||
' -lssl' + r.version + \ | ||
' -lcrypto' + r.version | ||
|
||
openssl_recipe = Recipe.get_recipe('openssl', self.ctx) | ||
env['CFLAGS'] += openssl_recipe.include_flags(arch) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems clever, I like it! 👍 |
||
env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch) | ||
env['LIBS'] = openssl_recipe.link_libs_flags() | ||
|
||
return env | ||
|
||
|
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
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
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.
Hm does libffi actually depend on python? The old recipe doesn't seem to have done that other than for crystax, it just leaves me wondering why it is required? Or is
libffi
a python-specific lib(I'm just curious, not saying it's necessarily wrong or anything!)
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.
@opacam got any input on this particular question?
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.
That's a pretty valid concern @Jonast and definitely deserves some investigations. In the meantime this PR is already improving the current state while not bringing any regression to me.
I think we could merge and eventually address that 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.
👍