View | Details | Raw Unified | Return to bug 276228 | Differences between
and this patch

Collapse All | Expand All

(-)b/audio/cava/Makefile (-25 / +38 lines)
Lines 1-11 Link Here
1
PORTNAME=	cava
1
PORTNAME=	cava
2
DISTVERSION=	0.7.4
2
DISTVERSION=	0.10.0
3
PORTREVISION=	2
4
CATEGORIES=	audio
3
CATEGORIES=	audio
5
4
6
MAINTAINER=	vendion@gmail.com
5
MAINTAINER=	vendion@gmail.com
7
COMMENT=	Console-based Audio Visualizer for MPD, PulseAudio, and sndio
6
COMMENT=	Cross-platform Audio Visualizer
8
WWW=		https://karlstav.github.io/cava
7
WWW=		https://github.com/karlstav/cava
9
8
10
LICENSE=	MIT
9
LICENSE=	MIT
11
LICENSE_FILE=	${WRKSRC}/LICENSE
10
LICENSE_FILE=	${WRKSRC}/LICENSE
Lines 13-53 LICENSE_FILE= ${WRKSRC}/LICENSE Link Here
13
LIB_DEPENDS=	libfftw3.so:math/fftw3 \
12
LIB_DEPENDS=	libfftw3.so:math/fftw3 \
14
		libiniparser.so:devel/iniparser
13
		libiniparser.so:devel/iniparser
15
14
16
USES=		autoreconf compiler:c11 libtool localbase ncurses
15
USES=		autoreconf compiler:c11 libtool localbase pkgconfig
17
USE_GITHUB=	yes
16
USE_GITHUB=	yes
18
GH_ACCOUNT=	karlstav
17
GH_ACCOUNT=	karlstav
19
18
20
GNU_CONFIGURE=	yes
19
GNU_CONFIGURE=	yes
21
CONFIGURE_ARGS=	--disable-input-alsa
20
CONFIGURE_ARGS=	--disable-input-alsa \
22
CONFIGURE_ENV=	ac_cv_lib_asound_snd_pcm_open=no \
21
		--disable-input-pipewire
23
		FONT_DIR=${DATADIR}
24
25
INSTALL_TARGET=	install-strip
26
22
27
PLIST_FILES=	bin/cava
23
PLIST_FILES=	bin/cava
28
PORTDOCS=	README.md
24
PORTDOCS=	README.md
29
PORTEXAMPLES=	config
25
PORTEXAMPLES=	config
30
26
31
OPTIONS_DEFINE=		DOCS EXAMPLES PORTAUDIO PULSEAUDIO SNDIO VT
27
OPTIONS_DEFINE=		DOCS EXAMPLES VT
32
OPTIONS_DEFAULT=	PULSEAUDIO SNDIO VT
28
OPTIONS_DEFAULT=	GLSL NCURSES OSS PORTAUDIO PULSEAUDIO SDL SNDIO VT
33
.if !exists(/usr/bin/vtfontcvt)
29
34
OPTIONS_EXCLUDE=	VT
30
OPTIONS_GROUP=		INPUT OUTPUT
35
.endif
31
OPTIONS_GROUP_INPUT=	OSS PORTAUDIO PULSEAUDIO SNDIO
32
OPTIONS_GROUP_OUTPUT=	GLSL NCURSES SDL
33
34
GLSL_DESC=		Build with GLSL support (implies ${GLSL_IMPLIES})
35
GLSL_BUILD_DEPENDS=	${LOCALBASE}/share/aclocal/ax_check_gl.m4:devel/autoconf-archive
36
GLSL_USES=		gl
37
GLSL_USE=		gl=egl
38
GLSL_CONFIGURE_OFF=	--disable-output-sdl-glsl
39
GLSL_IMPLIES=		SDL
36
40
37
VT_DESC=	Build with vt(4) support (installs custom font)
41
NCURSES_DESC=		Build with ncurses support
42
NCURSES_USES=		ncurses
43
NCURSES_CONFIGURE_OFF=	--disable-output-ncurses
38
44
45
OSS_DESC=		Build with OSS support
46
OSS_CONFIGURE_OFF=	--disable-input-oss
47
48
PORTAUDIO_DESC=			Build with portaudio support
39
PORTAUDIO_LIB_DEPENDS=		libportaudio.so:audio/portaudio
49
PORTAUDIO_LIB_DEPENDS=		libportaudio.so:audio/portaudio
40
PORTAUDIO_CONFIGURE_OFF=	--disable-input-portaudio
50
PORTAUDIO_CONFIGURE_OFF=	--disable-input-portaudio
41
51
52
PULSEAUDIO_DESC=		Build with pulseaudio support
42
PULSEAUDIO_LIB_DEPENDS=		libpulse-simple.so:audio/pulseaudio \
53
PULSEAUDIO_LIB_DEPENDS=		libpulse-simple.so:audio/pulseaudio \
43
				libpulse.so:audio/pulseaudio
