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.
This commit is contained in:
Leonid Pliushch 2020-01-02 16:08:27 +02:00
parent 377e59e2f5
commit 17acc4a871
3 changed files with 72 additions and 0 deletions

View File

@ -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"

View File

@ -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);

View File

@ -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 */