core-foundation-rs
core-foundation-rs copied to clipboard
gate the build with target_os = "macos"
so that we don't get build errors on linux.
Ref: https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/core-graphics-types/debian/patches/cnf-macos.patch
Why is core-graphics-types being compiled on Linux?
This is due to the peculiarities of how the Debian resolution of source packaged work, I'll try to explain why I packaged it.
Problem statement
I would like to package the font-kit package, and that depends on core-graphics that depend on core-graphics-types.
A deeper look into why
Each rust crates becomes one source package in Debian, so that the copyright + license information can be reviewed, and in according to the Debian policy of not vendoring dependencies.
Each dependency from Cargo.toml becomes one item in the Debian depends
specification, you can see an (unrelated) example here: https://linux-packages.com/debian/package/librust-addr2line-dev
Since the depends
resolution happens before cargo starts building the source code, the #[cnf] gating in Cargo.toml in font-kit isn't availible.
Then the option becomes to either patch the font-kit package to remove all unneeded dependencies, or to package those into their own debian packages.
I prefer to reduce the amount of debian specific patches if that is possible, so I packaged core-graphics-types, that turned out to still require a patch, since the code didn't even build on linux, but I thought I could at least provide that patch upstream.
Sorry for the wall of text, but I hope that this explains the background of the patch.
Does every foundational crate used by a cross-platform rust library require patches like this?
I think many build cross platform without trouble as it is today, we also package windows api crates for example: https://packages.debian.org/sid/librust-winapi-dev
I don't know if all of them have gotten patches from some debian package maintainer at some point in time or not :)
:umbrella: The latest upstream changes (presumably b009c87f2da0038bb474800cd88597843e5dbdae) made this pull request unmergeable. Please resolve the merge conflicts.