[Qbs] Deployment and dependency bundling

Alberto Mardegan mardy at users.sourceforge.net
Fri Dec 27 16:04:08 CET 2019


On 27/12/19 15:15, Oswald Buddenhagen wrote:
> dependency embedding should be a property of the Depends item (based on
> https://bugreports.qt.io/browse/QBS-585). the way this is actually
> handled is platform-dependent and needs to be properly abstracted
> (https://bugreports.qt.io/browse/QBS-229).

I agree that in many cases the Depends item is the one who has the best
information on how to handle its deployment. For example, the QtGui
module will know which platform plugins need to be deployed, and the
QtQml module could know which QML modules need to be deployed and how.

Solving this probably doesn't seem easy, so in my dumb approach (using
ldd) I was hoping to find a quicker solution that would take care of
solving only part of the problem.

But if we can reach an agreement on how this could look like, jumping to
the implementation will be easier. For the time being I don't have a
clear picture. Maybe we can start by defining how this will look like in
the project file?


Project {
  QtGuiApplication {
    Depends {
      name: "QtGui"

      /* Or should this be automatically detected depending on
       * the target? Maybe one should have a "deployed-app" product,
       * and deployment should be triggered if and only if qbs is
       * asked to build that target?
       */
      deployment.enabled: product.install

      /* The "*plugins" properties are specific to the QtGui
       * dependency.
       */
      deployment.imageformatsPlugins: ["png", "svg"]
      deployment.sqldriversPlugins: ["qsqlite"]
    }

    Depends {
      name: "QtQuick"

      deployment.enabled: product.install

      /* The "modules", "deduceModulesFrom", "excludeModules" properties
       * are specific to the QtQuick and QtQml dependencies.
       */
      deployment.modules: ["QtQuick","QtQuick.Controls.Material"]
      // deployment.deduceModulesFrom: [ "src/myqmlfiles/*.qml" ]
      // deployment.excludeModules: [ "QtQuick.Controls.Universal" ]
    }

    Depends {
      name: "exiv2"
      deployment.enabled: product.install
    }

    /* Then, the actual shared libraries required by libQt5Gui.so,
     * libQt5Quick.so and libexiv2.so would be collected
     * automatically by QBS if "deployment.enabled" is true on the
     * Product.
     * Additional properties could be used to exclude some libraries
     * from being deployed (because we assume they exist in the
     * target system).
     */
    deployment.enabled: install
    deployment.excludePatterns: [ "libstdc++.so*", "libxcb.so*" ]

    /* Excluded libraries could be listed in txt files (the AppImage
     * project for example maintains such a list).
     */
    // deployment.excludeFiles: [
    //   "appimage_exclude.txt",
    //   "macos_excludelist.txt"
    // ]

  }
}


Does the above look reasonable (and feasible)?


Ciao,
  Alberto


-- 
http://www.mardy.it - Geek in un lingua international


More information about the Qbs mailing list