diff options
author | Tobias Kortkamp <tobik@FreeBSD.org> | 2020-05-30 00:39:11 +0000 |
---|---|---|
committer | Tobias Kortkamp <tobik@FreeBSD.org> | 2020-05-30 00:39:11 +0000 |
commit | 0803b3611a1ff13a2dab916722403ef4d7523052 (patch) | |
tree | 00777558bc02fe30f96d5eca0b710ee1c8fe5cfd /audio/cava | |
parent | graphics/sane-backends: Update to 1.0.30 (diff) |
audio/cava: Update to 0.7.0
Changes: https://github.com/karlstav/cava/releases/tag/0.7.0
Notes
Notes:
svn path=/head/; revision=537023
Diffstat (limited to 'audio/cava')
-rw-r--r-- | audio/cava/Makefile | 23 | ||||
-rw-r--r-- | audio/cava/distinfo | 6 | ||||
-rw-r--r-- | audio/cava/files/patch-Makefile.am | 23 | ||||
-rw-r--r-- | audio/cava/files/patch-cava.c | 65 | ||||
-rw-r--r-- | audio/cava/files/patch-config.c | 43 | ||||
-rw-r--r-- | audio/cava/files/patch-configure.ac | 13 | ||||
-rw-r--r-- | audio/cava/files/patch-example__files_config | 14 | ||||
-rw-r--r-- | audio/cava/files/patch-input_sndio.c | 29 | ||||
-rw-r--r-- | audio/cava/files/patch-output_terminal__ncurses.c | 20 |
9 files changed, 189 insertions, 47 deletions
diff --git a/audio/cava/Makefile b/audio/cava/Makefile index 771aa5150aac..aa724052c174 100644 --- a/audio/cava/Makefile +++ b/audio/cava/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= cava -DISTVERSION= 0.6.1 -PORTREVISION= 2 +DISTVERSION= 0.7.0 CATEGORIES= audio MAINTAINER= tobik@FreeBSD.org @@ -19,6 +18,7 @@ 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} @@ -28,7 +28,7 @@ PLIST_FILES= bin/cava PORTDOCS= README.md PORTEXAMPLES= config -OPTIONS_DEFINE= DOCS EXAMPLES PULSEAUDIO SNDIO VT +OPTIONS_DEFINE= DOCS EXAMPLES PORTAUDIO PULSEAUDIO SNDIO VT OPTIONS_DEFAULT= PULSEAUDIO SNDIO VT .if !exists(/usr/bin/vtfontcvt) OPTIONS_EXCLUDE= VT @@ -36,16 +36,19 @@ OPTIONS_EXCLUDE= VT VT_DESC= Build with vt(4) support (installs custom font) -PULSEAUDIO_CONFIGURE_ENV_OFF= ac_cv_lib_pulse_simple_pa_simple_new=no +PORTAUDIO_LIB_DEPENDS= libportaudio.so:audio/portaudio +PORTAUDIO_CONFIGURE_OFF= --disable-input-portaudio + PULSEAUDIO_LIB_DEPENDS= libpulse-simple.so:audio/pulseaudio \ - libpulse.so:audio/pulseaudio \ + libpulse.so:audio/pulseaudio +PULSEAUDIO_CONFIGURE_OFF= --disable-input-pulse -SNDIO_CONFIGURE_ENV_OFF= ac_cv_lib_sndio_sio_open=no -SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio +SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio +SNDIO_CONFIGURE_OFF= --disable-input-sndio -VT_BUILD_DEPENDS= psf2bdf:x11-fonts/psftools -VT_MAKE_ARGS_OFF= cava_font__DATA="" -VT_PLIST_FILES= ${DATADIR}/cava.fnt +VT_BUILD_DEPENDS= psf2bdf:x11-fonts/psftools +VT_MAKE_ARGS_OFF= cava_font__DATA="" +VT_PLIST_FILES= ${DATADIR}/cava.fnt pre-configure: @${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version diff --git a/audio/cava/distinfo b/audio/cava/distinfo index eb5ffb8ca591..8eb5029e69b7 100644 --- a/audio/cava/distinfo +++ b/audio/cava/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1525757005 -SHA256 (karlstav-cava-0.6.1_GH0.tar.gz) = 98b880e7e704ed457863f379f31b488e06076bb34a5de02825096969b916a78d -SIZE (karlstav-cava-0.6.1_GH0.tar.gz) = 42285 +TIMESTAMP = 1590792822 +SHA256 (karlstav-cava-0.7.0_GH0.tar.gz) = 1ced5b131b86f2aa86259c58c2d2dfd46201ab908395229191b5a8dec894b84c +SIZE (karlstav-cava-0.7.0_GH0.tar.gz) = 52865 diff --git a/audio/cava/files/patch-Makefile.am b/audio/cava/files/patch-Makefile.am index c6db50c867f8..8628601a1c49 100644 --- a/audio/cava/files/patch-Makefile.am +++ b/audio/cava/files/patch-Makefile.am @@ -2,21 +2,34 @@ does not recognize - Do not install the Linux-only font ---- Makefile.am.orig 2018-05-03 16:07:33 UTC +--- Makefile.am.orig 2020-05-26 20:29:47 UTC +++ Makefile.am -@@ -13,11 +13,12 @@ cava_SOURCES = cava.c - cava_LDADD = -liniparser +@@ -10,11 +10,11 @@ M_CPPFLAGS = -DSYSTEM_LIBINIPARSER=@SYSTEM_LIBINIPARSE + + bin_PROGRAMS = cava + cava_SOURCES = cava.c config.c input/common.c input/fifo.c input/shmem.c \ +- output/terminal_noncurses.c output/raw.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 -cava_CFLAGS = -std=c99 -Wall -Wextra -Wno-unused-result -Wno-maybe-uninitialized + -D_POSIX_SOURCE -D _POSIX_C_SOURCE=200809L -DFONT_DIR=\"@FONT_DIR@\" -+ +cava_CFLAGS = -std=c99 -Wall -Wextra + if OSX + cava_CFLAGS += -DNORT +@@ -39,11 +39,11 @@ if SNDIO + endif + + if NCURSES +- cava_SOURCES += output/terminal_bcircle.c output/terminal_ncurses.c ++ cava_SOURCES += output/terminal_ncurses.c + endif + cava_font_dir = @FONT_DIR@ -cava_font__DATA = cava.psf +cava_font__DATA = cava.fnt if !SYSTEM_LIBINIPARSER - cava_SOURCES += iniparser/libiniparser.la + cava_LDADD = -liniparser diff --git a/audio/cava/files/patch-cava.c b/audio/cava/files/patch-cava.c index 74b65e3b7b91..8e2573a16b5c 100644 --- a/audio/cava/files/patch-cava.c +++ b/audio/cava/files/patch-cava.c @@ -1,15 +1,62 @@ ---- cava.c.orig 2018-10-04 05:51:51 UTC +--- cava.c.orig 2020-05-26 20:29:47 UTC +++ cava.c -@@ -341,8 +341,12 @@ as of 0.4.0 all options are specified in config file, - "/dev/console") == 0) inAtty = 1; +@@ -32,13 +32,11 @@ + #include "util.h" - if (inAtty) { + #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" +@@ -91,8 +89,6 @@ void cleanup(void) { + #else + ; + #endif +- } else if (output_mode == OUTPUT_NONCURSES) { +- cleanup_terminal_noncurses(); + } + } + +@@ -338,8 +334,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"); ++ 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"); + system("setfont cava.psf >/dev/null 2>&1"); + system("setterm -blank 0"); +#endif - } - } + } + // We use unicode block characters to draw the bars and +@@ -547,12 +547,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); +- init_terminal_noncurses(p.col, p.bgcol, width, lines, p.bar_width); +- height = (lines - 1) * 8; +- break; +- + case OUTPUT_RAW: + if (strcmp(p.raw_target, "/dev/stdout") != 0) { + // checking if file exists +@@ -998,10 +992,6 @@ as of 0.4.0 all options are specified in config file, + p.gradient); + 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); +- 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 index 8059acc60d45..897f543436ff 100644 --- a/audio/cava/files/patch-config.c +++ b/audio/cava/files/patch-config.c @@ -1,11 +1,34 @@ ---- config.c.orig 2017-08-26 08:52:40 UTC +Remove noncurses output method which only produces a garbled mess +on terminals. + +--- config.c.orig 2020-05-29 23:28:58 UTC +++ config.c -@@ -378,7 +378,7 @@ if (p->smcount > 0) { - iniparser_getseckeys(ini, "eq", keys); - #endif - #ifdef LEGACYINIPARSER -- char **keys = iniparser_getseckeys(ini, "eq"); -+ char **keys = iniparser_getseckeys(ini, "eq", keys); - #endif - for (int sk = 0; sk < p->smcount; sk++) { - p->smooth[sk] = iniparser_getdouble(ini, keys[sk], 1); +@@ -173,10 +173,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 + #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 +@@ -408,7 +404,7 @@ bool load_config(char configPath[PATH_MAX], struct con + } + + #ifdef NCURSES +- outputMethod = (char *)iniparser_getstring(ini, "output:method", "noncurses"); ++ outputMethod = (char *)iniparser_getstring(ini, "output:method", "ncurses"); + #endif + #ifndef NCURSES + outputMethod = (char *)iniparser_getstring(ini, "output:method", "noncurses"); diff --git a/audio/cava/files/patch-configure.ac b/audio/cava/files/patch-configure.ac new file mode 100644 index 000000000000..9c60535a724c --- /dev/null +++ b/audio/cava/files/patch-configure.ac @@ -0,0 +1,13 @@ +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 new file mode 100644 index 000000000000..a6ffb8d49fbd --- /dev/null +++ b/audio/cava/files/patch-example__files_config @@ -0,0 +1,14 @@ +--- example_files/config.orig 2020-05-29 23:30:26 UTC ++++ example_files/config +@@ -76,10 +76,7 @@ + + [output] + +-# Output method. Can be 'ncurses', 'noncurses' or 'raw'. +-# 'noncurses' uses a custom framebuffer technique and draws only changes +-# from frame to frame. As of version 0.7.0 'noncurses' is default. +-# ++# 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 new file mode 100644 index 000000000000..2e0d49c01f4f --- /dev/null +++ b/audio/cava/files/patch-input_sndio.c @@ -0,0 +1,29 @@ +Stop using uninitialized variable after lazy refactoring upstream + +--- input/sndio.c.orig 2020-05-29 23:20:44 UTC ++++ input/sndio.c +@@ -8,14 +8,13 @@ void *input_sndio(void *data) { + struct sio_par par; + struct sio_hdl *hdl; + int16_t buf[256]; +- unsigned int channels; + + sio_initpar(&par); + par.sig = 1; + 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) { +@@ -34,7 +33,7 @@ void *input_sndio(void *data) { + exit(EXIT_FAILURE); + } + +- uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / channels; ++ 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 index ec8c54a06375..139005cc801c 100644 --- a/audio/cava/files/patch-output_terminal__ncurses.c +++ b/audio/cava/files/patch-output_terminal__ncurses.c @@ -1,16 +1,16 @@ ---- output/terminal_ncurses.c.orig 2018-10-04 05:56:00 UTC +--- output/terminal_ncurses.c.orig 2020-05-29 23:00:32 UTC +++ output/terminal_ncurses.c -@@ -215,9 +215,13 @@ int flastd[200], int gradient) { +@@ -262,9 +262,13 @@ int draw_terminal_ncurses(int is_tty, int terminal_hei // general: cleanup void cleanup_terminal_ncurses(void) { - echo(); + echo(); +#ifdef __FreeBSD__ -+ system("/usr/sbin/vidcontrol -f >/dev/null 2>&1"); ++ 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"); + 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, + /*for(int i = 0; i < gradient_size; ++i) { + if(the_color_redefinitions[i].color) { + init_color(the_color_redefinitions[i].color, |