APP=alsa-lib
VERSION=1.2.3.1
BUILD=1sml
HOMEPAGE="http://alsa-project.org"
DOWNLOAD=''
DESC="Advanced Linux Sound Architecture provides audio and MIDI functionality for Linux"
REQUIRES="musl"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z**
  cd $APP-$VERSION
  fixbuilddirpermissions

  patch -p1 < $SRCDIR/remove-test.patch

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --disable-python \
    --disable-static \
    --disable-resmgr \
    --enable-seq \
    --enable-aload \
    --disable-dependency-tracking \
    --without-versioned 

  make
  make install DESTDIR=$PKG

  cp COPYING $PKGDOCS/

  ( cd $PKG
    mv share/alsa/alsa.conf share/alsa/alsa.conf.new 
    # create a blank asound.conf.new
    mkdir -p etc ; touch etc/asound.conf.new
  )

  if [ "$ARCH" = "aarch64" ]; then
    # Provide some sample conf files for using USB audio by overwriting the above file
    cp $SRCDIR/alsa.conf.rpi.usbaudio $PKG/share/alsa/alsa.conf.new
    cp $SRCDIR/asound.conf.rpi $PKG/etc/asound.conf.new
  fi

  mkfinalpkg
}

SHA512SUMS="
ed0a81371117a91a5024f3bef5a881ffa9521399eab5e016924669a3f1eba2d6a02efa284b160089bc581717d39d15325ebb2faf162e4d3dabe4c29785a5fb58  alsa-lib-1.2.3.1.tar.bz2
e15318431fe2d5bd1e42ef793f223e3e5995890d7befe6daa3d7456ccf5cb2f51eb79171539cecae13032a9b8a798ea35e04c89b27c7ef9567e2c03fb8db4512  remove-test.patch
"
