# Maintainer: Newbyte <newbyte@postmarketos.org>
pkgname=sofia-sip-linphone
pkgver=1.13.45
_pkgver="${pkgver}bc"
pkgrel=0
pkgdesc="RFC3261 compliant SIP User-Agent library (Linphone version)"
url="https://gitlab.linphone.org/BC/public/external/sofia-sip"
arch="all"
license="LGPL-2.1-only"
options="!check" # torture_su_root test fails
makedepends="automake autoconf coreutils libtool m4 glib-dev openssl-dev>3 lksctp-tools-dev"
subpackages="$pkgname-dev $pkgname-dbg $pkgname-doc $pkgname-tools"
source="$pkgname-$_pkgver.tar.gz::https://github.com/BelledonneCommunications/sofia-sip/archive/$_pkgver.tar.gz
	0001-Remove-bc-suffix-from-version.patch
	"
builddir="$srcdir/sofia-sip-$_pkgver"

prepare() {
	default_prepare
	sh autogen.sh
}

build() {
	./configure \
		--prefix=/usr \
		--with-openssl \
		--enable-static=no \
		--disable-rpath
	make
}

check() {
	TPORT_DEBUG=9 TPORT_TEST_HOST=0.0.0.0 make check
}

package() {
	make DESTDIR="$pkgdir" install
}

tools() {
	amove usr/bin
}

sha512sums="
4e6ed6c8ad0dba53c4c490abe248e8c537e00991d78e882ec93920477f6f2b36ee1fe5cfa90cea1c6f3d07fbccdd96adea881efd49e3aa89f647826ce8200344  sofia-sip-linphone-1.13.45bc.tar.gz
f1dbeab1293f936092439d34046ae9fece6a283656746d92d49115c94a65c2a2061a55ff069949af663b8e96991c056cba5677efffce879eae2791ecf1b9263d  0001-Remove-bc-suffix-from-version.patch
"
