# Maintainer: Melvin Vermeeren <mail@mel.vin>
# Adapted to and included in Slint by Didier Spaier didieratslintdotfr
pkgname=mpd-sacd
pkgver=0.23.11
pkgrel=1slint
# I install Sphinx as user to buid the doc - Didier
export PATH=$PATH:~/.local/bin
slackdesc=\
(
 #|-----handy-ruler------------------------------------------------------|
"$pkgname (Music Player Daemon with SACD and DVDA ISO playback.)"

"MPD is designed for integrating a computer into a stereo system that"
"provides control for music playback over a local network.  It is also"
"a great music player using one of many available clients."

"URL: https://sourceforge.net/p/sacddecoder/mpd/MPD.git/ci/master/tree/"
)
export giturl=https://git.code.sf.net/p/sacddecoder/mpd/MPD.git
export commit=dd961b15
license=('GPL')
depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl' 'faad2'
	'sqlite' 'jack' 'libmms' 'wavpack' 'avahi' 'libid3tag' 'yajl' 'libmpdclient'
	'icu' 'libupnp' 'libnfs' 'libsamplerate' 'libsoxr' 'smbclient' 'libcdio-paranoia'
	'libgme' 'zziplib' 'fluidsynth' 'libmikmod' 'wildmidi')
makedepends=('boost' 'meson' 'python-sphinx' 'clang' 'ninja')
source=("mpd-${pkgver}.tar.xz" 'sysusers.d' 'tmpfiles.d' 'conf' 'README.Slint')
docs=(mpdconf.example README.Slint)
options=('nosrcpack')

build() {
	cd mpd-$pkgver
	meson . output/release \
		--mandir=/usr/man \
		--prefix=/usr \
		--sysconfdir=/etc \
        --localstatedir=/var \
        --sharedstatedir=/var/lib
	ninja -C output/release
	DESTDIR=$PKG ninja -C output/release install
	mkdir -p $PKG/usr/doc/mpd-sacd-$pkgver
	cp -r $PKG/usr/share/doc/mpd/* $PKG/usr/doc/mpd-sacd-$pkgver/
	rm -r $PKG/usr/share/doc
	(cd $PKG/usr/doc/mpd-sacd-$pkgver
	pandoc -f gfm -t html5 -o README.html README.md && rm README.md
	)
	install -Dm644 ../../sysusers.d $PKG/usr/lib/sysusers.d/mpd.conf
	install -Dm644 ../../conf $PKG/etc/mpd.conf
	install -Dm644 ../../tmpfiles.d $PKG/usr/lib/tmpfiles.d/mpd.conf
}
