FS#62761 - [lsd] Move any and all font dependencies of lsd to optional deps

Attached to Project: Community Packages
Opened by Andy (andydecleyre) - Tuesday, 28 May 2019, 06:01 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:00 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Orhun Parmaksız (orhun)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

The lsd package has a hard dependency on awesome-terminal-fonts, but other fonts can fulfill the need. On my system, I have much better icon support in lsd with ttf-nerd-fonts-symbols (as in the AUR) than with those provided by awesome-terminal-fonts.

awesome-terminal-fonts should be an optional dependency (after all, lsd has a 'unicode' theme as well). If other suitable font packages such as ttf-nerd-fonts-symbols make it into the community repository in the future, they can also be added as optional dependencies right along side.

Additional info:
* 0.14.0-1
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:00 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/lsd/issues/1
Comment by Eli Schwartz (eschwartz) - Tuesday, 28 May 2019, 06:20 GMT
On the other hand, the default output without the font is to emit characters without a font glyph and thus render broken output.
Comment by Andy (andydecleyre) - Tuesday, 28 May 2019, 16:31 GMT
@eschwartz

Well, that depends on the user's installed fonts, which may or may not come from the official repos, or third party repos, or the AUR, or non-repo sources. The AUR has >30 "nerd-fonts" packages available, and some folks also patch their chosen fonts manually.

And as far as I can tell, even using the currently required font dependencies, output is broken for at least these filetypes:

zip,
epub,
json,
txt,
conf,
js,
md,
sh,
css,
yml

That was using the following block in my user's fonts.conf:

<match target="pattern">
<test qual="any" name="family"><string>monospace</string></test>
<edit name="family" mode="assign" binding="same"><string>Iosevka Custom</string></edit>
<edit name="family" mode="append" binding="weak"><string>EmojiOne</string></edit>
<edit name="family" mode="append" binding="weak"><string>Pomodoro</string></edit>
<edit name="family" mode="append" binding="weak"><string>FontAwesome</string></edit>
<edit name="family" mode="append" binding="weak"><string>octicons</string></edit>
<edit name="family" mode="append" binding="weak"><string>icomoon</string></edit>
</match>

Whereas the following block results in a complete, non-broken output (as far as I can tell):

<match target="pattern">
<test qual="any" name="family"><string>monospace</string></test>
<edit name="family" mode="assign" binding="same"><string>Iosevka Custom</string></edit>
<edit name="family" mode="append" binding="weak"><string>EmojiOne</string></edit>
<edit name="family" mode="append" binding="weak"><string>Symbols Nerd Font</string></edit>
</match>

So as it is, I think we have broken output by default with or without that hard requirement on the system. Ideally a more complete font of icons will make it into the community repo, so it can be added as an optional dep.

EDIT: And if the user uses the 'unicode' theme for lsd, the number of fonts which satisfy the requirements goes way up.
Comment by Levente Polyak (anthraxx) - Tuesday, 28 May 2019, 21:48 GMT
its the best font in the repos right now that does its job to make lsd look like something.
what is the concern? its a couple of kilobytes to install. you are still free to install and use whatever font you like
Comment by Andy (andydecleyre) - Tuesday, 28 May 2019, 21:54 GMT
As I said, those particular fonts are only one of many ways to provide the icons, and provide a broken experience at best. If the maintainer of this pkgbuild wants to keep enforcing these broken requirements, it's their choice, and I will maintain a fork on the AUR.
Comment by Andy (andydecleyre) - Wednesday, 12 June 2019, 18:46 GMT
Alright, in the meantime I've added lsd-truedeps to the AUR with more honest and accurate dependencies.
Comment by Andy (andydecleyre) - Wednesday, 12 June 2019, 20:32 GMT
And it has already been forcibly removed. Does that mean someone has decided to correct the dependencies on this package, or that someone wants to ensure a package with accurate dependencies is not made available to users, even via the user repo?
Comment by Andy (andydecleyre) - Wednesday, 13 November 2019, 20:05 GMT
The only action taken on this issue was to remove the fixed version from AUR availability. Since it's been five months with no fix here, I'm resubmitting the fixed version. Please don't remove the fixed version until/unless this official package gets fixed. Optional dependencies are optional.
Comment by Eli Schwartz (eschwartz) - Wednesday, 13 November 2019, 20:20 GMT
Are you asking to get your account banned?
Comment by Andy (andydecleyre) - Thursday, 14 November 2019, 14:50 GMT
Not at all! I didn't intend to offend.
Comment by Eli Schwartz (eschwartz) - Thursday, 14 November 2019, 15:11 GMT
> And it has already been forcibly removed.

