Skip to content

Linking against private frameworks? #501

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

Closed
NyaomiDEV opened this issue Sep 4, 2023 · 4 comments
Closed

Linking against private frameworks? #501

NyaomiDEV opened this issue Sep 4, 2023 · 4 comments
Labels
A-framework Affects the framework crates and the translator for them question Further information is requested

Comments

@NyaomiDEV
Copy link

I wonder if it is inside the scope of this project to be able to link against private frameworks (specifically MediaRemote) and to use them in a mostly-type-safe way.

@madsmtm madsmtm added the question Further information is requested label Sep 4, 2023
@silvanshade
Copy link
Contributor

There has been a little discussion around being able to use the header-translator (the tool icrate uses to generate the Rust definitions from the Apple frameworks) for other frameworks. For example, see item 2 at #429.

So far there hasn't been a lot of work toward making this practical though. In principle, I believe it should be possible now, but it would require some modification to the icrate configuration and potentially to some parts of header-translator.

The situation should improve in the next few months hopefully, once there has been more progress made toward the new dependency scanning backend.

@madsmtm
Copy link
Owner

madsmtm commented Sep 4, 2023

At some point after #345 we'll probably figure out a good way for translating headers not provided via. Xcode, then you should be able to just run header-translator (or whatever it'll end up being named) on your header and get a Rust library that targets that.

@madsmtm
Copy link
Owner

madsmtm commented Sep 4, 2023

Oops, @silvanshade beat me to it, but agree with everything they said

@madsmtm madsmtm added this to the Rewrite header translator milestone Sep 11, 2023
@madsmtm madsmtm added the A-framework Affects the framework crates and the translator for them label May 24, 2024
@madsmtm madsmtm removed this from the Rewrite header translator milestone Apr 9, 2025
@madsmtm
Copy link
Owner

madsmtm commented Apr 9, 2025

My current plan is to work on improving bindgen's Objective-C support, see #729. Once that is done, you'd be able to use bindgen to map the private framework. So I'll close this issue in favour of that one.

It might be possible to do it today using header-translator, but I don't really want to support such use-cases.

Another option in the meantime would be to manually author the bindings you need using the extern_class!, extern_methods! and extern_protocol! macros that objc2 provides.

@madsmtm madsmtm closed this as completed Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants