Адъ меломана. NB mpd для Solaris

Database+files only mpd for installation on home NFS server.

Только база данных с поддержкой нужных файлов без вывода, ресемплеров, энкодеров.

Update: значительнее практичнее использовать ffmpeg вместо libmad, wavpack, flac.

Basic env and preparations

export DEV_ROOT=/develop/build
export DEV_SRC=/develop/source
PATH=/usr/gnu/bin:/usr/local/bin:/develop/build/bin/:/usr/opengrok/bin:$PATH
sudo pkg install gnu-* (alot of GNU staff like autoconf/automake/grep)
sudo pkg install codec/flac
sudo pkg install develop/icu
cd $DEV_SRC && mkdir mpd && cd mpd

Boost (about 2 hours)

git clone --recursive https://github.com/boostorg/boost.git
cd boost
./bootstrap.sh --without-libraries=python \
--without-libraries=stacktrace
./b2 -d 0 -q -j 8
cd ..

libfaad (aac, i have a huge collection in aac format)

git clone git@github.com:gypified/libfaad.git
cd libfaad
./configure --prefix $DEV_ROOT
gmake -j 8 install
cd ..

WavPack

wget http://www.wavpack.com/wavpack-5.1.0.tar.bz2
gtar cfj wavpack-5.1.0.tar.bz2
cd wavpack-5.1.10
./configure --prefix $DEV_ROOT
gmake -j 8 install
cd ..

libmad

wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
gtar xfz libmad-0.15.1b.tar.gz
cd libmad
./configure --prefix $DEV_ROOT
gmake -j 8 install
cd ..

libid3tag

wget ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz
gtar xfz libid3tag-0.15.1b.tar.gz
tar xfz libid3tag-0.15.1b.tar.gz
cd libid3tag
./configure --prefix $DEV_ROOT
gmake -j 8 install
cd ..

mpd (10 minutes)

git clone git@github.com:MusicPlayerDaemon/MPD.git
cd MPD
# pkg install codec/flac develop/icu
./configure \
 --with-boost=$DEV_SRC/mpd/boost \
 --with-boost-libdir=$DEV_SRC/mpd/boost/stage/lib \
 --prefix $DEV_ROOT \
 --sysconfdir=/etc \
 CPPFLAGS="-I/usr/include -I$DEV_ROOT/include" \
 LD_LIBRARY_PATH=$DEV_ROOT/lib \
 ID3TAG_LIBS=$DEV_ROOT/lib \
 MAD_LIBS=$DEV_ROOT/lib \
 PKG_CONFIG_PATH=$DEV_ROOT/lib/pkgconfig \
 --with-zeroconf=no \
 --disable-pulse \
 --disable-alsa \
 --disable-ipv6 \
 --disable-oss \
 --disable-solaris-output \
 --disable-iso9660 \
 --disable-ipv6 \
 --disable-nfs \
 --disable-smbclient \
 --disable-webdav \
 --disable-adplug \
 --disable-audiofile \
 --disable-ffmpeg \
 --disable-fluidsynth \
 --disable-gme \
 --disable-mikmod \
 --disable-modplug \
 --disable-mpc \
 --disable-mpg123 \
 --disable-sidplay \
 --disable-sndfile \
 --disable-vorbis \
 --disable-wildmidi \
 --disable-ao \
 --disable-alsa \
 --disable-fifo \
 --disable-haiku \
 --disable-httpd-output \
 --disable-jack \
 --disable-mms \
 --disable-openal \
 --disable-oss \
 --disable-osx \
 --disable-pipe-output \
 --disable-pulse \
 --disable-recorder-output \
 --disable-roar \
 --disable-shout \
 --disable-sndio \
 --disable-solaris-output \
 --disable-cdio-paranoia \
 --disable-soundcloud \
 --disable-lame-encoder \
 --disable-shine-encoder \
 --disable-twolame-encoder \
 --disable-vorbis-encoder \
 --disable-wave-encoder \
 --disable-lsr \
 --disable-soxr \
 --disable-neighbor-plugins \
 --disable-upnp \
 --disable-expat \
 --disable-libwrap \
 --disable-debug \
 --disable-test \
 --disable-documentation \
 --disable-inotify \
 --disable-libmpdclient \
 --disable-zzip \
 --disable-opus \
 --enable-database \
 --enable-daemon \
 --enable-sqlite \
 --enable-icu \
 --enable-un \
 --enable-id3 \
 --enable-mad \
 --enable-flac \
 --enable-bzip2 \
 --enable-cue \
 --enable-curl \
 --enable-tcp \
 --enable-largefile \
 --enable-dsd \
 --enable-zlib \
 --enable-wavpack \
 --enable-aac \
gmake -j 8
PARTIALLY static build – this is VERY dirty shit but it works good
g++ -std=c++14 -D_POSIX_PTHREAD_SEMANTICS -pthread -g -O2 \
 -fvisibility=hidden -fno-threadsafe-statics \
 -fmerge-all-constants -ffast-math -ftree-vectorize \
 -ffunction-sections -fdata-sections -Wall -Wextra \
 -Wmissing-declarations -Wshadow -Wpointer-arith \
 -Wcast-qual -Wwrite-strings -Wsign-compare \
 -Wno-noexcept-type -o src/mpd src/Main.o libdecoder.a \
 $DEV_ROOT/lib/libid3tag.a $DEV_ROOT/lib/libmad.a \
 $DEV_ROOT/lib/libwavpack.a $DEV_ROOT/lib/libfaad.a \
 libmpd.a  libdb_plugins.a   libstorage.a \
 -lcurl libplaylist_plugins.a -lFLAC -lm -lsqlite3 \
 libdecoder.a libxiph.a -lFLAC -lm -L/develop/build/lib \
 libinput.a -lcurl libarchive.a -lbz2 liboutput_plugins.a \
 libtag.a -lz libfilter_plugins.a libpcm.a libmixer_plugins.a \
 libconf.a libbasic.a libevent.a libthread.a libnet.a libfs.a \
 -lz libsystem.a libutil.a libicu.a -licui18n -licuuc \
 -licudata -lm -lnsl -lsocket
strip src/mpd

Now we had mpd binary dynamically linked only with system-wide libs, and now it’s ready for deployment (as database only, there is no output plugins, encoders, so on).

Leave a Reply