Christian Weisgerber <na...@mips.inka.de> wrote:

> As I only recently discovered, mpg321 has gained a new maintainer
> and there have been new releases.  Here's an update to the latest
> one.

Now with updated WANTLIB.

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/mpg321/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile    29 Mar 2012 13:38:13 -0000      1.26
+++ Makefile    8 Jul 2012 13:25:13 -0000
@@ -5,8 +5,8 @@ SHARED_ONLY=    Yes
 
 COMMENT=       free clone of mpg123, a command-line mp3 player
 
-DISTNAME=      mpg321-0.2.10
-REVISION=      3
+VERSION=       0.3.2
+PKGNAME=       mpg321-${VERSION}
 CATEGORIES=    audio
 HOMEPAGE=      http://mpg321.sourceforge.net/
 
@@ -18,18 +18,20 @@ PERMIT_PACKAGE_FTP= Yes
 PERMIT_DISTFILES_CDROM=        Yes
 PERMIT_DISTFILES_FTP=  Yes
 
-WANTLIB=               ao>=3 c id3tag>=2 mad>=2 z
+WANTLIB=       ao c id3tag m mad pthread z
 
-MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=mpg321/}
+MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=mpg321/}
+DISTFILES=     mpg321_${VERSION}.orig.tar.gz
 
 LIB_DEPENDS=   audio/libao \
                audio/libid3tag \
                audio/libmad
 
+WRKDIST=       ${WRKDIR}/mpg321-${VERSION}-orig
 SEPARATE_BUILD=        Yes
-USE_GROFF =    Yes
 CONFIGURE_STYLE=gnu
