1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
inherit multilib-minimal
|
7 |
7 |
|
8 |
|
DESCRIPTION="free lossless audio encoder and decoder"
|
|
8 |
DESCRIPTION="Free lossless audio encoder and decoder"
|
9 |
9 |
HOMEPAGE="https://xiph.org/flac/"
|
10 |
10 |
SRC_URI="https://downloads.xiph.org/releases/${PN}/${P}.tar.xz"
|
11 |
11 |
|
12 |
12 |
LICENSE="BSD FDL-1.2 GPL-2 LGPL-2.1"
|
13 |
|
SLOT="0"
|
|
13 |
# <libFLAC SONAME>-<libFLAC++ SONAME>
|
|
14 |
SLOT="0/10-12"
|
14 |
15 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-solaris"
|
15 |
|
IUSE="+cxx debug ogg cpu_flags_ppc_altivec cpu_flags_ppc_vsx cpu_flags_x86_sse static-libs"
|
|
16 |
IUSE="+cxx debug ogg cpu_flags_x86_avx2 cpu_flags_x86_avx static-libs"
|
|
17 |
# AVX configure switch is for both AVX & AVX2
|
|
18 |
REQUIRED_USE="
|
|
19 |
cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
|
|
20 |
"
|
16 |
21 |
|
17 |
22 |
RDEPEND="ogg? ( media-libs/libogg[${MULTILIB_USEDEP}] )"
|
18 |
23 |
DEPEND="${RDEPEND}"
|
... | ... | |
20 |
25 |
app-arch/xz-utils
|
21 |
26 |
sys-devel/gettext
|
22 |
27 |
virtual/pkgconfig
|
23 |
|
abi_x86_32? ( dev-lang/nasm )"
|
|
28 |
"
|
24 |
29 |
|
25 |
30 |
multilib_src_configure() {
|
26 |
31 |
local myeconfargs=(
|
27 |
32 |
--disable-doxygen-docs
|
28 |
33 |
--disable-examples
|
29 |
|
--disable-xmms-plugin
|
30 |
34 |
$([[ ${CHOST} == *-darwin* ]] && echo "--disable-asm-optimizations")
|
31 |
|
$(use_enable cpu_flags_ppc_altivec altivec)
|
32 |
|
$(use_enable cpu_flags_ppc_vsx vsx)
|
33 |
|
$(use_enable cpu_flags_x86_sse sse)
|
|
35 |
$(use_enable cpu_flags_x86_avx avx)
|
34 |
36 |
$(use_enable cxx cpplibs)
|
35 |
37 |
$(use_enable debug)
|
36 |
38 |
$(use_enable ogg)
|
... | ... | |
40 |
42 |
# no effect if ogg support is disabled
|
41 |
43 |
--with-ogg
|
42 |
44 |
)
|
|
45 |
|
43 |
46 |
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
44 |
47 |
}
|
45 |
48 |
|
46 |
49 |
multilib_src_test() {
|
47 |
50 |
if [[ ${UID} != 0 ]]; then
|
|
51 |
# Parallel tests work for CMake but don't for autotools as of 1.4.3
|
|
52 |
# https://github.com/xiph/flac/commit/aaffdcaa969c19aee9dc89be420eae470b55e405
|
48 |
53 |
emake -j1 check
|
49 |
54 |
else
|
50 |
55 |
ewarn "Tests will fail if ran as root, skipping."
|