[vlc-devel] [PATCH 3.0 2/6] tools: fix cmake not finding packages on msys2
Steve Lhomme
robux4 at ycbcr.xyz
Wed Jun 17 12:57:21 CEST 2020
The PKG_CONFIG_PATH is converted to a Windows-like path and thus pkg-config
can't use it.
(cherry picked from commit 68fd1eaae9dc8fee485882f186a8b15b42e3a42d)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
---
extras/tools/cmake-msys-FindPkg.patch | 23 +++++++++++++++++++++++
extras/tools/tools.mak | 1 +
2 files changed, 24 insertions(+)
create mode 100644 extras/tools/cmake-msys-FindPkg.patch
diff --git a/extras/tools/cmake-msys-FindPkg.patch b/extras/tools/cmake-msys-FindPkg.patch
new file mode 100644
index 0000000000..6b73e9eace
--- /dev/null
+++ b/extras/tools/cmake-msys-FindPkg.patch
@@ -0,0 +1,23 @@
+--- cmake/Modules/FindPkgConfig.cmake.msys_pkg 2018-10-01 16:51:37.332632500 +0200
++++ cmake/Modules/FindPkgConfig.cmake 2018-10-01 16:51:46.815041400 +0200
+@@ -344,6 +344,20 @@ macro(_pkg_check_modules_internal _is_re
+ unset(_lib_dirs)
+ unset(_pkgconfig_path)
+ endif()
++
++ if (CYGWIN OR MSYS)
++ # fix the PKG_CONFIG_PATH transformed into a cmake path with incorrect msys pathes
++ file(TO_CMAKE_PATH "$ENV{PKG_CONFIG_PATH}" _pkgconfig_path_cmake)
++ execute_process(
++ COMMAND sh.exe "-c" "cygpath -up '${_pkgconfig_path_cmake}'"
++ RESULT_VARIABLE _cygpath_retval
++ OUTPUT_VARIABLE _cygpath_outval
++ ERROR_VARIABLE _cygpath_error
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ ERROR_STRIP_TRAILING_WHITESPACE)
++ set(ENV{PKG_CONFIG_PATH} ${_cygpath_outval})
++ #message(STATUS "new ENV $ENV{PKG_CONFIG_PATH}")
++ endif()
+
+ # iterate through module list and check whether they exist and match the required version
+ foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 040dbf4499..a941edf264 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -84,6 +84,7 @@ cmake-$(CMAKE_VERSION).tar.gz:
cmake: cmake-$(CMAKE_VERSION).tar.gz
$(UNPACK)
+ $(APPLY) cmake-msys-FindPkg.patch
$(APPLY) cmake-winstore.patch
$(MOVE)
--
2.26.2
More information about the vlc-devel
mailing list