[arch-commits] Commit in freerdp/trunk (PKGBUILD freerdp-2.5.0-ffmpeg5.patch)

David Runge dvzrv at gemini.archlinux.org
Mon Jan 24 18:55:49 UTC 2022


    Date: Monday, January 24, 2022 @ 18:55:49
  Author: dvzrv
Revision: 1114867

upgpkg: freerdp 2:2.5.0-2: Rebuild against ffmpeg 5.0.

Apply upstreamed patch to guard against calls to deprecated ffmpeg functions.
Simplify quoting in file.
Simplify calls to cmake and make.
Do not break long lines.

Added:
  freerdp/trunk/freerdp-2.5.0-ffmpeg5.patch
Modified:
  freerdp/trunk/PKGBUILD

-----------------------------+
 PKGBUILD                    |   60 ++++++++++++++++++++++--------------------
 freerdp-2.5.0-ffmpeg5.patch |   44 ++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 28 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-01-24 18:55:44 UTC (rev 1114866)
+++ PKGBUILD	2022-01-24 18:55:49 UTC (rev 1114867)
@@ -5,42 +5,47 @@
 _name=FreeRDP
 pkgname=freerdp
 pkgver=2.5.0
-pkgrel=1
+pkgrel=2
 epoch=2
 pkgdesc="Free implementation of the Remote Desktop Protocol (RDP)"
-arch=('x86_64')
+arch=(x86_64)
 url="https://www.freerdp.com/"
-license=('Apache')
-depends=('dbus-glib' 'glibc' 'gstreamer' 'gst-plugins-base-libs' 'libcups'
-'libgssglue' 'libx11' 'libxcursor' 'libxext' 'libxdamage' 'libxfixes'
-'libxkbcommon' 'libxi' 'libxinerama' 'libxkbfile' 'libxrandr' 'libxrender'
-'libxtst' 'openssl' 'pcsclite' 'wayland')
-makedepends=('alsa-lib' 'cmake' 'docbook-xsl' 'ffmpeg' 'icu' 'krb5'
-'libjpeg-turbo' 'libpulse' 'libusb' 'pam' 'systemd-libs' 'xmlto' 'xorgproto')
-provides=('libfreerdp2.so' 'libfreerdp-client2.so' 'libfreerdp-server2'
-'libfreerdp-shadow2.so' 'libfreerdp-shadow-subsystem2.so' 'libwinpr2.so'
-'libwinpr-tools2.so' 'libuwac0.so')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz"
-        "$pkgname-2.0.0-manpage_formatting.patch")
+license=(Apache)
+depends=(dbus-glib glibc gstreamer gst-plugins-base-libs libcups libgssglue
+libx11 libxcursor libxext libxdamage libxfixes libxkbcommon libxi libxinerama
+libxkbfile libxrandr libxrender libxtst openssl pcsclite wayland)
+makedepends=(alsa-lib cmake docbook-xsl ffmpeg icu krb5 libjpeg-turbo libpulse
+libusb pam systemd-libs xmlto xorgproto)
+provides=(libfreerdp2.so libfreerdp-client2.so libfreerdp-server2
+libfreerdp-shadow2.so libfreerdp-shadow-subsystem2.so libwinpr2.so
+libwinpr-tools2.so libuwac0.so)
+source=(
+  "$pkgname-$pkgver.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz"
+  "$pkgname-2.5.0-ffmpeg5.patch"
+  "$pkgname-2.0.0-manpage_formatting.patch"
+)
 sha512sums=('7720306c8d0915578f6758f46ba0e0b8a81bbdcd1c80e08711576605142467f6735f644099e79a05113959fb30cd1070ca138a523537a41a7102880daf89c04c'
+            '7dd82d4db128c3abf1a3fe77edf5b9fece90c2171e2e2935d0f8fe0524d108bdc0fd2afb6dbf95a5778c76dc090c015c2a63e85ab864fed7c560b27f65a67ba9'
             'd960e042d1527b5d5721136b6b20fc36f65beafd010581ea5b908668537fe9fe622de6689a29c0274b0d6f1e513615f0d02e56c1d1d1e613d093e145d39af8d7')
 b2sums=('c81262e9963525c83960f8ca95b142787787ce844633ce6aa81820be90575dd59f802dd277cb950de12c120f25caa9b189c0bf942c91af9119f3f4338b0796d1'
+        '4b053f1b5fef67fd44b4261a06702b9dacac1505151f33d104d1b1b7b18df446a300a2d4c8cf4fa0ba57b532e03308b2fcdcd2e75c0f05bf7cd8ead7146bd9b3'
         '8242fe56ba9cf5352d836f656645a46142c1aecea3e8200203117a0cccc226135591c16fa0a24cfa196ade7b703832ff6871a948fd3bbbcc1d9c6df9885dc360')
 
 prepare() {
-  mv -v "${_name}-${pkgver}" "${pkgname}-${pkgver}"
-  cd "${pkgname}-${pkgver}"
+  cd "${_name}-${pkgver}"
   # fix man page formatting:
   # https://bugs.archlinux.org/task/64814
   patch -Np1 -i "../${pkgname}-2.0.0-manpage_formatting.patch"
+  # fix build with ffmpeg >= 5.0
+  # https://github.com/FreeRDP/FreeRDP/pull/7578
+  patch -Np1 -i "../${pkgname}-2.5.0-ffmpeg5.patch"
 }
 
 build() {
-  cd "${pkgname}-${pkgver}"
-  cmake -DCMAKE_INSTALL_PREFIX='/usr' \
-        -DCMAKE_INSTALL_LIBDIR='lib' \
-        -DCMAKE_BUILD_TYPE='None' \
-        -DPROXY_PLUGINDIR='/usr/lib/freerdp2/server/proxy/plugins' \
+  cmake -DCMAKE_INSTALL_PREFIX=/usr \
+        -DCMAKE_INSTALL_LIBDIR=lib \
+        -DCMAKE_BUILD_TYPE=None \
+        -DPROXY_PLUGINDIR=/usr/lib/freerdp2/server/proxy/plugins \
         -DWITH_DSP_FFMPEG=ON \
         -DWITH_FFMPEG=ON \
         -DWITH_PULSE=ON \
@@ -56,16 +61,15 @@
         -DCHANNEL_URBDRC_CLIENT=ON \
         -Wno-dev \
         -B build \
-        -S .
+        -S "${_name}-${pkgver}"
   make VERBOSE=1 -C build
 }
 
 package() {
-  depends+=('libasound.so' 'libavcodec.so' 'libavutil.so' 'libicuuc.so'
-  'libjpeg.so' 'libpam.so' 'libpulse.so' 'libswscale.so' 'libswresample.so'
-  'libsystemd.so' 'libusb-1.0.so')
-  cd "${pkgname}-${pkgver}"
+  depends+=(libasound.so libavcodec.so libavutil.so libicuuc.so libjpeg.so
+  libpam.so libpulse.so libswscale.so libswresample.so libsystemd.so
+  libusb-1.0.so)
+
   make DESTDIR="${pkgdir}" install -C build
-  install -vDm 644 {ChangeLog,README.md} \
-    -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -vDm 644 "${_name}-${pkgver}/"{ChangeLog,README.md} -t "${pkgdir}/usr/share/doc/${pkgname}"
 }

