Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 806372 - net-libs/tdlib - new package
Summary: net-libs/tdlib - new package
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-04 09:46 UTC by akater
Modified: 2021-08-07 12:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Add net-libs/tdlib (file_806372.txt,5.47 KB, patch)
2021-08-04 09:48 UTC, akater
Details | Diff
Add net-libs/tdlib (file_806372.txt,6.83 KB, patch)
2021-08-05 11:49 UTC, akater
Details | Diff
Add net-libs/tdlib (file_806372.txt,6.11 KB, patch)
2021-08-07 12:53 UTC, akater
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description akater 2021-08-04 09:46:12 UTC
TDLib is a cross-platform library for building Telegram clients.

(Re)building telegram-desktop is not appealing.  TDLib allows for more lightweight Telegram clients.  One example of such is tdlib-purple for Pidgin; I myself never used it but I'm sure it would be interesting to some users.  Another example is Telega for GNU Emacs which is a very featureful and actively developed client and is the best messaging application I personally ever used; I intend to submit its ebuild after tdlib is merged.


Reproducible: Always




There are some issues with the ebuild that I can't resolve on my own.  However, I tested it with several USE flag combinations, on several profiles, namely hardened musl, hardened default.  I've been using TDLib-based client on those devices for several years now almost every day; it works fine.  Were it not for issues that need to be resolved, I'd say this ebuild shouldn't be keyworded on amd64.  Build process only seems to improve with newer versions so far.

Good news:

- lto, low-ram and doc work (meaning, ebuild install is finished) in most, if not any combination, with gcc

Not-so-good news:

- I did not test with clang as I don't use it and Gentoo Wiki suggests this toolchain requires self-bootstrapping and some manual configuration; I don't have time for this now.  However, upstream actually recommends clang over gcc so I expect it to just work if you have it set up.  Test runs are welcome.

- Even though doc does build and install, I'm not qualified to check if it's being built correctly.  I'm not familiar with doxygen.

- Right now, java use flag doesn't seem to do much; I'm not using Java and I'm not going to delve deeper into this; I don't know what Gentoo policy has to say about it but I think it's better to keep the flag to hopefully attract more attention from potential contributors.  Broken USE flags are abundant; i don't think having another one will make Gentoo worse (if it's broken at all).  Also, some comments will be lost if the flag is removed, and contributors would have to do more unnecessary work.  See also the next point.

- Upstream offers an interactive build instructions generator which lists some options probably worthy of support, including java and javascript https://tdlib.github.io/td/build.html Instructions are extensive; looks like it would be easy for users dealing with those systems to add support for them.  Check it out if you do.

- There may be a more preferrable treatment of sqlite-related bits; see `pg_overlay` for somewhat extensive `src_prepare` work that seems to be sqlite-related.  I'm not qualified to deal with this.

Now, for straightforward issues which certainly need to be resolved.  Help on these is appreciated:

- `src_prepare` has a sed call borrowed from mva ebuild repository.  I'm not familiar with cmake and I don't know what that call is doing.  ebuild install succeeds both with it and without it.  I leave it for evaluation by those more experienced with cmake.

- USE=cli only affects dobin `tg_cli`, and I get a baffling error with it 
> /usr/bin/install: cannot change ownership of > '/var/tmp/portage/net-libs/tdlib-1.7.0/image/usr/bin/tg_cli': Operation not permitted

- A year or two ago I had multilib issues; now they are gone (chost = ctarget is entierly the same it was then) but I still mention it just in case.  I don't understand anything about handling multilib issues.

- Tests segfault (!) for me on both hardened default and hardened musl.  There's a tests-related snippet in `src_prepare` borrowed from `pg_overlay`.  pg's ebuild also has lots of other stuff in `src_prepare`; maybe the snippet I copied is useless without it.  However, it's also easily possible the issue is with my profiles being hardened so I'm not investigating further on my own.  Tests fail for me whether I include the snippet or not.

- I'm not sure what entity should be listed as a maintanier in `metadata.xml`.


P.S. This submission wouldn't happen if not for work by mva, pg_overlay and other ebuild repositories' maintainers whose approaches I studied.  All errors in the resulting ebuild are probably mine.
Comment 1 akater 2021-08-04 09:48:30 UTC
Created attachment 730082 [details, diff]
Add net-libs/tdlib

I'm aware of Signed-Off and repoman.  This is not a final submission anyway as there are issues.
Comment 2 akater 2021-08-05 11:49:54 UTC
Created attachment 730272 [details, diff]
Add net-libs/tdlib

The permission error I mentioned only happens during ebuild install but not during emerge.  So this is not an issue.

However, there was a QA notice on insecure RUNPATHs in `tg_cli`.  I provided a patch that seems to fix i but I don't really understand what is going on.

Outstanding issues:

- `src_prepare` has a sed call borrowed from mva ebuild repository, its purpose unclear.  I don't feel like asking mva himself right now; maybe a week or two later.

- Tests segfault.

- Maintanier contacts in `metadata.xml`.

- Ensure there are no multilib issues (unlikely but still).
Comment 3 akater 2021-08-07 12:53:42 UTC
Created attachment 731068 [details, diff]
Add net-libs/tdlib

Light improvements, make repoman happy.