git: e96c71a078c8 - main - multimedia/{mplayer|mencoder}: Fix ffmpeg4 linking if ffmpeg6 present

From: Thomas Zander <riggs_at_FreeBSD.org>
Date: Mon, 01 May 2023 09:39:56 UTC
The branch main has been updated by riggs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e96c71a078c8227bc09ca6d2e53bac79f04b6520

commit e96c71a078c8227bc09ca6d2e53bac79f04b6520
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-05-01 09:34:57 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2023-05-01 09:38:22 +0000

    multimedia/{mplayer|mencoder}: Fix ffmpeg4 linking if ffmpeg6 present
    
    PR:             270569
    Reported by:    george@m5p.com
    Reviewed by:    riggs
---
 multimedia/mplayer/files/patch-configure | 50 +++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/multimedia/mplayer/files/patch-configure b/multimedia/mplayer/files/patch-configure
index 0fee48e1d8ad..e9feca44baaa 100644
--- a/multimedia/mplayer/files/patch-configure
+++ b/multimedia/mplayer/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig	2021-03-05 12:28:06 UTC
+--- configure.orig	2023-02-20 22:41:00 UTC
 +++ configure
-@@ -664,7 +664,7 @@ armthumb=auto
+@@ -666,7 +666,7 @@ armthumb=auto
  _iwmmxt=auto
  _mtrr=auto
  _altivec=auto
@@ -9,7 +9,7 @@
  _ranlib=ranlib
  _windres=windres
  _cc=cc
-@@ -1016,7 +1016,7 @@ for ac_option do
+@@ -1019,7 +1019,7 @@ for ac_option do
      ld_static=''
      ;;
    --enable-profile)
@@ -18,7 +18,7 @@
      ;;
    --disable-profile)
      _profile=
-@@ -1486,7 +1486,6 @@ for ac_option do
+@@ -1491,7 +1491,6 @@ for ac_option do
  
    *)
      echo "Unknown parameter: $ac_option"
@@ -26,7 +26,7 @@
      ;;
  
    esac
-@@ -1524,40 +1523,6 @@ rm -f "$TMPLOG"
+@@ -1529,40 +1528,6 @@ rm -f "$TMPLOG"
  echo configuration: $configuration > "$TMPLOG"
  echo >> "$TMPLOG"
  
@@ -67,7 +67,7 @@
  list_subparts() {
    test ! -e ffmpeg/libav${3} && return 1
    pattern="s/^[^#]*${1}.*([^ ,]*, *\([^ ,)]*\).*/\1_${2}/p"
-@@ -1836,7 +1801,7 @@ if test -z "$_target" ; then
+@@ -1844,7 +1809,7 @@ if test -z "$_target" ; then
    case "$1" in
        x86_64|amd64|x64|i[3-9]86*|i86pc|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;;
        ia64) host_arch=ia64 ;;
@@ -76,7 +76,7 @@
        alpha) host_arch=alpha ;;
        sun4*|sparc*) host_arch=sparc ;;
        parisc*|hppa*|9000*) host_arch=hppa ;;
-@@ -1962,7 +1927,11 @@ echocheck "working compiler"
+@@ -1970,7 +1935,11 @@ echocheck "working compiler"
  cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
  echo "yes"
  
@@ -89,7 +89,7 @@
  
  if test -z "$_target" ; then
    cat > $TMPC << EOF
-@@ -3090,7 +3059,7 @@ if x86_32 ; then
+@@ -3100,7 +3069,7 @@ if x86_32 ; then
      _pref_as_version='2.16.92'
      echo 'pabsd %xmm0, %xmm1' >> $TMPS
    fi
@@ -98,7 +98,7 @@
  
    if test "$as_verc_fail" != yes ; then
      echores "ok"
-@@ -3357,6 +3326,13 @@ if arm ; then
+@@ -3367,6 +3336,13 @@ if arm ; then
    fi
    echores "$setend"
  
@@ -112,7 +112,7 @@
    echocheck "softfloat ABI"
    softfloat=yes
    cpp_condition_check '' 'defined(__ARM_PCS_VFP) || (!defined(__ARM_PCS) && !defined(__SOFTFP__))' && softfloat=no