54
				libpulse.so:audio/pulseaudio
44
PULSEAUDIO_CONFIGURE_OFF=	--disable-input-pulse
55
PULSEAUDIO_CONFIGURE_OFF=	--disable-input-pulse
45
56
57
SDL_DESC=		Build with SDL support
58
SDL_USES=		sdl
59
SDL_USE=		sdl=sdl2
60
SDL_CONFIGURE_OFF=	--disable-output-sdl
61
62
SNDIO_DESC=		Build with sndio support
46
SNDIO_LIB_DEPENDS=	libsndio.so:audio/sndio
63
SNDIO_LIB_DEPENDS=	libsndio.so:audio/sndio
47
SNDIO_CONFIGURE_OFF=	--disable-input-sndio
64
SNDIO_CONFIGURE_OFF=	--disable-input-sndio
48
65
66
VT_DESC=		Build and install custom font for vt(4)
49
VT_BUILD_DEPENDS=	psf2bdf:x11-fonts/psftools
67
VT_BUILD_DEPENDS=	psf2bdf:x11-fonts/psftools
50
VT_MAKE_ARGS_OFF=	cava_font__DATA=""
68
VT_CONFIGURE_OFF=	--disable-cava-font
51
VT_PLIST_FILES=		${DATADIR}/cava.fnt
69
VT_PLIST_FILES=		${DATADIR}/cava.fnt
52
70
53
.include <bsd.port.pre.mk>
71
.include <bsd.port.pre.mk>
Lines 57-75 CFLAGS+= -Wno-error=deprecated-non-prototype Link Here
57
.endif
75
.endif
58
76
59
pre-configure:
77
pre-configure:
60
	@${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version
78
	${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version
61
62
pre-build-VT-on:
63
	psf2bdf --fontname="-gnu-cava-medium-r-normal--16-160-75-75-c-80-iso10646-1" \
64
		${WRKSRC}/cava.psf > ${WRKSRC}/cava.bdf
65
	vtfontcvt ${WRKSRC}/cava.bdf ${WRKSRC}/cava.fnt
66
79
67
post-install-DOCS-on:
80
post-install-DOCS-on:
68
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
81
	${MKDIR} ${STAGEDIR}${DOCSDIR}
69
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
82
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
70
83
71
post-install-EXAMPLES-on:
84
post-install-EXAMPLES-on:
72
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
85
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
73
	${INSTALL_DATA} ${WRKSRC}/example_files/config ${STAGEDIR}${EXAMPLESDIR}
86
	${INSTALL_DATA} ${WRKSRC}/example_files/config ${STAGEDIR}${EXAMPLESDIR}
74
87
75
.include <bsd.port.post.mk>
88
.include <bsd.port.post.mk>
(-)b/audio/cava/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1627884520
1
TIMESTAMP = 1704828328
2
SHA256 (karlstav-cava-0.7.4_GH0.tar.gz) = fefd3cc04d41b03ca416630cafadbfda6c75e2ca0869da1f03963dcb13e1ecb7
2
SHA256 (karlstav-cava-0.10.0_GH0.tar.gz) = 1e40c93cb476ada538c131cb68ab1b56ce214d75b834508cbe76a57ae1ea153f
3
SIZE (karlstav-cava-0.7.4_GH0.tar.gz) = 101847
3
SIZE (karlstav-cava-0.10.0_GH0.tar.gz) = 124085
(-)a/audio/cava/files/patch-Makefile.am (-22 lines)
Removed Link Here
1
- Remove some flags that gcc 4.2 (on tier 2 archs like powerpc)
2
  does not recognize
3
- Do not install the Linux-only font
4
5
--- Makefile.am.orig	2021-05-18 18:13:38 UTC
6
+++ Makefile.am
7
@@ -22,7 +22,7 @@ if OSX
8
 else
9
     cava_LDFLAGS += -lrt
10
     cava_font_dir = @FONT_DIR@
11
-    cava_font__DATA = cava.psf
12
+    cava_font__DATA = cava.fnt
13
 endif
14
 
15
 if ALSA
16
@@ -52,5 +52,6 @@ if !SYSTEM_LIBINIPARSER
17
     cava_LDADD += -Liniparser/.libs
18
     cava_CPPFLAGS += -Iiniparser/src
19
 endif
20
+
21
 
22
 
(-)a/audio/cava/files/patch-cava.c (-96 lines)
Removed Link Here
1
--- cava.c.orig	2021-05-18 18:13:38 UTC
2
+++ cava.c
3
@@ -36,13 +36,11 @@
4
 #include "util.h"
5
 
6
 #ifdef NCURSES
7
-#include "output/terminal_bcircle.h"
8
 #include "output/terminal_ncurses.h"
9
 #include <curses.h>
10
 #endif
11
 
12
 #include "output/raw.h"
13
-#include "output/terminal_noncurses.h"
14
 
15
 #include "input/alsa.h"
16
 #include "input/common.h"
17
@@ -92,8 +90,6 @@ void cleanup(void) {
18
 #else
19
         ;
20
 #endif
21
-    } else if (output_mode == OUTPUT_NONCURSES) {
22
-        cleanup_terminal_noncurses();
23
     }
24
 }
25
 
26
@@ -260,10 +256,10 @@ as of 0.4.0 all options are specified in config file, 
27
             if (inAtty) {
28
                 // checking if cava psf font is installed in FONTDIR
29
                 FILE *font_file;
30
-                font_file = fopen(FONTDIR "/cava.psf", "r");
31
+                font_file = fopen(FONTDIR "/cava.fnt", "r");
32
                 if (font_file) {
33
                     fclose(font_file);
34
-                    system("setfont " FONTDIR "/cava.psf  >/dev/null 2>&1");
35
+		     system("/usr/sbin/vidcontrol -f " FONTDIR "/cava.fnt > /dev/null 2>&1");
36
                 } else {
37
                     // if not it might still be available, we dont know, must try
38
                     system("setfont cava.psf  >/dev/null 2>&1");
39
@@ -532,16 +528,6 @@ as of 0.4.0 all options are specified in config file, 
40
                 height = lines * 8;
41
                 break;
42
 #endif
43
-            case OUTPUT_NONCURSES:
44
-                get_terminal_dim_noncurses(&width, &lines);
45
-
46
-                if (p.xaxis != NONE)
47
-                    lines--;
48
-
49
-                init_terminal_noncurses(inAtty, p.col, p.bgcol, width, lines, p.bar_width);
50
-                height = lines * 8;
51
-                break;
52
-
53
             case OUTPUT_RAW:
54
                 if (strcmp(p.raw_target, "/dev/stdout") != 0) {
55
                     int fptest;
56
@@ -787,11 +773,6 @@ as of 0.4.0 all options are specified in config file, 
57
             if (p.xaxis != NONE) {
58
                 x_axis_info = 1;
59
                 double center_frequency;
60
-                if (output_mode == OUTPUT_NONCURSES) {
61
-                    printf("\r\033[%dB", lines + 1);
62
-                    if (remainder)
63
-                        printf("\033[%dC", remainder);
64
-                }
65
                 for (int n = 0; n < number_of_bars; n++) {
66
                     if (p.stereo) {
67
                         if (n < number_of_bars / 2)
68
@@ -817,16 +798,6 @@ as of 0.4.0 all options are specified in config file, 
69
                             mvprintw(lines, n * (p.bar_width + p.bar_spacing) + remainder, "%.1f",
70
                                      freq_kilohz);
71
 #endif
72
-                    } else if (output_mode == OUTPUT_NONCURSES) {
73
-                        if (center_frequency < 1000)
74
-                            printf("%-4d", freq_floor);
75
-                        else if (center_frequency > 1000 && center_frequency < 10000)
76
-                            printf("%.2f", freq_kilohz);
77
-                        else
78
-                            printf("%.1f", freq_kilohz);
79
-
80
-                        if (n < number_of_bars - 1)
81
-                            printf("\033[%dC", p.bar_width + p.bar_spacing - 4);
82
                     }
83
                 }
84
                 printf("\r\033[%dA", lines + 1);
85
@@ -1142,11 +1113,6 @@ as of 0.4.0 all options are specified in config file, 
86
                                                p.gradient, x_axis_info);
87
                     break;
88
 #endif
89
-                case OUTPUT_NONCURSES:
90
-                    rc = draw_terminal_noncurses(inAtty, lines, width, number_of_bars, p.bar_width,
91
-                                                 p.bar_spacing, remainder, bars, previous_frame,
92
-                                                 x_axis_info);
93
-                    break;
94
                 case OUTPUT_RAW:
95
                     rc = print_raw_out(number_of_bars, fp, p.is_bin, p.bit_format, p.ascii_range,
96
                                        p.bar_delim, p.frame_delim, bars);
(-)a/audio/cava/files/patch-config.c (-34 lines)
Removed Link Here
1
Remove noncurses output method which only produces a garbled mess
2
on terminals.
3
4
--- config.c.orig	2021-08-02 22:27:47 UTC
5
+++ config.c
6
@@ -181,10 +181,6 @@ bool validate_config(struct config_params *p, struct e
7
         return false;
8
 #endif
9
     }
10
-    if (strcmp(outputMethod, "noncurses") == 0) {
11
-        p->output = OUTPUT_NONCURSES;
12
-        p->bgcol = 0;
13
-    }
14
     if (strcmp(outputMethod, "raw") == 0) { // raw:
15
         p->output = OUTPUT_RAW;
16
         p->bar_spacing = 0;
17
@@ -220,7 +216,7 @@ bool validate_config(struct config_params *p, struct e
18
 #ifndef NCURSES
19
         write_errorf(
20
             error,
21
-            "output method %s is not supported, supported methods are: 'noncurses' and 'raw'\n",
22
+            "output method %s is not supported, supported methods are: 'raw'\n",
23
             outputMethod);
24
         return false;
25
 #endif
26
@@ -228,7 +224,7 @@ bool validate_config(struct config_params *p, struct e
27
 #ifdef NCURSES
28
         write_errorf(error,
29
                      "output method %s is not supported, supported methods are: 'ncurses', "
30
-                     "'noncurses' and 'raw'\n",
31
+                     "and 'raw'\n",
32
                      outputMethod);
33
         return false;
34
 #endif
(-)a/audio/cava/files/patch-configure.ac (-13 lines)
Removed Link Here
1
Neuter gratuitous OS check that is not used for anything at all.
2
3
--- configure.ac.orig	2020-05-26 20:29:47 UTC
4
+++ configure.ac
5
@@ -294,7 +294,7 @@ case "${host_os}" in
6
         build_mac=yes
7
         ;;
8
     *)
9
-        AC_MSG_ERROR(["OS $host_os is not supported"])
10
+        AC_MSG_NOTICE([I'm a teapot])
11
         ;;
12
 esac
13
 
(-)a/audio/cava/files/patch-example__files_config (-14 lines)
Removed Link Here
1
--- example_files/config.orig	2020-10-29 12:41:35 UTC
2
+++ example_files/config
3
@@ -73,10 +73,7 @@
4
 
5
 [output]
6
 
7
-# Output method. Can be 'ncurses', 'noncurses' or 'raw'.
8
-# 'noncurses' uses a custom framebuffer technique and draws only changes
9
-# from frame to frame. 'ncurses' is default if supported
10
-#
11
+# Output method. Can be 'ncurses' or 'raw'.
12
 # 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data
13
 # stream of the bar heights that can be used to send to other applications.
14
 # 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
(-)a/audio/cava/files/patch-input_sndio.c (-22 lines)
Removed Link Here
1
Stop using uninitialized variable after lazy refactoring upstream
2
3
--- input/sndio.c.orig	2020-10-29 12:44:33 UTC
4
+++ input/sndio.c
5
@@ -14,7 +14,7 @@ void *input_sndio(void *data) {
6
     par.bits = 16;
7
     par.le = 1;
8
     par.rate = 44100;
9
-    par.rchan = 2;
10
+    par.rchan = audio->channels;
11
     par.appbufsz = sizeof(buf) / par.rchan;
12
 
13
     if ((hdl = sio_open(audio->source, SIO_REC, 0)) == NULL) {
14
@@ -33,7 +33,7 @@ void *input_sndio(void *data) {
15
         exit(EXIT_FAILURE);
16
     }
17
 
18
-    uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / 2;
19
+    uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / audio->channels;
20
     while (audio->terminate != 1) {
21
         if (sio_read(hdl, buf, sizeof(buf)) == 0) {
22
             fprintf(stderr, __FILE__ ": sio_read() failed: %s\n", strerror(errno));
(-)a/audio/cava/files/patch-output_terminal__ncurses.c (-16 lines)
Removed Link Here
1
--- output/terminal_ncurses.c.orig	2020-10-29 12:36:59 UTC
2
+++ output/terminal_ncurses.c
3
@@ -267,9 +267,13 @@ int draw_terminal_ncurses(int is_tty, int terminal_hei
4
 // general: cleanup
5
 void cleanup_terminal_ncurses(void) {
6
     echo();
7
+#ifdef __FreeBSD__
8
+    system("/usr/sbin/vidcontrol -f >/dev/null 2>&1");
9
+#else
10
     system("setfont  >/dev/null 2>&1");
11
     system("setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz  >/dev/null 2>&1");
12
     system("setterm -blank 10  >/dev/null 2>&1");
13
+#endif
14
     /*for(int i = 0; i < gradient_size; ++i) {
15
             if(the_color_redefinitions[i].color) {
16
                     init_color(the_color_redefinitions[i].color,
(-)b/audio/cava/pkg-descr (-4 / +5 lines)
Lines 1-5 Link Here
1
C.A.V.A. is a bar spectrum audio visualizer for the terminal using
1
CAVA (Cross-platform Audio Visualizer) is a bar spectrum audio visualizer for
2
PulseAudio, sndio or fifo buffer for input.
2
the terminal (ncurses) or desktop (SDL). It also provides a GLSL shader output
3
backend which can enhance the desktop experience even more. The supported input
4
backends include OSS, sndio and fifo.
3
5
4
This program is not intended for scientific use.  It's written to look
6
This program is not intended for scientific use. It's written to look
5
responsive and aesthetic when used to visualize music.
7
responsive and aesthetic when used to visualize music.
6
- 

Return to bug 276228