1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit nsplugins multilib-minimal
10 DESCRIPTION="Cisco OpenH264 library and Gecko Media Plugin for Mozilla packages"
11 HOMEPAGE="http://www.openh264.org/"
12 SRC_URI="https://github.com/cisco/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
13 https://github.com/mozilla/gmp-api/archive/Firefox${MOZVER}.tar.gz -> gmp-api-Firefox${MOZVER}.tar.gz"
16 KEYWORDS="~amd64 ~x86"
21 RDEPEND="!<www-client/firefox-${MOZVER}"
22 DEPEND="dev-lang/nasm"
24 DOCS=( LICENSE CONTRIBUTORS README.md )
27 epatch "${FILESDIR}"/pkgconfig-pathfix.patch
31 multilib_src_configure() {
32 ln -s "${WORKDIR}"/gmp-api-Firefox${MOZVER} gmp-api || die
36 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
37 emake V=Yes CFLAGS_M32="" CFLAGS_M64="" CFLAGS_OPT="" \
38 PREFIX="${EPREFIX}/usr" \
39 SHAREDLIB_DIR="${EPREFIX}/usr/$(get_libdir)" \
40 INCLUDES_DIR="${EPREFIX}/usr/include/${PN}" \
44 multilib_src_compile() {
45 local mybits="ENABLE64BIT=No"
47 s390x|alpha|*64) mybits="ENABLE64BIT=Yes";;
50 emakecmd ${mybits} ${tgt}
51 use plugin && emakecmd ${mybits} plugin
54 multilib_src_install() {
55 emakecmd DESTDIR="${D}" install-shared
57 use utils && dobin h264{enc,dec}
60 local plugpath="usr/$(get_libdir)/${PLUGINS_DIR}/gmp-gmp${PN}/system-installed"
61 insinto "/${plugpath}"
62 doins libgmpopenh264.so* gmpopenh264.info
63 echo "MOZ_GMP_PATH=\"${EROOT}${plugpath}\"" >"${T}"/98-moz-gmp-${PN}
64 doenvd "${T}"/98-moz-gmp-${PN}
66 cat <<PREFEOF >"${T}"/${P}.js
67 pref("media.gmp-gmp${PN}.autoupdate", false);
68 pref("media.gmp-gmp${PN}.version", "system-installed");
71 insinto /usr/$(get_libdir)/firefox/defaults/pref
74 insinto /usr/$(get_libdir)/seamonkey/defaults/pref
81 if [[ -z ${REPLACING_VERSIONS} ]]; then
82 elog "Please restart your login session, in order for the session's environment"
83 elog "to include the new MOZ_GMP_PATH variable."
86 elog "This package attempts to override the Mozilla GMPInstaller auto-update process,"
87 elog "however even if it is not successful in doing so the profile-installed plugin"
88 elog "will not be used unless this package is removed. This package will take precedence"
89 elog "over any gmp-gmpopenh264 that may be installed in a user's profile."