summaryrefslogtreecommitdiff
path: root/audio/cava
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2018-10-04 07:30:36 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2018-10-04 07:30:36 +0000
commitbf85617e4b2f64e44e7cb1071bc70c6e25cb87c7 (patch)
treeb0e40aec17127b98e79b7de08a730046fa2cfa4b /audio/cava
parentNew port: math/adol-c: Automatic differentiation library (diff)
audio/cava: Add vt(4) font
On Linux Cava loads a custom font to display blocks with varying heights and widths on the Linux console. Provide support for it on FreeBSD with vt(4) too.
Notes
Notes: svn path=/head/; revision=481208
Diffstat (limited to 'audio/cava')
-rw-r--r--audio/cava/Makefile11
-rw-r--r--audio/cava/files/patch-Makefile.am12
-rw-r--r--audio/cava/files/patch-cava.c15
-rw-r--r--audio/cava/files/patch-output_terminal__ncurses.c16
4 files changed, 48 insertions, 6 deletions
diff --git a/audio/cava/Makefile b/audio/cava/Makefile
index 4a8f23afd99f..29bd4e6a0e80 100644
--- a/audio/cava/Makefile
+++ b/audio/cava/Makefile
@@ -2,6 +2,7 @@
PORTNAME= cava
DISTVERSION= 0.6.1
+PORTREVISION= 1
CATEGORIES= audio
MAINTAINER= tobik@FreeBSD.org
@@ -10,6 +11,7 @@ COMMENT= Console-based Audio Visualizer for MPD, PulseAudio, and sndio
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
+BUILD_DEPENDS= psf2bdf:x11-fonts/psftools
LIB_DEPENDS= libfftw3.so:math/fftw3 \
libiniparser.so:devel/iniparser
@@ -18,11 +20,12 @@ USE_GITHUB= yes
GH_ACCOUNT= karlstav
GNU_CONFIGURE= yes
-CONFIGURE_ENV= ac_cv_lib_asound_snd_pcm_open=no
+CONFIGURE_ENV= ac_cv_lib_asound_snd_pcm_open=no \
+ FONT_DIR=${DATADIR}
INSTALL_TARGET= install-strip
-PLIST_FILES= bin/cava
+PLIST_FILES= bin/cava ${DATADIR}/cava.fnt
PORTDOCS= README.md
PORTEXAMPLES= config
@@ -39,6 +42,10 @@ SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio
pre-configure:
@${ECHO_CMD} ${DISTVERSION} > ${WRKSRC}/version
+pre-build:
+ psf2bdf ${WRKSRC}/cava.psf > ${WRKSRC}/cava.bdf
+ vtfontcvt ${WRKSRC}/cava.bdf ${WRKSRC}/cava.fnt
+
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
diff --git a/audio/cava/files/patch-Makefile.am b/audio/cava/files/patch-Makefile.am
index 856c041e469b..c6db50c867f8 100644
--- a/audio/cava/files/patch-Makefile.am
+++ b/audio/cava/files/patch-Makefile.am
@@ -2,17 +2,21 @@
does not recognize
- Do not install the Linux-only font
---- Makefile.am.orig 2018-09-10 08:31:56 UTC
+--- Makefile.am.orig 2018-05-03 16:07:33 UTC
+++ Makefile.am
-@@ -14,10 +14,8 @@ cava_LDADD = -liniparser
+@@ -13,11 +13,12 @@ cava_SOURCES = cava.c
+ cava_LDADD = -liniparser
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_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
--cava_font_dir = @FONT_DIR@
+ cava_font_dir = @FONT_DIR@
-cava_font__DATA = cava.psf
++cava_font__DATA = cava.fnt
if !SYSTEM_LIBINIPARSER
cava_SOURCES += iniparser/libiniparser.la
diff --git a/audio/cava/files/patch-cava.c b/audio/cava/files/patch-cava.c
new file mode 100644
index 000000000000..74b65e3b7b91
--- /dev/null
+++ b/audio/cava/files/patch-cava.c
@@ -0,0 +1,15 @@
+--- cava.c.orig 2018-10-04 05:51:51 UTC
++++ cava.c
+@@ -341,8 +341,12 @@ as of 0.4.0 all options are specified in config file,
+ "/dev/console") == 0) inAtty = 1;
+
+ 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
+ }
+ }
+
diff --git a/audio/cava/files/patch-output_terminal__ncurses.c b/audio/cava/files/patch-output_terminal__ncurses.c
new file mode 100644
index 000000000000..ec8c54a06375
--- /dev/null
+++ b/audio/cava/files/patch-output_terminal__ncurses.c
@@ -0,0 +1,16 @@
+--- output/terminal_ncurses.c.orig 2018-10-04 05:56:00 UTC
++++ output/terminal_ncurses.c
+@@ -215,9 +215,13 @@ int flastd[200], int gradient) {
+ // 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");
++#endif
+ /*for(int i = 0; i < gradient_size; ++i) {
+ if(the_color_redefinitions[i].color) {
+ init_color(the_color_redefinitions[i].color,