NAME="pulseaudio"
DESC="Sound system for POSIX OSes"
VERSION="16.1"
FILES=("https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-$VERSION.tar.xz")
HASHES=("2c7b8ceb5d7337565c7314b4d6087ca8")
DEPENDS=("speex" "glib" "alsa-lib" "libsndfile" "dbus")

PACKAGE() {
  tar xf $NAME-$VERSION.tar.xz
  cd $NAME-$VERSION

  mkdir build
  cd    build

  meson setup --prefix=/usr     \
            --buildtype=release \
            -Ddatabase=gdbm     \
            -Ddoxygen=false     \
            -Dbluez5=disabled   \
            .. 

  ninja && DESTDIR="$ROOTDIR" ninja install
  rm -fv "$ROOTDIR/etc/dbus-1/system.d/pulseaudio-system.conf"
  mv "$ROOTDIR/lib/udev" "$ROOTDIR/usr/lib/udev"
  rm -rv "$ROOTDIR/lib"

  cd ../.. && rm -r $NAME-$VERSION
}
