Skip to content
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

Rework for Pillow/pil recipes & update jpeg and png #1573

Merged
merged 7 commits into from
Jan 13, 2019

Conversation

opacam
Copy link
Member

@opacam opacam commented Jan 9, 2019

Several actions taken here:

  • Update jpeg and moved to mainline
  • Update png
  • Force to build freetype/harfbuzz only as static libraries (to make sure that Pillow/pil gets linked with the static libraries, plus we cannot use those libraries in his shared form because we will have conflicts with the ones distributed by android os...so no need to build those libraries unless properly versioned as we do with openssl libs)
  • Make it work Pillow with python3/python2/python2legacy
  • Make it work pil with python2 and python2legacy
  • Add freetype/harfbuzz support for Pillow/pil
  • Formats the touched recipes and fixes imports

Note: This should work, tested in python3. I must review the code and create the proper commits plus I may change something that we may not need. I push it in this state in case that anyone has troubles building Pillow/pil with the new core.

@opacam opacam changed the title Fix Pillow/pil for python2 and python3 [WIP] Fix Pillow/pil for python2 and python3 Jan 9, 2019
@opacam opacam changed the title [WIP] Fix Pillow/pil for python2 and python3 [WIP] Rework for Pillow/pil recipes & update jpeg and png Jan 9, 2019
…ce code and fix imports

We force to only build the static library to avoid that Pillow/pil gets linked with the shared library, plus we cannot use those libraries in his shared form because we will have conflicts with the ones distributed by android os...so no need to build those libraries unless properly versioned as we do with openssl libs
Also add a patch that may allow us to build the libraries in his shared form...in case we need them
- Fix compatibility for new jpeg
- add freetype/harfbuzz support
- move libraries from LDFLAGS to LIBS
- format source code
- Fix compatibility for new jpeg
- add freetype/harfbuzz support
- move libraries from LDFLAGS to LIBS
- make it work with python2 and python2legacy
@ghost
Copy link

ghost commented Jan 10, 2019

I am just testing this, and I ran into some detail: maybe https://github.com/kivy/python-for-android/blob/master/doc/source/quickstart.rst#installing-dependencies should be expanded to add - cmake (required for some native code recipes)? (Before this pull request, I never needed to have it installed)

@ghost
Copy link

ghost commented Jan 10, 2019

Edit: outdated/irrelevant

@ghost
Copy link

ghost commented Jan 11, 2019

Tested build & runtime now, works 🆗 so given without this it won't even build, this is really an essential upgrade 👍

@ghost
Copy link

ghost commented Jan 11, 2019

@opacam could you add an edit to this pull request which changes this file and adds - cmake (required for some native code recipes) to the dependencies? Just so we don't forget

The recent rework of the jpeg recipe has introduced a new build dependency for us, so we add it to the section `Installing Dependencies` to no forgot about it.
@opacam opacam changed the title [WIP] Rework for Pillow/pil recipes & update jpeg and png Rework for Pillow/pil recipes & update jpeg and png Jan 11, 2019
version = '1.6.15'
url = 'https://github.com/julienr/libpng-android/archive/{version}.zip'
version = '1.6.29'
url = 'https://github.com/julienr/libpng-android/archive/master.zip'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I guess you hardcoded the branch/tag by mistake right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow didn't notice that one 😮 now I feel blind. yeah, would be nice to know if that is an accident or not

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is no error...well...I forgot to notify it (my apologies for that...I completely forgot about it...)...

Well...the thing is that the author of the github's repo never released/tagged this version, despite He performed the necessary changes in master branch and notify about it in the README file...I thing that we should try to move it from that repo to the mainline repo, plus considering that the last commit is more than a year old...mmm...I have bad feelings about that...

Anyway...maybe we should target a commit instead of a version, this way we wouldn't hardcode the url...I still think that we should try to move it to mainline but maybe would be better to do it in another pr (this way we could solve the current Pillow/pil issues, and move the png recipe to the mainline repository when we can).

@Jonast and @AndreMiras, what do you think?

Copy link

@ghost ghost Jan 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@opacam yea hardcoding/pinning a commit seems like the best idea for now 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks for the explanation.
Yes I would either hardcode the commit or the master branch in the version string. But in any case I would keep that {version} temple so people who use the recipe can override with png==whatever-they-want

We set the last commit published for a version because the author of the github's repo never released/tagged it, despite He performed the necessary changes in master branch and notify about it in the README file...so this way we don't hardcode the url.

Note: we should try to move the png repo to mainline because of  the issue mentioned above and the fact that the last commit of the repo is more than one year old
jni_ln = join(build_dir, 'jni')
if not exists(jni_ln):
shprint(sh.ln, '-s', build_dir, jni_ln)
shprint(sh.rm, '-f', 'CMakeCache.txt', 'CMakeFiles/')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rm -f work on a directory without the -r flag?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'-DCMAKE_SYSTEM_PROCESSOR={cpu}'.format(cpu='arm'),
'-DCMAKE_POSITION_INDEPENDENT_CODE=1',
'-DCMAKE_ANDROID_ARCH_ABI={arch}'.format(arch=arch.arch),
'-DCMAKE_ANDROID_NDK=' + self.ctx.ndk_dir,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, why don't you use the same format string syntax as before/after for consistency?

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome work, as usual

@AndreMiras AndreMiras merged commit e3123f4 into kivy:master Jan 13, 2019
@opacam opacam deleted the python-core-pil branch June 15, 2019 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants