aboutsummaryrefslogtreecommitdiffstats
path: root/main/flac/APKBUILD
blob: 3d4893b6788374da1426419dfc5110b3cdd20473 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=flac
pkgver=1.4.0
pkgrel=0
pkgdesc="Free Lossless Audio Codec"
url="https://xiph.org/flac/"
arch="all"
license="custom:Xiph LGPL GPL FDL"
options="!check" # Tests are infinite
subpackages="$pkgname-dev $pkgname-libs $pkgname-doc"
makedepends="cmake libogg-dev nasm !libiconv samurai"
source="https://downloads.xiph.org/releases/flac/flac-$pkgver.tar.xz"

# secfixes:
#   1.3.4-r0:
#     - CVE-2020-0499
#     - CVE-2021-0561
#   1.3.2-r2:
#     - CVE-2017-6888


build() {
	case "$CARCH" in
	x86)
		local sse=off
		;;
	x86_64)
		local sse=on
		;;
	esac

	export CFLAGS="$CFLAGS -O2 -flto=auto"
	export CXXFLAGS="$CXXFLAGS -O2 -flto=auto"

	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_MANDIR=/usr/share/man/man1 \
		-DBUILD_TESTING=OFF \
		-DBUILD_EXAMPLES=OFF \
		-DBUILD_SHARED_LIBS=ON \
		-DNDEBUG=ON \
		-DWITH_SSE=$sse

	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

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

	install -Dm0644 COPYING.Xiph \
		"$pkgdir"/usr/share/licenses/$pkgname/COPYING.Xiph
}

sha512sums="
b7310de7bcf49584c0a1fdc6d5ee7216a8ab3e2b1af85366fa0905752da13e1cbb9638e0d92f3b756568a69848abf4d5c2fe0d21a86c6fdb4840f2678daf0f8d  flac-1.4.0.tar.xz
"