[vlc-devel] [PATCH 2/2] contrib: mfx: backport upstream patch to fix UWP detection

Steve Lhomme robux4 at ycbcr.xyz
Fri May 29 17:06:10 CEST 2020


We don't use a custom toolchain anymore so we need to detect UWP properly.
---
 ...builds-with-a-regular-mingw32-toolch.patch | 40 +++++++++++++++++++
 contrib/src/mfx/rules.mak                     |  3 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch

diff --git a/contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch b/contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch
new file mode 100644
index 000000000000..511c42dd3f66
--- /dev/null
+++ b/contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch
@@ -0,0 +1,40 @@
+From c51a54c15f51579804030c70592c0a26065f1242 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 28 May 2020 13:26:18 +0200
+Subject: [PATCH] detect winstore builds with a regular mingw32 toolchain
+
+It's trigerred with a mingw32winrt or mingw32uwp toolchain.
+
+Forcing the WINAPI_FAMILY should be enough to trigger the winstore mode.
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 490432a..c6f07cb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,6 +35,20 @@ AS_CASE([${host_os}],
+         AM_CONDITIONAL([WINDOWS_STORE], [true])
+         DLLIB="$(DLLIB) -ldxgi"
+     ],
++    [mingw32], [
++        AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
++          [[#include <winapifamily.h>
++           #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++           # error Win32 Desktop build
++           #endif
++          ]],[[;]])
++        ],[
++            AM_CONDITIONAL([WINDOWS_STORE], [true])
++            DLLIB="$(DLLIB) -ldxgi"
++        ],[
++            AM_CONDITIONAL([WINDOWS_STORE], [false])
++        ])
++    ],
+     [
+         AM_CONDITIONAL([WINDOWS_STORE], [false])
+     ]
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/mfx/rules.mak b/contrib/src/mfx/rules.mak
index 1bf9580871be..0d74302b788f 100644
--- a/contrib/src/mfx/rules.mak
+++ b/contrib/src/mfx/rules.mak
@@ -1,7 +1,7 @@
 # mfx (Media SDK)
 
 mfx_GITURL := https://github.com/lu-zero/mfx_dispatch.git
-MFX_GITHASH := c51a54c15f51579804030c70592c0a26065f1242
+MFX_GITHASH := 7efc7505465bc1f16fbd1da3d24aa5bd9d46c5ca
 
 ifeq ($(call need_pkg,"mfx"),)
 PKGS_FOUND += mfx
@@ -29,6 +29,7 @@ $(TARBALLS)/mfx-$(MFX_GITHASH).tar.xz:
 
 mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx
 	$(UNPACK)
+	$(APPLY) $(SRC)/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch
 	cd $(UNPACK_DIR) && autoreconf -ivf
 	$(MOVE)
 
-- 
2.26.2



More information about the vlc-devel mailing list