pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/audio/moc-devel Add a moc-devel package for version 2....



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2f9c2720ddef
branches:  trunk
changeset: 540762:2f9c2720ddef
user:      bjs <bjs%pkgsrc.org@localhost>
date:      Mon Apr 07 16:10:37 2008 +0000

description:
Add a moc-devel package for version 2.5.0alpha3.  This package uses
a getline() function taken from nbftp--bothering with gnulib was too
annoying.  It works for me on NetBSD-current, but please let me
know if there are any problems.

I've also extended the check for sched_get_priority_max(3)--both here
and in audio/moc--to look in librt prior to giving up.  This allows
moc to run with realtime priority on NetBSD-current; unfortunately,
presently this requires root perms.

diffstat:

 audio/moc-devel/DESCR            |  17 +++++++
 audio/moc-devel/Makefile         |  49 +++++++++++++++++++++
 audio/moc-devel/PLIST            |  26 +++++++++++
 audio/moc-devel/distinfo         |   9 +++
 audio/moc-devel/files/getline.c  |  93 ++++++++++++++++++++++++++++++++++++++++
 audio/moc-devel/options.mk       |  58 ++++++++++++++++++++++++
 audio/moc-devel/patches/patch-aa |  29 ++++++++++++
 audio/moc-devel/patches/patch-ab |  16 ++++++
 audio/moc-devel/patches/patch-ac |  10 ++++
 audio/moc-devel/patches/patch-ad |  77 +++++++++++++++++++++++++++++++++
 10 files changed, 384 insertions(+), 0 deletions(-)

diffs (truncated from 424 to 300 lines):

diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/DESCR     Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,17 @@
+MOC (music on console) is a console audio player for LINUX/UNIX
+designed to be powerful and easy to use. Noteworthy features
+include:
+
+  * By default, files are decoded and played in a background
+    process. This allows the user to quit the interface (e.g.,
+    if one needs to close the xterm) without affecting
+    playback. It also allows attaching multiple interfaces
+    (e.g. in multiple xterms) to the same player.
+  * Playback should be smooth even under high cpu or I/O load,
+    due to the use of output buffering in a separate thread.
+  * There are no sound gaps in between files, because the next
+    file to be played is precached while playing the current
+    file.
+
+Note: To avoid conflicts with Qt's 'moc', the moc binary is
+called 'mocp'.
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/Makefile  Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,49 @@
+# $NetBSD: Makefile,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $
+
+DISTNAME=              moc-2.5.0-alpha3
+PKGNAME=               ${DISTNAME:S/-alpha/./:moc%=moc-devel%}
+CATEGORIES=            audio
+MASTER_SITES=          ftp://ftp.daper.net/pub/soft/moc/unstable/
+EXTRACT_SUFX=          .tar.bz2
+
+MAINTAINER=            peter.schuller%infidyne.com@localhost
+HOMEPAGE=              http://moc.daper.net/
+COMMENT=               Curses based console audio player
+
+PKG_DESTDIR_SUPPORT=   user-destdir
+
+CONFLICTS=             moc-[0-9]*
+
+GNU_CONFIGURE=         yes
+USE_PKGLOCALEDIR=      yes
+USE_LIBTOOL=           yes
+USE_NCURSES=           yes
+USE_TOOLS+=            pkg-config
+#USE_TOOLS+=           autoconf automake
+
+# We require ncurses because with curses arrow key navigation is buggy
+CONFIGURE_ARGS+=       --with-ncurses
+
+SUBST_CLASSES+=                oss
+SUBST_STAGE.oss=       pre-configure
+SUBST_FILES.oss=       config.example options.c
+SUBST_SED.oss=         -e s,/dev/dsp,${DEVOSSAUDIO},g
+SUBST_MESSAGE.oss=     Fixing hardcoded audio device.
+
+.include "options.mk"
+###
+### This target is [currently] for regenerating configure to add the 
+### sched_get_priority_max check of librt.
+###
+#pre-configure:
+#      cd ${WRKSRC} && autoreconf -v -i
+post-extract:
+       ${CP} ${FILESDIR}/getline.c ${WRKSRC}
+
+.include "../../audio/libid3tag/buildlink3.mk"
+.include "../../audio/libmad/buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../mk/oss.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/PLIST     Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,26 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $
+bin/mocp
+${FLAC}lib/moc/decoder_plugins/libflac_decoder.la
+lib/moc/decoder_plugins/libmp3_decoder.la
+${VORBIS}lib/moc/decoder_plugins/libvorbis_decoder.la
+${SNDFILE}lib/moc/decoder_plugins/libsndfile_formats_decoder.la
+${SPEEX}lib/moc/decoder_plugins/libspeex_decoder.la
+man/man1/mocp.1
+share/doc/moc/README
+share/doc/moc/THANKS
+share/doc/moc/config.example
+share/doc/moc/keymap.example
+share/moc/themes/black_theme
+share/moc/themes/darkdot_theme
+share/moc/themes/example_theme
+share/moc/themes/green_theme
+share/moc/themes/moca_theme
+share/moc/themes/nightly_theme
+share/moc/themes/red_theme
+share/moc/themes/transparent-background
+share/moc/themes/yellow_red_theme
+@dirrm share/moc/themes
+@dirrm share/moc
+@dirrm share/doc/moc
+@dirrm lib/moc/decoder_plugins
+@dirrm lib/moc
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/distinfo  Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $
+
+SHA1 (moc-2.5.0-alpha3.tar.bz2) = 59251b6239ad38f3f5ba8a1f73d1e90246765ab7
+RMD160 (moc-2.5.0-alpha3.tar.bz2) = 7a603538e2080f3e182a543bc82100a09a56c2fe
+Size (moc-2.5.0-alpha3.tar.bz2) = 489824 bytes
+SHA1 (patch-aa) = ae4ec98da135617d5433308462a99271ed31bde3
+SHA1 (patch-ab) = 750f9a75c368788cf7d6f55e2ef44d7e41d99aa4
+SHA1 (patch-ac) = 6b42e7df0dc3dfeb0a7c5e5226a28b01d2fd27c7
+SHA1 (patch-ad) = 5785a54e683f8c063e7b603e7cc07a33dd080590
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/files/getline.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/files/getline.c   Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,93 @@
+/*     $NetBSD: getline.c,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $ */
+/*     $NetBSD: getline.c,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $      */
+
+/*-
+ * Copyright (c) 1997-2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+
+/* Read a line from the FILE stream into buf/buflen using fgets(), so up
+ * to buflen-1 chars will be read and the result will be NUL terminated.
+ * If the line has a trailing newline it will be removed.
+ * If the line is too long, excess characters will be read until
+ * newline/EOF/error.
+ * If EOF/error occurs or a too-long line is encountered and errormsg
+ * isn't NULL, it will be changed to a description of the problem.
+ * (The EOF message has a leading \n for cosmetic purposes).
+ * Returns:
+ *     >=0     length of line (excluding trailing newline) if all ok
+ *     -1      error occurred
+ *     -2      EOF encountered
+ *     -3      line was too long
+ */
+int
+getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
+{
+       int     rv, ch;
+       size_t  len;
+
+       if (fgets(buf, buflen, stream) == NULL) {
+               if (feof(stream)) {     /* EOF */
+                       rv = -2;
+                       if (errormsg)
+                               *errormsg = "\nEOF received";
+               } else  {               /* error */
+                       rv = -1;
+                       if (errormsg)
+                               *errormsg = "Error encountered";
+               }
+               clearerr(stream);
+               return rv;
+       }
+       len = strlen(buf);
+       if (buf[len-1] == '\n') {       /* clear any trailing newline */
+               buf[--len] = '\0';
+       } else if (len == buflen-1) {   /* line too long */
+               while ((ch = getchar()) != '\n' && ch != EOF)
+                       continue;
+               if (errormsg)
+                       *errormsg = "Input line is too long";
+               clearerr(stream);
+               return -3;
+       }
+       if (errormsg)
+               *errormsg = NULL;
+       return len;
+}
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/options.mk        Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,58 @@
+# $NetBSD: options.mk,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.moc
+PKG_SUPPORTED_OPTIONS= sndfile flac vorbis speex curl samplerate
+PKG_SUGGESTED_OPTIONS= sndfile flac vorbis curl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Msamplerate)
+CONFIGURE_ARGS+=       --with-samplerate
+PKG_OPTIONS+=          sndfile
+.  include "../../audio/libsamplerate/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --without-samplerate
+.endif
+
+.if !empty(PKG_OPTIONS:Msndfile) || !empty(PKG_OPTIONS:Msamplerate)
+PLIST_SUBST+=          SNDFILE=
+CONFIGURE_ARGS+=       --with-sndfile
+.  include "../../audio/libsndfile/buildlink3.mk"
+.else
+PLIST_SUBST+=          SNDFILE='@comment '
+CONFIGURE_ARGS+=       --without-sndfile
+.endif
+
+.if !empty(PKG_OPTIONS:Mflac)
+PLIST_SUBST+=          FLAC=
+CONFIGURE_ARGS+=       --with-flac
+.  include "../../audio/flac/buildlink3.mk"
+.else
+PLIST_SUBST+=          FLAC='@comment '
+CONFIGURE_ARGS+=       --without-flac
+.endif
+
+.if !empty(PKG_OPTIONS:Mvorbis)
+PLIST_SUBST+=          VORBIS=
+CONFIGURE_ARGS+=       --with-vorbis
+.  include "../../audio/libvorbis/buildlink3.mk"
+.else
+PLIST_SUBST+=          VORBIS='@comment '
+CONFIGURE_ARGS+=       --without-vorbis
+.endif
+
+.if !empty(PKG_OPTIONS:Mspeex)
+PLIST_SUBST+=          SPEEX=
+CONFIGURE_ARGS+=       --with-speex
+.  include "../../audio/speex/buildlink3.mk"
+.else
+PLIST_SUBST+=          SPEEX='@comment '
+CONFIGURE_ARGS+=       --without-speex
+.endif
+
+.if !empty(PKG_OPTIONS:Mcurl)
+CONFIGURE_ARGS+=       --with-curl
+.  include "../../www/curl/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --without-curl
+.endif
diff -r d53cf07b1c1b -r 2f9c2720ddef audio/moc-devel/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/moc-devel/patches/patch-aa  Mon Apr 07 16:10:37 2008 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-aa,v 1.1.1.1 2008/04/07 16:10:37 bjs Exp $
+
+--- softmixer.c.orig   2008-04-06 19:57:33.000000000 -0400
++++ softmixer.c
+@@ -35,6 +35,12 @@
+ #include "common.h"
+ #include "log.h"
+ 
++#ifndef getline
++#define NETBSD_GETLINE
++int     getline(FILE *, char *, size_t, const char **);
++#include "getline.c"
++#endif
++
+ #define swap_32bit_endianess(i32) \
+   ( ((i32&0x000000FF)<<24) | ((i32&0x0000FF00)<<8)| \
+   ((i32&0x00FF0000)>>8) | ((i32&0xFF000000)>>24) ) 
+@@ -147,7 +153,11 @@ void softmixer_read_config()
+   int buffersize=-1, readbytes=-1;
+   int tmp;



Home | Main Index | Thread Index | Old Index