1 |
commit: 498b587c2e15dc6e2041d9dbf3f162a49a0dc257 |
2 |
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 1 08:02:04 2022 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 1 08:15:32 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=498b587c |
7 |
|
8 |
media-libs/openh264: add 2.3.0 |
9 |
|
10 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
11 |
|
12 |
media-libs/openh264/Manifest | 2 + |
13 |
.../files/openh264-2.3.0-pkgconfig-pathfix.patch | 41 +++++++ |
14 |
media-libs/openh264/openh264-2.3.0.ebuild | 121 +++++++++++++++++++++ |
15 |
3 files changed, 164 insertions(+) |
16 |
|
17 |
diff --git a/media-libs/openh264/Manifest b/media-libs/openh264/Manifest |
18 |
index f39be21b8256..c939d4a9aeac 100644 |
19 |
--- a/media-libs/openh264/Manifest |
20 |
+++ b/media-libs/openh264/Manifest |
21 |
@@ -1,2 +1,4 @@ |
22 |
+DIST gmp-api-Firefox39-3a01c086d1b0394238ff1b5ad22e76022830625a.tar.gz 10464 BLAKE2B db6990a55b4128c267ee5ffa4e38edd2551c862e549776b4092d5683818001366665830c6304642cdd9c2c0afe06035edebafde769693082ae7a5236cdc463e8 SHA512 a6383834391d98754177b54df31d006144b5cad952df60115fd12fb6f0c87e571a10f9ce7276b817e4137efd97ffa7bca5092e289b0eb7cde2a3ad923319e874 |
23 |
DIST gmp-api-Firefox39-e3935759360861812d33cbd3b713e25f1de1ecb5.tar.gz 10440 BLAKE2B 92379258f2664778baee50b99573dbeae50e723a3f7605c62a4ca3aedd9129fbd1991d7b3ead1b8a3689e71f783ded0b15dca5e6d910345c95a6f28898bbdda3 SHA512 85e4b58cc66072fad2b6dbaa65a955a8931f73eb3664f05ddca65157ac5c2547225910c36b4507d88179a95cfb35a5aff6edadd3c0fa5418529c80ae6d736f44 |
24 |
DIST openh264-2.2.0.tar.gz 60275282 BLAKE2B 69e44396de229c65cf7a87d6f9ce8e2ef67fbdad6740f6aa64825b71fc00af945dca3e4726b9f0b4f4b83e363f3f7aadadabbab291c612b0fb61b42478a8cacf SHA512 637e2bfa45ad586c10fc8990cad4d824ada07e277fd965c3a6cdd19bc7836b2d7082574037a3ff2ee631207dd8cb0ec4f68abafdc19646b433de561c47ce8d38 |
25 |
+DIST openh264-2.3.0.tar.gz 60290792 BLAKE2B 08aa571471188c72bb0f098fa1cfaf9ba46ee4311f50518de868a2d7bbd61d9d4547cf5d33b3140d56c09a1ea7ea411bfaa96ed960e159876e6cc803f081b5d3 SHA512 5f0ccbb3c0026a010d9830e973312486f9d5ea8152afa3653ab6b3c43906a1169cebea70532134c1624846cc03b586e85b12cfd0621af505bd532a7dd833defd |
26 |
|
27 |
diff --git a/media-libs/openh264/files/openh264-2.3.0-pkgconfig-pathfix.patch b/media-libs/openh264/files/openh264-2.3.0-pkgconfig-pathfix.patch |
28 |
new file mode 100644 |
29 |
index 000000000000..b36aad74e7b4 |
30 |
--- /dev/null |
31 |
+++ b/media-libs/openh264/files/openh264-2.3.0-pkgconfig-pathfix.patch |
32 |
@@ -0,0 +1,41 @@ |
33 |
+diff -Naur a/Makefile b/Makefile |
34 |
+--- a/Makefile 2022-06-10 04:51:46.000000000 +0300 |
35 |
++++ b/Makefile 2022-08-01 10:28:52.698923925 +0300 |
36 |
+@@ -27,6 +27,7 @@ |
37 |
+ DESTDIR= |
38 |
+ LIBDIR_NAME=lib |
39 |
+ SHAREDLIB_DIR=$(PREFIX)/lib |
40 |
++INCLUDES_DIR=$(PREFIX)/include |
41 |
+ PROJECT_NAME=openh264 |
42 |
+ MODULE_NAME=gmpopenh264 |
43 |
+ GMP_API_BRANCH=Firefox39 |
44 |
+@@ -286,14 +287,14 @@ |
45 |
+ endif |
46 |
+ |
47 |
+ $(PROJECT_NAME).pc: $(PROJECT_NAME).pc.in |
48 |
+- @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/lib;' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $< > $@ |
49 |
++ @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(SHAREDLIB_DIR);' -e 's;@includesdir@;$(INCLUDES_DIR);' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $< > $@ |
50 |
+ |
51 |
+ $(PROJECT_NAME)-static.pc: $(PROJECT_NAME).pc.in |
52 |
+- @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/lib;' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $< > $@ |
53 |
++ @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(SHAREDLIB_DIR);' -e 's;@includesdir@;$(INCLUDES_DIR);' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $< > $@ |
54 |
+ |
55 |
+ install-headers: |
56 |
+- mkdir -p $(DESTDIR)$(PREFIX)/include/wels |
57 |
+- install -m 644 $(SRC_PATH)/codec/api/wels/codec*.h $(DESTDIR)$(PREFIX)/include/wels |
58 |
++ mkdir -p $(DESTDIR)$(INCLUDES_DIR)/wels |
59 |
++ install -m 644 $(SRC_PATH)/codec/api/wels/codec*.h $(DESTDIR)$(INCLUDES_DIR)/wels |
60 |
+ |
61 |
+ install-static-lib: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) install-headers |
62 |
+ mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME) |
63 |
+diff -Naur a/openh264.pc.in b/openh264.pc.in |
64 |
+--- a/openh264.pc.in 2022-06-10 04:51:46.000000000 +0300 |
65 |
++++ b/openh264.pc.in 2022-08-01 10:38:28.231850059 +0300 |
66 |
+@@ -1,6 +1,6 @@ |
67 |
+ prefix=@prefix@ |
68 |
+ libdir=@libdir@ |
69 |
+-includedir=${prefix}/include |
70 |
++includedir=@includesdir@ |
71 |
+ |
72 |
+ Name: OpenH264 |
73 |
+ Description: OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. |
74 |
|
75 |
diff --git a/media-libs/openh264/openh264-2.3.0.ebuild b/media-libs/openh264/openh264-2.3.0.ebuild |
76 |
new file mode 100644 |
77 |
index 000000000000..518d3060fe18 |
78 |
--- /dev/null |
79 |
+++ b/media-libs/openh264/openh264-2.3.0.ebuild |
80 |
@@ -0,0 +1,121 @@ |
81 |
+# Copyright 1999-2022 Gentoo Authors |
82 |
+# Distributed under the terms of the GNU General Public License v2 |
83 |
+ |
84 |
+EAPI=8 |
85 |
+ |
86 |
+inherit toolchain-funcs multilib-minimal |
87 |
+ |
88 |
+MOZVER=39 |
89 |
+MY_GMP_COMMIT="3a01c086d1b0394238ff1b5ad22e76022830625a" |
90 |
+ |
91 |
+DESCRIPTION="Cisco OpenH264 library and Gecko Media Plugin for Mozilla packages" |
92 |
+HOMEPAGE="https://www.openh264.org/ https://github.com/cisco/openh264" |
93 |
+SRC_URI="https://github.com/cisco/openh264/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz |
94 |
+ https://github.com/mozilla/gmp-api/archive/${MY_GMP_COMMIT}.tar.gz -> gmp-api-Firefox${MOZVER}-${MY_GMP_COMMIT}.tar.gz" |
95 |
+LICENSE="BSD" |
96 |
+ |
97 |
+# openh264 soname version. |
98 |
+# (2.2.0 needed a minor bump due to undocumented but breaking ABI changes, just to be sure. |
99 |
+# https://github.com/cisco/openh264/issues/3459 ) |
100 |
+SLOT="0/6.1" |
101 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" |
102 |
+IUSE="cpu_flags_arm_neon cpu_flags_x86_avx2 +plugin utils" |
103 |
+ |
104 |
+RESTRICT="bindist test" |
105 |
+ |
106 |
+BDEPEND=" |
107 |
+ abi_x86_32? ( dev-lang/nasm ) |
108 |
+ abi_x86_64? ( dev-lang/nasm )" |
109 |
+ |
110 |
+DOCS=( LICENSE CONTRIBUTORS README.md ) |
111 |
+ |
112 |
+PATCHES=( "${FILESDIR}"/openh264-2.3.0-pkgconfig-pathfix.patch ) |
113 |
+ |
114 |
+src_prepare() { |
115 |
+ default |
116 |
+ |
117 |
+ sed -i -e 's/ | generate-version//g' Makefile || die |
118 |
+ sed -e 's|$FULL_VERSION|""|g' codec/common/inc/version_gen.h.template > \ |
119 |
+ codec/common/inc/version_gen.h |
120 |
+ |
121 |
+ multilib_copy_sources |
122 |
+} |
123 |
+ |
124 |
+multilib_src_configure() { |
125 |
+ ln -s "${WORKDIR}"/gmp-api-${MY_GMP_COMMIT} gmp-api || die |
126 |
+} |
127 |
+ |
128 |
+emakecmd() { |
129 |
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" AR="$(tc-getAR)" \ |
130 |
+ emake V=Yes CFLAGS_M32="" CFLAGS_M64="" CFLAGS_OPT="" \ |
131 |
+ PREFIX="${EPREFIX}/usr" \ |
132 |
+ LIBDIR_NAME="$(get_libdir)" \ |
133 |
+ SHAREDLIB_DIR="${EPREFIX}/usr/$(get_libdir)" \ |
134 |
+ INCLUDES_DIR="${EPREFIX}/usr/include/${PN}" \ |
135 |
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 Yes No) \ |
136 |
+ ARCH="$(tc-arch)" \ |
137 |
+ $@ |
138 |
+} |
139 |
+ |
140 |
+multilib_src_compile() { |
141 |
+ local myopts="ENABLE64BIT=No" |
142 |
+ case "${ABI}" in |
143 |
+ s390x|alpha|*64) myopts="ENABLE64BIT=Yes";; |
144 |
+ esac |
145 |
+ |
146 |
+ if use arm; then |
147 |
+ myopts+=" USE_ASM=$(usex cpu_flags_arm_neon Yes No)" |
148 |
+ fi |
149 |
+ |
150 |
+ emakecmd ${myopts} |
151 |
+ use plugin && emakecmd ${myopts} plugin |
152 |
+} |
153 |
+ |
154 |
+multilib_src_install() { |
155 |
+ emakecmd DESTDIR="${D}" install-shared |
156 |
+ |
157 |
+ if use utils; then |
158 |
+ newbin h264enc openh264enc |
159 |
+ newbin h264dec openh264dec |
160 |
+ fi |
161 |
+ |
162 |
+ if use plugin; then |
163 |
+ local plugpath="${ROOT}/usr/$(get_libdir)/nsbrowser/plugins/gmp-gmp${PN}/system-installed" |
164 |
+ insinto "${plugpath}" |
165 |
+ doins libgmpopenh264.so* gmpopenh264.info |
166 |
+ echo "MOZ_GMP_PATH=\"${plugpath}\"" >"${T}"/98-moz-gmp-${PN} |
167 |
+ doenvd "${T}"/98-moz-gmp-${PN} |
168 |
+ |
169 |
+ cat <<PREFEOF >"${T}"/${P}.js |
170 |
+pref("media.gmp-gmp${PN}.autoupdate", false); |
171 |
+pref("media.gmp-gmp${PN}.version", "system-installed"); |
172 |
+PREFEOF |
173 |
+ |
174 |
+ insinto /usr/$(get_libdir)/firefox/defaults/pref |
175 |
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js |
176 |
+ |
177 |
+ insinto /usr/$(get_libdir)/seamonkey/defaults/pref |
178 |
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js |
179 |
+ fi |
180 |
+} |
181 |
+ |
182 |
+pkg_postinst() { |
183 |
+ if use plugin; then |
184 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
185 |
+ elog "Please restart your login session, in order for the session's environment" |
186 |
+ elog "to include the new MOZ_GMP_PATH variable." |
187 |
+ elog "" |
188 |
+ fi |
189 |
+ elog "This package attempts to override the Mozilla GMPInstaller auto-update process," |
190 |
+ elog "however even if it is not successful in doing so the profile-installed plugin" |
191 |
+ elog "will not be used unless this package is removed. This package will take precedence" |
192 |
+ elog "over any gmp-gmpopenh264 that may be installed in a user's profile." |
193 |
+ elog "" |
194 |
+ fi |
195 |
+ |
196 |
+ if use utils; then |
197 |
+ elog "Utilities h264enc and h264dec are installed as openh264enc and openh264dec" |
198 |
+ elog "to avoid file collisions with media-video/h264enc" |
199 |
+ elog "" |
200 |
+ fi |
201 |
+} |