[MacPorts] #56128: qmake5 PortGroup does not respect configure.ldflags

MacPorts noreply at macports.org
Sun May 13 16:07:12 UTC 2018


#56128: qmake5 PortGroup does not respect configure.ldflags
---------------------+---------------------------------
  Reporter:  mojca   |      Owner:  MarcusCalhoun-Lopez
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:          |
---------------------+---------------------------------

Comment (by MarcusCalhoun-Lopez):

 Sorry for not getting to this earlier.

 The reason that the qmake5 PortGroup does not respect
 {{{configure.ldflags}}} is because qmake is its own build ecosystem.\\
 The default values of {{{configure.ldflags}}} are {{{-L/opt/local/lib}}}
 and {{{-Wl,-headerpad_max_install_names}}}.\\
 {{{-headerpad_max_install_names}}} is
 [http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/features/mac/default_post.prf#n40
 added to QMAKE_LFLAGS] by using
 [http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/common/gcc-base-
 mac.conf#n21 QMAKE_LFLAGS_HEADERPAD].\\
 {{{-L/opt/local/lib}}} is supposed to be redundant as well.\\
 The qmake way of adding a library is [http://doc.qt.io/qt-5/qmake-
 variable-reference.html#libs LIBS] or [http://doc.qt.io/qt-5/qmake-
 project-files.html#configuration-features PKGCONFIG].\\
 There might be a case to be made for adding {{{LIBS += -L${prefix}/lib}}},
 in the {{{.qmake.cache}}} file.\\
 However, I would argue that this is unnecessary since qmake respects the
 {{{LIBRARY_PATH=${prefix}/lib}}} environmental variable set by MacPorts.

 Removing `qt5.ldflags ${configure.ldflags}` in
 [https://github.com/macports/macports-
 ports/blob/66b25e1930aecb7642060ecaf1d471f4e830e830/devel/kchmviewer/Portfile#L75
 kchmviewer] allowed the port to build without problems for me.\\
 It also built correctly without removing\\
 [https://github.com/macports/macports-
 ports/blob/66b25e1930aecb7642060ecaf1d471f4e830e830/devel/kchmviewer/files
 /patch-use-webkit-and-dbus.diff#L10 LIBS += -lchm -lzip]\\
 and replacing it with\\
 [https://github.com/macports/macports-
 ports/blob/66b25e1930aecb7642060ecaf1d471f4e830e830/devel/kchmviewer/files
 /patch-use-webkit-and-dbus.diff#L36 LIBS +=
 @PREFIX@/lib/libchm.$$QMAKE_EXTENSION_SHLIB
 @PREFIX@/lib/libzip.$$QMAKE_EXTENSION_SHLIB].\\
 I am not sure if there are other reasons why these patches are needed.

-- 
Ticket URL: <https://trac.macports.org/ticket/56128#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list