So you figured the solution was to re-upload it?

> Does that mean someone has decided to correct the dependencies on this package, or that someone wants to ensure a package with accurate dependencies is not made available to users, even via the user repo?

No, the two actions were totally unrelated. The AUR package you created was deleted as a duplicate of community/lsd on the grounds that "fixing" the dependencies is not sufficient rationale for creating a new package. Therefore, do not reupload it. Do not do so again.

On an unrelated note, you believe the dependencies for the repository package are incorrect. If that is true, then the repository package should be fixed. But so far, you have not convinced the maintainer that they are in fact incorrect, and even if they were, it is unclear why a 400KB package that you personally don't need, is problematic to have as an extraneous package (for the sake of making the package actually work out of the box).

Comment by Levente Polyak (anthraxx) - Thursday, 14 November 2019, 17:06 GMT
+1 on Eli. This is currently the only package providing a default glyph experience inside the repo (and thats ultimately what repo packages care about). Also if we take the idea of optdepends further, it would mean we would list 60 different fonts if all of them would be moved to the repos? frankly not. One way would be to have a glyph related meta provides name that appropriate glyph fonts could provide.
Currently from a repo perspective this seems to be just for the sake of not having a 400kb font, but i can tell you you have more than just a handful of dependencies included in other packages (as we tend to enable lot of features if available) that you will never even use. At the end, this is not gentoo. So Either at one point a good abstract comes up for meta provides of glyph fonts that fonts can adopt or you will need to either provide a local build on your disc that has one dependency less or switch to gentoo with use flags.
Comment by Andy (andydecleyre) - Friday, 15 November 2019, 00:29 GMT
> So you figured the solution was to re-upload it?

Five months ago, it was removed by force. No one asked me to remove it, no one volunteered an explanation, and no one offered one here in response to my request for one.

The information available to me was that this issue was marked as assigned, and kept open. So I figured the intent was to fix the bug. After waiting those five months, I figured no one cared to follow through, so I'd offer my solution to the community again until anyone did care to follow through. I didn't think it was a solution, just a temporary help while waiting for a solution.

> Therefore, do not reupload it. Do not do so again.

OK. Please note this is the very first time anyone has communicated to me about that package.

I apologize for offending everybody.
Comment by Sergey Kasmy (SleeplessSloth) - Friday, 06 March 2020, 00:05 GMT
The hard dependency on awesome-terminal-fonts is also a bit of a nuisance for headless systems, too, e.g. on my machine awesome-terminal-fonts pulls together with itself fontconfig and its friends, in my case:

extra/fontconfig
extra/freetype2
extra/graphite
extra/harfbuzz
extra/libpng

Since I'm using it exclusively through ssh, that's a bit unnecessary. pacman's --assume-installed helped me in that case but I believe that a soft dep would be better. Please reconsider.
Thanks!
Comment by Eli Schwartz (eschwartz) - Friday, 06 March 2020, 00:09 GMT
awesome-terminal-fonts shouldn't depend on fontconfig.
Comment by Sergey Kasmy (SleeplessSloth) - Friday, 06 March 2020, 00:11 GMT Comment by xduugu (xduugu) - Tuesday, 24 March 2020, 23:08 GMT
There is a nerd font package, ttf-nerd-fonts-symbols, in the community repository since last month[1]. Would it be an option to depend on this package instead of awesome-terminal-fonts? It seems to work fine and even includes more glyphs than the dated awesome-terminal-fonts package (no upstream activity since June 16, 2017).

[1] https://www.archlinux.org/packages/community/x86_64/ttf-nerd-fonts-symbols/
Comment by Eli Schwartz (eschwartz) - Wednesday, 25 March 2020, 20:43 GMT
Perhaps we could have both packages provide a virtual package which lsd would depend on. Suggestions for an appropriate virtual package name?

Note that the initial bug report indicated a user preference for exactly ttf-nerd-fonts-symbols, but other people concerned by the fontconfig dependency won't be able to satisfy that due to ttf-nerd-fonts-symbols also having the strange dependency on fontconfig.
Comment by xduugu (xduugu) - Thursday, 26 March 2020, 15:11 GMT
Okay, so we actually have three issues in this report:

1. The default font dependency awesome-terminal-fonts is outdated, upstream looks dead.

There were no updates to the awesome-terminal-fonts projects since almost three years and the font is missing symbols, for example for shell and perl scripts. On the other hand, there is now a package in the repositories, ttf-nerd-fonts-symbols, that provides these symbols and can actually completely replace the old awesome-terminal-fonts package. Replacing the font dependency would therefore improve the lsd output compared to the current situation.

It would be possible to use a virtual package instead, but I do not see the need since there is only one package in the repositories (after dropping awesome-terminal-fonts) that could provide it and I am not sure if all glphy fonts are compatible. I think lsd specifically needs font-awesome.

I would suggest to make lsd depend on ttf-nerd-fonts-symbols instead of awesome-terminal-fonts and the awesome-terminal-fonts package can be dropped as soon as the optional dependencies of the powerlevel packages were updated as well. Should I create a new report for this?

2. The font dependency should be optional, because lsd can be used without a glyph font on headless systems.

Since lsd does not fall back to the unicode icon theme if no glyph font is installed, making the font dependency optional would lead to a worse experience for the default user, probably leading to many reports of broken lsd output.

In my opinion, making the font dependency optional is not a good solution. Instead, the following issue should be fixed:

3. Several font packages depend on fontconfig which is not necessary anymore.

According to the font packaging guidelines, the dependency on fontconfig only exists for historic reasons:

https://wiki.archlinux.org/index.php/Font_packaging_guidelines#Dependencies

> Dependencies
>
> Fonts do not depend on anything. Many packages in the repositories, however,
> include fontconfig and xorg-mkfontscale as dependecies. Those were required
> when font packages needed to use install scripts to update the font cache – a
> lot of duplicate work now done by pacman hooks. If you install fontconfig or
> xorg-mkfontscale, all existing fonts in /usr/share/fonts/ will be cached making
> it unnecessary to force people to use fontconfig or mkfontscale.

So the obvious solution would be to create a TODO list to drop this dependency (and xorg-mkfontscale) from all font packages. As soon as this is implemented, it will be possible to install fonts (and also lsd) without the fontconfig dependency.
Comment by xduugu (xduugu) - Monday, 30 March 2020, 13:48 GMT
Point 3 was implemented for ttf-nerd-fonts-symbols[1] in  FS#66012 , awesome-terminal-fonts will probably follow soon. The fontconfig dependency issue raised in this report should not be an impediment anymore.

[1] https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/ttf-nerd-fonts-symbols&id=e24dd0e438b19758949db98718d010fdd178e015
Comment by Hugo Osvaldo Barrera (hobarrera) - Friday, 24 April 2020, 13:49 GMT
Installing lsd and awesome-terminal-fonts provides broken output for me.
Installing lsd without awesome-terminal-fonts provides broken output for me.

Only installing a nerd-patched font gives me unbroken output.

Installing awesome-terminal-fonts will only work if your terminal automatically falls back to other system fonts.
Many terminals ONLY use a single font: the one configured, and no other. Having a second font sitting there installed affects nothing.

OTOH, I've noticed that when installing awesome-terminal-fonts, other apps seems to break -- it would seem that this font has precedence over other fonts whenever fontconfig does its fallback magic. Uninstalling awesome-terminal-fonts fixed it for me.


In other words: `lsd` won't work necessarily work because of the presence of awesome-terminal-fonts, and may work without it.

Upstream is also pretty clear in the instructions: they require a patched font. So it seems that these results align with upstream's expectations.
Comment by Hugo Osvaldo Barrera (hobarrera) - Thursday, 19 August 2021, 10:24 GMT
`ttf-nerd-fonts-symbols-mono` and a few others are now in `[community]`.

Given that upstream recommends either font-awesome or nerd-fonts, can `optdepends` be changed set `nerd-fonts` and `awesome-terminal-fonts` to reflect this, and the latter be removed from `depends`?
Comment by Orhun Parmaksız (orhun) - Tuesday, 09 May 2023, 18:38 GMT
@hobarrera the patch has been applied in 0.23.1-2
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...