aboutsummaryrefslogtreecommitdiffstats
path: root/community/libsrt/APKBUILD
blob: 58c55017526d7912be849d13d6ea62719680e528 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Contributor: Yohann DANELLO <yohann.danello@crans.org>
# Maintainer: Yohann DANELLO <yohann.danello@crans.org>
pkgname=libsrt
pkgver=1.4.2
pkgrel=0
pkgdesc="Secure Reliable Transport (SRT)"
options="!check" # TestMuxer.IPv4_and_IPv6 fail when setting up IPv6
url="https://www.srtalliance.org/"
arch="all"
license="MPL-2.0"
makedepends="cmake openssl-dev linux-headers"
checkdepends="gtest-dev"
subpackages="$pkgname-progs $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/Haivision/srt/archive/v$pkgver.tar.gz
	fix-cmake.patch"
builddir="$srcdir/srt-$pkgver"

build() {
	if options_has "!check"; then
		_testing=OFF
	else
		_testing=ON
	fi

	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DENABLE_UNITTESTS=$_testing \
		-DENABLE_TESTING=$_testing \
		-DENABLE_STATIC=OFF \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	# Broken tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

progs() {
	pkgdesc="Tools for working with SRT"
	depends=""
	amove usr/bin
}

sha512sums="4c978e3898737e566f47222a0095df1b49591d79927850cc94c838b7eaccf401faf1c5d038fa45b6fd30c85f980e7c212a79c07ed6f9008430e8a5a594a31ffe  libsrt-1.4.2.tar.gz
c981710879f1bd83674ed9baeb394e33c5d18af7ca8f3ce92dc683f9d4ec36baeba56bbbc36371ce66d1e65441e33c6b82aecfaa32ee76b2bd9e3dc7feb7b815  fix-cmake.patch"