1 TERMUX_PKG_HOMEPAGE
=https
://www.musicpd.org
2 TERMUX_PKG_DESCRIPTION
="Music player daemon"
3 TERMUX_PKG_VERSION
=0.20.18
5 TERMUX_PKG_SHA256
=7bef591314a4e3336767314b469da0aa212a5fd2a29480eeff831fafaf9079c7
6 TERMUX_PKG_SRCURL
=https
://github.com
/MusicPlayerDaemon
/MPD
/archive
/v
$TERMUX_PKG_VERSION.
tar.gz
7 TERMUX_PKG_DEPENDS
="libcurl, libid3tag, libopus, libevent, fftw, libpulseaudio, libmpdclient, boost, openal-soft, libvorbis, libsqlite, ffmpeg, libmp3lame, libbz2"
8 TERMUX_PKG_EXTRA_CONFIGURE_ARGS
="
19 TERMUX_PKG_BUILD_IN_SRC
=yes
20 TERMUX_PKG_CONFFILES
="$TERMUX_PREFIX/etc/mpd.conf"
22 termux_step_pre_configure
() {
23 CXXFLAGS
+=" -DTERMUX -UANDROID"
24 LDFLAGS
+=" -llog -lOpenSLES"
25 NOCONFIGURE
=1 .
/autogen.sh
26 rm -f
/data
/data
/com.termux
/files
/usr
/etc
/mpd.conf
29 termux_step_make_install
() {
30 # Try to work around OpenSL ES library clashes:
31 # Linking against libOpenSLES causes indirect linkage against
32 # libskia.so, which links against the platform libjpeg.so and
33 # libpng.so, which are not compatible with the Termux ones.
35 # On Android N also liblzma seems to conflict.
37 cp -f
$TERMUX_PREFIX/share
/doc
/mpd
/mpdconf.example
/data
/data
/com.termux
/files
/usr
/etc
/mpd.conf
38 mkdir
-p
$TERMUX_PREFIX/libexec
39 mkdir
-p
$TERMUX_PREFIX/var
/mpd
40 mv $TERMUX_PREFIX/bin
/mpd
$TERMUX_PREFIX/libexec
41 local SYSTEM_LIBFOLDER
=lib64
42 if [ $TERMUX_ARCH_BITS = 32 ]; then SYSTEM_LIBFOLDER
=lib
; fi
44 echo "#!/bin/sh" > $TERMUX_PREFIX/bin
/mpd
45 cat $TERMUX_SCRIPTDIR/packages
/mpd
/mpd-script.sh
>> $TERMUX_PREFIX/bin
/mpd
46 # Work around issues on devices having ffmpeg libraries
47 # in a system vendor dir, reported by live_the_dream on #termux:
48 local FFMPEG_LIBS
="" lib
49 # c++_shared needs to go first in every c++ app that uses audio directly.
50 for lib
in c
++_shared curl ssl event opus vorbis avcodec avfilter avformat avutil postproc swresample swscale sqlite3
; do
51 if [ -n
"$FFMPEG_LIBS" ]; then FFMPEG_LIBS
+=":"; fi
52 FFMPEG_LIBS
+="$TERMUX_PREFIX/lib/lib${lib}.so"
54 echo "export LD_PRELOAD=$FFMPEG_LIBS" >> $TERMUX_PREFIX/bin
/mpd
55 chmod +x
$TERMUX_PREFIX/bin
/mpd
56 # /system/vendor/lib(64) needed for libqc-opt.so on
57 # a xperia z5 c, reported by BrainDamage on #termux:
58 echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:/system/vendor/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib exec $TERMUX_PREFIX/libexec/mpd \"\$@\"" >> $TERMUX_PREFIX/bin
/mpd
61 termux_step_create_debscripts
() {
62 echo "#!$TERMUX_PREFIX/bin/sh" > postinst
63 echo 'mkdir -p $HOME/.mpd/playlists' >> postinst