#####################################################################################################
# Build plugin script: slackwareaarch64-<ver>/source/l/glibc/buildplugins/Widevine/Widevine.conf
# Author.............: Minime_2003 on LQ
# Reference..........: https://www.linuxquestions.org/questions/showthread.php?p=6498108#post6498108
# Upstream repository: https://github.com/mostman/Slackbuilds/tree/Slackware-15.0/glibc
# Patch location.....: https://github.com/mostman/Slackbuilds/tree/Slackware-15.0/glibc/patches
#####################################################################################################

# To cause this script to load from the glibc build process:
# cd source/l/glibc
# $ BUILD_PLUGINS=Widevine ./arm/build
#
# Note: other build plugins can be specified in the same 'BUILD_PLUGINS' variable, space separated.
# e.g.
# $ BUILD_PLUGINS="Widevine rk3399 raspberrypi" ./arm/build

function Widevine_srcpatch() {
  echo "-------- Patches fixes Widevine (CDM) in ARM -------"
  
  # Add support for SHT_RELR
  auto_apply_patch $PORTCWD/buildplugins/Widevine/patches/glibc-add-support-for-SHT_RELR-sections.patch.gz || failpatch

  # Fix TLS for Widevine
  auto_apply_patch $PORTCWD/buildplugins/Widevine/patches/glibc-tls-libwidevinecdm.so-since-4.10.2252.0-has-TLS-with.patch.gz || failpatch

}

