description="Linux Audio Developer's Simple Plugin API (LADSPA)"
url="http://www.ladspa.org/"

packager="tnut <tnut@nutyx.org>"
contributors="Pierre B"

makedepends=(libsndfile)

name=ladspa
version=1.17

source=(https://ladspa.org/download/ladspa_sdk_${version}.tgz
       ladspa-fix-memleak-in-plugin-scanning.patch)

build() {
mv -v ${name}_sdk_${version} ${name}-${version}
cd $name-$version
patch -Np0 -i ../ladspa-fix-memleak-in-plugin-scanning.patch

sed -e "s#-O2#${CFLAGS} ${LDFLAGS}#" -i src/Makefile
cd src
make targets
make INSTALL_PLUGINS_DIR="$PKG/usr/lib/ladspa/" \
     INSTALL_INCLUDE_DIR="$PKG/usr/include/"    \
     INSTALL_BINARY_DIR="$PKG/usr/bin/" install

install -vDm 644 ../doc/*.{html,txt} -t $PKG/usr/share/doc/$name
}
