-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Can't build a package with bcrypt as requirement #1910
Comments
This is due to SDL2 build blacklist: /pythonforandroid/bootstraps/sdl2/build/blacklist.txt |
Adding the relevant files to a custom whitelist.txt doesn't seem to solve everything however, as now it fails on hashlib. Adding pycrypto to requirements doesn't seem to help. |
This possibly runs quite deep and has been going on for a long time: https://stackoverflow.com/questions/24256134/using-hashlib-with-kivy-buildozer |
#1260 this told me to add openssl to requirements, which I did. Now, I get a |
Erf. A So in short, it seems the only required steps are to add openssl to requirements in buildozer.spec, and manage the whitelist.txt to revert the blacklisted encodings. The file looks as follows:
And in buildozer.spec: The exact name of the config entry might be different in the future, I know it has changed in the past. |
Oops: I think I'll have to build a recipe, hehe. |
Here's the recipe I created for BCrypt - it's probably not optimal by any means, but hey, WorksForMe™ so I guess it's GoodEnough™ ? :-) from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class BCryptRecipe(CompiledComponentsPythonRecipe):
name = 'bcrypt'
version = '3.1.7'
url = 'https://github.com/pyca/bcrypt/archive/{version}.tar.gz'
depends = ['openssl', 'cffi']
call_hostpython_via_targetpython = False
def get_recipe_env(self, arch):
env = super(BCryptRecipe, self).get_recipe_env(arch)
openssl_recipe = Recipe.get_recipe('openssl', self.ctx)
env['CFLAGS'] += openssl_recipe.include_flags(arch)
env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch)
env['LIBS'] = openssl_recipe.link_libs_flags()
return env
recipe = BCryptRecipe() |
Great work 👏 |
Sorry man hectic time at work, coming very soon 😁
|
Also it doesn't include the whitelist in the recipe and I'm not quite sure
how to achieve that so your input is welcome 😊
|
No rush, you already provided the solution in this ticket. So if people are in a urge to see it in the tree, they know what to do 😄 |
I also had the issue! |
I don't think this will work with arm64-v8a builds yet, I need to fix this properly at some point, can anyone provide some feedback on this? Thanks in advance :-) |
@ZurMaD check this |
Everything is in the title. If you attempt to build a package with bcrypt in the requirements, you'll get an error when it tries to import the "encodings" module.
The text was updated successfully, but these errors were encountered: