summaryrefslogtreecommitdiff
path: root/media-libs/openh264
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-07-27 10:33:45 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-07-27 10:33:45 +0100
commita12f416baa722b8bda57c0d527fb28b3d06b2aeb (patch)
tree00347496d39521fc572cc53fbd17037fbe73ca06 /media-libs/openh264
parentef27446dc21d9fb7ee400987661cb759f6a6ee85 (diff)
gentoo auto-resync : 27:07:2023 - 10:33:45
Diffstat (limited to 'media-libs/openh264')
-rw-r--r--media-libs/openh264/Manifest1
-rw-r--r--media-libs/openh264/openh264-2.3.1-r2.ebuild134
2 files changed, 135 insertions, 0 deletions
diff --git a/media-libs/openh264/Manifest b/media-libs/openh264/Manifest
index f2e5c3635a76..ebdef7f152b5 100644
--- a/media-libs/openh264/Manifest
+++ b/media-libs/openh264/Manifest
@@ -3,4 +3,5 @@ AUX openh264-2.3.1-pr3630.patch 5566 BLAKE2B 06e6ff75ccbcb287413752283d3b192ccd9
DIST gmp-api-Firefox39-3a01c086d1b0394238ff1b5ad22e76022830625a.tar.gz 10464 BLAKE2B db6990a55b4128c267ee5ffa4e38edd2551c862e549776b4092d5683818001366665830c6304642cdd9c2c0afe06035edebafde769693082ae7a5236cdc463e8 SHA512 a6383834391d98754177b54df31d006144b5cad952df60115fd12fb6f0c87e571a10f9ce7276b817e4137efd97ffa7bca5092e289b0eb7cde2a3ad923319e874
DIST openh264-2.3.1.tar.gz 60290897 BLAKE2B b4480150cfe7c44b89c7b294698db06f93d96f5f9f3ef4345108c4e360e99bc6133407cead54e720e6e74aa17ab9f2e4342287a42f19463a54eb44c9d3141c80 SHA512 fd59c767794cdfb934d692d5929e4500d78606cbf1e403bc7c7dce048cc07e40daa0794357adb856d29479427a53460c76338e156b6bbeaa36139afcd603c8e1
EBUILD openh264-2.3.1-r1.ebuild 3925 BLAKE2B 3d0b73c310f1582ec7f010fd9104c44d3f4581ea8b806e2fe16d495ec29517f997e1f85b981bf0db3015bd939b3c57c34e8de97864b0faaa1ca40f4657fbc215 SHA512 118d32d0d888bdf614dbfd2ee42e27e2ec196653bcc4ef79c8bf673e87f8ce08c657a326b41f940ffc9b8e923380520ae84bf656706fe4e48ee13a26071a3d03
+EBUILD openh264-2.3.1-r2.ebuild 3952 BLAKE2B a23325be69269489c8fb404b098d9ba32addde9cc1e740dd0b6cc805dc66c19d9dec110d8eaac0d850cf0f29acb487cb188d358494db0979048317108ee10550 SHA512 a2487b8f55445d73e8ff2b78314178a66f7b897017c05db3992c6aa7e76a5967c281a27c33c1a3f6f111aa95c7c69f4c39ec2dea24ddff4917e7f5d4d38df705
MISC metadata.xml 569 BLAKE2B 14a021fba978f0156bab46178d05a6b9f8f67fdeba784d587759207fe60ea1d74a383eec3fc40662c39d33fcecb71d8cafe7eb6354383c253e0a3f7f1e94feae SHA512 ceb77117c6a50f16640b329368c86db26127b8e501475dbaca4c53ba41315b0fc7161f6d9268cb86d1f6dbf2cf867e2bb0e6b5f45240ab3227b99b734c344efd
diff --git a/media-libs/openh264/openh264-2.3.1-r2.ebuild b/media-libs/openh264/openh264-2.3.1-r2.ebuild
new file mode 100644
index 000000000000..6f169205a2b2
--- /dev/null
+++ b/media-libs/openh264/openh264-2.3.1-r2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs multilib-minimal
+
+MOZVER=39
+MY_GMP_COMMIT="3a01c086d1b0394238ff1b5ad22e76022830625a"
+
+DESCRIPTION="Cisco OpenH264 library and Gecko Media Plugin for Mozilla packages"
+HOMEPAGE="https://www.openh264.org/ https://github.com/cisco/openh264"
+SRC_URI="https://github.com/cisco/openh264/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/mozilla/gmp-api/archive/${MY_GMP_COMMIT}.tar.gz -> gmp-api-Firefox${MOZVER}-${MY_GMP_COMMIT}.tar.gz"
+LICENSE="BSD"
+
+# openh264 soname version.
+# (2.2.0 needed a minor bump due to undocumented but breaking ABI changes, just to be sure.
+# https://github.com/cisco/openh264/issues/3459 )
+SLOT="0/7"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="cpu_flags_arm_neon cpu_flags_x86_avx2 +plugin test utils"
+
+RESTRICT="bindist !test? ( test )"
+
+BDEPEND="
+ abi_x86_32? ( dev-lang/nasm )
+ abi_x86_64? ( dev-lang/nasm )
+ test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
+
+DOCS=( LICENSE CONTRIBUTORS README.md )
+
+PATCHES=(
+ "${FILESDIR}"/openh264-2.3.0-pkgconfig-pathfix.patch
+ "${FILESDIR}"/${PN}-2.3.1-pr3630.patch
+)
+
+src_prepare() {
+ default
+
+ ln -svf "/dev/null" "build/gtest-targets.mk" || die
+ sed -i -e 's/$(LIBPREFIX)gtest.$(LIBSUFFIX)//g' Makefile || die
+
+ sed -i -e 's/ | generate-version//g' Makefile || die
+ sed -e 's|$FULL_VERSION|""|g' codec/common/inc/version_gen.h.template > \
+ codec/common/inc/version_gen.h
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ ln -s "${WORKDIR}"/gmp-api-${MY_GMP_COMMIT} gmp-api || die
+}
+
+emakecmd() {
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ emake V=Yes CFLAGS_M32="" CFLAGS_M64="" CFLAGS_OPT="" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR_NAME="$(get_libdir)" \
+ SHAREDLIB_DIR="${EPREFIX}/usr/$(get_libdir)" \
+ INCLUDES_DIR="${EPREFIX}/usr/include/${PN}" \
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 Yes No) \
+ HAVE_GTEST=$(usex test Yes No) \
+ ARCH="$(tc-arch)" \
+ ENABLEPIC="Yes" \
+ $@
+}
+
+multilib_src_compile() {
+ local myopts="ENABLE64BIT=No"
+ case "${ABI}" in
+ s390x|alpha|*64) myopts="ENABLE64BIT=Yes";;
+ esac
+
+ if use arm; then
+ myopts+=" USE_ASM=$(usex cpu_flags_arm_neon Yes No)"
+ fi
+
+ emakecmd ${myopts}
+ use plugin && emakecmd ${myopts} plugin
+}
+
+multilib_src_test() {
+ emakecmd test
+}
+
+multilib_src_install() {
+ emakecmd DESTDIR="${D}" install-shared
+
+ if use utils; then
+ newbin h264enc openh264enc
+ newbin h264dec openh264dec
+ fi
+
+ if use plugin; then
+ local plugpath="${ROOT}/usr/$(get_libdir)/nsbrowser/plugins/gmp-gmp${PN}/system-installed"
+ insinto "${plugpath}"
+ doins libgmpopenh264.so* gmpopenh264.info
+ echo "MOZ_GMP_PATH=\"${plugpath}\"" >"${T}"/98-moz-gmp-${PN}
+ doenvd "${T}"/98-moz-gmp-${PN}
+
+ cat <<PREFEOF >"${T}"/${P}.js
+pref("media.gmp-gmp${PN}.autoupdate", false);
+pref("media.gmp-gmp${PN}.version", "system-installed");
+PREFEOF
+
+ insinto /usr/$(get_libdir)/firefox/defaults/pref
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js
+
+ insinto /usr/$(get_libdir)/seamonkey/defaults/pref
+ newins "${T}"/${P}.js ${PN}-${PV/_p*/}.js
+ fi
+}
+
+pkg_postinst() {
+ if use plugin; then
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "Please restart your login session, in order for the session's environment"
+ elog "to include the new MOZ_GMP_PATH variable."
+ elog ""
+ fi
+ elog "This package attempts to override the Mozilla GMPInstaller auto-update process,"
+ elog "however even if it is not successful in doing so the profile-installed plugin"
+ elog "will not be used unless this package is removed. This package will take precedence"
+ elog "over any gmp-gmpopenh264 that may be installed in a user's profile."
+ elog ""
+ fi
+
+ if use utils; then
+ elog "Utilities h264enc and h264dec are installed as openh264enc and openh264dec"
+ elog "to avoid file collisions with media-video/h264enc"
+ elog ""
+ fi
+}