[vlc-commits] [Git][videolan/vlc][master] contrib: qt: fix link path on Windows

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Sep 13 05:16:02 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
09e3cc77 by Alexandre Janniaux at 2022-09-12T13:37:34+02:00
contrib: qt: fix link path on Windows

Path were still redirecting to the contrib-win64/ folder instead of
linking the $(PREFIX) folder in the Libs: section.

It was only impacting qt_plugins and not qt_modules. In particular, when
looking at qt/src/corelib/Makefile.Debug, we can see that a $(SED)
command line is added to replace the contrib-win64/ part into the
correct prefix path.

By looking at the qt/qmake/generators/makefile.cpp file, we can check
that this command is added because replacement has been requested for
qt_modules. However, replacement doesn't exist for qt_plugins so the
file is installed only with $(INSTALL_FILE).

At the same time, adding a replacement in the special qmake variable
QMAKE_PKGCONFIG_INSTALL_REPLACE leads to $(INSTALL_FILE) not being
called, because $(SED) > dst will be used to install the file instead.
It leads to pkg-static.sh not being called and libdir not being patched
correctly.

To fix this, also patch qmake to always use $(INSTALL_FILE) even if
$(SED) is used before.

Fixes #27316

- - - - -


1 changed file:

- contrib/src/qt/set-mkspecs-properties.patch


Changes:

=====================================
contrib/src/qt/set-mkspecs-properties.patch
=====================================
@@ -11,12 +11,16 @@
      qtConfig(debug_and_release): CONFIG += debug_and_release
 --- a/mkspecs/features/qt_plugin.prf	2020-09-02 12:15:07.000000000 +0200
 +++ b/mkspecs/features/qt_plugin.prf	2022-08-31 10:59:48.380662936 +0200
-@@ -14,8 +14,8 @@
+@@ -14,8 +14,12 @@
  isEmpty(PLUGIN_TYPE): error("PLUGIN_TYPE (plugins/ subdirectory) needs to be defined.")
 
  TEMPLATE = lib
 -CONFIG += plugin
 +CONFIG += plugin create_pc
++pluginpclib_replace.match = $$MODULE_BASE_OUTDIR/lib
++pluginpclib_replace.replace = $$[QT_INSTALL_LIBS]
++pluginpclib_replace.CONFIG = path
++QMAKE_PKGCONFIG_INSTALL_REPLACE += pluginpclib_replace
  DESTDIR = $$MODULE_BASE_OUTDIR/plugins/$$PLUGIN_TYPE
 
  win32:CONFIG(shared, static|shared) {
@@ -47,3 +51,28 @@
      CONFIG += skip_target_version_ext
  }
  
+--- a/qmake/generators/makefile.cpp	2020-09-02 12:15:07.000000000 +0200
++++ b/qmake/generators/makefile.cpp	2022-09-12 11:42:01.170411450 +0200
+@@ -3431,11 +3431,18 @@
+                                                + "," + windowsifyPath(replace.toQString()) + ",gi");
+             }
+         }
+-        if (sedargs.isEmpty()) {
+-            ret += "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
+-        } else {
+-            ret += "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
++
++        QString escaped_src = escapeFilePath(src);
++        if (!sedargs.isEmpty()) {
++            int pos = src.lastIndexOf('.');
++            QString filename = src.left(pos - 1);
++            QString ext = src.mid(pos + 1);
++            escaped_src = escapeFilePath(filename + ".qmakereplace." + ext);
++            ret += "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > "
++                   + escaped_src + " && ";
+         }
++
++        ret += "$(INSTALL_FILE) " + escaped_src + ' ' + escapeFilePath(dst);
+     }
+     return ret;
+ }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09e3cc77daeaf597a53f5a3937c386ea1e73e47c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09e3cc77daeaf597a53f5a3937c386ea1e73e47c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list