Added: freerdp-2.5.0-ffmpeg5.patch
===================================================================
--- freerdp-2.5.0-ffmpeg5.patch	                        (rev 0)
+++ freerdp-2.5.0-ffmpeg5.patch	2022-01-24 18:55:49 UTC (rev 1114867)
@@ -0,0 +1,44 @@
+From bfbfc1c365bc623d100387acc53933157d25f7d6 Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Mon, 24 Jan 2022 19:47:29 +0100
+Subject: [PATCH] Guard avcodec_register_call() calls
+
+{channels/tsmf/client/ffmpeg/tsmf,libfreerdp/codec/dsp}_ffmpeg.c:
+Guard calls to `avcodec_register_call()` against use beyond
+`AV_VERSION_INT(58, 10, 100)`, where upstream ffmpeg made it obsolete.
+---
+ channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 2 ++
+ libfreerdp/codec/dsp_ffmpeg.c             | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
+index 0444ad07b..cf0aa9ba1 100644
+--- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
++++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
+@@ -615,7 +615,9 @@ static void tsmf_ffmpeg_free(ITSMFDecoder* decoder)
+ static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT;
+ static BOOL CALLBACK InitializeAvCodecs(PINIT_ONCE once, PVOID param, PVOID* context)
+ {
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)
+ 	avcodec_register_all();
++#endif
+ 	return TRUE;
+ }
+ 
+diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c
+index db7450b7a..37c67da79 100644
+--- a/libfreerdp/codec/dsp_ffmpeg.c
++++ b/libfreerdp/codec/dsp_ffmpeg.c
+@@ -573,7 +573,9 @@ BOOL freerdp_dsp_ffmpeg_supports_format(const AUDIO_FORMAT* format, BOOL encode)
+ FREERDP_DSP_CONTEXT* freerdp_dsp_ffmpeg_context_new(BOOL encode)
+ {
+ 	FREERDP_DSP_CONTEXT* context;
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)
+ 	avcodec_register_all();
++#endif
+ 	context = calloc(1, sizeof(FREERDP_DSP_CONTEXT));
+ 
+ 	if (!context)
+-- 
+2.34.1
+



More information about the arch-commits mailing list