From b3e1e3e3b307e60924dcf3cf308488a362de88f0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 6 Mar 2018 10:47:29 +0100 Subject: Add module Exporter.pkgconfig This module generates .pc files for products, optionally attempting to derive some of the entries from the contents of the Export item. [ChangeLog] Added new module "Exporter.pkgconfig" for creating pkg- config metadata files. Task-number: QBS-1232 Change-Id: Ic41e645e4462e8f85ad6c2025fb967e88d3438f9 Reviewed-by: Joerg Bornemann --- doc/reference/items/language/export.qdoc | 2 + .../modules/exporter-pkgconfig-module.qdoc | 198 +++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 doc/reference/modules/exporter-pkgconfig-module.qdoc (limited to 'doc') diff --git a/doc/reference/items/language/export.qdoc b/doc/reference/items/language/export.qdoc index 3c89117e9..d8ed4c33d 100644 --- a/doc/reference/items/language/export.qdoc +++ b/doc/reference/items/language/export.qdoc @@ -91,5 +91,7 @@ \endcode \defaultvalue \c undefined + \see Exporter.qbs + \see Exporter.pkgconfig \since 1.12 */ diff --git a/doc/reference/modules/exporter-pkgconfig-module.qdoc b/doc/reference/modules/exporter-pkgconfig-module.qdoc new file mode 100644 index 000000000..29672fb21 --- /dev/null +++ b/doc/reference/modules/exporter-pkgconfig-module.qdoc @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \contentspage index.html + \qmltype Exporter.pkgconfig + \inqmlmodule QbsModules + \since Qbs 1.12 + + \brief Provides support for generating pkg-config files. + + The \c Exporter.pkgconfig module contains the properties and rules to create a + \l{https://www.freedesktop.org/wiki/Software/pkg-config}{pkg-config} + metadata (\c{.pc}) file for a \l Product. + + By default, \QBS will attempt to derive some of the \c {.pc} file's contents from + the product's \l Export item. This behavior can be suppressed by setting the + \l autoDetect property to \c false. + + \section2 Relevant File Tags + \target filetags-exporter-pkgconfig + + \table + \header + \li Tag + \li Since + \li Description + \row + \li \c{"Exporter.pkgconfig.pc"} + \li 1.12.0 + \li This tag is attached to the generated \c{.pc} file. + \endtable +*/ + +/*! + \qmlproperty bool Exporter.pkgconfig::autoDetect + + If this property is enabled, then \QBS will try to derive various \c {.pc} file + entries from the contents of the product's \l Export item, including the dependencies + declared therein. Values for these fields can still be explicitly provided via the + respective properties, in which case they will be concatenated with the auto-detected ones. + If an exported dependency is known to correspond to a pkg-config module (either by + pulling in the \c{Exporter.pkgconfig} module or by appearing in the \l requiresEntry + property), it will end up in the \c Requires field of the \c{.pc} file, otherwise + its exported \l cpp properties will be collected for use in the \c Cflags and \c Libs fields. + The \l excludedDependencies property can be used to ignore specific products altogether. + + \defaultvalue \c true +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::cflagsEntry + + The value of the \c Cflags field in the \c {.pc} file. + + If \l autoDetect is enabled, then this value will be appended to the flags derived from + the product's \l Export item and the dependencies declared therein. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::conflictsEntry + + The value of the \c Conflicts field in the \c {.pc} file. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::excludedDependencies + + If \l autoDetect is enabled, the entries of this property will be matched against + the product's exported dependencies. In case such a dependency's name is present in the array, + \QBS will not traverse that dependency to collect entries for the + \c Cflags, \c Libs, \c Requires and \c {Requires.private} fields. + + This list must not contain any values that are present in \l requiresEntry. + + \defaultvalue \c undefined +*/ + +/*! + \qmlproperty string Exporter.pkgconfig::fileName + + The file name of the generated pkg-config metadata file. + + \defaultvalue \c {product.targetName + ".pc"} +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::libsEntry + + The value of the \c Libs field in the \c {.pc} file. + + If \l autoDetect is enabled, then this value will be appended to the flags derived from + the product's \l Export item and the dependencies declared therein. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::libsPrivateEntry + + The value of the \c Libs.Private field in the \c {.pc} file. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty string Exporter.pkgconfig::nameEntry + + The value of the \c Name field in the \c {.pc} file. + + \defaultvalue \c {product.name} +*/ + + +/*! + \qmlproperty stringList Exporter.pkgconfig::requiresEntry + + The value of the \c Requires field in the \c {.pc} file. + + If \l autoDetect is enabled, then those of the product's exported dependencies + that pull in the \c {Exporter.pkgconfig} module will also end up in the + \c Requires field, provided they are not listed in \l excludedDependencies. + + If an exported dependency matches an entry of this array, \QBS will not traverse that + dependency to gather \l cpp properties for use in the \l cflagsEntry and \l libsEntry values, + as pkg-config takes care of that itself. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty stringList Exporter.pkgconfig::requiresPrivateEntry + + The value of the \c Requires.private field in the \c {.pc} file. + + If \l autoDetect is enabled, then those of the product's non-exported dependencies + that pull in the \c {Exporter.pkgconfig} module will also end up in the + \c Requires.private field, provided they are not listed in \l excludedDependencies. + + \defaultvalue \c {[]} +*/ + +/*! + \qmlproperty var Exporter.pkgconfig::transformFunction + + A function with the signature + \c {function(product, moduleName, propertyName, value)}. + This can be useful to "fine-tune" property values if \l autoDetect is enabled, in case + they need amending for the purpose of pkg-config. + The \c product parameter represents the exporting product, the remaining parameters describe + the module property. The modified value of the module property shall be returned. + + \defaultvalue \c undefined +*/ + +/*! + \qmlproperty string Exporter.pkgconfig::urlEntry + + The value of the \c URL field in the \c {.pc} file. + + \defaultvalue \c undefined +*/ + +/*! + \qmlproperty string Exporter.pkgconfig::versionEntry + + The value of the \c Version field in the \c {.pc} file. + + \defaultvalue \c {product.version} +*/ -- cgit v1.2.3 From c317ceb66930ac7a4312e6bfc51f1303a5413c34 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 5 Jun 2018 13:46:16 +0200 Subject: Update man page Change-Id: I46d015812d0cb49716123dc5a6748acf48c8bb3f Reviewed-by: Joerg Bornemann --- doc/man/qbs.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/man/qbs.1 b/doc/man/qbs.1 index cf5d5d767..32c112886 100644 --- a/doc/man/qbs.1 +++ b/doc/man/qbs.1 @@ -1,12 +1,12 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.5. -.TH QBS "1" "October 2017" "qbs 1.11.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH QBS "1" "June 2018" "qbs 1.12.0" "User Commands" .SH NAME qbs \- the Qbs build tool .SH SYNOPSIS .B qbs [\fI\,command\/\fR] [\fI\,command parameters\/\fR] .SH DESCRIPTION -Qbs 1.11.0, a cross\-platform build tool. +Qbs 1.12.0, a cross\-platform build tool. .SS "Built-in commands:" .TP build -- cgit v1.2.3 From 0af8d1b7870d44e4a024669cae28593173687de1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 5 Jun 2018 13:29:58 +0200 Subject: Exporter.pkgconfig: Add support for custom variables Change-Id: I42a01e549c15c91428d0f8bd9be03ea59c773032 Reviewed-by: Joerg Bornemann --- doc/reference/modules/exporter-pkgconfig-module.qdoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/reference/modules/exporter-pkgconfig-module.qdoc b/doc/reference/modules/exporter-pkgconfig-module.qdoc index 29672fb21..9489b4622 100644 --- a/doc/reference/modules/exporter-pkgconfig-module.qdoc +++ b/doc/reference/modules/exporter-pkgconfig-module.qdoc @@ -196,3 +196,15 @@ \defaultvalue \c {product.version} */ + +/*! + \qmlproperty string Exporter.pkgconfig::customVariables + + Use this property to add arbitrary variable assignments into the \c .pc file. + The property is a map that will produce one assignment per entry. + The keys and values of the map represent the left-hand sides and right-hand + sides of these assignments, respectively. The values are strings that will + be written into the file verbatim. + + \nodefaultvalue +*/ -- cgit v1.2.3