archrelease: copy trunk to extra-x86_64
[arch-packages.git] / flac / repos / extra-x86_64 / PKGBUILD
blobb164be102993dff91380b7743490fdd2f8e46d75
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Eric BĂ©langer <eric@archlinux.org>
4 pkgbase=flac
5 pkgname=('flac' 'flac-doc')
6 pkgver=1.4.2
7 pkgrel=1
8 pkgdesc='Free Lossless Audio Codec'
9 url='https://xiph.org/flac/'
10 arch=('x86_64')
11 license=('BSD' 'GPL')
12 depends=('gcc-libs' 'libogg')
13 makedepends=('nasm' 'cmake' 'ninja' 'doxygen' 'git' 'pandoc')
14 options=('debug')
15 _commit=b32e5cbf9818ca23dd22aaa75522042c16ea7d17  # tags/1.4.2
16 source=("git+https://github.com/xiph/flac?signed#commit=$_commit")
17 b2sums=('SKIP')
18 validpgpkeys=('5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23') # https://github.com/web-flow.gpg
20 pkgver() {
21   cd flac
22   git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
25 prepare() {
26   cd flac
28   # Fix GStreamer
29   # https://bugs.archlinux.org/task/76120
30   git cherry-pick -n 3d55a9dc6c14317b4766db96bb52e2fd95e920a9
32   # Shorten tests
33   sed -i 's/FLAC__TEST_LEVEL=1/FLAC__TEST_LEVEL=0/' test/CMakeLists.txt
36 build() {
37   cmake -S flac -B build -G Ninja \
38     -DCMAKE_BUILD_TYPE=None \
39     -DCMAKE_INSTALL_PREFIX=/usr \
40     -DBUILD_SHARED_LIBS=ON \
41     -DINSTALL_MANPAGES=ON \
42     -DWITH_STACK_PROTECTOR=OFF \
43     -DNDEBUG=ON
44   cmake --build build
46   # Build docs and place them where install expects them
47   cmake --build build --target FLAC-doxygen
48   mv build/doc/doxytmp/html flac/doc/api
51 check() {
52   cd build
53   ctest --output-on-failure --stop-on-failure -j1
56 package_flac() {
57   provides=('libFLAC.so' 'libFLAC++.so')
59   DESTDIR="${pkgdir}" cmake --install build
61   install -Dm 644 flac/src/*/*.m4 -t "${pkgdir}/usr/share/aclocal"
63   mkdir -p doc/usr/share
64   mv {"${pkgdir}",doc}/usr/share/doc
66   install -Dm 644 flac/COPYING.Xiph -t "${pkgdir}/usr/share/licenses/${pkgname}"
69 package_flac-doc() {
70   pkgdesc+=' documentation'
71   depends=()
73   mv doc/* "$pkgdir"
75   install -Dm 644 flac/COPYING.Xiph -t "${pkgdir}/usr/share/licenses/${pkgname}"
78 # vim:set sw=2 sts=-1 et: