From 17acc4a871b4571d453c6d2d8996a95c36ccc387 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Thu, 2 Jan 2020 16:08:27 +0200 Subject: [PATCH] add moc as disabled package Requested in https://github.com/termux/termux-packages/issues/1637. Package seems does not support PulseAudio which is required for sound output in Termux. --- disabled-packages/moc/build.sh | 9 +++++++ disabled-packages/moc/ffmpeg4.patch | 33 +++++++++++++++++++++++++ disabled-packages/moc/sun_len-def.patch | 30 ++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 disabled-packages/moc/build.sh create mode 100644 disabled-packages/moc/ffmpeg4.patch create mode 100644 disabled-packages/moc/sun_len-def.patch diff --git a/disabled-packages/moc/build.sh b/disabled-packages/moc/build.sh new file mode 100644 index 000000000..2064fa4b9 --- /dev/null +++ b/disabled-packages/moc/build.sh @@ -0,0 +1,9 @@ +# Supports only ALSA or OSS ? + +TERMUX_PKG_HOMEPAGE=http://moc.daper.net/ +TERMUX_PKG_DESCRIPTION="An ncurses console audio player designed to be powerful and easy to use" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_VERSION=2.5.2 +TERMUX_PKG_SRCURL=http://ftp.daper.net/pub/soft/moc/stable/moc-$TERMUX_PKG_VERSION.tar.bz2 +TERMUX_PKG_SHA256=f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08 +TERMUX_PKG_DEPENDS="ffmpeg, file, libcurl, libdb, libltdl, libmad, ncurses" diff --git a/disabled-packages/moc/ffmpeg4.patch b/disabled-packages/moc/ffmpeg4.patch new file mode 100644 index 000000000..fee3c1c2a --- /dev/null +++ b/disabled-packages/moc/ffmpeg4.patch @@ -0,0 +1,33 @@ +Index: decoder_plugins/ffmpeg/ffmpeg.c +=================================================================== +--- a/decoder_plugins/ffmpeg/ffmpeg.c (revisiĆ³n: 2963) ++++ b/decoder_plugins/ffmpeg/ffmpeg.c (copia de trabajo) +@@ -697,7 +697,7 @@ + * 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); +@@ -705,8 +705,8 @@ + } + + 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; + + if (avcodec_open2 (data->enc, data->codec, NULL) < 0) + { +@@ -725,7 +725,7 @@ + + 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); diff --git a/disabled-packages/moc/sun_len-def.patch b/disabled-packages/moc/sun_len-def.patch new file mode 100644 index 000000000..93650efe9 --- /dev/null +++ b/disabled-packages/moc/sun_len-def.patch @@ -0,0 +1,30 @@ +diff -uNr moc-2.5.2/main.c moc-2.5.2.mod/main.c +--- moc-2.5.2/main.c 2016-11-16 02:54:37.000000000 +0200 ++++ moc-2.5.2.mod/main.c 2020-01-02 16:01:04.339045422 +0200 +@@ -46,6 +46,11 @@ + #include "files.h" + #include "rcc.h" + ++#ifndef SUN_LEN ++# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ ++ + strlen ((ptr)->sun_path)) ++#endif ++ + struct parameters + { + char *config_file; +diff -uNr moc-2.5.2/server.c moc-2.5.2.mod/server.c +--- moc-2.5.2/server.c 2016-11-16 02:54:37.000000000 +0200 ++++ moc-2.5.2.mod/server.c 2020-01-02 16:00:50.770930819 +0200 +@@ -52,6 +52,11 @@ + #define SERVER_LOG "mocp_server_log" + #define PID_FILE "pid" + ++#ifndef SUN_LEN ++# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ ++ + strlen ((ptr)->sun_path)) ++#endif ++ + struct client + { + int socket; /* -1 if inactive */