| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
inherit cmake flag-o-matic multilib-minimal multibuild
|
|
6 |
inherit cmake-multilib edo flag-o-matic multibuild
|
| 7 |
7 |
|
| 8 |
8 |
DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
|
| 9 |
9 |
HOMEPAGE="https://www.x265.org/ https://bitbucket.org/multicoreware/x265_git/"
|
| ... | ... | |
| 14 |
14 |
MY_P="${PN}-${PV}"
|
| 15 |
15 |
else
|
| 16 |
16 |
SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
|
| 17 |
|
KEYWORDS="amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv x86"
|
|
17 |
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
|
| 18 |
18 |
MY_P="${PN}_${PV}"
|
| 19 |
19 |
fi
|
| 20 |
20 |
|
| ... | ... | |
| 23 |
23 |
|
| 24 |
24 |
LICENSE="GPL-2"
|
| 25 |
25 |
# subslot = libx265 soname
|
| 26 |
|
SLOT="0/209"
|
| 27 |
|
IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
|
|
26 |
SLOT="0/215"
|
|
27 |
IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test vmaf"
|
| 28 |
28 |
RESTRICT="!test? ( test )"
|
| 29 |
29 |
|
| 30 |
|
RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
|
|
30 |
RDEPEND="
|
|
31 |
numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )
|
|
32 |
vmaf? ( media-libs/libvmaf[${MULTILIB_USEDEP}] )
|
|
33 |
"
|
| 31 |
34 |
DEPEND="${RDEPEND}"
|
| 32 |
35 |
ASM_DEPEND=">=dev-lang/nasm-2.13"
|
| 33 |
36 |
BDEPEND="
|
| 34 |
37 |
abi_x86_32? ( ${ASM_DEPEND} )
|
| 35 |
|
abi_x86_64? ( ${ASM_DEPEND} )"
|
|
38 |
abi_x86_64? ( ${ASM_DEPEND} )
|
|
39 |
arm64? ( ${ASM_DEPEND} )
|
|
40 |
"
|
| 36 |
41 |
|
| 37 |
42 |
PATCHES=(
|
| 38 |
43 |
"${FILESDIR}/${PN}-9999-arm.patch"
|
| ... | ... | |
| 41 |
46 |
"${FILESDIR}/${PN}-3.5-r5-cpp-std.patch"
|
| 42 |
47 |
"${FILESDIR}/${PN}-3.5-r5-gcc15.patch"
|
| 43 |
48 |
|
| 44 |
|
"${FILESDIR}/${PN}-3.6-cmake-cleanup.patch"
|
|
49 |
"${FILESDIR}/${PN}-4.1-test-ns.patch"
|
| 45 |
50 |
|
| 46 |
|
"${FILESDIR}/${PN}-3.6-test-ns.patch"
|
| 47 |
|
"${FILESDIR}/${PN}-3.6-test-ns_2.patch"
|
| 48 |
|
|
| 49 |
|
"${FILESDIR}/${PN}-3.6-code-cleanup.patch"
|
| 50 |
51 |
"${FILESDIR}/${PN}-3.6-code-cleanup_2.patch"
|
| 51 |
52 |
"${FILESDIR}/${PN}-3.6-code-cleanup_3.patch"
|
| 52 |
|
"${FILESDIR}/${PN}-3.6-code-cleanup_4.patch"
|
|
53 |
|
|
54 |
"${FILESDIR}/${PN}-4.1-vmaf.patch"
|
| 53 |
55 |
|
| 54 |
56 |
"${FILESDIR}/${PN}-cmake-min-version-3.28.patch"
|
| 55 |
57 |
)
|
| ... | ... | |
| 61 |
63 |
)
|
| 62 |
64 |
}
|
| 63 |
65 |
|
|
66 |
src_prepare() {
|
|
67 |
cmake_src_prepare
|
|
68 |
|
|
69 |
sed -r -e 's/(set\(ARM_ARGS -O3)/# \1/g' -i CMakeLists.txt || die
|
|
70 |
|
|
71 |
# fix hardcoded path
|
|
72 |
# libvmaf ERROR could not read model from path: "/usr/local/share/model/vmaf_v0.6.1.json"
|
|
73 |
sed -e "s#/usr/local/share/model/#${EPREFIX}/usr/share/vmaf/model/#g" -i x265.h || die
|
|
74 |
|
|
75 |
# TODO check so_name via
|
|
76 |
# X265_BUILD 215
|
|
77 |
}
|
|
78 |
|
| 64 |
79 |
# By default, the library and the encoder is configured for only one output bit
|
| 65 |
80 |
# depth. Meaning, one has to rebuild libx265 if (s)he wants to produce HEVC
|
| 66 |
81 |
# files with a different bit depth, which is annoying. However, upstream
|
| ... | ... | |
| 111 |
126 |
local mycmakeargs=(
|
| 112 |
127 |
-DENABLE_PIC=ON
|
| 113 |
128 |
-DENABLE_LIBNUMA="$(usex numa)"
|
| 114 |
|
-DENABLE_SVT_HEVC="no" # missing
|
| 115 |
|
-DENABLE_VTUNE="no" # missing
|
|
129 |
-DENABLE_ALPHA="yes"
|
|
130 |
-DENABLE_MULTIVIEW="yes"
|
|
131 |
-DENABLE_SVT_HEVC="no" # broken
|
|
132 |
-DENABLE_SCC_EXT="yes"
|
|
133 |
-DENABLE_LIBVMAF="$(usex vmaf)"
|
|
134 |
-DENABLE_VTUNE="no" # missing Vtune
|
| 116 |
135 |
-DGIT_ARCHETYPE=1 #814116
|
| 117 |
136 |
-DLIB_INSTALL_DIR="$(get_libdir)"
|
| 118 |
137 |
)
|
| ... | ... | |
| 162 |
181 |
mycmakeargs+=(
|
| 163 |
182 |
-DEXTRA_LIB="${liblist}"
|
| 164 |
183 |
-DEXTRA_LINK_FLAGS="-L${BUILD_DIR}"
|
| 165 |
|
-DLINKED_10BIT"=$(usex 10bit)"
|
|
184 |
-DLINKED_10BIT="$(usex 10bit)"
|
| 166 |
185 |
-DLINKED_12BIT="$(usex 12bit)"
|
| 167 |
186 |
)
|
| 168 |
187 |
fi
|
| ... | ... | |
| 180 |
199 |
|
| 181 |
200 |
x265_variant_src_test() {
|
| 182 |
201 |
if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
|
| 183 |
|
"${BUILD_DIR}/test/TestBench" || die
|
|
202 |
edo "${BUILD_DIR}/test/TestBench" --nobench
|
| 184 |
203 |
else
|
| 185 |
204 |
einfo "Unit tests check only assembly."
|
| 186 |
205 |
einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}"
|