-
Notifications
You must be signed in to change notification settings - Fork 105
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
switch to yeslogic-fontconfig-sys instead of servo-fontconfig #192
Conversation
To get rid of a compiler warning
This is a draft until yeslogic/fontconfig-rs#12 is merged upstream. |
See also: Having two different -sys crates for fontconfig has created a messy situation because Cargo will refuse to build if two -sys crates link the same library by specifying |
PR to switch Slint to yeslogic-fontconfig-sys from servo-fontconfig: slint-ui/slint#956 |
0b61077
to
68d461e
Compare
That was merged and released upstream. This is ready for review. |
Hi @jdm are you still maintaining this crate? |
This seems like a reasonable path forwards. Thanks! |
📌 Commit 68d461e has been approved by |
switch to yeslogic-fontconfig-sys instead of servo-fontconfig servo-fontconfig statically links a vendored fontconfig library if fontconfig is not found by pkgconfig. Using a vendored fontconfig library instead of the system fontconfig library doesn't actually work well though: slint-ui/slint#88 Building a vendored copy of fontconfig is also problematic because fontconfig has a lot of C dependencies, which makes it difficult to cross compile the vendored copy of fontconfig: ``` $ pkg-config fontconfig --static --libs -lfontconfig -lfreetype -lz -lbz2 -lpng16 -lm -lm -lz -lharfbuzz -lm -lglib-2.0 -lm -lpcre -lsysprof-capture-4 -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lxml2 -lz -llzma -lm ``` Instead of using a vendored copy, with yeslogic/fontconfig-rs#12 yeslogic-fontconfig-sys will have a Cargo feature to dlopen fontconfig at runtime instead of linking it at build time. This is exposed in font-kit with the new source-fontconfig-dlopen feature, which is disabled by default. This feature makes it considerably easier to cross compile by avoiding the need to cross compile fontconfig and all its dependencies.
💔 Test failed - checks-github |
Can you run |
instead of servo-fontconfig servo-fontconfig statically links a vendored fontconfig library if fontconfig is not found by pkgconfig. Using a vendored fontconfig library instead of the system fontconfig library doesn't actually work well though: slint-ui/slint#88 Building a vendored copy of fontconfig is also problematic because fontconfig has a lot of C dependencies, which makes it difficult to cross compile the vendored copy of fontconfig: $ pkg-config fontconfig --static --libs -lfontconfig -lfreetype -lz -lbz2 -lpng16 -lm -lm -lz -lharfbuzz -lm -lglib-2.0 -lm -lpcre -lsysprof-capture-4 -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lxml2 -lz -llzma -lm Instead of using a vendored copy, with yeslogic/fontconfig-rs#12 yeslogic-fontconfig-sys will have a Cargo feature to dlopen fontconfig at runtime instead of linking it at build time. This is exposed in font-kit with the new source-fontconfig-dlopen feature, which is disabled by default. The feature can be enabled by setting the RUST_FONTCONFIG_DLOPEN environment variable to avoid needing to propagate the Cargo feature all the way through downstream Cargo.toml's. This feature makes it considerably easier to cross compile by avoiding the need to cross compile fontconfig and all its dependencies.
Okay, I ran |
@bors-servo r+ |
📌 Commit 4130e14 has been approved by |
☀️ Test successful - checks-github |
Thanks for merging. Could you publish a new release of the crate? |
Done. |
servo-fontconfig statically links a vendored fontconfig library if fontconfig is not found by pkgconfig. Using a vendored fontconfig
library instead of the system fontconfig library doesn't actually work well though:
slint-ui/slint#88
Building a vendored copy of fontconfig is also problematic because fontconfig has a lot of C dependencies, which makes it difficult to cross compile the vendored copy of fontconfig:
Instead of using a vendored copy, with
yeslogic/fontconfig-rs#12
yeslogic-fontconfig-sys will have a Cargo feature to dlopen fontconfig at runtime instead of linking it at build time. This is exposed in font-kit with the new source-fontconfig-dlopen feature, which is disabled by default. This feature makes it considerably easier to cross compile by avoiding the need to cross compile fontconfig and all its dependencies.