1 |
commit: 562810f98f70b4f6eb40547e264ee6f4d1016af9 |
2 |
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 27 13:33:40 2022 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 27 13:40:19 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=562810f9 |
7 |
|
8 |
media-libs/openh264: add 2.2.0_pre20220125 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/829782 |
11 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
12 |
|
13 |
media-libs/openh264/Manifest | 1 + |
14 |
.../openh264/openh264-2.2.0_pre20220125.ebuild | 119 +++++++++++++++++++++ |
15 |
2 files changed, 120 insertions(+) |
16 |
|
17 |
diff --git a/media-libs/openh264/Manifest b/media-libs/openh264/Manifest |
18 |
index 8c4c43375071..645f44fb87d6 100644 |
19 |
--- a/media-libs/openh264/Manifest |
20 |
+++ b/media-libs/openh264/Manifest |
21 |
@@ -1,2 +1,3 @@ |
22 |
DIST gmp-api-Firefox39-e3935759360861812d33cbd3b713e25f1de1ecb5.tar.gz 10440 BLAKE2B 92379258f2664778baee50b99573dbeae50e723a3f7605c62a4ca3aedd9129fbd1991d7b3ead1b8a3689e71f783ded0b15dca5e6d910345c95a6f28898bbdda3 SHA512 85e4b58cc66072fad2b6dbaa65a955a8931f73eb3664f05ddca65157ac5c2547225910c36b4507d88179a95cfb35a5aff6edadd3c0fa5418529c80ae6d736f44 |
23 |
DIST openh264-2.1.1.tar.gz 60239654 BLAKE2B d541fa686b1eb8352dbb4088fc4ef508f947660815c86b2bb7db841c927b7b9f763d7fe793f0fa1511620dbdc506c20cd5ad52740140337aa12b8c31b857a8e6 SHA512 f9c2925fa902c6278da40f68b967d25e62db7ce3541e8f5e7a0ee174204b6ecc7026b5853885c361f48ca01d71bacd585fb5b91f01f0c054ece80943f1afcf79 |
24 |
+DIST openh264-2.2.0_pre20220125.tar.gz 60276091 BLAKE2B 314adf64d92e9993aac2788b539d0173e4cdb6066dcc16c358ba28a887cf244f54025d916ea8a4add5617bd0a7e0f9fb9bb6ec5ac148faa0789c0975e75c736c SHA512 7bcb87d6ad54581f0552322f554f544fb7038b2a6bc632eee57d89885d432971bcb592590611ee754d0995e117327410e075ca2d6e3cff01585ea3c34f8376b9 |
25 |
|
26 |
diff --git a/media-libs/openh264/openh264-2.2.0_pre20220125.ebuild b/media-libs/openh264/openh264-2.2.0_pre20220125.ebuild |
27 |
new file mode 100644 |
28 |
index 000000000000..d391886b736c |
29 |
--- /dev/null |
30 |
+++ b/media-libs/openh264/openh264-2.2.0_pre20220125.ebuild |
31 |
@@ -0,0 +1,119 @@ |
32 |
+# Copyright 1999-2022 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=8 |
36 |
+ |
37 |
+inherit toolchain-funcs multilib-minimal |
38 |
+ |
39 |
+MOZVER=39 |
40 |
+MY_OPENH264_COMMIT="2c4379535ca62afafd39ca232f2e3592895b1fd7" |
41 |
+MY_GMP_COMMIT="e3935759360861812d33cbd3b713e25f1de1ecb5" |
42 |
+DESCRIPTION="Cisco OpenH264 library and Gecko Media Plugin for Mozilla packages" |
43 |
+HOMEPAGE="https://www.openh264.org/" |
44 |
+SRC_URI="https://github.com/cisco/openh264/archive/${MY_OPENH264_COMMIT}.tar.gz -> ${P}.tar.gz |
45 |
+ https://github.com/mozilla/gmp-api/archive/${MY_GMP_COMMIT}.tar.gz -> gmp-api-Firefox${MOZVER}-${MY_GMP_COMMIT}.tar.gz" |
46 |
+LICENSE="BSD" |
47 |
+SLOT="0/6.1" # subslot = openh264 soname version |
48 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" |
49 |
+IUSE="cpu_flags_arm_neon cpu_flags_x86_avx2 +plugin utils" |
50 |
+ |
51 |
+RESTRICT="bindist test" |
52 |
+ |
53 |
+BDEPEND=" |
54 |
+ abi_x86_32? ( dev-lang/nasm ) |
55 |
+ abi_x86_64? ( dev-lang/nasm )" |
56 |
+ |
57 |
+DOCS=( LICENSE CONTRIBUTORS README.md ) |
58 |
+ |
59 |
+PATCHES=( "${FILESDIR}/${PN}-2.1.0-pkgconfig-pathfix.patch" ) |
60 |
+ |
61 |
+S="${WORKDIR}/openh264-${MY_OPENH264_COMMIT}" |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ default |
65 |
+ |
66 |
+ sed -i -e 's/ | generate-version//g' Makefile || die |
67 |
+ sed -e 's|$FULL_VERSION|""|g' codec/common/inc/version_gen.h.template > \ |
68 |
+ codec/common/inc/version_gen.h |
69 |
+ |
70 |
+ multilib_copy_sources |
71 |
+} |
72 |
+ |
73 |
+multilib_src_configure() { |
74 |
+ ln -s "${WORKDIR}"/gmp-api-${MY_GMP_COMMIT} gmp-api || die |
75 |
+} |
76 |
+ |
77 |
+emakecmd() { |
78 |
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" AR="$(tc-getAR)" \ |
79 |
+ emake V=Yes CFLAGS_M32="" CFLAGS_M64="" CFLAGS_OPT="" \ |
80 |
+ PREFIX="${EPREFIX}/usr" \ |
81 |
+ LIBDIR_NAME="$(get_libdir)" \ |
82 |
+ SHAREDLIB_DIR="${EPREFIX}/usr/$(get_libdir)" \ |
83 |
+ INCLUDES_DIR="${EPREFIX}/usr/include/${PN}" \ |
84 |
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 Yes No) \ |
85 |
+ ARCH="$(tc-arch)" \ |
86 |
+ $@ |
87 |
+} |
88 |
+ |
89 |
+multilib_src_compile() { |
90 |
+ local myopts="ENABLE64BIT=No" |
91 |
+ case "${ABI}" in |
92 |
+ s390x|alpha|*64) myopts="ENABLE64BIT=Yes";; |
93 |
+ esac |
94 |
+ |
95 |
+ if use arm; then |
96 |
+ myopts+=" USE_ASM=$(usex cpu_flags_arm_neon Yes No)" |
97 |
+ fi |
98 |
+ |
99 |
+ emakecmd ${myopts} |
100 |
+ use plugin && emakecmd ${myopts} plugin |
101 |
+} |
102 |
+ |
103 |
+multilib_src_install() { |
104 |
+ emakecmd DESTDIR="${D}" install-shared |
105 |
+ |
106 |
+ if use utils; then |
107 |
+ newbin h264enc openh264enc |
108 |
+ newbin h264dec openh264dec |
109 |
+ fi |
110 |
+ |
111 |
+ if use plugin; then |
112 |
+ local plugpath="${ROOT}/usr/$(get_libdir)/nsbrowser/plugins/gmp-gmp${PN}/system-installed" |
113 |
+ insinto "${plugpath}" |
114 |
+ doins libgmpopenh264.so* gmpopenh264.info |
115 |
+ echo "MOZ_GMP_PATH=\"${plugpath}\"" >"${T}"/98-moz-gmp-${PN} |
116 |
+ doenvd "${T}"/98-moz-gmp-${PN} |
117 |
+ |
118 |
+ cat <<PREFEOF >"${T}"/${P}.js |
119 |
+pref("media.gmp-gmp${PN}.autoupdate", false); |
120 |
+pref("media.gmp-gmp${PN}.version", "system-installed"); |
121 |
+PREFEOF |
122 |
+ |
123 |
+ insinto /usr/$(get_libdir)/firefox/defaults/pref |
124 |
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js |
125 |
+ |
126 |
+ insinto /usr/$(get_libdir)/seamonkey/defaults/pref |
127 |
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js |
128 |
+ fi |
129 |
+} |
130 |
+ |
131 |
+pkg_postinst() { |
132 |
+ if use plugin; then |
133 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
134 |
+ elog "Please restart your login session, in order for the session's environment" |
135 |
+ elog "to include the new MOZ_GMP_PATH variable." |
136 |
+ elog "" |
137 |
+ fi |
138 |
+ elog "This package attempts to override the Mozilla GMPInstaller auto-update process," |
139 |
+ elog "however even if it is not successful in doing so the profile-installed plugin" |
140 |
+ elog "will not be used unless this package is removed. This package will take precedence" |
141 |
+ elog "over any gmp-gmpopenh264 that may be installed in a user's profile." |
142 |
+ elog "" |
143 |
+ fi |
144 |
+ |
145 |
+ if use utils; then |
146 |
+ elog "Utilities h264enc and h264dec are installed as openh264enc and openh264dec" |
147 |
+ elog "to avoid file collisions with media-video/h264enc" |
148 |
+ elog "" |
149 |
+ fi |
150 |
+} |