aboutsummaryrefslogtreecommitdiff
path: root/audio/cava
diff options
context:
space:
mode:
Diffstat (limited to 'audio/cava')
-rw-r--r--audio/cava/Makefile73
-rw-r--r--audio/cava/distinfo6
-rw-r--r--audio/cava/files/patch-Makefile.am24
-rw-r--r--audio/cava/files/patch-cava.c96
-rw-r--r--audio/cava/files/patch-config.c34
-rw-r--r--audio/cava/files/patch-configure.ac13
-rw-r--r--audio/cava/files/patch-example__files_config14
-rw-r--r--audio/cava/files/patch-input_sndio.c22
-rw-r--r--audio/cava/files/patch-output_terminal__ncurses.c16
-rw-r--r--audio/cava/files/pkg-message.in16
-rw-r--r--audio/cava/pkg-descr10
11 files changed, 71 insertions, 253 deletions
diff --git a/audio/cava/Makefile b/audio/cava/Makefile
index cbb1b292b7b7..ba533cdb17b0 100644
--- a/audio/cava/Makefile
+++ b/audio/cava/Makefile
@@ -1,9 +1,11 @@
PORTNAME= cava
-DISTVERSION= 0.7.3
+DISTVERSION= 0.10.1
+PORTREVISION= 1
CATEGORIES= audio
MAINTAINER= vendion@gmail.com
-COMMENT= Console-based Audio Visualizer for MPD, PulseAudio, and sndio
+COMMENT= Cross-platform Audio Visualizer
+WWW= https://github.com/karlstav/cava
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
@@ -11,57 +13,76 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libfftw3.so:math/fftw3 \
libiniparser.so:devel/iniparser
-USES= autoreconf compiler:c11 libtool localbase ncurses
+USES= autoreconf compiler:c11 libtool localbase pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= karlstav
GNU_CONFIGURE= yes
-CONFIGURE_ARGS= --disable-input-alsa
-CONFIGURE_ENV= ac_cv_lib_asound_snd_pcm_open=no \
- FONT_DIR=${DATADIR}
-
-INSTALL_TARGET= install-strip
+CONFIGURE_ARGS= --disable-input-alsa \
+ --disable-input-pipewire
PLIST_FILES= bin/cava
PORTDOCS= README.md
PORTEXAMPLES= config
+SUB_FILES= pkg-message
+
+OPTIONS_DEFINE= DOCS EXAMPLES VT
+OPTIONS_DEFAULT= GLSL JACK NCURSES OSS PORTAUDIO PULSEAUDIO SDL SNDIO VT
+
+OPTIONS_GROUP= INPUT OUTPUT
+OPTIONS_GROUP_INPUT= JACK OSS PORTAUDIO PULSEAUDIO SNDIO
+OPTIONS_GROUP_OUTPUT= GLSL NCURSES SDL
+
+GLSL_DESC= Build with GLSL support (implies ${GLSL_IMPLIES})
+GLSL_BUILD_DEPENDS= ${LOCALBASE}/share/aclocal/ax_check_gl.m4:devel/autoconf-archive
+GLSL_USES= gl
+GLSL_USE= gl=egl
+GLSL_CONFIGURE_ENABLE= output-sdl-glsl
+GLSL_IMPLIES= SDL
-OPTIONS_DEFINE= DOCS EXAMPLES PORTAUDIO PULSEAUDIO SNDIO VT
-OPTIONS_DEFAULT= PULSEAUDIO SNDIO VT
-.if !exists(/usr/bin/vtfontcvt)
-OPTIONS_EXCLUDE= VT
-.endif
+JACK_DESC= Build with JACK support
+JACK_LIB_DEPENDS= libjack.so:audio/jack
+JACK_CONFIGURE_ENABLE= input-jack
-VT_DESC= Build with vt(4) support (installs custom font)
+NCURSES_DESC= Build with ncurses support
+NCURSES_USES= ncurses
+NCURSES_CONFIGURE_ENABLE= output-ncurses
+OSS_DESC= Build with OSS support
+OSS_CONFIGURE_ENABLE= input-oss
+
+PORTAUDIO_DESC= Build with portaudio support
PORTAUDIO_LIB_DEPENDS= libportaudio.so:audio/portaudio
-PORTAUDIO_CONFIGURE_OFF= --disable-input-portaudio
+PORTAUDIO_CONFIGURE_ENABLE= input-portaudio
+PULSEAUDIO_DESC= Build with pulseaudio support
PULSEAUDIO_LIB_DEPENDS= libpulse-simple.so:audio/pulseaudio \
libpulse.so:audio/pulseaudio
-PULSEAUDIO_CONFIGURE_OFF= --disable-input-pulse
+PULSEAUDIO_CONFIGURE_ENABLE= input-pulse
+
+SDL_DESC= Build with SDL support
+SDL_USES= sdl
+SDL_USE= sdl=sdl2
+SDL_CONFIGURE_ENABLE= output-sdl
+SNDIO_DESC= Build with sndio support
SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio
-SNDIO_CONFIGURE_OFF= --disable-input-sndio
+SNDIO_CONFIGURE_ENABLE= input-sndio
+VT_DESC= Build and install custom font for vt(4)
VT_BUILD_DEPENDS= psf2bdf:x11-fonts/psftools
-VT_MAKE_ARGS_OFF= cava_font__DATA=""
+VT_CONFIGURE_ENABLE= cava-font
VT_PLIST_FILES= ${DATADIR}/cava.fnt
pre-configure:
- @${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version
-
-pre-build-VT-on:
- psf2bdf --fontname="-gnu-cava-medium-r-normal--16-160-75-75-c-80-iso10646-1" \
- ${WRKSRC}/cava.psf > ${WRKSRC}/cava.bdf
- vtfontcvt ${WRKSRC}/cava.bdf ${WRKSRC}/cava.fnt
+ ${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version
post-install-DOCS-on:
- @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
post-install-EXAMPLES-on:
- @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/example_files/config ${STAGEDIR}${EXAMPLESDIR}
.include <bsd.port.mk>
diff --git a/audio/cava/distinfo b/audio/cava/distinfo
index 4c90efb22b37..ef6d5bd01cc9 100644
--- a/audio/cava/distinfo
+++ b/audio/cava/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1603885847
-SHA256 (karlstav-cava-0.7.3_GH0.tar.gz) = 6363347ef4c74770767d9aa2fb5d65ad4c2aedf1d23bdaac50fc8e8e4e3c707e
-SIZE (karlstav-cava-0.7.3_GH0.tar.gz) = 101323
+TIMESTAMP = 1707006507
+SHA256 (karlstav-cava-0.10.1_GH0.tar.gz) = a3a60814326fa34b54e93ce0b1e66460d55f1007e576c5152fd47024d9ceaff9
+SIZE (karlstav-cava-0.10.1_GH0.tar.gz) = 129520
diff --git a/audio/cava/files/patch-Makefile.am b/audio/cava/files/patch-Makefile.am
deleted file mode 100644
index ee322757d48c..000000000000
--- a/audio/cava/files/patch-Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-- Remove some flags that gcc 4.2 (on tier 2 archs like powerpc)
- does not recognize
-- Do not install the Linux-only font
-
---- Makefile.am.orig 2020-10-07 16:30:24 UTC
-+++ Makefile.am
-@@ -13,7 +13,7 @@ cava_SOURCES = cava.c config.c input/common.c input/fi
- output/terminal_noncurses.c output/raw.c
- cava_LDFLAGS = -L/usr/local/lib -Wl,-rpath /usr/local/lib
- cava_CPPFLAGS = -DPACKAGE=\"$(PACKAGE)\" -DVERSION=\"$(VERSION)\" \
-- -D_POSIX_SOURCE -D _POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE_EXTENDED
-+ -D_POSIX_SOURCE -D _POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE_EXTENDED -DFONT_DIR=\"@FONT_DIR@\"
- cava_CFLAGS = -std=c99 -Wall -Werror -Wextra -Wno-unused-result -Wno-unknown-warning-option -Wno-maybe-uninitialized
-
- if OSX
-@@ -21,7 +21,7 @@ if OSX
- else
- cava_LDFLAGS += -lrt
- cava_font_dir = @FONT_DIR@
-- cava_font__DATA = cava.psf
-+ cava_font__DATA = cava.fnt
- endif
-
- if ALSA
diff --git a/audio/cava/files/patch-cava.c b/audio/cava/files/patch-cava.c
deleted file mode 100644
index e51adb46beb4..000000000000
--- a/audio/cava/files/patch-cava.c
+++ /dev/null
@@ -1,96 +0,0 @@
---- cava.c.orig 2020-10-07 16:30:24 UTC
-+++ cava.c
-@@ -36,13 +36,11 @@
- #include "util.h"
-
- #ifdef NCURSES
--#include "output/terminal_bcircle.h"
- #include "output/terminal_ncurses.h"
- #include <curses.h>
- #endif
-
- #include "output/raw.h"
--#include "output/terminal_noncurses.h"
-
- #include "input/alsa.h"
- #include "input/common.h"
-@@ -92,8 +90,6 @@ void cleanup(void) {
- #else
- ;
- #endif
-- } else if (output_mode == OUTPUT_NONCURSES) {
-- cleanup_terminal_noncurses();
- }
- }
-
-@@ -291,8 +287,12 @@ as of 0.4.0 all options are specified in config file,
- if (strncmp(ttyname(0), "/dev/ttys", 9) == 0)
- inAtty = 0;
- if (inAtty) {
-+#ifdef __FreeBSD__
-+ system("/usr/sbin/vidcontrol -f " FONT_DIR "/cava.fnt >/dev/null 2>&1");
-+#else
- system("setfont cava.psf >/dev/null 2>&1");
- system("setterm -blank 0");
-+#endif
- }
-
- // We use unicode block characters to draw the bars and
-@@ -540,16 +540,6 @@ as of 0.4.0 all options are specified in config file,
- height = lines * 8;
- break;
- #endif
-- case OUTPUT_NONCURSES:
-- get_terminal_dim_noncurses(&width, &lines);
--
-- if (p.xaxis != NONE)
-- lines--;
--
-- init_terminal_noncurses(inAtty, p.col, p.bgcol, width, lines, p.bar_width);
-- height = lines * 8;
-- break;
--
- case OUTPUT_RAW:
- if (strcmp(p.raw_target, "/dev/stdout") != 0) {
- // checking if file exists
-@@ -785,11 +775,6 @@ as of 0.4.0 all options are specified in config file,
- if (p.xaxis != NONE) {
- x_axis_info = 1;
- double center_frequency;
-- if (output_mode == OUTPUT_NONCURSES) {
-- printf("\r\033[%dB", lines + 1);
-- if (rest)
-- printf("\033[%dC", rest);
-- }
- for (n = 0; n < number_of_bars; n++) {
- if (p.stereo) {
- if (n < number_of_bars / 2)
-@@ -815,16 +800,6 @@ as of 0.4.0 all options are specified in config file,
- mvprintw(lines, n * (p.bar_width + p.bar_spacing) + rest, "%.1f",
- freq_kilohz);
- #endif
-- } else if (output_mode == OUTPUT_NONCURSES) {
-- if (center_frequency < 1000)
-- printf("%-4d", freq_floor);
-- else if (center_frequency > 1000 && center_frequency < 10000)
-- printf("%.2f", freq_kilohz);
-- else
-- printf("%.1f", freq_kilohz);
--
-- if (n < number_of_bars - 1)
-- printf("\033[%dC", p.bar_width + p.bar_spacing - 4);
- }
- }
- printf("\r\033[%dA", lines + 1);
-@@ -1124,11 +1099,6 @@ as of 0.4.0 all options are specified in config file,
- p.gradient, x_axis_info);
- break;
- #endif
-- case OUTPUT_NONCURSES:
-- rc = draw_terminal_noncurses(inAtty, lines, width, number_of_bars, p.bar_width,
-- p.bar_spacing, rest, bars, previous_frame,
-- x_axis_info);
-- break;
- case OUTPUT_RAW:
- rc = print_raw_out(number_of_bars, fp, p.is_bin, p.bit_format, p.ascii_range,
- p.bar_delim, p.frame_delim, bars);
diff --git a/audio/cava/files/patch-config.c b/audio/cava/files/patch-config.c
deleted file mode 100644
index 9979b6579a75..000000000000
--- a/audio/cava/files/patch-config.c
+++ /dev/null
@@ -1,34 +0,0 @@
-Remove noncurses output method which only produces a garbled mess
-on terminals.
-
---- config.c.orig 2020-10-29 12:33:01 UTC
-+++ config.c
-@@ -181,10 +181,6 @@ bool validate_config(struct config_params *p, struct e
- return false;
- #endif
- }
-- if (strcmp(outputMethod, "noncurses") == 0) {
-- p->om = OUTPUT_NONCURSES;
-- p->bgcol = 0;
-- }
- if (strcmp(outputMethod, "raw") == 0) { // raw:
- p->om = OUTPUT_RAW;
- p->bar_spacing = 0;
-@@ -220,7 +216,7 @@ bool validate_config(struct config_params *p, struct e
- #ifndef NCURSES
- write_errorf(
- error,
-- "output method %s is not supported, supported methods are: 'noncurses' and 'raw'\n",
-+ "output method %s is not supported, supported methods are: 'raw'\n",
- outputMethod);
- return false;
- #endif
-@@ -228,7 +224,7 @@ bool validate_config(struct config_params *p, struct e
- #ifdef NCURSES
- write_errorf(error,
- "output method %s is not supported, supported methods are: 'ncurses', "
-- "'noncurses' and 'raw'\n",
-+ "and 'raw'\n",
- outputMethod);
- return false;
- #endif
diff --git a/audio/cava/files/patch-configure.ac b/audio/cava/files/patch-configure.ac
deleted file mode 100644
index 9c60535a724c..000000000000
--- a/audio/cava/files/patch-configure.ac
+++ /dev/null
@@ -1,13 +0,0 @@
-Neuter gratuitous OS check that is not used for anything at all.
-
---- configure.ac.orig 2020-05-26 20:29:47 UTC
-+++ configure.ac
-@@ -294,7 +294,7 @@ case "${host_os}" in
- build_mac=yes
- ;;
- *)
-- AC_MSG_ERROR(["OS $host_os is not supported"])
-+ AC_MSG_NOTICE([I'm a teapot])
- ;;
- esac
-
diff --git a/audio/cava/files/patch-example__files_config b/audio/cava/files/patch-example__files_config
deleted file mode 100644
index 5a810485fe9f..000000000000
--- a/audio/cava/files/patch-example__files_config
+++ /dev/null
@@ -1,14 +0,0 @@
---- example_files/config.orig 2020-10-29 12:41:35 UTC
-+++ example_files/config
-@@ -73,10 +73,7 @@
-
- [output]
-
--# Output method. Can be 'ncurses', 'noncurses' or 'raw'.
--# 'noncurses' uses a custom framebuffer technique and draws only changes
--# from frame to frame. 'ncurses' is default if supported
--#
-+# Output method. Can be 'ncurses' or 'raw'.
- # 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data
- # stream of the bar heights that can be used to send to other applications.
- # 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
diff --git a/audio/cava/files/patch-input_sndio.c b/audio/cava/files/patch-input_sndio.c
deleted file mode 100644
index 38737e10450e..000000000000
--- a/audio/cava/files/patch-input_sndio.c
+++ /dev/null
@@ -1,22 +0,0 @@
-Stop using uninitialized variable after lazy refactoring upstream
-
---- input/sndio.c.orig 2020-10-29 12:44:33 UTC
-+++ input/sndio.c
-@@ -14,7 +14,7 @@ void *input_sndio(void *data) {
- par.bits = 16;
- par.le = 1;
- par.rate = 44100;
-- par.rchan = 2;
-+ par.rchan = audio->channels;
- par.appbufsz = sizeof(buf) / par.rchan;
-
- if ((hdl = sio_open(audio->source, SIO_REC, 0)) == NULL) {
-@@ -33,7 +33,7 @@ void *input_sndio(void *data) {
- exit(EXIT_FAILURE);
- }
-
-- uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / 2;
-+ uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / audio->channels;
- while (audio->terminate != 1) {
- if (sio_read(hdl, buf, sizeof(buf)) == 0) {
- fprintf(stderr, __FILE__ ": sio_read() failed: %s\n", strerror(errno));
diff --git a/audio/cava/files/patch-output_terminal__ncurses.c b/audio/cava/files/patch-output_terminal__ncurses.c
deleted file mode 100644
index c6a1e8fb503d..000000000000
--- a/audio/cava/files/patch-output_terminal__ncurses.c
+++ /dev/null
@@ -1,16 +0,0 @@
---- output/terminal_ncurses.c.orig 2020-10-29 12:36:59 UTC
-+++ output/terminal_ncurses.c
-@@ -267,9 +267,13 @@ int draw_terminal_ncurses(int is_tty, int terminal_hei
- // general: cleanup
- void cleanup_terminal_ncurses(void) {
- echo();
-+#ifdef __FreeBSD__
-+ system("/usr/sbin/vidcontrol -f >/dev/null 2>&1");
-+#else
- system("setfont >/dev/null 2>&1");
- system("setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1");
- system("setterm -blank 10 >/dev/null 2>&1");
-+#endif
- /*for(int i = 0; i < gradient_size; ++i) {
- if(the_color_redefinitions[i].color) {
- init_color(the_color_redefinitions[i].color,
diff --git a/audio/cava/files/pkg-message.in b/audio/cava/files/pkg-message.in
new file mode 100644
index 000000000000..506384b89f88
--- /dev/null
+++ b/audio/cava/files/pkg-message.in
@@ -0,0 +1,16 @@
+[
+{ type: install
+ message: <<EOM
+If you want to visualize your currently played back audio then be aware that the
+audio backends OSS and sndio can't feed the outgoing audio directly into CAVA
+without further setup:
+
+* For OSS you need to use audio/virtual_oss in order to create a loopback
+ audio device.
+* For sndio you need to start a sndio server and create a monitoring
+ sub-device.
+
+Please see %%DOCSDIR%%/README.md for additional help and instructions.
+EOM
+}
+]
diff --git a/audio/cava/pkg-descr b/audio/cava/pkg-descr
index a2262be11179..63e424c00eac 100644
--- a/audio/cava/pkg-descr
+++ b/audio/cava/pkg-descr
@@ -1,7 +1,7 @@
-C.A.V.A. is a bar spectrum audio visualizer for the terminal using
-PulseAudio, sndio or fifo buffer for input.
+CAVA (Cross-platform Audio Visualizer) is a bar spectrum audio visualizer for
+the terminal (ncurses) or desktop (SDL). It also provides a GLSL shader output
+backend which can enhance the desktop experience even more. The supported input
+backends include OSS, sndio, JACK, portaudio, pulseaudio and fifo.
-This program is not intended for scientific use. It's written to look
+This program is not intended for scientific use. It's written to look
responsive and aesthetic when used to visualize music.
-
-WWW: https://karlstav.github.io/cava