pkgsrc-Changes archive

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

CVS commit: pkgsrc/audio/cmus-legacy



Module Name:    pkgsrc
Committed By:   nia
Date:           Sat Mar 16 17:53:11 UTC 2024

Added Files:
        pkgsrc/audio/cmus-legacy: DESCR Makefile PLIST distinfo options.mk
        pkgsrc/audio/cmus-legacy/patches: patch-alsa.c patch-mixer__sun.c
            patch-sun.c

Log Message:
Import cmus 2.7.1 as audio/cmus-legacy

cmus is a small, fast and powerful console music player for Unix-like
operating systems.

This version of cmus is for old operating systems that only have a C99
capable compiler, and lack support for C11 atomics.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/cmus-legacy/DESCR \
    pkgsrc/audio/cmus-legacy/Makefile pkgsrc/audio/cmus-legacy/PLIST \
    pkgsrc/audio/cmus-legacy/distinfo pkgsrc/audio/cmus-legacy/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/cmus-legacy/patches/patch-alsa.c \
    pkgsrc/audio/cmus-legacy/patches/patch-mixer__sun.c \
    pkgsrc/audio/cmus-legacy/patches/patch-sun.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/audio/cmus-legacy/DESCR
diff -u /dev/null pkgsrc/audio/cmus-legacy/DESCR:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/DESCR      Sat Mar 16 17:53:11 2024
@@ -0,0 +1,5 @@
+cmus is a small, fast and powerful console music player for Unix-like
+operating systems.
+
+This version of cmus is for old operating systems that only have a C99
+capable compiler, and lack support for C11 atomics.
Index: pkgsrc/audio/cmus-legacy/Makefile
diff -u /dev/null pkgsrc/audio/cmus-legacy/Makefile:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/Makefile   Sat Mar 16 17:53:11 2024
@@ -0,0 +1,63 @@
+# $NetBSD: Makefile,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+DISTNAME=              cmus-2.7.1
+CATEGORIES=            audio
+MASTER_SITES=          ${MASTER_SITE_GITHUB:=cmus/}
+GITHUB_TAG=            v${PKGVERSION_NOREV}
+
+MAINTAINER=            pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=              https://cmus.github.io/
+COMMENT=               Small and fast text mode music player (C99 version)
+LICENSE=               gnu-gpl-v2
+
+EXTRACT_USING=         bsdtar
+HAS_CONFIGURE=         yes
+USE_TOOLS+=            gmake pkg-config
+
+REPLACE_SH+=           cmus-status-display
+
+CONFIGURE_ARGS+=       prefix=${PREFIX}
+CONFIGURE_ARGS+=       mandir=${PREFIX}/${PKGMANDIR}
+
+CONFIGURE_ARGS+=       CONFIG_FLAC=y
+CONFIGURE_ARGS+=       CONFIG_VORBIS=y
+
+# heavy C++ dependency unsuitable for old platforms
+CONFIGURE_ARGS+=       CONFIG_CUE=n
+# not in pkgsrc yet
+CONFIGURE_ARGS+=       CONFIG_ROAR=n
+# requires systemd
+CONFIGURE_ARGS+=       CONFIG_MPRIS=n
+
+.include "../../mk/oss.buildlink3.mk"
+
+PLIST_VARS+=           oss
+.if ${OPSYS} != "NetBSD" && ${OSS_TYPE} != "none"
+PLIST.oss=             yes
+CONFIGURE_ARGS+=       CONFIG_OSS=y
+.else
+CONFIGURE_ARGS+=       CONFIG_OSS=n
+.endif
+
+PLIST_VARS+=           sunaudio
+.if ${OPSYS} == "SunOS" || exists(/usr/include/sys/audioio.h)
+CONFIGURE_ARGS+=       CONFIG_SUN=y
+PLIST.sunaudio=                yes
+.else
+CONFIGURE_ARGS+=       CONFIG_SUN=n
+.endif
+
+PLIST_VARS+=           libao
+.if ${OSS_TYPE} == "none"
+.  include "../../audio/libao/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_AO=y
+PLIST.libao=           yes
+.endif
+
+.include "options.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../audio/flac/buildlink3.mk"
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/ncursesw/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/audio/cmus-legacy/PLIST
diff -u /dev/null pkgsrc/audio/cmus-legacy/PLIST:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/PLIST      Sat Mar 16 17:53:11 2024
@@ -0,0 +1,36 @@
+@comment $NetBSD: PLIST,v 1.1 2024/03/16 17:53:11 nia Exp $
+bin/cmus
+bin/cmus-remote
+${PLIST.faad}lib/cmus/ip/aac.so
+${PLIST.ffmpeg}lib/cmus/ip/ffmpeg.so
+lib/cmus/ip/flac.so
+${PLIST.mad}lib/cmus/ip/mad.so
+${PLIST.mikmod}lib/cmus/ip/mikmod.so
+${PLIST.modplug}lib/cmus/ip/modplug.so
+${PLIST.faad}lib/cmus/ip/mp4.so
+${PLIST.musepack}lib/cmus/ip/mpc.so
+${PLIST.opus}lib/cmus/ip/opus.so
+lib/cmus/ip/vorbis.so
+lib/cmus/ip/wav.so
+${PLIST.wavpack}lib/cmus/ip/wavpack.so
+${PLIST.alsa}lib/cmus/op/alsa.so
+${PLIST.libao}lib/cmus/op/ao.so
+${PLIST.jack}lib/cmus/op/jack.so
+${PLIST.oss}lib/cmus/op/oss.so
+${PLIST.pulseaudio}lib/cmus/op/pulse.so
+${PLIST.sunaudio}lib/cmus/op/sun.so
+man/man1/cmus-remote.1
+man/man1/cmus.1
+man/man7/cmus-tutorial.7
+share/cmus/cyan.theme
+share/cmus/default.theme
+share/cmus/gray-88.theme
+share/cmus/green-mono-88.theme
+share/cmus/green.theme
+share/cmus/night.theme
+share/cmus/rc
+share/cmus/solarized-dark.theme
+share/cmus/solarized-light.theme
+share/cmus/xterm-white.theme
+share/cmus/zenburn.theme
+share/doc/cmus/examples/cmus-status-display
Index: pkgsrc/audio/cmus-legacy/distinfo
diff -u /dev/null pkgsrc/audio/cmus-legacy/distinfo:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/distinfo   Sat Mar 16 17:53:11 2024
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+BLAKE2s (cmus-2.7.1.tar.gz) = 037f4ea95b8c2f183b16ed8cec61d8f65465b96fa94ddd92a49e12aa3a04b32e
+SHA512 (cmus-2.7.1.tar.gz) = b29ce10bbb61eb41c33c4912be320718fcf005a5797320145b124f048f6be5f5b0cebb67471ef7b062bd6f854849b6aae0e82e9adbf289a44237787932ea1576
+Size (cmus-2.7.1.tar.gz) = 296818 bytes
+SHA1 (patch-alsa.c) = 90147f01e2dcb614b326f9e4cd06002e01b76555
+SHA1 (patch-mixer__sun.c) = 974c12e06f6071a3bbd51231b2923044c1dca335
+SHA1 (patch-sun.c) = cb260b81339076247386825bc4c374c361b4d8e1
Index: pkgsrc/audio/cmus-legacy/options.mk
diff -u /dev/null pkgsrc/audio/cmus-legacy/options.mk:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/options.mk Sat Mar 16 17:53:11 2024
@@ -0,0 +1,138 @@
+# $NetBSD: options.mk,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+PKG_OPTIONS_VAR=               PKG_OPTIONS.cmus
+
+PKG_SUPPORTED_OPTIONS+=                alsa mad musepack faad
+PKG_SUPPORTED_OPTIONS+=                wavpack ffmpeg opus jack pulseaudio
+
+PKG_OPTIONS_OPTIONAL_GROUPS=   mod
+PKG_OPTIONS_GROUP.mod=         modplug mikmod
+
+PKG_SUGGESTED_OPTIONS+=                mad modplug opus wavpack
+PKG_SUGGESTED_OPTIONS.Linux+=  alsa
+
+PKG_OPTIONS_LEGACY_OPTS+=      mpcdec:musepack
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=   ${PKG_SUPPORTED_OPTIONS}
+
+###
+### Backends
+###
+
+# ALSA support
+#
+.if !empty(PKG_OPTIONS:Malsa)
+.  include "../../audio/alsa-lib/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_ALSA=y
+PLIST.alsa=            yes
+.else
+CONFIGURE_ARGS+=       CONFIG_ALSA=n
+.endif
+
+# PULSE support
+#
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+.  include "../../audio/pulseaudio/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_PULSE=y
+PLIST.pulseaudio=              yes
+.else
+CONFIGURE_ARGS+=       CONFIG_PULSE=n
+.endif
+
+# JACK support
+#
+.if !empty(PKG_OPTIONS:Mjack)
+.include "../../audio/jack/buildlink3.mk"
+.include "../../audio/libsamplerate/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_JACK=y
+CONFIGURE_ARGS+=       CONFIG_SAMPLERATE=y
+PLIST.jack=            yes
+.else
+CONFIGURE_ARGS+=       CONFIG_JACK=n
+CONFIGURE_ARGS+=       CONFIG_SAMPLERATE=n
+.endif
+
+###
+### Codecs
+###
+
+# MAD support
+#
+.if !empty(PKG_OPTIONS:Mmad)
+.include "../../audio/libmad/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_MAD=y
+PLIST.mad=             yes
+.else
+CONFIGURE_ARGS+=       CONFIG_MAD=n
+.endif
+
+# MPCDEC support
+#
+.if !empty(PKG_OPTIONS:Mmusepack)
+.include "../../audio/musepack/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_MPC=y
+PLIST.musepack=                yes
+.else
+CONFIGURE_ARGS+=       CONFIG_MPC=n
+.endif
+
+# VAWPACK support
+#
+.if !empty(PKG_OPTIONS:Mwavpack)
+.include "../../audio/wavpack/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_WAVPACK=y
+PLIST.wavpack=         yes
+.else
+CONFIGURE_ARGS+=       CONFIG_WAVPACK=n
+.endif
+
+# FFMPEG support
+#
+.if !empty(PKG_OPTIONS:Mffmpeg)
+.include "../../multimedia/ffmpeg2/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_FFMPEG=y
+PLIST.ffmpeg=          yes
+.else
+CONFIGURE_ARGS+=       CONFIG_FFMPEG=n
+.endif
+
+# modplay support
+#
+.if !empty(PKG_OPTIONS:Mmikmod)
+.include "../../audio/libmikmod/buildlink3.mk"
+.include "../../audio/libaudiofile/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_MODPLUG=n
+CONFIGURE_ARGS+=       CONFIG_MIKMOD=y
+PLIST.mikmod=          yes
+.endif
+.if !empty(PKG_OPTIONS:Mmodplug)
+.include "../../audio/libmodplug/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_MODPLUG=y
+CONFIGURE_ARGS+=       CONFIG_MIKMOD=n
+PLIST.modplug=         yes
+.endif
+
+# FAAD support
+#
+.if !empty(PKG_OPTIONS:Mfaad)
+.include "../../audio/faad2/buildlink3.mk"
+.include "../../multimedia/mp4v2/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_AAC=y
+CONFIGURE_ARGS+=       CONFIG_MP4=y
+PLIST.faad=            yes
+.else
+CONFIGURE_ARGS+=       CONFIG_AAC=n
+CONFIGURE_ARGS+=       CONFIG_MP4=n
+.endif
+
+# Opus support
+#
+.if !empty(PKG_OPTIONS:Mopus)
+.include "../../audio/opusfile/buildlink3.mk"
+CONFIGURE_ARGS+=       CONFIG_OPUS=y
+PLIST.opus=            yes
+.else
+CONFIGURE_ARGS+=       CONFIG_OPUS=n
+.endif

