Menu

#46 pkgconfig support

None
closed
nobody
None
5
2019-08-03
2014-09-03
Rex Dieter
No

Here's a patch we've been using in fedora awhile that adds pkgconfig support, so the qwt build provides a qwt.pc file.

1 Attachments

Discussion

  • Uwe Rathmann

    Uwe Rathmann - 2014-09-12

    This patch looks a bit too simple to me - f.e I can't see how designer plugin or docs are packaged. Also dependencies like QtSvg are depending on the configuration in qwtconfig.pri + Qwt project files need to be distribution independent.

    But as I'm not familiar with pkgconfig and I couldn't find much information about QMAKE_PKGCONFIG variables in the Qt docs ( is this Qt4, Qt5 or both ? ) I would need some help in this area.

    Please contact me by Email if you ( or someone else reading this ) are interested to see pkgconfig config support in the qwt project files.

     
  • Rex Dieter

    Rex Dieter - 2014-09-12

    The primary target for pkgconfig files are apps that want to build/link-against qwt.

    pkgconfig can theoretically support custom tags for additional information beyond the usual:
    prefix
    includes
    libs

    but I'm not aware if Qt/qmake supports anything beyond the standard stuff (I think not)

     
  • Rex Dieter

    Rex Dieter - 2014-09-12

    As for including QtSvg here, I think I erroneously added that as a dependency. As far as I can tell now, it can be removed to leave just:
    QMAKE_PKGCONFIG_REQUIRES = QtGui

     
  • Uwe Rathmann

    Uwe Rathmann - 2014-09-16
    • status: open --> closed
    • Group: -->
     
  • Uwe Rathmann

    Uwe Rathmann - 2014-09-16

    I have commited the commands from the patch to src/src.pro and textengines/mathml/mathml.pro with the following modifications:

    a) I didn't set QMAKE_PKGCONFIG_DESTDIR, simply because it seems to be buggy in combination with qmake includes - leading to wrong path names in case of mathml.pro. Without setting the dir the pc files end up in the same directory as the corresponding libraries. Hope there is no special rule for having a pkgconfig subdirecty, when using it.

    b) I'm unsure with the list in QMAKE_PKGCONFIG_REQUIRES as I don't know about the names of the depending Qt packages - also are these names common for most distributions or is it Fedora only. For a first try I simply assumed, that package names and the Qt modules are matching. So depending on the configuration in qwtconfig.pri: qwt.pc might depend on QtGui.pc QtSvg.pc and QtOpenGL.pc.

    I have introduced a new configuration flag "QwtPkgConfig" in qwtconfig.pri, that is disabled in the qwt 6.1 branch, but enabled in all branches >= 6.2 for unix platforms.

     
  • Rex Dieter

    Rex Dieter - 2014-09-16

    Thanks.

    a. that's ok, since qwt by default installs into a custom prefix anyway(*), consumers will likely have to set PKG_CONFIG_PATH

    b. Qt's pkgconfig file names are standard, not distro specific. Qt5 ones are named differently though. For example, QtGui vs Qt5Gui

    (*) I have a separate patch to install qwt into qt system dirs if you're interested, probably not upstreamable in its current form, but you should get the idea:
    http://pkgs.fedoraproject.org/cgit/qwt.git/tree/qwt-6.1.0-qt_install_paths.patch

     
  • Uwe Rathmann

    Uwe Rathmann - 2014-09-16

    Could you please tell me all pkg-config names, that are available for Qt4 and Qt5 - or show me a link, where I can help myself ?

    Concerning the other patch:

    the overall idea is, that you can control, where to install Qwt by changing the settings in qwtconfig.pri. The default setting is not to install into qt system dirs - by intention - with the argument that there is no reason to reinstall Qwt with every minor ( binary compatible ) update of Qt. But I know that some users prefer to install into the Qt system directory, because it simplifies configuring the build+run time enfironment.

    From your patch it looks like it is possible to install into the qt system dirs by changing qwtconfig.pri only ( the changes for the other files seem to be unrelated ? ), but not all of your changes would be easy to find for an average Qt user. So maybe its worth to introduce a new CONFIG option, that alternatively offers your settings. Then the user could change the way how to install Qwt easily, without having to mess with qmake detailss.

    But one thing that seems wrong to me is renaming doc to html, as you find html and man pages under doc.

     
  • Uwe Rathmann

    Uwe Rathmann - 2014-09-17

    O.k. I took the list of Qt package names from how they are installed with a regular Qt build - not sure if this really what most distros do.

    src.pro and mathml.pro have been adjusted for writing the proper Qt package dependencies ( it is not only a matter of names as Qt5 is more modular and therefore pulls more libs ).

    For Qt5 I tried to use a similar naming scheme as Qt does ( f.e Qt5Qwt6 ), for Qt4 qmake seems to be to limited and didn't see an easy way for having different names for lib and pkgconfig. Finally I found a way how to install to lib/pkgconfig - accepting that Qt4 creates pointless pkgconfig subdirectories by accident in the local build directories.

     

Anonymous
Anonymous

Add attachments
Cancel