iCepa / Tor.framework

Tor framework for the iCepa project
Other
249 stars 55 forks source link

Mac Catalyst xcframework #55

Closed chrisballinger closed 2 years ago

chrisballinger commented 4 years ago

In order to support Mac Catalyst you'll need to start producing an xcframework. I've already got it working for CPAProxy: https://github.com/ursachec/CPAProxy/blob/marzipan/scripts/build-cpaproxy-xcframework.sh

The main takeaways are that I first had to create an xcframework of the C static libraries libcpaproxy.xcframework, and then statically linked that into the main framework CPAProxy.xcframework.

If you want to also support Catalyst you need to build another architecture with flags -target x86_64-apple-ios-macabi -miphoneos-version-min=13.0.

tladesignz commented 4 years ago

Hm. Interesting. Happy to receive pull requests, but no resources available to spend time on this, currently.

Fonta1n3 commented 4 years ago

@tladesignz @chrisballinger Thanks to Blockchain Commons and Wolf Mcnally there is now a build script for xcframework, it is not polished but it works, you can check it out https://github.com/BlockchainCommons/iOS-TorFramework#installation

chrisballinger commented 4 years ago

@Fonta1n3 Nice! Would you be interested in submitting a pull request upstream?

Fonta1n3 commented 4 years ago

@Fonta1n3 Nice! Would you be interested in submitting a pull request upstream?

It is not mine... I asked the author if he would do that but he said "it's not ready".

tladesignz commented 4 years ago

@BlockchainCommons, happy to upstream, when you feel it's ready!

Fonta1n3 commented 4 years ago

One major limitation with this build script is it statically builds what is on master (outdated Tor), it does not allow for updates... Do you guys have any idea how to allow it to build the latest versions of Tor? I know you did not build it but your knowledge and C code is probably a lot better then mine.

tladesignz commented 4 years ago

One major limitation with this build script is it statically builds what is on master (outdated Tor), it does not allow for updates... Do you guys have any idea how to allow it to build the latest versions of Tor? I know you did not build it but your knowledge and C code is probably a lot better then mine.

No C knowledge needed. Just git pull in the Tor submodule. Might need to adapt the build script.

Fonta1n3 commented 4 years ago

Excellent, will try.

tladesignz commented 2 years ago

Since Carthage becomes quite outdated with Apple Silicon and their trick of bundling an x64 debug and an ARM release build in a fat binary which does not work there, I finally moved this thing completely over to CocoaPods:

https://github.com/iCepa/Tor.framework/tree/pure_pod

It's not great, since you have to slurp in the complete Tor and OpenSSL repos and have to have the complete build chain working on your dev device, but you're now way more flexible in terms of compilation targets.

I think this makes the whole Catalyst build obsolete?

If you think I'm wrong or have anything to add, feel free to reopen!