ncmpcpp cpp curses mpdclient (#975)
[termux-packages] / packages / mpd / build.sh
CommitLineData
49196266 1TERMUX_PKG_HOMEPAGE="https://www.musicpd.org"
2TERMUX_PKG_DESCRIPTION="music player daemon"
3TERMUX_PKG_VERSION=0.20.6
4TERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/MPD/archive/v$TERMUX_PKG_VERSION.tar.gz
5TERMUX_PKG_FOLDERNAME=MPD-$TERMUX_PKG_VERSION
6TERMUX_PKG_SHA256=42729305dbafb912bb9197698822b112aa78ab691f87433e37c511ce91ce0a0d
7TERMUX_PKG_DEPENDS="libcurl, libid3tag, libopus, libevent, fftw, libpulseaudio, libmpdclient, boost, openal-soft, libvorbis, libsqlite, ffmpeg"
8TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-sndio --disable-alsa --disable-ao --disable-mad --without-tremor --disable-epoll --disable-iconv --disable-icu"
9TERMUX_PKG_BUILD_IN_SRC=yes
10TERMUX_PKG_CONFFILES="$TERMUX_PREFIX/etc/mpd.conf"
11termux_step_pre_configure() {
12 CXXFLAGS+=" -DTERMUX -UANDROID"
13 LDFLAGS+=" -llog -lOpenSLES"
14 NOCONFIGURE=1 ./autogen.sh
15 rm -f /data/data/com.termux/files/usr/etc/mpd.conf
16}
17termux_step_make_install () {
18 # Try to work around OpenSL ES library clashes:
19 # Linking against libOpenSLES causes indirect linkage against
20 # libskia.so, which links against the platform libjpeg.so and
21 # libpng.so, which are not compatible with the Termux ones.
22 #
23 # On Android N also liblzma seems to conflict.
24 make install
25 cp -f $TERMUX_PREFIX/share/doc/mpd/mpdconf.example /data/data/com.termux/files/usr/etc/mpd.conf
26 mkdir -p $TERMUX_PREFIX/libexec
27 mkdir -p $TERMUX_PREFIX/var/mpd
28 mv $TERMUX_PREFIX/bin/mpd $TERMUX_PREFIX/libexec
29 local SYSTEM_LIBFOLDER=lib64
30 if [ $TERMUX_ARCH_BITS = 32 ]; then SYSTEM_LIBFOLDER=lib; fi
31
32 echo "#!/bin/sh" > $TERMUX_PREFIX/bin/mpd
33 cat $TERMUX_SCRIPTDIR/packages/mpd/mpd-script.sh >> $TERMUX_PREFIX/bin/mpd
34 # Work around issues on devices having ffmpeg libraries
35 # in a system vendor dir, reported by live_the_dream on #termux:
36 local FFMPEG_LIBS="" lib
37 # gnustl_shared needs to go first in every c++ app that uses audio directly.
38 for lib in gnustl_shared curl ssl event opus vorbis avcodec avfilter avformat avutil postproc swresample swscale sqlite3; do
39 if [ -n "$FFMPEG_LIBS" ]; then FFMPEG_LIBS+=":"; fi
40 FFMPEG_LIBS+="$TERMUX_PREFIX/lib/lib${lib}.so"
41 done
42 echo "export LD_PRELOAD=$FFMPEG_LIBS" >> $TERMUX_PREFIX/bin/mpd
43 chmod +x $TERMUX_PREFIX/bin/mpd
44 # /system/vendor/lib(64) needed for libqc-opt.so on
45 # a xperia z5 c, reported by BrainDamage on #termux:
46 echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:/system/vendor/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib exec $TERMUX_PREFIX/libexec/mpd \"\$@\"" >> $TERMUX_PREFIX/bin/mpd
47
48}
49termux_step_create_debscripts() {
50echo 'mkdir -p $HOME/.mpd/playlists' >> postinst
51}