1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-12 18:59:50 +03:00

main/flac: Added static library

I made the shared build overwrite the installed files so people
using cmake to find dependencies would default to the shared libraries.
For people using direct linking or pkg-config, this doesn't effect them.

Signed-off-by: Charadon <dev@iotib.net>
This commit is contained in:
Charadon 2025-06-23 08:10:17 -04:00 committed by Natanael Copa
parent af41143c97
commit 253ee9b07f

View file

@ -1,13 +1,13 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=flac
pkgver=1.4.3
pkgrel=1
pkgrel=2
pkgdesc="Free Lossless Audio Codec"
url="https://xiph.org/flac/"
arch="all"
license="BSD-3-Clause AND GPL-2.0-or-later"
options="!check" # Tests are infinite
subpackages="$pkgname-dev $pkgname-libs libflac libflac++:libpp $pkgname-doc"
subpackages="$pkgname-static $pkgname-dev $pkgname-libs libflac libflac++:libpp $pkgname-doc"
makedepends="cmake libogg-dev !libiconv samurai"
source="https://downloads.xiph.org/releases/flac/flac-$pkgver.tar.xz"
@ -22,6 +22,7 @@ build() {
export CFLAGS="$CFLAGS -O3 -flto=auto"
export CXXFLAGS="$CXXFLAGS -O3 -flto=auto"
# Shared
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
@ -29,15 +30,27 @@ build() {
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON \
-DNDEBUG=ON
# Static
cmake -B build-static -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DNDEBUG=ON
cmake --build build
cmake --build build-static
}
check() {
ctest --test-dir build
ctest --test-dir build-static
}
package() {
# Static goes first, so it won't overwrite the shared version of files.
DESTDIR="$pkgdir" cmake --install build-static
DESTDIR="$pkgdir" cmake --install build
install -Dm0644 COPYING.Xiph \