Import libmpg123-1.5.1. This package provides the mpg123 project's

core decoder library, which the new mpg123 package will depend on.
Other software packages are beginning to write plug-ins for this
library, and so installing it seperately is worthwhile.

NOTE: I have encountered segfaults when attempting to use the jack
module, which is threaded, with mpg123 unless I linked mpg123 with
libpthread.  This may or may not apply to the library, though my
intuition is that it does not, as obviously the executable is
what calls lt_dlopen().  Thus, for now the Makefile and b3.mk of the
executable will pull in dlopen.buildlink3.mk, setting
DLOPEN_REQUIRE_PTHREADS=yes as necessary (last time I checked on
NetBSD 4.99, it was).
This commit is contained in:
bjs 2008-09-07 00:56:15 +00:00
parent 54fdadcfa5
commit 146eaf55b5
11 changed files with 209 additions and 0 deletions

1
audio/libmpg123/DESCR Normal file
View file

@ -0,0 +1 @@
This package provides the mpg123 project's core decoder library.

50
audio/libmpg123/Makefile Normal file
View file

@ -0,0 +1,50 @@
# $NetBSD: Makefile,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
#
.include "../../audio/libmpg123/Makefile.version"
DISTNAME= mpg123-${MPG123_VERSION}
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mpg123/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= bjs@NetBSD.org
HOMEPAGE= http://mpg123.sourceforge.net/
COMMENT= MPEG layer 1, 2, and 3 decoder library
PKG_DESTDIR_SUPPORT= user-destdir
GNU_CONFIGURE= yes
USE_TOOLS+= pkg-config
USE_LIBTOOL= yes
PKGCONFIG_OVERRIDE+= libmpg123.pc.in
BUILD_DIRS= src/libmpg123
INSTALL_DIRS= src/libmpg123
CONFIGURE_ARGS+= --enable-fifo=yes
CONFIGURE_ARGS+= --enable-modules=yes
CONFIGURE_ARGS+= --enable-network=yes
CONFIGURE_ARGS+= --enable-gapless=yes
###
### XXX Use pkgsrc-provided CFLAGS.
###
CONFIGURE_ARGS+= --with-optimization=0
CFLAGS+= ${COPTS.mpg123:U${COPTS}}
###
### XXX This should be set to 'no' for platforms where it is required.
### It's easier doing this here than patching configure.
MPG123_XFERMEM?= yes
.if !empty(MPG123_XFERMEM:tl:Myes)
BUILDLINK_TRANSFORM+= rm:-DNO_XFERMEM
.endif
LIBMPG123_PCDIR= ${PREFIX}/lib/pkgconfig
post-install:
${INSTALL_DATA_DIR} ${DESTDIR}${LIBMPG123_PCDIR}
${INSTALL_DATA} ${WRKSRC}/libmpg123.pc ${DESTDIR}${LIBMPG123_PCDIR}
.include "options.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -0,0 +1,4 @@
# $NetBSD: Makefile.version,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
#
MPG123_VERSION= 1.5.1

3
audio/libmpg123/PLIST Normal file
View file

@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
include/mpg123.h
lib/libmpg123.la

View file

@ -0,0 +1,19 @@
# $NetBSD: buildlink3.mk,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MPG123_BUILDLINK3_MK:= ${MPG123_BUILDLINK3_MK}+
.if ${BUILDLINK_DEPTH} == "+"
BUILDLINK_DEPENDS+= mpg123
.endif
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nmpg123}
BUILDLINK_PACKAGES+= mpg123
BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}mpg123
.if ${MPG123_BUILDLINK3_MK} == "+"
BUILDLINK_API_DEPENDS.mpg123+= mpg123>=1.5.1
BUILDLINK_PKGSRCDIR.mpg123?= ../../audio/libmpg123
.endif # MPG123_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}

9
audio/libmpg123/distinfo Normal file
View file

@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
SHA1 (mpg123-1.5.1.tar.bz2) = 4e85388294c5c432bd899bb910694dd259e76679
RMD160 (mpg123-1.5.1.tar.bz2) = aeaf5ab770eeb66826d81ba3d840492709b2c7a5
Size (mpg123-1.5.1.tar.bz2) = 1033406 bytes
SHA1 (patch-aa) = faf686e1b47bc53ef5155129da2fd0b81632c2f9
SHA1 (patch-ab) = 7d1d36cf5ea4a3e3d0a43da351ac7e3c97c636bf
SHA1 (patch-ac) = 751f52278354413e11f857c53e954e2fd56ba06b
SHA1 (patch-ad) = 2b888b710499308216a90d48036c1d00327033e3

View file

@ -0,0 +1,38 @@
# $NetBSD: options.mk,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
#
PKG_OPTIONS_VAR= PKG_OPTIONS.libmp123
PKG_SUPPORTED_OPTIONS= inet6 debug
.include "../../mk/bsd.fast.prefs.mk"
.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "i386"
PKG_SUPPORTED_OPTIONS+= simd
.elif !empty(MACHINE_ARCH:Marm*)
PKG_SUPPORTED_OPTIONS+= mpg123-arm-fixed64
.endif
PKG_SUGGESTED_OPTIONS= ${PKG_SUPPORTED_OPTIONS}
.include "../../mk/bsd.options.mk"
SIMD_CONFIGURE_ARGS.powerpc= altvec
SIMD_CONFIGURE_ARGS.i386= x86_dither
.if empty(PKG_OPTIONS:Minet6)
CONFIGURE_ARGS+= --with-ipv6=no
.endif
.if !empty(PKG_OPTIONS:Msimd)
CONFIGURE_ARGS+= --with-cpu=${SIMD_CONFIGURE_ARGS.${MACHINE_ARCH}}
.elif !empty(PKG_OPTIONS:Mmpg123-arm-fixed64)
CONFIGURE_ARGS+= --with-cpu=generic_nofpu
.else
CONFIGURE_ARGS+= --with-cpu=generic_fpu
.endif
.if !empty(PKG_OPTIONS:Mdebug)
CONFIGURE_ARGS+= --enable-debug=yes
.else
CONFIGURE_ARGS+= --enable-debug=no
.endif

View file

@ -0,0 +1,17 @@
$NetBSD: patch-aa,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
--- src/output/esd.c.orig 2008-08-29 02:43:51.000000000 -0400
+++ src/output/esd.c
@@ -18,6 +18,12 @@
#endif
#include "debug.h"
+#ifdef NETBSD
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+#endif
+
+
static unsigned esd_rate = 0, esd_format = 0, esd_channels = 0;

View file

@ -0,0 +1,22 @@
$NetBSD: patch-ab,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
--- src/output/oss.c.orig 2008-08-29 02:43:51.000000000 -0400
+++ src/output/oss.c
@@ -167,7 +167,7 @@ static int open_oss(audio_output_t *ao)
if(!ao) return -1;
if(!ao->device) {
- ao->device = "/dev/dsp";
+ ao->device = DEVOSSAUDIO;
usingdefdev = 1;
}
@@ -176,7 +176,7 @@ static int open_oss(audio_output_t *ao)
if(ao->fn < 0)
{
if(usingdefdev) {
- ao->device = "/dev/sound/dsp";
+ ao->device = DEVOSSSOUND;
ao->fn = open(ao->device,O_WRONLY);
if(ao->fn < 0) {
if(!AOQUIET) error("Can't open default sound device!");

View file

@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
--- src/term.c.orig 2008-08-29 02:43:56.000000000 -0400
+++ src/term.c
@@ -196,7 +196,7 @@ static void term_handle_input(mpg123_han
while(n > 0) {
fd_set r;
struct timeval t;
- char val;
+ unsigned char val;
t.tv_sec=0;
t.tv_usec=(do_delay) ? 10*1000 : 0;

View file

@ -0,0 +1,33 @@
$NetBSD: patch-ad,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
--- src/xfermem.c.orig 2008-08-29 02:43:56.000000000 -0400
+++ src/xfermem.c
@@ -37,6 +37,13 @@ void xfermem_init (txfermem **xf, size_t
#ifdef HAVE_MMAP
# ifdef MAP_ANON
+
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
+ if(madvise((void *)xf, (regsize - sizeof(txfermem)),
+ MADV_SEQUENTIAL) < 0)
+ fprintf(stderr,"madvise failed, continuing anyway...\n");
+#endif
+
if ((*xf = (txfermem *) mmap(0, regsize, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0)) == (txfermem *) -1) {
perror ("mmap()");
@@ -92,7 +99,13 @@ void xfermem_done (txfermem *xf)
if(!xf)
return;
#ifdef HAVE_MMAP
- munmap ((caddr_t) xf, xf->size + xf->metasize + sizeof(txfermem));
+ munmap ((void *) xf, xf->size + xf->metasize + sizeof(txfermem));
+
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
+ if(madvise((void *)xf, (xf->size + xf->metasize), MADV_FREE) < 0)
+ fprintf(stderr,"madvise failed, continuing anyways..\n");
+#endif
+
#else
if (shmdt((void *) xf) == -1) {
perror ("shmdt()");