-
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
Added a matplotlib recipe #1822
Conversation
Awesome work! |
For now it probably does break other things using freetype and libpng, since it makes the recipes build shared object files instead of static libraries. Also freetype no longer uses harfbuzz, which presumably leads to worse results. Both things can be addressed. |
I was working to fix the last couple of issues but my phone's broken, so it won't be done for a few days. Along the way, I was going to delete the PIL recipe (depends on png which I've changed) since pillow seems to work fine for us. Any objections to that? |
I've no problem on that, but maybe, instead of removing it, we could redirect the As a side note: as far as I know, the About this:
Some time ago I fixed this cyclic dependency issue with |
@opacam I'd be delighted if you do a PR for that, it should be no problem to merge to master and rebase this one on it. Did you do the apparently-correct build process of first building a bare freetype, then building harfbuzz depending on that freetype, then building freetype depending on that harfbuzz? |
Yes, that is the process... |
af7ee7d
to
cd3d18f
Compare
This seems to work now, I tested pillow as well with the changes to libpng and it was able to load, modify and save a png image fine. I'm not completely happy about copying libpng.so to libpng16.so and then loading it explicitly in PythonUtil.java, but I couldn't get matplotlib to link with it otherwise and it seems basically fine. I guess I could have left it as libpng.so in the apk (and the autoloading should take care of finding the symbols), but it isn't clear that this is actually a better choice - if matplotlib wants to link to libpng16, maybe other things do as well. Overall, I think it's okay to leave a further decision to if/when we have more recipes wanting to link with libpng. |
I've replaced the pil recipe with a wrapper that prints a warning and then builds pillow. This seems to work fine, and should avoid backwards compatibility issues. |
Also modify Pillow recipe because depends on png
Yes, I don't like either this, we already had some discussion about the load of the libraries in that file (and teorically we don't need to do that... as you said) so seeing png's recipe I remembered that I myself put those comments in there. Yesterday night I tried to move libpng to the mainline repo and it seems to work fine. I may add that the final generated library is precisely The fact that the soname it's the same that the library filename make the things work without touching the javafile, at least on my tests with Pillow, but should be the same with matplotlib...so...could you try with this png recipe removing all the changes you made to png recipe and without the PythonUtil.java changes? Note: since we already had surprises with freetype and harfbuzz cyclic dependency issue, I think that would be great that we could test this with another system than mine or travis The png recipe: ⬇️ |
I've merged and tested @opacam's changes, it works fine. PIL also works, tested loading a png, modifying, and saving again. I think this can be merged now. |
Great @inclement!! https://travis-ci.org/kivy/python-for-android/jobs/540940495#L238-L244 |
|
||
|
||
MatplotlibApp().run() | ||
runTouchApp(Image(source='test.png', allow_stretch=True)) |
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.
I think that we could remove this line, I'm right?
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.
Yep, that's an old debug line, thanks.
2cdc3ce
to
f7f0451
Compare
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.
Thanks @inclement, Good job!!
Finally got this working. This isn't in a mergeable state due to the changes it makes to other recipes and some parts that could be improved, but it's surprisingly close.
The necessary steps seem to be:
hb_ft_...
symbol. Possibly this can be fixed by the three-stage build (freetype-without-harfbuzz then harfbuzz-with-freetype then freetype-with-harfbuzz) that you can read about online.I haven't tested it widely, but the testapp seems fine with basic plotting: