[dev] Re: [sacc][PATCH] Infer the (n)curses(w) library to use and -l

From: Spenser Truex <truex_AT_equwal.com>
Date: Wed, 17 Aug 2022 15:31:33 -0300

On 22/08/16 10:04AM, Quentin Rameau wrote:
> Hi Spenser,
> > Useful since curses cocks up any portability here. We prioritise the
> > user's entries in CURSESLIB where possible, and use LIBS when pkg-config
> > cannot be used.
> Indeed, dealing with *ncurses* is a mess.
> Ideally, we would only link against terminfo,
> because that's what sacc needs, not curses,
> but sadly this is implemented in most system
> through ncurses.
> > An opinioned change (maybe the user should just figure this stuff out
> > himself or curses should be fixed).
> As a result, there is no good simple way to deal with that,
> and I prefer letting the user dealing with their system,
> because they should know better
> (with the potential help of documentation)
> how it is setup.

The goal of this patch is to just "be helpful" rather than silently not
building with some opaque messages about ld.

> Regarding the patch itself, besides the actual target idea,
> I prefer to keep the Makefile POSIX-compatible
> and you're introducing GNU make style operators.

POSIX make doesn't appear to have $(shell) which is the main thing used
here. Instead the commands could be run inside a recipe somehow.

(posix make documentation): https://pubs.opengroup.org/onlinepubs/9699919799/

> I'm not motivated to change the way we link against terminfo,
> at least not that way,
> but maybe we could introduce a comment there
> explaining that ncurses is a mess, but that already sounds like
> something most people would already know???

For a comment, mentioning pkg-config --libs would be sufficient.

> In any case, thanks for your patch Spenser,
> and I hope you'll still find sacc useful,
> cheers!
> P.S.: sacc isn't really a suckless.org project, although I suppose
> people will not mind too much having it discussed there.

I'm satisfied with adding a comment as a solution and will submit a
patch. Then I will remember what to do the next time I compile sacc in
a couple of years.

CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
Spenser Truex        https://equwal.com

Received on Wed Aug 17 2022 - 20:31:33 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 17 2022 - 20:36:08 CEST