aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/qt.py
AgeCommit message (Collapse)AuthorFilesLines
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen1-2/+3
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen1-1/+1
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen1-2/+2
2024-02-12override subclass attribute type when we know it is not NoneEli Schwartz1-0/+2
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker1-13/+2
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-09-18Remove get_pkgconfig_variable()Xavier Claessens1-7/+7
Make sure that pkgconfig_define is a pair of strings and not a list with more than 2 strings.
2023-09-08dependencies: fix crash in Qt if private_headers dir not foundEli Schwartz1-1/+1
You cannot listdir() a directory that doesn't exist. This header directory may not exist if suitable devel packages in distros with split devel packages, aren't installed. In theory we could raise a suitable error here. But it would be inconsistent -- we don't otherwise validate that the Qt include directories exist, usually just assuming they do because the dependency was found. And this is niche code inside a non-default special kwarg. At least for pkg-config, it's probably a bug in the distro if pkg-config files exist but the headers don't. The qmake status is less clear. Avoiding a crash means that at the very least, if those headers are in fact directly used by the project, an obvious compiler error occurs instead of a noisy meson traceback. Fixes #12214
2023-09-08Override config-tool get_variable args for qmakeNirbheek Chauhan1-0/+3
2023-06-26dependencies: switch the delayed-import mechanism for custom dependenciesEli Schwartz1-3/+4
Simply store the module it is expected to be found in. That module then appends to the packages dict, which guarantees mypy can verify that it's got the right type -- there is no casting needed.
2023-06-08dependencies/qt: add support for Qt frameworks referencing includes in ↵Matthew Waters1-2/+5
include directory e.g. QtQml with Qt 6.4.0 referencing QtQmlIntegration is one such example
2023-05-23qt: Allow specifying separate tools for qt4/5/6Nirbheek Chauhan1-1/+1
Currently you can only use one of qt4, qt5, qt6 in a single project when using a machine file because the config-tool lookup for qt only looks at `qmake` in the machine files, instead of looking up the binary names directly. Allow specifying `qmake` `qmake4` `qmake5` and `qmake6`. This is necessary for gstreamer, which can build separate qt5 and qt6 plugins that are distributed as static libraries, so the user can pick which one to use.
2023-04-11fix various spelling issuesJosh Soref1-2/+2
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-11-29Fix crash when toolchain is missingSmallWood-D1-1/+2
Add a MissingCompiler class returned by compiler detecting methods intead of None - accessing such an object raises a DependencyException Fixes #10586 Co-authored-by: duckflyer <duckflyer@gmail.com>
2022-10-06Add handling Qt6's EntryPoint library.Hagen Möbius1-9/+18
- this fixes #10792 - Qt6EntryPoint(d) replaces qtmain(d) from Qt 4 & 5 - uses the same mechanism: `main: true` - uses a special mixin class for pkg-config and config-tool dependency calculation
2022-08-09dependencies: reject Qt6 pkg-config dependency if libexecdir is not knownEli Schwartz1-0/+7
This is needed for 6.1 support as noted in commit a606ce22eb0dd05eef56384d59954edad7da131d but at the time there was no pkg-config detection method at all. The stub code for Qt6 didn't support libexecdir at all, and the pkg-config files added to newer versions of Qt6 didn't export that information either until a further bugfix release. Enforce that this information is required.
2022-08-09qt: fix qt 6 tools detection for pkg-configKonstantin1-1/+21
Add correct reading of pkgconfig-announced bindir and pkgconfig-announced libexecdir. Will work only on 6.3+
2022-04-12qt dependency: adapt to the qmake command changed nameEli Schwartz1-1/+1
Qt now has official guidance for the symlinked names of the tools, which is great. Qt now officially calls the tools `fooX` instead of `foo-qtX` where the major version of Qt is X. Which is not great, because a bit of an unofficial standard had prior art and now needs to change, and we never adapted. Prefer the official name whenever looking up qmake, and in the testsuite, specifically look only for the official name on versions of qt which we know should have that.
2022-04-12qt dependency: find the correct -qtX configtool nameEli Schwartz1-1/+2
Fixes regression in commit c211fea51389728783cf59ae41156a5e0de9c41a. The original dependency lookup looked for `qmake-{self.name}`, i.e. `qmake-qt5`, but when porting to config-tool, it got switched to `qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never worked. As a result, if `qmake-qt5` and `qmake` both existed, and the latter was NOT qt5, it would only try the less preferred name, and then fail. We need to define self.name early enough to define the configtool names, which means we need to set it before running the configtool __init__() even though configtool/pkgconfig would also set it to the same value. Mark the tests as passing on two distros that were failing to detect qmake due to this issue, and were marked for skipping because we assumed that the CI skipping there was an expected case rather than an old regression.
2022-04-12Add support for Qt 6.1+John Lindgren1-0/+9
Qt 6.1 moved the location of some binaries from QT_HOST_BINS to QT_HOST_LIBEXECS as noted in the changelog: c515ee178f Move build tools to libexec instead of the bin dir - Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. https://code.qt.io/cgit/qt/qtreleasenotes.git/tree/qt/6.1.0/release-note.txt It's possible to help the 'qt' module find the tools by adding Qt's libexec directory to the PATH environment variable, but this manual workaround is not ideal. To compensate, meson now needs to look for moc, rcc, uic, etc. in QT_HOST_LIBEXECS as well as QT_HOST_BINS. Co-authored-by: Stefan Hajnoczi <stefanha@jammr.net>
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-2/+2
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-01-18dependencies: don't pass kwargs from get_pkgconfig_variableDylan Baker1-6/+6
This is a layering violation, we're relying on the way the interpreter handles keyword arguments. Instead, pass them as free variables, destructuring in the interpreter
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz1-1/+1
2021-10-10Fix typos discovered by codespellChristian Clauss1-3/+3
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-5/+5
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-03-23Refactor Qt Dependency into proper split classes with factoriesDylan Baker1-140/+157
Currently the Qt Dependencies still use the old "combined" method for dependencies with multiple ways to be found. This is problematic as it means that `get_variable()` and friends don't work, as the dependency can't implement any of those methods. The correct solution is to make use of multiple Dependency instances, and a factory to tie them together. This does that. To handle QMake, I've leveraged the existing config-tool mechanism, which allows us to save a good deal of code, and use well tested code instead of rolling more of our own code. The one thing this doesn't do, but we probably should, is expose the macOS ExtraFrameworks directly, instead of forcing them to be found through QMake. That is a problem for another series, and someone who cares more about macOS than I do.
2021-03-22qt: move compilers_detect to the qt moduleDylan Baker1-53/+1
It's a method on the QtDependeny that exists purely for the consumption of the qt module (in the form, return some stuff the module makes into an instance variable). So put it where it actually belongs, and pass the qt dependency into it.
2021-03-22dependencies/qt: Split _get_modules_lib_suffix out of the classDylan Baker1-29/+32
As we break these classes up we're going to need this.
2021-03-22dependencies/qt: split get_qmake_host_bins into a free functionDylan Baker1-10/+11
It's static anyway, and never overwritten.
2021-03-22dependencies/qt: Add type annotationsDylan Baker1-50/+71
And fix some style and correctness issues
2021-03-22dependencies: split qt out of the ui moduleDylan Baker1-0/+448
It's a big enough and complicated enough bit of code that it deserves its own module.