1 |
commit: 50c7c4021e347ee549164595280cf8a23c960959 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 10 04:32:45 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 10 04:44:54 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50c7c402 |
7 |
|
8 |
media-libs/libaom: fix musl build (ftello) |
9 |
|
10 |
Closes: https://bugs.gentoo.org/869419 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/libaom-3.4.0-posix-c-source-ftello.patch | 13 +++ |
14 |
media-libs/libaom/libaom-3.4.0-r1.ebuild | 113 +++++++++++++++++++++ |
15 |
2 files changed, 126 insertions(+) |
16 |
|
17 |
diff --git a/media-libs/libaom/files/libaom-3.4.0-posix-c-source-ftello.patch b/media-libs/libaom/files/libaom-3.4.0-posix-c-source-ftello.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..6e910b3f732c |
20 |
--- /dev/null |
21 |
+++ b/media-libs/libaom/files/libaom-3.4.0-posix-c-source-ftello.patch |
22 |
@@ -0,0 +1,13 @@ |
23 |
+https://bugs.gentoo.org/869419 |
24 |
+ |
25 |
+POSIX_C_SOURCE is needed for ftello. |
26 |
+--- a/CMakeLists.txt |
27 |
++++ b/CMakeLists.txt |
28 |
+@@ -266,6 +266,7 @@ add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES}) |
29 |
+ add_dependencies(aom_rtcd aom_version) |
30 |
+ |
31 |
+ if(ENABLE_EXAMPLES) |
32 |
++ add_definitions(-D_POSIX_C_SOURCE=200112L) |
33 |
+ add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES}) |
34 |
+ set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_encoder_stats) |
35 |
+ endif() |
36 |
|
37 |
diff --git a/media-libs/libaom/libaom-3.4.0-r1.ebuild b/media-libs/libaom/libaom-3.4.0-r1.ebuild |
38 |
new file mode 100644 |
39 |
index 000000000000..7c969b44ed77 |
40 |
--- /dev/null |
41 |
+++ b/media-libs/libaom/libaom-3.4.0-r1.ebuild |
42 |
@@ -0,0 +1,113 @@ |
43 |
+# Copyright 1999-2022 Gentoo Authors |
44 |
+# Distributed under the terms of the GNU General Public License v2 |
45 |
+ |
46 |
+EAPI=8 |
47 |
+ |
48 |
+PYTHON_COMPAT=( python3_{8..11} ) |
49 |
+inherit cmake-multilib python-any-r1 |
50 |
+ |
51 |
+if [[ ${PV} == *9999* ]]; then |
52 |
+ inherit git-r3 |
53 |
+ EGIT_REPO_URI="https://aomedia.googlesource.com/aom" |
54 |
+else |
55 |
+ SRC_URI="https://storage.googleapis.com/aom-releases/${P}.tar.gz" |
56 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
57 |
+fi |
58 |
+ |
59 |
+DESCRIPTION="Alliance for Open Media AV1 Codec SDK" |
60 |
+HOMEPAGE="https://aomedia.org https://aomedia.googlesource.com/aom/" |
61 |
+ |
62 |
+LICENSE="BSD-2" |
63 |
+SLOT="0/3" |
64 |
+IUSE="doc +examples test" |
65 |
+IUSE="${IUSE} cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3" |
66 |
+IUSE="${IUSE} cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_avx cpu_flags_x86_avx2" |
67 |
+IUSE="${IUSE} cpu_flags_arm_neon" |
68 |
+# Tests need more wiring up |
69 |
+RESTRICT="!test? ( test ) test" |
70 |
+ |
71 |
+REQUIRED_USE=" |
72 |
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx ) |
73 |
+ cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 ) |
74 |
+" |
75 |
+ |
76 |
+BDEPEND="${PYTHON_DEPS} |
77 |
+ dev-lang/perl |
78 |
+ abi_x86_32? ( dev-lang/yasm ) |
79 |
+ abi_x86_64? ( dev-lang/yasm ) |
80 |
+ abi_x86_x32? ( dev-lang/yasm ) |
81 |
+ doc? ( app-doc/doxygen ) |
82 |
+" |
83 |
+ |
84 |
+# The PATENTS file is required to be distributed with this package, bug #682214 |
85 |
+DOCS=( PATENTS ) |
86 |
+ |
87 |
+PATCHES=( |
88 |
+ "${FILESDIR}"/${PN}-3.4.0-posix-c-source-ftello.patch |
89 |
+) |
90 |
+ |
91 |
+multilib_src_configure() { |
92 |
+ local mycmakeargs=( |
93 |
+ -DENABLE_CCACHE=OFF |
94 |
+ -DENABLE_DOCS=$(multilib_native_usex doc ON OFF) |
95 |
+ -DENABLE_EXAMPLES=$(multilib_native_usex examples ON OFF) |
96 |
+ -DENABLE_NASM=OFF |
97 |
+ -DENABLE_TESTS=$(usex test) |
98 |
+ -DENABLE_TOOLS=ON |
99 |
+ -DENABLE_WERROR=OFF |
100 |
+ |
101 |
+ # Needs libjxl, currently unpackaged. |
102 |
+ -DCONFIG_TUNE_BUTTERAUGLI=0 |
103 |
+ |
104 |
+ # neon support is assumed to be always enabled on arm64 |
105 |
+ -DENABLE_NEON=$(usex cpu_flags_arm_neon ON $(usex arm64 ON OFF)) |
106 |
+ # ENABLE_DSPR2 / ENABLE_MSA for mips |
107 |
+ -DENABLE_MMX=$(usex cpu_flags_x86_mmx ON OFF) |
108 |
+ -DENABLE_SSE=$(usex cpu_flags_x86_sse ON OFF) |
109 |
+ -DENABLE_SSE2=$(usex cpu_flags_x86_sse2 ON OFF) |
110 |
+ -DENABLE_SSE3=$(usex cpu_flags_x86_sse3 ON OFF) |
111 |
+ -DENABLE_SSSE3=$(usex cpu_flags_x86_ssse3 ON OFF) |
112 |
+ -DENABLE_SSE4_1=$(usex cpu_flags_x86_sse4_1 ON OFF) |
113 |
+ -DENABLE_SSE4_2=$(usex cpu_flags_x86_sse4_2 ON OFF) |
114 |
+ -DENABLE_AVX=$(usex cpu_flags_x86_avx ON OFF) |
115 |
+ -DENABLE_AVX2=$(usex cpu_flags_x86_avx2 ON OFF) |
116 |
+ ) |
117 |
+ |
118 |
+ # For 32-bit multilib builds, force some intrinsics on to work around |
119 |
+ # bug #816027. libaom seems to do runtime detection for some targets |
120 |
+ # at least, so this isn't an issue. |
121 |
+ if ! multilib_is_native_abi && use amd64 ; then |
122 |
+ mycmakeargs+=( |
123 |
+ -DENABLE_SSE3=ON |
124 |
+ -DENABLE_SSSE3=ON |
125 |
+ ) |
126 |
+ fi |
127 |
+ |
128 |
+ # On ARM32-on-ARM64, things end up failing if NEON is off, bug #835456 |
129 |
+ # Just force generic, given it's a niche situation. |
130 |
+ # TODO: could try forcing armv7 or similar? |
131 |
+ if use arm && ! use cpu_flags_arm_neon && [[ $(uname -p) == "aarch64" ]] ; then |
132 |
+ ewarn "Forcing generic for arm32-on-arm64 build (bug #835456)" |
133 |
+ mycmakeargs+=( |
134 |
+ -DAOM_TARGET_CPU=generic |
135 |
+ ) |
136 |
+ fi |
137 |
+ |
138 |
+ cmake_src_configure |
139 |
+} |
140 |
+ |
141 |
+multilib_src_test() { |
142 |
+ "${BUILD_DIR}"/test_libaom || die |
143 |
+} |
144 |
+ |
145 |
+multilib_src_install() { |
146 |
+ if multilib_is_native_abi && use doc ; then |
147 |
+ local HTML_DOCS=( "${BUILD_DIR}"/docs/html/. ) |
148 |
+ fi |
149 |
+ |
150 |
+ cmake_src_install |
151 |
+} |
152 |
+ |
153 |
+multilib_src_install_all() { |
154 |
+ find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die |
155 |
+} |