2018-02-12 20:19:51 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://www.musicpd.org
|
|
|
|
TERMUX_PKG_DESCRIPTION="Music player daemon"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="GPL-2.0"
|
2019-01-11 00:56:36 +01:00
|
|
|
TERMUX_PKG_VERSION=0.21.4
|
|
|
|
TERMUX_PKG_SHA256=42e8c4f3a0a0e4632a68a2b72f580620deea539b513ac97ea3e2ed8b17094452
|
2017-05-18 00:23:11 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/MPD/archive/v$TERMUX_PKG_VERSION.tar.gz
|
2019-01-07 22:14:32 +01:00
|
|
|
TERMUX_PKG_DEPENDS="libcurl, libid3tag, libopus, libpulseaudio, libmpdclient, openal-soft, libvorbis, libsqlite, ffmpeg, libmp3lame, libbz2, libogg"
|
2019-01-07 02:04:31 +01:00
|
|
|
TERMUX_PKG_BUILD_DEPENDS="boost"
|
2017-05-18 14:03:47 +02:00
|
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
2019-01-03 00:49:06 +01:00
|
|
|
-Dalsa=disabled
|
|
|
|
-Dao=disabled
|
|
|
|
-Depoll=false
|
|
|
|
-Dexpat=disabled
|
|
|
|
-Diconv=disabled
|
|
|
|
-Dicu=disabled
|
|
|
|
-Dmad=disabled
|
|
|
|
-Dpcre=disabled
|
|
|
|
-Dsndio=disabled
|
2017-05-18 14:03:47 +02:00
|
|
|
"
|
2017-05-18 00:23:11 +02:00
|
|
|
TERMUX_PKG_CONFFILES="$TERMUX_PREFIX/etc/mpd.conf"
|
2017-05-18 14:03:47 +02:00
|
|
|
|
2017-05-18 00:23:11 +02:00
|
|
|
termux_step_pre_configure() {
|
|
|
|
CXXFLAGS+=" -DTERMUX -UANDROID"
|
|
|
|
LDFLAGS+=" -llog -lOpenSLES"
|
2019-01-03 00:49:06 +01:00
|
|
|
rm -f $TERMUX_PREFIX/etc/mpd.conf
|
2017-05-18 00:23:11 +02:00
|
|
|
}
|
2017-05-18 14:03:47 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_make_install() {
|
2019-01-03 00:49:06 +01:00
|
|
|
cp -f $TERMUX_PKG_SRCDIR/doc/mpdconf.example $TERMUX_PREFIX/etc/mpd.conf
|
|
|
|
|
2017-05-18 00:23:11 +02:00
|
|
|
# Try to work around OpenSL ES library clashes:
|
2017-05-18 14:03:47 +02:00
|
|
|
# Linking against libOpenSLES causes indirect linkage against
|
|
|
|
# libskia.so, which links against the platform libjpeg.so and
|
|
|
|
# libpng.so, which are not compatible with the Termux ones.
|
|
|
|
#
|
|
|
|
# On Android N also liblzma seems to conflict.
|
2017-05-18 00:23:11 +02:00
|
|
|
mkdir -p $TERMUX_PREFIX/libexec
|
2017-05-18 14:03:47 +02:00
|
|
|
mkdir -p $TERMUX_PREFIX/var/mpd
|
2017-05-18 00:23:11 +02:00
|
|
|
mv $TERMUX_PREFIX/bin/mpd $TERMUX_PREFIX/libexec
|
2017-05-18 14:03:47 +02:00
|
|
|
local SYSTEM_LIBFOLDER=lib64
|
|
|
|
if [ $TERMUX_ARCH_BITS = 32 ]; then SYSTEM_LIBFOLDER=lib; fi
|
2017-05-18 00:23:11 +02:00
|
|
|
|
2017-05-18 14:03:47 +02:00
|
|
|
echo "#!/bin/sh" > $TERMUX_PREFIX/bin/mpd
|
2017-05-18 00:23:11 +02:00
|
|
|
cat $TERMUX_SCRIPTDIR/packages/mpd/mpd-script.sh >> $TERMUX_PREFIX/bin/mpd
|
2017-05-18 14:03:47 +02:00
|
|
|
# Work around issues on devices having ffmpeg libraries
|
|
|
|
# in a system vendor dir, reported by live_the_dream on #termux:
|
|
|
|
local FFMPEG_LIBS="" lib
|
2017-07-14 09:49:14 +02:00
|
|
|
# c++_shared needs to go first in every c++ app that uses audio directly.
|
2018-09-22 03:04:08 +02:00
|
|
|
for lib in c++_shared curl ssl opus vorbis avcodec avfilter avformat avutil postproc swresample swscale sqlite3; do
|
2017-05-18 14:03:47 +02:00
|
|
|
if [ -n "$FFMPEG_LIBS" ]; then FFMPEG_LIBS+=":"; fi
|
|
|
|
FFMPEG_LIBS+="$TERMUX_PREFIX/lib/lib${lib}.so"
|
|
|
|
done
|
|
|
|
echo "export LD_PRELOAD=$FFMPEG_LIBS" >> $TERMUX_PREFIX/bin/mpd
|
2017-05-18 00:23:11 +02:00
|
|
|
chmod +x $TERMUX_PREFIX/bin/mpd
|
2017-05-18 14:03:47 +02:00
|
|
|
# /system/vendor/lib(64) needed for libqc-opt.so on
|
|
|
|
# a xperia z5 c, reported by BrainDamage on #termux:
|
|
|
|
echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:/system/vendor/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib exec $TERMUX_PREFIX/libexec/mpd \"\$@\"" >> $TERMUX_PREFIX/bin/mpd
|
2017-05-18 00:23:11 +02:00
|
|
|
}
|
2017-05-18 14:03:47 +02:00
|
|
|
|
2017-05-18 00:23:11 +02:00
|
|
|
termux_step_create_debscripts() {
|
2017-08-15 07:09:08 +02:00
|
|
|
echo "#!$TERMUX_PREFIX/bin/sh" > postinst
|
2017-05-18 14:03:47 +02:00
|
|
|
echo 'mkdir -p $HOME/.mpd/playlists' >> postinst
|
2017-05-18 00:23:11 +02:00
|
|
|
}
|