-CONFIGURE_ARGS=        --disable-mpg123-symlink
+CONFIGURE_ARGS=        --disable-mpg123-symlink \
+               --disable-alsa
 CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
                LDFLAGS="-L${LOCALBASE}/lib"
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/mpg321/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    5 Apr 2007 15:37:43 -0000       1.4
+++ distinfo    8 Jul 2012 13:25:13 -0000
@@ -1,5 +1,4 @@
-MD5 (mpg321-0.2.10.tar.gz) = u0A7NcLSVlXVXw9ha49Huw==
-RMD160 (mpg321-0.2.10.tar.gz) = wIZ+bKfApeL/AG4MOqhm0v3lKbo=
-SHA1 (mpg321-0.2.10.tar.gz) = kCaNDRh93XYl0UO5V5HLOaFjC3k=
-SHA256 (mpg321-0.2.10.tar.gz) = 2wwplZK48fcE9BvT/Dor8ThlgQhYjVGvYWOMVRrxsNQ=
-SIZE (mpg321-0.2.10.tar.gz) = 113449
+RMD160 (mpg321_0.3.2.orig.tar.gz) = BOo2yJO75vsAVKf81xKUknz3Csk=
+SHA1 (mpg321_0.3.2.orig.tar.gz) = vxwiVCyGr2kmeCjkXyF/3rSeXUM=
+SHA256 (mpg321_0.3.2.orig.tar.gz) = 
BW/MA+P1xQIex0u1BT0yxKO4m0CGR43Pga2uZQ6sKE4=
+SIZE (mpg321_0.3.2.orig.tar.gz) = 151139
Index: patches/patch-ao_c
===================================================================
RCS file: patches/patch-ao_c
diff -N patches/patch-ao_c
--- patches/patch-ao_c  3 Jun 2010 16:07:02 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-ao_c,v 1.2 2010/06/03 16:07:02 pea Exp $
---- ao.c.orig  Sun Mar 24 06:49:47 2002
-+++ ao.c       Fri May 14 22:52:35 2010
-@@ -94,7 +94,7 @@ void check_ao_default_play_device()
- void check_default_play_device()
- {
-     /* check that no output devices are currently selected */
--    if (!(options.opt & (MPG321_USE_OSS | MPG321_USE_STDOUT | MPG321_USE_ALSA 
| MPG321_USE_ESD 
-+    if (!(options.opt & (MPG321_USE_OSS | MPG321_USE_SUN | MPG321_USE_STDOUT 
| MPG321_USE_ALSA | MPG321_USE_ESD 
-                          | MPG321_USE_NULL | MPG321_USE_WAV | MPG321_USE_ARTS 
| MPG321_USE_AU 
-                          | MPG321_USE_CDR | MPG321_USE_ALSA09 | 
MPG321_USE_USERDEF)))
-     {
-@@ -229,6 +229,7 @@ void open_ao_playdevice(struct mad_header const *heade
-            and restore it afterwards */
-         signal(SIGINT, SIG_DFL);
-         
-+      memset(&format, 0, sizeof(format));
-         format.bits = 16;
-         format.rate = header->samplerate;
-         format.channels = (options.opt & MPG321_FORCE_STEREO) ? 2 : 
MAD_NCHANNELS(header);
Index: patches/patch-mpg321_c
===================================================================
RCS file: /cvs/ports/audio/mpg321/patches/patch-mpg321_c,v
retrieving revision 1.6
diff -u -p -r1.6 patch-mpg321_c
--- patches/patch-mpg321_c      30 Oct 2008 14:46:59 -0000      1.6
+++ patches/patch-mpg321_c      8 Jul 2012 13:25:13 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
---- mpg321.c.orig      Sun Mar 24 06:49:20 2002
-+++ mpg321.c   Thu Oct 30 14:48:54 2008
-@@ -75,9 +75,15 @@ void mpg321_error(char *file)
+--- mpg321.c.orig      Sun Mar 25 14:27:49 2012
++++ mpg321.c   Sun Jul  8 14:15:18 2012
+@@ -332,9 +332,15 @@ void mpg321_error(char *file)
  
  void usage(char *argv0)
  {
@@ -18,12 +18,12 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/3
          "Options supported:\n"
          "   --verbose or -v          Increase verbosity\n"
          "   --quiet or -q            Quiet mode (no title or boilerplate)\n"
-@@ -85,7 +91,13 @@ void usage(char *argv0)
+@@ -342,7 +348,13 @@ void usage(char *argv0)
          "   --skip N or -k N         Skip N frames into the file\n"
-         "   --verbose or -v          Be more verbose in playing files\n"
+         "   --frames N or -n N       Play only the first N frames\n"
          "   -o dt                    Set output devicetype to dt\n" 
--    "                                [esd,alsa(09),arts,sun,oss]\n"
-+        "                            (");
+-        "                                [esd,alsa(09),arts,sun,oss]\n"
++        "                                (");
 +    for (i = 0; i < driver_count; i++) {
 +        fprintf(stderr, "%s%s", devices[i]->short_name,
 +            (i + 1 < driver_count) ? ", " : "");
@@ -33,34 +33,16 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/3
          "   --audiodevice N or -a N  Use N for audio-out\n"
          "   --stdout or -s           Use stdout for audio-out\n"
          "   --au N                   Use au file N for output\n"
-@@ -101,7 +113,7 @@ void usage(char *argv0)
-         "   --version or -V          Print version information\n"
-         "\n"
+@@ -376,7 +388,7 @@ void usage(char *argv0)
+       "n        Skip song.                                    \n"
+       "\n"
          "This version of mpg321 has been configured with " AUDIO_DEFAULT " as 
its default\n"
 -        "libao output device.\n" , argv0);
 +        "libao output device.\n");
  }
  
  /* retsigtype is defined by configure;
-@@ -188,7 +200,7 @@ static int show_id3(struct id3_tag const *tag)
-             
-             else
-             {
--                printf(names[i]);
-+                printf("%s", names[i]);
-                 free(names[i]);
-             }
-         }
-@@ -203,7 +215,7 @@ static int show_id3(struct id3_tag const *tag)
-             if (!names[i])  {
-                 fprintf (stderr, emptystring);
-             }   else    {
--                fprintf (stderr, names[i]);
-+                fprintf (stderr, "%s", names[i]);
-                 free (names[i]);
-             }
-             if (i%2) fprintf (stderr, "\n");
-@@ -239,6 +251,8 @@ int main(int argc, char *argv[])
+@@ -539,6 +551,8 @@ int main(int argc, char *argv[])
  
      status = MPG321_PLAYING;
      
@@ -69,16 +51,15 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/3
      /* Get the command line options */
      parse_options(argc, argv, pl);
  
-@@ -257,8 +271,6 @@ int main(int argc, char *argv[])
-     if (shuffle_play)
-         shuffle_files(pl);
+@@ -666,7 +680,6 @@ int main(int argc, char *argv[])
  
--    ao_initialize();
--
-     check_default_play_device();
+     }
+     else {
+-          ao_initialize();
+           check_default_play_device();
+     }
      
-     if (!(options.opt & MPG321_REMOTE_PLAY))
-@@ -285,6 +297,8 @@ int main(int argc, char *argv[])
+@@ -764,6 +777,8 @@ int main(int argc, char *argv[])
          signal(SIGINT, SIG_DFL);
          
          playbuf.buf = NULL;
@@ -87,55 +68,3 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/3
          playbuf.fd = -1;
          playbuf.length = 0;
          playbuf.done = 0;
-@@ -410,12 +424,14 @@ int main(int argc, char *argv[])
-             
-             if(fstat(fd, &stat) == -1)
-             {
-+                close(fd);
-                 mpg321_error(currentfile);
-                 continue;
-             }
-             
-             if (!S_ISREG(stat.st_mode))
-             {
-+                close(fd);
-                 continue;
-             }
-             
-@@ -432,6 +448,7 @@ int main(int argc, char *argv[])
-             if((playbuf.buf = mmap(0, playbuf.length, PROT_READ, MAP_SHARED, 
fd, 0))
-                                 == MAP_FAILED)
-             {
-+                close(fd);
-                 mpg321_error(currentfile);
-                 continue;
-             }
-@@ -509,9 +526,6 @@ int main(int argc, char *argv[])
- 
-         mad_decoder_finish(&decoder);
- 
--        if (quit_now)
--            break;
--
-         if (playbuf.frames)
-              free(playbuf.frames);
- 
-@@ -521,6 +535,7 @@ int main(int argc, char *argv[])
-         if (playbuf.fd == -1)
-         {
-             munmap(playbuf.buf, playbuf.length);
-+            close(fd);
-         }
- 
-         else
-@@ -535,10 +550,6 @@ int main(int argc, char *argv[])
-         ao_close(playdevice);
- 
-     ao_shutdown();
--
--#if defined(RAW_SUPPORT) || defined(HTTP_SUPPORT) || defined(FTP_SUPPORT) 
--    if(fd) close(fd);
--#endif
- 
-     return(0);
- }
Index: patches/patch-mpg321_h
===================================================================
RCS file: patches/patch-mpg321_h
diff -N patches/patch-mpg321_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mpg321_h      8 Jul 2012 13:25:13 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- mpg321.h.orig      Sun Mar 25 14:27:49 2012
++++ mpg321.h   Sun Jul  8 14:00:16 2012
+@@ -200,6 +200,7 @@ void check_ao_default_play_device();
+ void check_default_play_device();
+ int playdevice_is_live();
+ void open_ao_playdevice(struct mad_header const *header);
++ao_device *open_ao_playdevice_buffer(struct mad_header const *header);
+ 
+ /* remote control (-R) functions */
+ void remote_get_input_wait(buffer *buf);
+@@ -290,7 +291,7 @@ output_frame *Output_Queue;
+ /* Shared total decoded frames */
+ decoded_frames *Decoded_Frames;
+ 
+-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
++#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) || 
defined(__OpenBSD__)
+ /* */
+ #else
+ union semun {
Index: patches/patch-network_c
===================================================================
RCS file: patches/patch-network_c
diff -N patches/patch-network_c
--- patches/patch-network_c     10 Sep 2005 16:42:01 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-network_c,v 1.1 2005/09/10 16:42:01 naddy Exp $
---- network.c.orig     Sun Mar 24 06:49:56 2002
-+++ network.c  Mon Aug 15 17:26:03 2005
-@@ -225,7 +225,8 @@ int http_open(char *arg)
-      * a html page and not the stream */
-     snprintf(http_request, sizeof(http_request), "GET /%s HTTP/1.0\r\n"
- /*  "User-Agent: Mozilla/2.0 (Win95; I)\r\n" */
--             "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", 
filename, host);
-+             "User-Agent: mpg321/%s\r\n"
-+             "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", 
filename, VERSION, host);
- 
-     send(tcp_sock, http_request, strlen(http_request), 0);
- 
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to