- Notifications
You must be signed in to change notification settings - Fork3.8k
Compile freetype with harfbuzz, reduce manylinux wheelsize#3445
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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 ensures that every self-built library is installed in /usr/local/libThese libraries are stripped off of unneeded symbolsAlso does some CMake usage improvements
Okay I've done some testing, and this PR should be done from my end |
illume approved these changesSep 15, 2022
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.
thank-you-very-cool! 🎉
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
Uh oh!
There was an error while loading.Please reload this page.
Kind of a follow up on#3430, when I was updating
SDL_ttfin there I realised thatSDL_ttfstatically linked against a vendored freetype+harfbuzz, which meant that our wheels are actually including freetype twice.Without this PR, a 2.1.3 manylinux wheel will easily shoot past the 30 MB mark. And the biggest culprit is harfbuzz. I've noticed that an uncompressed and unstripped harfbuzz shared library is almost 31 MB, and this is almost half of the entire pygame install by itself. Since harfbuzz is such a large dependency, I thought that my wheelsize reducing patch should go along in this PR, even though it's technically an independent change. The rest of the bundled
sofiles in the manylinux wheel together constitute a large fraction of the total wheel size. My "fix" for this is basically runningstripon all these so files (by first consolidating all of these in/usr/local/lib). This reduces the wheelsize by about 60% in my initial draft (from 31.8 MB to 13 MB)And ofc, the added benefit of this PR is that
pygame.freetypegets harfbuzz support. Nothing much should change on thepygame.fontend because here harfbuzz support was already introduced along with the SDL_ttf 2.0.18 updateThis PR is a draft while I'm doing more testing, not a 2.1.3 blocker