SchildiChat / schildichat-android-next

Matrix client / Element X fork
https://schildi.chat/android/next/
GNU Affero General Public License v3.0
68 stars 6 forks source link

Publish on F-Droid (main repository) #18

Open austinhuang0131 opened 3 months ago

austinhuang0131 commented 3 months ago

Since Element X is now there, though I'm not sure whether you forking components constitute a blocker.

SpiritCroc commented 3 months ago

Indeed, the main reason why I haven't PRed SchildiNext to fdroid yet are our forks of the Rust libraries (matrix sdk and rich-text-editor), irrespective of whether EleX is on fdroid or not.

In more detail, I haven't had enough motivation to publish these libraries to sonatype/mavencentral since I don't have experience with this yet and it seems like a lot of paperwork. Sonatype seems the best library hosting solution though, considering jitpack doesn't support building Rust libraries afaik.

Currently, I host these libraries on GitHub packages. Unfortunately GitHub requires you to use an API key to retrieve packages, even for public repositories. By now github is apparently no longer interested in opening this up. Now, when it comes to the fdroid main repository, requiring any secrets not available in the public repo for building is a no-go. (Also if we'd hard-code some github API keys in the repo for some throwaway account, github will immediately detect and block, so that won't work either xD).

So I probably need to get through the sonatype application process at some point.

linsui commented 2 months ago

Can't we build those libs? :)

SpiritCroc commented 2 months ago

@linsui I don't know about what means the fdroid tools provide for building these libs, but it's totally possible to build these dependencies locally!

Of course one needs to have a working Rust compiler set up in addition to the common Android build tools, and maybe some more dependencies, I'd need to check the respective READMEs again.

I'm just realizing that picking up the correct revision for the rust-sdk is a bit trickier than just following a single git tag, since the upstream build scripts that I adopted only add a git tag to the rust-components but not the SDK. How I've been doing it when merging upstream releases is fetching it from github releases, which would also work for SchildiChat:

> rust_ver=0.2.22
> curl https://github.com/SchildiChat/matrix-rust-components-kotlin/releases/tag/sc-sdk-v"$rust_ver" | grep ">https://github.com/SchildiChat/matrix-rust-sdk/tree/" | sed "s|.*https://github.com/SchildiChat/matrix-rust-sdk/tree/\\(.*\\)</a>.*|\\1|g"
9be4a0ed8531a37555bdd1d014b7a38015ae9fb6

I assume I could also teach the upstream build scripts to just also add a git tag to the SDK repo itself, but for merge conflicts it's always good to limit the changes I do.

BTW, on my desktop with decent hardware (AMD 5950X) building a release build of the Rust SDK for all architectures takes around 45 Minutes, so whatever runs the fdroid builds would need for allow such build times :)

linsui commented 2 months ago

We can do that, no problem. :)