Index: pkgsrc/audio/cmus-legacy/patches/patch-alsa.c
diff -u /dev/null pkgsrc/audio/cmus-legacy/patches/patch-alsa.c:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/patches/patch-alsa.c       Sat Mar 16 17:53:11 2024
@@ -0,0 +1,17 @@
+$NetBSD: patch-alsa.c,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+Allow building the alsa plugin on NetBSD (for test purposes).
+
+--- alsa.c.orig        2015-06-29 09:56:08.000000000 +0000
++++ alsa.c
+@@ -59,6 +59,10 @@
+ 
+ #include <alsa/asoundlib.h>
+ 
++#ifndef ESTRPIPE
++#define ESTRPIPE EPIPE
++#endif
++
+ static sample_format_t alsa_sf;
+ static snd_pcm_t *alsa_handle;
+ static snd_pcm_format_t alsa_fmt;
Index: pkgsrc/audio/cmus-legacy/patches/patch-mixer__sun.c
diff -u /dev/null pkgsrc/audio/cmus-legacy/patches/patch-mixer__sun.c:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/patches/patch-mixer__sun.c Sat Mar 16 17:53:11 2024
@@ -0,0 +1,53 @@
+$NetBSD: patch-mixer__sun.c,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+Fix building on SunOS.
+
+--- mixer_sun.c.orig   2015-06-29 09:56:08.000000000 +0000
++++ mixer_sun.c
+@@ -54,6 +54,7 @@ static int sun_mixer_get_option(int, cha
+ 
+ static int mixer_open(const char *dev)
+ {
++#ifdef AUDIO_MIXER_DEVINFO
+       struct mixer_devinfo minf;
+       int output_class;
+ 
+@@ -99,6 +100,7 @@ static int mixer_open(const char *dev)
+ 
+       if (sun_mixer_volume_delta == 0)
+               sun_mixer_volume_delta = 1;
++#endif
+ 
+       return 0;
+ 
+@@ -191,6 +193,7 @@ static int sun_mixer_close(void)
+ 
+ static int sun_mixer_set_volume(int l, int r)
+ {
++#ifdef AUDIO_MIXER_DEVINFO
+       struct mixer_ctrl minf;
+       int ovall, ovalr;
+ 
+@@ -214,12 +217,14 @@ static int sun_mixer_set_volume(int l, i
+ 
+       if (ioctl(mixer_fd, AUDIO_MIXER_WRITE, &minf) == -1)
+               return -1;
++#endif
+ 
+       return 0;
+ }
+ 
+ static int sun_mixer_get_volume(int *l, int *r)
+ {
++#ifdef AUDIO_MIXER_DEVINFO
+       struct mixer_ctrl minf;
+ 
+       minf.dev = sun_mixer_device_id;
+@@ -236,6 +241,7 @@ static int sun_mixer_get_volume(int *l, 
+               *l = minf.un.value.level[AUDIO_MIXER_LEVEL_LEFT];
+               *r = minf.un.value.level[AUDIO_MIXER_LEVEL_RIGHT];
+       }
++#endif
+ 
+       return 0;
+ }
Index: pkgsrc/audio/cmus-legacy/patches/patch-sun.c
diff -u /dev/null pkgsrc/audio/cmus-legacy/patches/patch-sun.c:1.1
--- /dev/null   Sat Mar 16 17:53:11 2024
+++ pkgsrc/audio/cmus-legacy/patches/patch-sun.c        Sat Mar 16 17:53:11 2024
@@ -0,0 +1,59 @@
+$NetBSD: patch-sun.c,v 1.1 2024/03/16 17:53:11 nia Exp $
+
+Fix building on SunOS.
+
+--- sun.c.orig 2015-06-29 09:56:08.000000000 +0000
++++ sun.c
+@@ -31,6 +31,26 @@
+ #include "sf.h"
+ #include "xmalloc.h"
+ 
++/* Compatibility defines, for old *BSD or SunOS systems */
++#ifndef AUDIO_ENCODING_SLINEAR_LE
++#define AUDIO_ENCODING_SLINEAR_LE AUDIO_ENCODING_LINEAR
++#endif
++#ifndef AUDIO_ENCODING_SLINEAR_BE
++#define AUDIO_ENCODING_SLINEAR_BE AUDIO_ENCODING_LINEAR
++#endif
++#ifndef AUDIO_ENCODING_ULINEAR_BE
++#define AUDIO_ENCODING_ULINEAR_BE AUDIO_ENCODING_LINEAR
++#endif
++#ifndef AUDIO_ENCODING_ULINEAR_LE
++#define AUDIO_ENCODING_ULINEAR_LE AUDIO_ENCODING_LINEAR
++#endif
++#ifndef AUDIO_ENCODING_SLINEAR
++#define AUDIO_ENCODING_SLINEAR AUDIO_ENCODING_LINEAR8
++#endif
++#ifndef AUDIO_ENCODING_ULINEAR
++#define AUDIO_ENCODING_ULINEAR AUDIO_ENCODING_LINEAR8
++#endif
++
+ static sample_format_t sun_sf;
+ static int sun_fd = -1;
+ 
+@@ -38,7 +58,11 @@ static char *sun_audio_device = NULL;
+ 
+ static int sun_reset(void)
+ {
++#if defined(AUDIO_FLUSH)  /* BSD extension */
+       if (ioctl(sun_fd, AUDIO_FLUSH, NULL) == -1)
++#elif defined(I_FLUSH) && defined(FLUSHW)
++      if (ioctl(sun_fd, I_FLUSH, FLUSHW) == -1)
++#endif
+               return -1;
+ 
+       return 0;
+@@ -56,7 +80,13 @@ static int sun_set_sf(sample_format_t sf
+       ainf.play.channels = sf_get_channels(sun_sf);
+       ainf.play.sample_rate = sf_get_rate(sun_sf);
+       ainf.play.pause = 0;
++#if defined __NetBSD__ || defined __OpenBSD__
++#if defined AUMODE_PLAY_ALL
++      ainf.mode = AUMODE_PLAY | AUMODE_PLAY_ALL;
++#else
+       ainf.mode = AUMODE_PLAY;
++#endif
++#endif
+ 
+       switch (sf_get_bits(sun_sf)) {
+       case 16:



Home | Main Index | Thread Index | Old Index