diff options
author | pav <pav@FreeBSD.org> | 2006-05-09 00:05:17 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2006-05-09 00:05:17 +0800 |
commit | 1d6864e4d7f271ced741d2c8a6cdd5709ecebc8b (patch) | |
tree | d80a21f1cd2b0790ac29e3d548cddae8b3bd478b /audio/libjackasyn | |
parent | db37f12717b62c2adcdb23d226454d509d6800c2 (diff) | |
download | freebsd-ports-gnome-1d6864e4d7f271ced741d2c8a6cdd5709ecebc8b.tar.gz freebsd-ports-gnome-1d6864e4d7f271ced741d2c8a6cdd5709ecebc8b.tar.zst freebsd-ports-gnome-1d6864e4d7f271ced741d2c8a6cdd5709ecebc8b.zip |
libjackasyn is a library that allows you to use programs written for the OSS
sound API with the JACK audio server (jackit.sf.net). libjackasyn is a library
that can be used for two purposes.
First it can be loaded via the LD_PRELOAD variable, turning OSS applications
automatically into JACK-aware applications.
Second, it can be used to link against the program during build time, making it
trivial to turn an OSS aware sound application into a JACK aware sound
application in a short time.
libjackasyn got its name from the asynchronous manner in which it communicates
with the JACK server, which means by using libjackasyn you will introduce an
additional delay exactly the size of one JACK audiobuffer (1024 samples or 44
ms with the JACK default settings). This delay can be reduced by reducing the
JACK buffersize. It should not matter for sound generating applications, but
it might introduce phasing effects when doing sound processing.
WWW: http://gige.xdv.org/libjackasyn/
PR: ports/94290
Submitted by: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe>
Diffstat (limited to 'audio/libjackasyn')
-rw-r--r-- | audio/libjackasyn/Makefile | 52 | ||||
-rw-r--r-- | audio/libjackasyn/distinfo | 3 | ||||
-rw-r--r-- | audio/libjackasyn/files/patch-Makefile.in | 38 | ||||
-rw-r--r-- | audio/libjackasyn/files/patch-configure | 20 | ||||
-rw-r--r-- | audio/libjackasyn/files/patch-libjackasyn.c | 22 | ||||
-rw-r--r-- | audio/libjackasyn/files/patch-libjackoss.c | 26 | ||||
-rw-r--r-- | audio/libjackasyn/files/patch-libjackoss.h | 23 | ||||
-rw-r--r-- | audio/libjackasyn/files/pkg-message.in | 35 | ||||
-rw-r--r-- | audio/libjackasyn/pkg-descr | 19 | ||||
-rw-r--r-- | audio/libjackasyn/pkg-plist | 5 |
10 files changed, 243 insertions, 0 deletions
diff --git a/audio/libjackasyn/Makefile b/audio/libjackasyn/Makefile new file mode 100644 index 000000000000..68f56cbadc7c --- /dev/null +++ b/audio/libjackasyn/Makefile @@ -0,0 +1,52 @@ +# New ports collection makefile for: libjackasyn +# Date created: 2006-03-06 +# Whom: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe> +# +# $FreeBSD$ +# + +PORTNAME= libjackasyn +PORTVERSION= 0.12 +CATEGORIES= audio devel +MASTER_SITES= http://gige.xdv.org/soft/libjackasyn/download/ + +MAINTAINER= acardenas@bsd.org.pe +COMMENT= Allow use any sound program for the OSS system as a JACK client + +LIB_DEPENDS= jack.0:${PORTSDIR}/audio/jack \ + samplerate.1:${PORTSDIR}/audio/libsamplerate + +USE_GMAKE= yes +GNU_CONFIGURE= yes +INSTALLS_SHLIB= yes + +LDFLAGS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} +CXXFLAGS+= -I${LOCALBASE}/include + +CONFIGURE_ENV+= CC="${CC}" LDFLAGS="${LDFLAGS}" +MAKE_ENV= LDFLAGS="${LDFLAGS}" CPPFLAGS="${CFLAGS}" + +CONFIGURE_ARGS= --prefix=${PREFIX} +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +CONFIGURE_ENV+= CC="${CC}" CXX="${CXX}" LDFLAGS="${LDFLAGS}" +MAKE_ENV= LDFLAGS="${LDFLAGS}" CPPFLAGS="${CXXFLAGS}" + +SUB_FILES= pkg-message +MAN1= jacklaunch.1 + +post-patch: + @${REINPLACE_CMD} -e 's|%%PTHREAD%%|${PTHREAD_LIBS}|g' ${WRKSRC}/${CONFIGURE_SCRIPT} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/libjackasyn.so.${PORTVERSION} ${PREFIX}/lib/libjackasyn.so.0 + ${INSTALL_PROGRAM} ${WRKSRC}/libjackasyn.a ${PREFIX}/lib + ${INSTALL_SCRIPT} ${WRKSRC}/jacklaunch ${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/libjackoss.h ${PREFIX}/include + +post-install: + @cd ${PREFIX}/lib && \ + ${LN} -s libjackasyn.so.0 libjackasyn.so + ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1/ + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/audio/libjackasyn/distinfo b/audio/libjackasyn/distinfo new file mode 100644 index 000000000000..18d00b4e86c0 --- /dev/null +++ b/audio/libjackasyn/distinfo @@ -0,0 +1,3 @@ +MD5 (libjackasyn-0.12.tar.gz) = fae5e0315668798f009b91ca6d34d29e +SHA256 (libjackasyn-0.12.tar.gz) = 39f64bf5297549a816692e26342003ee0cd4e54fe5bfe1056d92b8dcc79d46f1 +MD5 (libjackasyn-0.12.tar.gz) = 73802 diff --git a/audio/libjackasyn/files/patch-Makefile.in b/audio/libjackasyn/files/patch-Makefile.in new file mode 100644 index 000000000000..19dfe61cacb5 --- /dev/null +++ b/audio/libjackasyn/files/patch-Makefile.in @@ -0,0 +1,38 @@ +--- Makefile.in Mon Mar 6 07:40:18 2006 ++++ Makefile.in Tue Mar 28 08:19:51 2006 +@@ -8,8 +8,9 @@ + SRC_FILES = libjackasyn.c libjackoss.c clientfuncs.c + OBJ_FILES = $(SRC_FILES:.c=.o) libjackoss_pl.o + HEADERS = libjackasyn.h libjackoss.h +-CFLAGS = -O2 -Wall -I. -fPIC -rdynamic -DMAJOR=$(MAJOR) -DMINOR=$(MINOR) @DEBUG@ +-LIBS = -lc @LIBS@ ++CFLAGS = -Wall ${CPPFLAGS} -I. -fPIC -rdynamic -DMAJOR=$(MAJOR) -DMINOR=$(MINOR) @DEBUG@ ++LIBS = -lc @LIBS@ ${LDFLAGS} ++CC? = ${CC} + + + prefix = @prefix@ +@@ -22,7 +23,7 @@ + ar cr libjackasyn.a *.o + + shared: +- gcc -shared -Wl,-soname=libjackasyn.so.0 -o libjackasyn.so.$(VERSION) *.o $(LIBS) ++ ${CC} -shared -Wl,-soname=libjackasyn.so.0 -o libjackasyn.so.$(VERSION) *.o $(LIBS) + + install: + -rm $(prefix)/lib/libjackasyn.so* +@@ -34,7 +35,7 @@ + install -m 755 jacklaunch $(prefix)/bin + + test: +- gcc -o test test.c libjackasyn.a -ljack -ldl -lm ++ ${CC} -o test test.c libjackasyn.a -ljack -ldl -lm + + clean: + -rm *~ $(OBJ_FILES) +@@ -55,4 +56,4 @@ + $(OBJ_FILES) : $(HEADERS) + + libjackoss_pl.o: libjackoss.c +- gcc -c $(CFLAGS) -DLD_PRELOAD -o $@ $< ++ ${CC} -c $(CFLAGS) -DLD_PRELOAD -o $@ $< diff --git a/audio/libjackasyn/files/patch-configure b/audio/libjackasyn/files/patch-configure new file mode 100644 index 000000000000..807f1ccc43b4 --- /dev/null +++ b/audio/libjackasyn/files/patch-configure @@ -0,0 +1,20 @@ +--- configure Tue Aug 24 08:42:36 2004 ++++ configure Mon Mar 6 11:08:00 2006 +@@ -2506,7 +2506,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-ljack $LIBS" ++LIBS="-ljack %%PTHREAD%% $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -2562,7 +2562,7 @@ + #define HAVE_LIBJACK 1 + _ACEOF + +- LIBS="-ljack $LIBS" ++ LIBS="-ljack %%PTHREAD%% $LIBS" + + else + echo please install jack jackit.sf.net;exit diff --git a/audio/libjackasyn/files/patch-libjackasyn.c b/audio/libjackasyn/files/patch-libjackasyn.c new file mode 100644 index 000000000000..98bf9760a123 --- /dev/null +++ b/audio/libjackasyn/files/patch-libjackasyn.c @@ -0,0 +1,22 @@ +--- libjackasyn.c Tue Aug 24 08:29:32 2004 ++++ libjackasyn.c Thu Apr 6 12:09:57 2006 +@@ -47,9 +47,9 @@ + fprintf(stderr,"libjackasyn: cannot get application name\n"); + return NULL; + } +- n = namefield + strlen("Name: "); ++ n = namefield; + len=0; +- while (*(n+len) != '\n' && len < 255) len++; ++ while (*(n+len) != ' ' && len < 255) len++; + if (len >= 255) { + fprintf(stderr,"libjackasyn: cannot get process name\n"); + return NULL; +@@ -58,7 +58,7 @@ + pname = malloc(len+2); + n[len]='\0'; + sprintf(pname,"%s_%d",n,num); +- ++ + return pname; + } diff --git a/audio/libjackasyn/files/patch-libjackoss.c b/audio/libjackasyn/files/patch-libjackoss.c new file mode 100644 index 000000000000..133a7ca87717 --- /dev/null +++ b/audio/libjackasyn/files/patch-libjackoss.c @@ -0,0 +1,26 @@ +--- libjackoss.c Mon Mar 6 07:19:23 2006 ++++ libjackoss.c Mon Mar 6 12:25:46 2006 +@@ -117,7 +117,7 @@ + } + + va_start (args, flags); +- mode = va_arg (args, mode_t); ++ mode = va_arg (args, int); + va_end (args); + + if ((strncmp(name,"/dev/dsp",8) && strncmp(name,"/dev/audio",8)) +@@ -367,10 +367,10 @@ + UNIMPLEMENTED( SNDCTL_DSP_MAPOUTBUF); + UNIMPLEMENTED( SNDCTL_DSP_SETSYNCRO); + UNIMPLEMENTED( SNDCTL_DSP_SETDUPLEX); +- UNIMPLEMENTED( SNDCTL_DSP_GETCHANNELMASK); +- UNIMPLEMENTED( SNDCTL_DSP_BIND_CHANNEL); +- UNIMPLEMENTED( SNDCTL_DSP_SETSPDIF); +- UNIMPLEMENTED( SNDCTL_DSP_GETSPDIF); ++// UNIMPLEMENTED( SNDCTL_DSP_GETCHANNELMASK); ++// UNIMPLEMENTED( SNDCTL_DSP_BIND_CHANNEL); ++// UNIMPLEMENTED( SNDCTL_DSP_SETSPDIF); ++// UNIMPLEMENTED( SNDCTL_DSP_GETSPDIF); + + default: + fprintf(stderr,"unknown ioctl\n"); diff --git a/audio/libjackasyn/files/patch-libjackoss.h b/audio/libjackasyn/files/patch-libjackoss.h new file mode 100644 index 000000000000..c5e23fba4790 --- /dev/null +++ b/audio/libjackasyn/files/patch-libjackoss.h @@ -0,0 +1,23 @@ +--- libjackoss.h Mon Mar 6 07:14:48 2006 ++++ libjackoss.h Thu Mar 23 22:22:42 2006 +@@ -2,6 +2,11 @@ + #define __LIBJACKOSS_H__ + #include <sys/types.h> + #include <sys/poll.h> ++#include <sys/param.h> ++ ++#if __FreeBSD_version <= 492100 ++typedef unsigned int nfds_t; ++#endif + + #ifdef __cplusplus + extern "C" { +@@ -15,7 +20,7 @@ + int jackoss_select(int n, fd_set *readfds, + fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout); +- int jackoss_poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); ++ int jackoss_poll(struct pollfd *__fds, nfds_t __nfds, int __timeout); + /* these are mainly need for sox */ + + FILE * jackoss_fopen (const char *pathname, const char *mode); diff --git a/audio/libjackasyn/files/pkg-message.in b/audio/libjackasyn/files/pkg-message.in new file mode 100644 index 000000000000..d3c5b424deb0 --- /dev/null +++ b/audio/libjackasyn/files/pkg-message.in @@ -0,0 +1,35 @@ +############################################################################### + +1) To use libjackasyn as a jack's client, you need to set LD_PRELOAD. + + csh: + setenv LD_PRELOAD %%PREFIX%%/lib/libjackasyn.so + + bash: + export LD_PRELOAD=%%PREFIX%%/lib/libjackasyn.so + + And start jackd (only works using root account) + + # jackd -d oss + +2) You need procfs mounted. + + # mount_procfs procfs /proc + + Also you could edit your /etc/fstab file and add this line + + proc /proc procfs rw 0 0 + + This to load procfs on boot time, or typing + + # mount /proc + +3) Run your program (using root account, jackd and xmms must have the same uid). + + Example: xmms + xmms-jackasyn + + # xmms + + If jackd isn't running, the libjackasyn will use normal oss device + +############################################################################## diff --git a/audio/libjackasyn/pkg-descr b/audio/libjackasyn/pkg-descr new file mode 100644 index 000000000000..8a9924b5bfa9 --- /dev/null +++ b/audio/libjackasyn/pkg-descr @@ -0,0 +1,19 @@ +libjackasyn is a library that allows you to use programs written for the OSS +sound API with the JACK audio server (jackit.sf.net). libjackasyn is a library +that can be used for two purposes. + +First it can be loaded via the LD_PRELOAD variable, turning OSS applications +automatically into JACK-aware applications. + +Second, it can be used to link against the program during build time, making it +trivial to turn an OSS aware sound application into a JACK aware sound +application in a short time. + +libjackasyn got its name from the asynchronous manner in which it communicates +with the JACK server, which means by using libjackasyn you will introduce an +additional delay exactly the size of one JACK audiobuffer (1024 samples or 44 +ms with the JACK default settings). This delay can be reduced by reducing the +JACK buffersize. It should not matter for sound generating applications, but +it might introduce phasing effects when doing sound processing. + +WWW: http://gige.xdv.org/libjackasyn/ diff --git a/audio/libjackasyn/pkg-plist b/audio/libjackasyn/pkg-plist new file mode 100644 index 000000000000..c84f76bec07a --- /dev/null +++ b/audio/libjackasyn/pkg-plist @@ -0,0 +1,5 @@ +bin/jacklaunch +include/libjackoss.h +lib/libjackasyn.a +lib/libjackasyn.so +lib/libjackasyn.so.0 |