| 1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 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 |
# Please bump with media-video/x264-encoder
|
| 7 |
7 |
|
| 8 |
|
inherit multilib-minimal toolchain-funcs flag-o-matic
|
|
8 |
inherit edo multilib-minimal toolchain-funcs flag-o-matic
|
| 9 |
9 |
|
| 10 |
10 |
DESCRIPTION="Free library for encoding X264/AVC streams"
|
| 11 |
11 |
HOMEPAGE="https://www.videolan.org/developers/x264.html"
|
| ... | ... | |
| 16 |
16 |
else
|
| 17 |
17 |
X264_COMMIT="4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1"
|
| 18 |
18 |
SRC_URI="https://code.videolan.org/videolan/x264/-/archive/${X264_COMMIT}/x264-${X264_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
|
| 19 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
|
|
19 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
| 20 |
20 |
S="${WORKDIR}/${PN}-${X264_COMMIT}"
|
| 21 |
21 |
fi
|
| 22 |
22 |
|
| 23 |
23 |
LICENSE="GPL-2"
|
| 24 |
24 |
SLOT="0/164" # SONAME
|
| 25 |
|
IUSE="cpu_flags_ppc_altivec +interlaced opencl static-libs +threads"
|
|
25 |
IUSE="cpu_flags_ppc_altivec +interlaced opencl static-libs"
|
| 26 |
26 |
|
| 27 |
27 |
ASM_DEP=">=dev-lang/nasm-2.13"
|
| 28 |
28 |
DEPEND="
|
| ... | ... | |
| 45 |
45 |
export AS="${CC}"
|
| 46 |
46 |
fi
|
| 47 |
47 |
|
| 48 |
|
local asm_conf=""
|
| 49 |
|
|
| 50 |
|
if \
|
| 51 |
|
[[ ${ABI} == x86* ]] \
|
| 52 |
|
|| [[ ${ABI} == "x32" ]] \
|
| 53 |
|
|| [[ ${CHOST} == armv5* ]] \
|
| 54 |
|
|| [[ ${ABI} == ppc* ]] && { use !cpu_flags_ppc_altivec ; } \
|
| 55 |
|
|| use mips && { ! test-compile 'c' 'int main(void){__asm__("addvi.b $w0, $w1, 1");return 0;}' ; }
|
| 56 |
|
then
|
| 57 |
|
asm_conf=" --disable-asm"
|
|
48 |
local myconf=(
|
|
49 |
--prefix="${EPREFIX}"/usr
|
|
50 |
--libdir="${EPREFIX}"/usr/$(get_libdir)
|
|
51 |
--disable-cli
|
|
52 |
--disable-avs
|
|
53 |
--disable-lavf
|
|
54 |
--disable-swscale
|
|
55 |
--disable-ffms
|
|
56 |
--disable-gpac
|
|
57 |
--enable-pic
|
|
58 |
--enable-shared
|
|
59 |
--host="${CHOST}"
|
|
60 |
--cross-prefix="${CHOST}-"
|
|
61 |
$(usex interlaced "" "--disable-interlaced")
|
|
62 |
$(usex opencl "" "--disable-opencl")
|
|
63 |
$(usex static-libs "--enable-static" "")
|
|
64 |
)
|
|
65 |
|
|
66 |
if [[ ${ABI} == x86* || ${ABI} == x32 || ${CHOST} == armv5* ]]; then
|
|
67 |
myconf+=( --disable-asm )
|
|
68 |
elif [[ ${ABI} == ppc* ]]; then
|
|
69 |
if ! use cpu_flags_ppc_altivec; then
|
|
70 |
myconf+=( --disable-asm )
|
|
71 |
fi
|
|
72 |
elif use mips; then
|
|
73 |
if ! test-compile 'c' 'int main(void){__asm__("addvi.b $w0, $w1, 1");return 0;}'; then
|
|
74 |
myconf+=( --disable-asm )
|
|
75 |
fi
|
| 58 |
76 |
fi
|
| 59 |
77 |
|
| 60 |
|
"${S}/configure" \
|
| 61 |
|
--prefix="${EPREFIX}"/usr \
|
| 62 |
|
--libdir="${EPREFIX}"/usr/$(get_libdir) \
|
| 63 |
|
--disable-cli \
|
| 64 |
|
--disable-avs \
|
| 65 |
|
--disable-lavf \
|
| 66 |
|
--disable-swscale \
|
| 67 |
|
--disable-ffms \
|
| 68 |
|
--disable-gpac \
|
| 69 |
|
--enable-pic \
|
| 70 |
|
--enable-shared \
|
| 71 |
|
--host="${CHOST}" \
|
| 72 |
|
--cross-prefix="${CHOST}-" \
|
| 73 |
|
$(usex interlaced "" "--disable-interlaced") \
|
| 74 |
|
$(usex opencl "" "--disable-opencl") \
|
| 75 |
|
$(usex static-libs "--enable-static" "") \
|
| 76 |
|
$(usex threads "" "--disable-thread") \
|
| 77 |
|
${asm_conf} || die
|
|
78 |
edo "${S}"/configure "${myconf[@]}"
|
| 78 |
79 |
}
|