description="A library written in C that allows you to create and run audio and video streams"
url="https://github.com/BelledonneCommunications/bctoolbox"

packager="tnut <tnut@nutyx.org>"
contributors="Rems"

makedepends=(mbedtls bcunit cmake)

name=bctoolbox
version=0.6.0
release=2

PKGMK_KEEP_SOURCES="no"

source=(https://github.com/BelledonneCommunications/bctoolbox/archive/$version.tar.gz
        https://sources.debian.org/data/main/b/bctoolbox/0.6.0-2/debian/patches/fix-ftbfs-with-mbedtls-2.7.patch
        https://sources.debian.org/data/main/b/bctoolbox/0.6.0-2/debian/patches/deprecated_mbedtls_header)

build() {

cd $name-$version
patch -Np1 -i ../fix-ftbfs-with-mbedtls-2.7.patch
patch -Np1 -i ../deprecated_mbedtls_header
mkdir -pv build
cd build
cmake -DCMAKE_SKIP_RPATH=ON -DENABLE_TESTS_COMPONENT=OFF \
      -DENABLE_SHARED=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make
make DESTDIR="${PKG}" install
}
