Skip to content

Commit

Permalink
audio/jack-capture: Add dependencies; Fix format handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed Nov 4, 2022
1 parent 9f0cd13 commit bcd61b6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
6 changes: 6 additions & 0 deletions audio/jack-capture/Makefile
@@ -1,6 +1,7 @@
PORTNAME= jack-capture
DISTVERSION= 0.9.73-38
DISTVERSIONSUFFIX= -g10cec47
PORTREVISION= 1
CATEGORIES= audio

MAINTAINER= yuri@FreeBSD.org
Expand All @@ -12,6 +13,9 @@ LICENSE_FILE= ${WRKSRC}/COPYING

BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libjack.so:audio/jack \
liblo.so:audio/liblo \
libmp3lame.so:audio/lame \
libogg.so:audio/libogg \
libsndfile.so:audio/libsndfile

USES= gmake localbase:ldflags pkgconfig
Expand All @@ -20,6 +24,8 @@ USE_GITHUB= yes
GH_ACCOUNT= kmatheussen
GH_PROJECT= jack_capture

MAKE_ENV= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"

BINARY_ALIAS= gcc=${CC} g++=${CXX}

PLIST_FILES= bin/jack_capture
Expand Down
38 changes: 38 additions & 0 deletions audio/jack-capture/files/patch-gen__das__config__h.sh
@@ -0,0 +1,38 @@
--- gen_das_config_h.sh.orig 2022-11-04 16:32:42 UTC
+++ gen_das_config_h.sh
@@ -16,7 +16,7 @@
echo "#include <sndfile.h>" >temp$$.c
echo "main(){return SF_FORMAT_OGG;}" >>temp$$.c
echo >>temp$$.c
-if gcc temp$$.c 2>/dev/null; then
+if gcc $CFLAGS $LDFLAGS temp$$.c 2>/dev/null; then
echo "#define HAVE_OGG 1"
else
echo "#define HAVE_OGG 0"
@@ -26,7 +26,7 @@ fi
echo "#include <lame/lame.h>" >temp$$.c
echo "main(){return 0;}" >>temp$$.c
echo >>temp$$.c
-if gcc temp$$.c -lmp3lame 2>/dev/null; then
+if gcc $CFLAGS $LDFLAGS temp$$.c -lmp3lame 2>/dev/null; then
echo "#define HAVE_LAME 1"
echo "//COMPILEFLAGS -lmp3lame"
else
@@ -37,7 +37,7 @@ fi
echo "#include <lo/lo.h>" >temp$$.c
echo "main(){return 0;}" >>temp$$.c
echo >>temp$$.c
-if pkg-config --cflags --libs liblo >/dev/null 2>/dev/null && gcc temp$$.c `pkg-config --cflags --libs liblo` 2>/dev/null ; then
+if pkg-config --cflags --libs liblo >/dev/null 2>/dev/null && gcc $CFLAGS $LDFLAGS temp$$.c `pkg-config --cflags --libs liblo` 2>/dev/null ; then
echo "#define HAVE_LIBLO 1"
echo "//COMPILEFLAGS " `pkg-config --cflags --libs liblo`
else
@@ -48,7 +48,7 @@ fi
echo "#include <jack/jack.h>" >temp$$.c
echo "main(){return (int)jack_port_get_latency_range;}" >>temp$$.c
echo >>temp$$.c
-if gcc temp$$.c -ljack 2>/dev/null ; then
+if gcc $CFLAGS $LDFLAGS temp$$.c -ljack 2>/dev/null ; then
echo "#define NEW_JACK_LATENCY_API 1"
else
echo "#define NEW_JACK_LATENCY_API 0"
11 changes: 11 additions & 0 deletions audio/jack-capture/files/patch-gen__setformat__c.sh
@@ -0,0 +1,11 @@
--- gen_setformat_c.sh.orig 2022-11-04 20:56:46 UTC
+++ gen_setformat_c.sh
@@ -63,7 +63,7 @@ for a in $ai;do
esac
echo "main(){return $format;}" >>temp.c
echo >>temp.c
- if gcc temp.c 2>/dev/null; then
+ if gcc $CFLAGS $LDFLAGS temp.c 2>/dev/null; then
echo " (!strcasecmp(\""$a"\",soundfile_format)) ? $format :"
fi
done

0 comments on commit bcd61b6

Please sign in to comment.