Bug 276318 - audio/cmus: no colors in terminal
Summary: audio/cmus: no colors in terminal
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Nuno Teixeira
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-14 14:48 UTC by Ivan
Modified: 2024-01-17 17:22 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (eduardo)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2024-01-14 14:48:16 UTC
Hi there!

Here is the bug description:
https://forums.freebsd.org/threads/cmus-no-colors-in-xfce-freebsd-14rc4.90911/

I found out that there is a problem in file ui_curses.c:2295

	if (has_colors()) {
#if HAVE_USE_DEFAULT_COLORS
		start_color();
		use_default_colors();
#endif
	}

It doesn't execute start_color() because of the lack of HAVE_USE_DEFAULT_COLORS define.

So, to fix this the port must define HAVE_USE_DEFAULT_COLORS

Please update the port
Comment 1 Ivan 2024-01-14 14:55:40 UTC
It also should define HAVE_RESIZETERM in config/curses.h
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2024-01-14 20:23:07 UTC
(In reply to Ivan from comment #1)
Hello,
Have you tested patch the port? Could you uploaded here?
Comment 3 Ivan 2024-01-15 04:04:12 UTC
Tested. The app works great with the changes.

I have no patch at the moment. I just edited config/curses.h between configure and build stage

And I guess this change should be some another file. It's an configure issue
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2024-01-15 07:52:50 UTC
(In reply to Ivan from comment #3)

I'm looking at log:
...
checking for NCURSES_LIBS (pkg-config)... -fstack-protector-strong -lncursesw -ltinfow
checking for NCURSES_CFLAGS (pkg-config)...
checking for working ncurses setup... yes
checking for function resizeterm... no
checking for function use_default_colors... no
...

This checks are from configure:
...
check_function "resizeterm" $NCURSES_CFLAGS $NCURSES_LIBS
        HAVE_RESIZETERM=`test $? -ne 0 ; echo $?`

        check_function "use_default_colors" $NCURSES_CFLAGS $NCURSES_LIBS
        HAVE_USE_DEFAULT_COLORS=`test $? -ne 0 ; echo $?
...

We need to know why this functions return a "negative" value.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-01-15 08:24:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4430a994eea5d6b2ed84c940963788069d6fd1d6

commit 4430a994eea5d6b2ed84c940963788069d6fd1d6
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2024-01-15 08:17:46 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-01-15 08:23:59 +0000

    audio/cmus: Fix absence of colors in terminal

    Apply uptream patch to fix function detection. check_function failed to
    compile due to clang -Wint-conversion warning became error.

    See also: https://github.com/cmus/cmus/pull/1269

    PR:             276318
    Reported by:    Ivan <ivan@drm.su>

 audio/cmus/Makefile | 3 ++-
 audio/cmus/distinfo | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2024-01-15 08:35:23 UTC
(In reply to Ivan from comment #3)

Fixed. Could you give a try with port revision 8 after updating git tree?
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2024-01-17 17:22:25 UTC
Committed, thanks!