Download raw body.
UPDATE: moc
On 2024/11/24 04:15, Brad Smith wrote:
> Instead of disabling the FFmpeg support for moc I have switched the port to
> using a fork that has up to date FFmpeg support up through to version 7.
>
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/moc/Makefile,v
> retrieving revision 1.31
> diff -u -p -u -p -r1.31 Makefile
> --- Makefile 21 Nov 2024 07:00:52 -0000 1.31
> +++ Makefile 21 Nov 2024 10:23:44 -0000
> @@ -1,65 +1,65 @@
> COMMENT = console audio player
> -DISTNAME = moc-2.5.2
> +
> +DIST_TUPLE+= gitlab tomaszg mocp fb0a63b564b40fa861204e2f804b696c6ee573da .
> +PKGNAME = moc-2.6.a3
$ pkg_check-version moc-2.6.a3 moc-2.6.0 moc-2.6.1 moc-2.5.2
moc-*- sorted: moc-2.5.2 moc-2.6.0 moc-2.6.1 moc-2.6.a3
moc-2.6alpha3 would work better
> CATEGORIES = audio
> -HOMEPAGE = https://moc.daper.net/
> -SITES = https://ftp.daper.net/pub/soft/moc/stable/ \
> - https://distfiles.sigtrap.nl/
> -EXTRACT_SUFX = .tar.bz2
> -REVISION = 12
>
> # GPLv3+
> PERMIT_PACKAGE = Yes
>
> # uses pledge()
> -WANTLIB += ${COMPILER_LIBCXX} FLAC c crypto curl curses db faad
> -WANTLIB += iconv id3tag ltdl m mad magic modplug mp3lame mpcdec
> -WANTLIB += mpg123 nghttp2 nghttp3 ngtcp2 ngtcp2_crypto_quictls
> -WANTLIB += ogg opus samplerate sndfile sndio speex ssl tag tag_c
> -WANTLIB += vorbis vorbisenc vorbisfile wavpack z
> +WANTLIB += ${COMPILER_LIBCXX} FLAC X11 X11-xcb Xext Xfixes aom
> +WANTLIB += avcodec avformat avutil bz2 c crypto curl curses dav1d
> +WANTLIB += drm faad gsm iconv id3tag intl ltdl lzma m mad magic
> +WANTLIB += modplug mp3lame mpcdec mpg123 nghttp2 nghttp3 ngtcp2
> +WANTLIB += ngtcp2_crypto_quictls ogg opus popt samplerate sndfile
> +WANTLIB += sndio speex ssl swresample tag tag_c theoradec theoraenc
> +WANTLIB += va va-drm va-x11 vorbis vorbisenc vorbisfile vpx wavpack
> +WANTLIB += x264 x265 xcb xcb-dri3 xml2 xvidcore z
>
> -COMPILER = base-clang ports-gcc base-gcc
> +COMPILER = base-clang ports-gcc
> +
> +RUN_DEPENDS+= devel/desktop-file-utils \
> + x11/gtk+4,-guic
>
> LIB_DEPENDS = audio/faad \
> audio/flac \
> - audio/lame \
> audio/libid3tag \
> audio/libmad \
> audio/libmodplug \
> - audio/libogg \
> audio/libsamplerate \
> audio/libsndfile \
> audio/libvorbis \
> - audio/mpg123 \
> audio/musepack \
> - audio/opus \
> audio/speex \
> audio/taglib \
> audio/wavpack \
> - converters/libiconv \
> - databases/db/v4 \
> devel/libmagic \
> devel/libtool,-ltdl \
> - net/curl \
> - net/ngtcp2 \
> - www/nghttp2 \
> - www/nghttp3
> + devel/popt \
> + graphics/ffmpeg \
> + net/curl
>
> +AUTOCONF_VERSION= 2.71
> +AUTOMAKE_VERSION= 1.16
> SEPARATE_BUILD = Yes
> -
> -CONFIGURE_STYLE = gnu
> +CONFIGURE_STYLE = autoreconf
> CONFIGURE_ARGS += \
> - --with-sndio \
> + --disable-cache \
> --without-jack \
> --without-oss \
> --without-alsa \
> + --without-mpg123 \
> + --without-mpris \
> + --without-opus \
> + --without-pulse \
> --without-rcc \
> --without-included-ltdl \
> --without-timidity \
> - --without-ffmpeg \
> - --with-magic \
> --with-ltdl-include=${LOCALBASE}/include \
> --with-ltdl-lib=${LOCALBASE}/lib
> -CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include -I${LOCALBASE}/include/db4" \
> +CONFIGURE_ENV = CPPFLAGS="-Wno-unused-but-set-parameter -I${LOCALBASE}/include -I${LOCALBASE}/include/db4" \
> LDFLAGS="-L${LOCALBASE}/lib"
>
> pre-install:
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/audio/moc/distinfo,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 distinfo
> --- distinfo 18 Nov 2017 12:01:14 -0000 1.2
> +++ distinfo 21 Nov 2024 10:23:44 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (moc-2.5.2.tar.bz2) = 86aBFWAqR4i3z6m76Tl6nV4kxoy2GldpXRwsPs9J2wg=
> -SIZE (moc-2.5.2.tar.bz2) = 602728
> +SHA256 (tomaszg-mocp-fb0a63b564b40fa861204e2f804b696c6ee573da.tar.gz) = 0vVH+wk+UGP9Ag7nk+8QAKhSL0W4NwMQ8yok5DyyKIo=
> +SIZE (tomaszg-mocp-fb0a63b564b40fa861204e2f804b696c6ee573da.tar.gz) = 703656
> Index: patches/patch-config_example_in
> ===================================================================
> RCS file: /cvs/ports/audio/moc/patches/patch-config_example_in,v
> retrieving revision 1.3
> diff -u -p -u -p -r1.3 patch-config_example_in
> --- patches/patch-config_example_in 11 Mar 2022 18:20:18 -0000 1.3
> +++ patches/patch-config_example_in 21 Nov 2024 10:23:44 -0000
> @@ -3,7 +3,7 @@ Remove audio choices that are irrelevant
> Index: config.example.in
> --- config.example.in.orig
> +++ config.example.in
> -@@ -121,32 +121,10 @@
> +@@ -140,32 +140,10 @@
> #
> #HTTPProxy =
>
> @@ -35,5 +35,5 @@ Index: config.example.in
> -#ALSAMixer1 = PCM
> -#ALSAMixer2 = Master
>
> - # Under some circumstances on 32-bit systems, audio played continously
> - # for long periods of time may begin to stutter. Setting this option to
> + # Save software mixer state?
> + # If enabled, a file 'softmixer' will be created in '~/.moc/' storing the
> Index: patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
> ===================================================================
> RCS file: patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
> diff -N patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
> --- patches/patch-decoder_plugins_ffmpeg_ffmpeg_c 11 Mar 2022 18:20:18 -0000 1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,34 +0,0 @@
> -Maint: Migrate to FFmpeg/LibAV's AV_-prefixed #defines.
> -
> -Index: decoder_plugins/ffmpeg/ffmpeg.c
> ---- decoder_plugins/ffmpeg/ffmpeg.c.orig
> -+++ decoder_plugins/ffmpeg/ffmpeg.c
> -@@ -984,7 +984,7 @@ static void *ffmpeg_open (const char *file)
> - * FFmpeg/LibAV in use. For some versions this will be caught in
> - * *_find_stream_info() above and misreported as an unfound codec
> - * parameters error. */
> -- if (data->codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
> -+ if (data->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
> - decoder_error (&data->error, ERROR_FATAL, 0,
> - "The codec is experimental and may damage MOC: %s",
> - data->codec->name);
> -@@ -993,8 +993,8 @@ static void *ffmpeg_open (const char *file)
> - #endif
> -
> - set_downmixing (data);
> -- if (data->codec->capabilities & CODEC_CAP_TRUNCATED)
> -- data->enc->flags |= CODEC_FLAG_TRUNCATED;
> -+ if (data->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
> -+ data->enc->flags |= AV_CODEC_FLAG_TRUNCATED;
> -
> - #ifdef HAVE_AVCODEC_OPEN2
> - if (avcodec_open2 (data->enc, data->codec, NULL) < 0)
> -@@ -1025,7 +1025,7 @@ static void *ffmpeg_open (const char *file)
> -
> - data->sample_width = sfmt_Bps (data->fmt);
> -
> -- if (data->codec->capabilities & CODEC_CAP_DELAY)
> -+ if (data->codec->capabilities & AV_CODEC_CAP_DELAY)
> - data->delay = true;
> - data->seek_broken = is_seek_broken (data);
> - data->timing_broken = is_timing_broken (data->ic);
> Index: patches/patch-main_c
> ===================================================================
> RCS file: /cvs/ports/audio/moc/patches/patch-main_c,v
> retrieving revision 1.4
> diff -u -p -u -p -r1.4 patch-main_c
> --- patches/patch-main_c 11 Mar 2022 18:20:18 -0000 1.4
> +++ patches/patch-main_c 21 Nov 2024 10:23:44 -0000
> @@ -4,33 +4,36 @@
> Index: main.c
> --- main.c.orig
> +++ main.c
> -@@ -174,6 +174,8 @@ static void start_moc (const struct parameters *params
> - case 0: /* child - start server */
> - set_me_server ();
> - list_sock = server_init (params->debug, params->foreground);
> -+ if (pledge("stdio rpath wpath cpath inet unix dns audio", NULL) == -1)
> -+ fatal ("pledge() failed: %s", strerror(errno));
> - rc = write (notify_pipe[1], &i, sizeof(i));
> - if (rc < 0)
> - fatal ("write() to notify pipe failed: %s",
> -@@ -208,10 +210,14 @@ static void start_moc (const struct parameters *params
> +@@ -161,6 +161,8 @@ static void start_moc (const struct parameters *params
> + if (params->foreground) {
> set_me_server ();
> - list_sock = server_init (params->debug, params->foreground);
> - signal (SIGCHLD, sig_chld);
> -+ if (pledge("stdio rpath wpath cpath inet unix dns audio", NULL) == -1)
> + server_init (params->debug, params->foreground);
> ++ if (pledge("stdio rpath wpath cpath inet unix audio", NULL) == -1)
> + fatal ("pledge() failed: %s", strerror(errno));
> - server_loop (list_sock);
> + server_loop ();
> + return;
> }
> -
> - if (!params->only_server) {
> +@@ -185,6 +187,8 @@ static void start_moc (const struct parameters *params
> + case 0: /* child - start server */
> + set_me_server ();
> + server_init (params->debug, params->foreground);
> ++ if (pledge("stdio rpath wpath cpath inet unix audio", NULL) == -1)
> ++ fatal ("pledge() failed: %s", strerror(errno));
> + rc = write (notify_pipe[1], &i, sizeof(i));
> + if (rc < 0)
> + fatal ("write() to notify pipe failed: %s", xstrerror (errno));
> +@@ -216,6 +220,8 @@ static void start_moc (const struct parameters *params
> + if (params->only_server)
> + send_int (server_sock, CMD_DISCONNECT);
> + else {
> + if (pledge("stdio rpath wpath cpath flock unix tty proc", NULL) == -1)
> + fatal ("pledge() failed: %s", strerror(errno));
> - signal (SIGPIPE, SIG_IGN);
> - if (ping_server(server_sock)) {
> - if (!params->dont_run_iface) {
> -@@ -800,6 +806,9 @@ int main (int argc, char *argv[])
> - struct utsname uts;
> - #endif
> + xsignal (SIGPIPE, SIG_IGN);
> + if (!ping_server (server_sock))
> + fatal ("Can't connect to the server!");
> +@@ -1202,6 +1208,9 @@ int main (int argc, const char *argv[])
> + mocp_argc = argc;
> + mocp_argv = argv;
>
> + if (pledge("stdio rpath wpath cpath flock inet unix dns tty proc prot_exec audio", NULL) == -1)
> + fatal ("pledge() failed: %s", strerror(errno));
> @@ -38,19 +41,20 @@ Index: main.c
> #ifdef PACKAGE_REVISION
> logit ("This is Music On Console (revision %s)", PACKAGE_REVISION);
> #else
> -@@ -852,11 +861,12 @@ int main (int argc, char *argv[])
> +@@ -1265,12 +1274,14 @@ int main (int argc, const char *argv[])
> io_init ();
> rcc_init ();
> decoder_init (params.debug);
> - srand (time(NULL));
>
> -- if (!params.only_server && params.dont_run_iface)
> -+ if (!params.only_server && params.dont_run_iface) {
> + if (params.allow_iface)
> + start_moc (¶ms, args);
> +- else
> ++ else {
> + if (pledge("cpath rpath stdio unix", NULL) == -1)
> + fatal ("pledge() failed: %s", strerror(errno));
> server_command (¶ms, args);
> -- else
> -+ } else
> - start_moc (¶ms, args);
> ++ }
>
> lists_strs_free (args);
> + options_free ();
> Index: patches/patch-mocp_1
> ===================================================================
> RCS file: /cvs/ports/audio/moc/patches/patch-mocp_1,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-mocp_1
> --- patches/patch-mocp_1 11 Mar 2022 18:20:18 -0000 1.2
> +++ patches/patch-mocp_1 21 Nov 2024 10:23:44 -0000
> @@ -1,7 +1,8 @@
> Fix paths in manual.
>
> ---- mocp.1.orig Sun Apr 24 06:23:30 2016
> -+++ mocp.1 Sun Jun 5 13:16:37 2016
> +Index: mocp.1
> +--- mocp.1.orig
> ++++ mocp.1
> @@ -58,10 +58,8 @@ Implies \fB\-S\fP. Run the server in foreground and l
> .TP
> \fB\-R\fP \fINAME\fP[\fB:\fP...], \
> @@ -15,7 +16,7 @@ Fix paths in manual.
> .LP
> .TP
> \fB\-m\fP, \fB\-\-music\-dir\fP
> -@@ -123,7 +121,7 @@ file currently being played.
> +@@ -128,7 +126,7 @@ file currently being played.
> .TP
> \fB\-T\fP \fITHEME\fP, \fB\-\-theme\fP \fITHEME\fP
> Use a theme file. If the path is not absolute, the file will be searched
> @@ -24,7 +25,7 @@ Fix paths in manual.
> \fB~/.moc/themes/\fP and the current directory.
> .LP
> .TP
> -@@ -143,7 +141,7 @@ allows the new values to be picked up by substitutions
> +@@ -152,7 +150,7 @@ allows the new values to be picked up by substitutions
> options are overridden afterwards (which gives the choice of whether the
> configured values are replaced or added to).
> .IP
> @@ -33,7 +34,7 @@ Fix paths in manual.
> of the options available.
> .LP
> .RS
> -@@ -261,7 +259,7 @@ MOC directory for the configuration file, socket, the
> +@@ -440,7 +438,7 @@ MOC directory for the configuration file, socket, the
> .TP
> .B ~/.moc/config
> Configuration file for MOC. The format is very simple; to see how to use
> @@ -42,7 +43,7 @@ Fix paths in manual.
> with the program. The example file fully describes all the configuration
> options, and so is a useful reference when using the \fB\-O\fP option. As
> this file can specify commands which invoke other applications MOC will
> -@@ -271,11 +269,11 @@ it is writable by anyone other than its owner.
> +@@ -460,11 +458,11 @@ variable above.)
> .TP
> .B ~/.moc/themes
> .TQ
> Index: patches/patch-playlist_c
> ===================================================================
> RCS file: /cvs/ports/audio/moc/patches/patch-playlist_c,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-playlist_c
> --- patches/patch-playlist_c 11 Mar 2022 18:20:18 -0000 1.2
> +++ patches/patch-playlist_c 21 Nov 2024 10:23:44 -0000
> @@ -1,14 +1,14 @@
> Replace rand(3)-based computation with arc4random_uniform(3).
>
> ---- playlist.c.orig Sun Jun 5 13:54:04 2016
> -+++ playlist.c Sun Jun 5 13:58:53 2016
> -@@ -774,8 +774,7 @@ void plist_shuffle (struct plist *plist)
> +Index: playlist.c
> +--- playlist.c.orig
> ++++ playlist.c
> +@@ -846,7 +846,7 @@ void plist_shuffle (struct plist *plist)
> int i;
>
> - for (i = 0; i < plist->num; i++)
> -- plist_swap (plist, i,
> -- (rand()/(float)RAND_MAX) * (plist->num - 1));
> + for (i = 0; i < plist->num; i += 1)
> +- plist_swap (plist, i, (rand () / (float)RAND_MAX) * (plist->num - 1));
> + plist_swap (plist, i, arc4random_uniform(plist->num));
>
> - rb_clear (&plist->search_tree);
> + rb_tree_clear (plist->search_tree);
>
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/audio/moc/pkg/PLIST,v
> retrieving revision 1.5
> diff -u -p -u -p -r1.5 PLIST
> --- pkg/PLIST 21 Nov 2024 07:00:52 -0000 1.5
> +++ pkg/PLIST 21 Nov 2024 10:23:44 -0000
> @@ -2,6 +2,7 @@
> lib/moc/
> lib/moc/decoder_plugins/
> @so lib/moc/decoder_plugins/libaac_decoder.so
> +@so lib/moc/decoder_plugins/libffmpeg_decoder.so
> @so lib/moc/decoder_plugins/libflac_decoder.so
> @so lib/moc/decoder_plugins/libmodplug_decoder.so
> @so lib/moc/decoder_plugins/libmp3_decoder.so
> @@ -11,6 +12,7 @@ lib/moc/decoder_plugins/
> @so lib/moc/decoder_plugins/libvorbis_decoder.so
> @so lib/moc/decoder_plugins/libwavpack_decoder.so
> @man man/man1/mocp.1
> +share/applications/mocp.desktop
> share/doc/moc/
> share/doc/moc/README
> share/doc/moc/README_equalizer
> @@ -18,14 +20,23 @@ share/doc/moc/THANKS
> share/examples/moc/
> share/examples/moc/config.example
> share/examples/moc/keymap.example
> +share/icons/hicolor/scalable/apps/mocp.svg
> share/moc/
> share/moc/themes/
> +share/moc/themes/black_orange_theme
> share/moc/themes/black_theme
> +share/moc/themes/blue_theme
> share/moc/themes/darkdot_theme
> share/moc/themes/example_theme
> share/moc/themes/green_theme
> +share/moc/themes/lcars
> +share/moc/themes/lcars2
> share/moc/themes/moca_theme
> share/moc/themes/nightly_theme
> share/moc/themes/red_theme
> share/moc/themes/transparent-background
> +share/moc/themes/white_theme
> +share/moc/themes/winter
> share/moc/themes/yellow_red_theme
> +@tag update-desktop-database
> +@tag gtk-update-icon-cache %D/share/icons/hicolor
>
UPDATE: moc