summaryrefslogtreecommitdiff
path: root/user/libsndfile/APKBUILD
blob: fc6b77f6aad538effedf7203331825299dd0ff39 (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
58
59
60
61
62
63
64
65
66
# Contributor: Sergey Lukin <sergej.lukin@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libsndfile
pkgver=1.1.0
pkgrel=0
pkgdesc="Library for reading and writing sampled sound files (WAV, AIFF, ...)"
url="https://libsndfile.github.io/libsndfile/"
arch="all"
license="LGPL-2.1-only OR LGPL-3.0-only"
subpackages="$pkgname-dev $pkgname-doc"
depends=""
makedepends="alsa-lib-dev flac-dev libogg-dev libvorbis-dev linux-headers opus-dev python3 cmake"
source="https://github.com/libsndfile/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz"

# secfixes:
#   1.0.28-r2:
#   - CVE-2017-12562
#   1.0.28-r0:
#   - CVE-2017-7585
#   - CVE-2017-7741
#   - CVE-2017-7742
#   1.0.28-r1:
#   - CVE-2017-8361
#   - CVE-2017-8362
#   - CVE-2017-8363
#   - CVE-2017-8365

build() {
	cmake -B build-shared \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DENABLE_MPEG=OFF \
		-DBUILD_REGTEST=OFF \
		-DBUILD_TESTING=OFF
	make -C build-shared

	# required for testing
	cmake -B build-static \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=False \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DENABLE_MPEG=OFF \
		-DBUILD_REGTEST=OFF \
		-DBUILD_TESTING=ON
	make -C build-static
}

check() {
	cd build-static
	# the failed 'wrt_32bit.sd2' test is not a new regression
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E '(write_read_test_sd2)'
}

package() {
	make -C build-shared DESTDIR="$pkgdir" install
	make -C build-static DESTDIR="$pkgdir" install
}

sha512sums="d01696a8a88a4444e5eb91a137cf7b26b55b12c1fe3b648653f7e78674bbdf61870066216c9ff2f6a1e63bdf7b558af9a759480cf6523b607d29347b12762006  libsndfile-1.1.0.tar.xz"