-@@ -4266,7 +4242,7 @@ echocheck "pthread"
+@@ -4277,7 +4253,7 @@ echocheck "pthread"
  if linux ; then
    THREAD_CFLAGS=-D_REENTRANT
  elif freebsd || netbsd || openbsd || bsdos ; then
@@ -121,7 +121,7 @@
  fi
  if test "$_pthreads" = auto ; then
  cat > $TMPC << EOF
-@@ -4276,7 +4252,7 @@ int main(void) { pthread_t tid; return pthread_create(
+@@ -4287,7 +4263,7 @@ int main(void) { pthread_t tid; return pthread_create(
  EOF
  _pthreads=no
  if ! hpux ; then
@@ -130,7 +130,7 @@
      # for crosscompilation, we cannot execute the program, be happy if we can link statically
      cc_check $THREAD_CFLAGS $ld_tmp && (tmp_run || test "$ld_static") && ld_pthread="$ld_tmp" && _pthreads=yes && break
    done
-@@ -4419,7 +4395,7 @@ int main(void) {
+@@ -4430,7 +4406,7 @@ int main(void) {
  }
  EOF
    _iconv=no
@@ -139,7 +139,17 @@
      cc_check $ld_tmp && extra_ldflags="$extra_ldflags $ld_tmp" &&
        ld_iconv="$ld_tmp" && _iconv=yes && break
    done
-@@ -5866,15 +5842,6 @@ EOF
+@@ -4460,7 +4436,8 @@ if test "$_termcap" = auto ; then
+   _termcap=no
+   for ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
+     statement_check term.h 'tgetent(0, 0)' $ld_tmp &&
+-      extra_ldflags="$extra_ldflags $ld_tmp" &&
++      # Nudge the linker into finding ffmpeg4 symbols first
++      extra_ldflags="-L%%LOCALBASE%%/ffmpeg4/lib $extra_ldflags $ld_tmp" &&
+       ld_termcap="$ld_tmp" && _termcap=yes && break
+   done
+ fi
+@@ -5876,15 +5853,6 @@ EOF
        break
      fi
    done
@@ -155,7 +165,7 @@
    if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
      _gl=yes
      _gl_win32=yes
-@@ -6409,7 +6376,7 @@ elif darwin ; then
+@@ -6419,7 +6387,7 @@ elif darwin ; then
  elif dragonfly ; then
    default_cdrom_device="/dev/cd0"
  elif freebsd ; then
@@ -164,7 +174,7 @@
  elif openbsd ; then
    default_cdrom_device="/dev/rcd0c"
  elif sunos ; then
-@@ -6422,7 +6389,7 @@ else
+@@ -6432,7 +6400,7 @@ else
    default_cdrom_device="/dev/cdrom"
  fi
  
@@ -173,7 +183,7 @@
    default_dvd_device=$default_cdrom_device
  elif darwin ; then
    default_dvd_device="/dev/rdiskN"
-@@ -6948,7 +6915,7 @@ echores "$_speex"
+@@ -6959,7 +6927,7 @@ echores "$_speex"
  echocheck "libgsm"
  if test "$_libgsm" = auto ; then
    _libgsm=no
@@ -182,7 +192,7 @@
  fi
  if test "$_libgsm" = yes ; then
    def_libgsm='#define CONFIG_LIBGSM 1'
-@@ -7424,6 +7391,16 @@ if test "$_librtmp" = yes && test "$networking" = yes;
+@@ -7391,6 +7359,16 @@ if test "$_librtmp" = yes && test "$networking" = yes;
    nolibrtmp=no
    def_librtmp='#define CONFIG_LIBRTMP 1'
    inputmodules="librtmp $inputmodules"
@@ -199,7 +209,7 @@
  else
    nolibrtmp=yes
    _librtmp=no
-@@ -7813,7 +7790,7 @@ echores "$_mp3lame"
+@@ -7808,7 +7786,7 @@ echores "$_mp3lame"
  echocheck "mencoder"
  if test "$_mencoder" = no ; then
    # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
@@ -208,12 +218,12 @@
  fi
  echores "$_mencoder"
  
-@@ -8419,7 +8396,7 @@ libs_mplayer=$ld_tmp
+@@ -8414,7 +8392,7 @@ libs_mplayer=$ld_tmp
  
  #############################################################################
  
 -CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
 +CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  
- CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+ CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=c++98"