summaryrefslogtreecommitdiffstats
path: root/conanfile.py
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2021-07-01 11:36:31 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-26 11:06:49 +0000
commit6ff02cd468a67d8f781c7ddffdc5a2fa6396a7f3 (patch)
tree4d456ce8fbb7bc1334b3eb7f1f922947b6129557 /conanfile.py
parent73de12462b570df64b6a19a0a462336ee5d67134 (diff)
Support builds with Conan
The recipe uses Conan's supported way to inherit from a given base class via 'python_requires_extend'. The qt-conan-common package implements a base class for Qt leaf module recipes. The build steps in leaf modules are mostly identical so it makes sense to put those in the base class. Dependencies are read by the base class from the 'dependencies.yaml' which is the same file the CI system uses. Task-number: QTBUG-94914 Change-Id: Ib09faf140df0c2c8862c4b09c14d1a6929cca8b4 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit bf05dc0ea34e6d2a2a242fd1ba0d11bbc5175a95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 00000000..cb6a34f8
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,56 @@
+#############################################################################
+##
+## Copyright (C) 2021 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the release tools of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## 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 General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from conans import ConanFile
+import re
+from pathlib import Path
+
+
+def _parse_qt_version_by_key(key: str) -> str:
+ with open(Path(__file__).parent.resolve() / ".cmake.conf") as f:
+ m = re.search(fr'{key} .*"(.*)"', f.read())
+ return m.group(1) if m else ""
+
+
+def _get_qt_minor_version() -> str:
+ return ".".join(_parse_qt_version_by_key("QT_REPO_MODULE_VERSION").split(".")[:2])
+
+
+class QtConnectivity(ConanFile):
+ name = "qtconnectivity"
+ license = "LGPL-3.0, GPL-2.0+, Commercial Qt License Agreement"
+ author = "The Qt Company <https://www.qt.io/contact-us>"
+ url = "https://code.qt.io/cgit/qt/qtconnectivity.git"
+ description = "Connectivity module for Qt"
+ topics = "qt", "qt6", "connectivity", "bluetooth", "nfc"
+ settings = "os", "compiler", "arch", "build_type"
+ # for referencing the version number and prerelease tag and dependencies info
+ exports = ".cmake.conf", "dependencies.yaml"
+ exports_sources = "*", "!conan*.*"
+ python_requires = f"qt-conan-common/{_get_qt_minor_version()}@qt/everywhere"
+ python_requires_extend = "qt-conan-common.QtLeafModule"