rougier / freetype-py

Python binding for the freetype library
Other
304 stars 88 forks source link

add support for building zlib and libpng libraries in setup-build-freetype.py #133

Closed mammo0 closed 2 years ago

mammo0 commented 3 years ago

Hello,

this PR is for solving #123.

Building with zlib or libpng support is disabled by default. So there's no new default behavior of this script. But if you want to build with

HinTak commented 3 years ago

If you bundle very common libraries like zlib and libpng you might need to look into the symbol export systems (not sure about it under cmake etc, but it is part of autoconf'ed build) not to re-export 3rd-party symbols, to avoid the Linux version of dll hell - where software using freetype and libpng get confused by the bundled libpng symbols within your build of freetype.

mammo0 commented 3 years ago

Well, honestly I've got not the knowledge of how the re-export of the symbols can be prevented.

I have oriented myself on how harfbuzz was built into the freetype library. After it worked for me, I just opened the PR here...

HinTak commented 3 years ago

The autoconf build of freetype sets symbols to be by default hidden, and passes a linker script to the linker to explicitly declare which symbols are exported.

mammo0 commented 3 years ago

Ok, can you show me an example?

HinTak commented 3 years ago

You can each for export in freetype e.g. https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=771d3c8ae25d5042a3f6b76a329ad3dd782eca66

mammo0 commented 3 years ago

So the variable EXPORTS_LIST should be set?

I'm sorry, but I don't have much experience in C/C++ and library programming... So maybe you can make the necessary changes? Because it seems you know what you're talking about...