--- www-client/chromium/chromium-44.0.2403.89.ebuild 2015-07-22 23:01:17.000000000 -0700 +++ www-client/chromium/chromium-44.0.2403.89-r1.ebuild 2015-07-25 17:19:11.222274234 -0700 @@ -19,7 +19,7 @@ SRC_URI="https://commondatastorage.googl LICENSE="BSD hotwording? ( no-source-code )" SLOT="0" KEYWORDS="amd64 ~arm x86" -IUSE="cups gnome gnome-keyring hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc" +IUSE="cups gnome gnome-keyring hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc +widevine" RESTRICT="proprietary-codecs? ( bindist )" # Native Client binaries are compiled with different set of flags, bug #452066. @@ -91,7 +91,8 @@ DEPEND="${RDEPEND} sys-apps/hwids[usb(+)] >=sys-devel/bison-2.4.3 sys-devel/flex - virtual/pkgconfig" + virtual/pkgconfig + widevine? ( www-plugins/chrome-binary-plugins[widevine] )" # For nvidia-drivers blocker, see bug #413637 . RDEPEND+=" @@ -122,6 +123,9 @@ if ! has chromium_pkg_die ${EBUILD_DEATH EBUILD_DEATH_HOOKS+=" chromium_pkg_die"; fi +# TODO: flag-mask widevine in non-intel profiles in lieu of this +REQUIRED_USE="|| ( x86 amd64 !widevine )" + DISABLE_AUTOFORMATTING="yes" DOC_CONTENTS=" Some web pages may require additional fonts to display properly. @@ -188,6 +192,30 @@ src_prepare() { epatch "${FILESDIR}/${PN}-system-jinja-r7.patch" + # When building non-Chrome-branded linux targets, + # build a full widevine cdm if requested (#547630) + epatch "${FILESDIR}/${PN}-widevine-2403.patch" + + if use widevine; then + local WIDEVINE_VERSION="$(< "${ROOT}/usr/$(get_libdir)/chromium-browser/widevine.version")" + [[ -z $WIDEVINE_VERSION ]] && die "Could not determine Widevine version." + + # to build the full widevine cdm, we must provide some versioning constants: + local header_lines=( + "#include \"third_party/widevine/cdm/widevine_cdm_common.h\"" + "#define WIDEVINE_CDM_AVAILABLE" + "#define WIDEVINE_CDM_VERSION_STRING \"${WIDEVINE_VERSION}\"" + ) + + # inject just above widevine_cdm_version.h's last line + local header_line sedscript='$i' + for header_line in "${header_lines[@]}"; do + sedscript+=${header_line} + sedscript+='\n' + done + sed -e "${sedscript}" -i third_party/widevine/cdm/widevine_cdm_version.h || die + fi + epatch_user # Remove most bundled libraries. Some are still needed. @@ -290,6 +318,20 @@ src_prepare() { } src_configure() { + if use widevine; then + local WIDEVINE_SUPPORTED_ARCHS="x64 ia32" + local arch + for arch in ${WIDEVINE_SUPPORTED_ARCHS}; do + [[ -d third_party/widevine/cdm/linux/${arch} ]] \ + || mkdir -p third_party/widevine/cdm/linux/${arch} \ + || die "Could not make widevine header directory for arch \"${arch}\"." + cp "${ROOT}/usr/$(get_libdir)/chromium-browser/libwidevinecdm.so" \ + third_party/widevine/cdm/widevine_cdm_*.h \ + third_party/widevine/cdm/linux/${arch}/ \ + || die "Could not copy headers for Widevine." + done + fi + local myconf="" # Never tell the build system to "enable" SSE2, it has a few unexpected @@ -362,7 +404,8 @@ src_configure() { $(gyp_use hotwording enable_hotwording) $(gyp_use kerberos) $(gyp_use pulseaudio) - $(gyp_use tcmalloc use_allocator tcmalloc none)" + $(gyp_use tcmalloc use_allocator tcmalloc none) + $(gyp_use widevine enable_widevine)" # Use explicit library dependencies instead of dlopen. # This makes breakages easier to detect by revdep-rebuild. @@ -582,6 +625,10 @@ src_install() { newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die + if use widevine; then + doexe out/Release/libwidevinecdmadapter.so + fi + # Install icons and desktop entry. local branding size for size in 16 22 24 32 48 64 128 256 ; do