aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
AgeCommit message (Collapse)AuthorFilesLines
2023-01-20Haiku pkgconfig directory layout supportX5121-0/+3
2023-01-04forbid using declare_dependency(objects: ...) with pkg-config modulePaolo Bonzini1-0/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-10-03pylint: enable unnecessary-comprehensionDylan Baker1-2/+1
2022-08-18modules/pkgconfig: make it a NewExtensionModuleDylan Baker1-5/+5
Since we no longer need Interpreter.extract_variables, we can remove the interpreter from the module!
2022-08-18modules/pkgconfig: mypy clean!Dylan Baker1-22/+25
2022-08-18modules/pkgconfig: Fix code to handle CustomTarget and CustomTargetIndexDylan Baker1-3/+4
2022-08-18modules/pkgconfig: remove type checking abstractionDylan Baker1-8/+7
Which confuses the heck out of mypy
2022-08-18modules/pkgconfig: get rid of modifications to the BuildTarget objectsDylan Baker1-24/+40
This would tack on extra attributes for meta data tracking. Do that with our own datastructures instead
2022-08-18modules/pkgconfig: ensure "name" is not NoneDylan Baker1-2/+9
The name can be None if a library is not passed as a positional argument, and the name keyword argument is not provided. We shouldn't allow that to happen.
2022-08-18modules/pkgconfig: Get most type annotations addedDylan Baker1-50/+80
There are still a lot of errors here due to a mixture of really bad design (adding extra attributes to objects), and legitimate type errors (passing a str where a List[str] is expected). I suspect a lot of these cases aren't hit for some reason.
2022-08-18modules/pkgconfig: Use typed_kwargsDylan Baker1-58/+98
2022-08-18modules/pkgconfig: use typed_pos_argsDylan Baker1-8/+6
2022-08-18modules/pkgconfig: fix typo in blocked variableDylan Baker1-1/+1
require_private -> requires_private.
2022-08-18modules/pkgconfig: Fix some low hanging typing issuesDylan Baker1-18/+20
2022-08-17modules: use module level information about new and deprecationDylan Baker1-1/+4
Instead of using FeatureNew/FeatureDeprecated in the module. The goal here is to be able to handle information about modules in a single place, instead of having to handle it separately. Each module simply defines some metadata, and then the interpreter handles the rest.
2022-07-06pkgconfig: do not add valgrind as requirementMarc-André Lureau1-0/+2
For the same reasons commit 7aa28456d ("Add dependency type for Valgrind") removed linking with valgrind, pkgconfig shouldn't generate "Requirements" for it, in general. This solves dbus meson port question/issue from: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/303#note_1444819 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-06-17fix parameter expansion in several error messagesMichael Mera1-1/+1
At several points in the code base, f-strings are not correctly expanded due to missing 'f' string prefix. This fixes all the occurrences I could find.
2022-04-19pkgconfig: Add relocatable module optionFredrik Salomonsson1-2/+14
If set to true it will generate the pkgconfig files as relocatable i.e the prefix variable will be relative to the install_dir. By default this is false. Will generate a MesonException if the pkgconfig file is installed outside of the package and pkgconfig.relocatable=true.
2022-03-09Move dataonly pkgconfig file to datadir/pkgconfigTristan Partin1-0/+1
dataonly files are architecture independent (lib vs lib64 for example). Fixes #9902
2022-02-15pkgconfig module: allow custom variables to reference builtin directoriesEli Schwartz1-11/+46
Automatically generate additional variables and write them into the generated pkg-config file. This means projects no longer need to manually define the ones they use, which is annoying for dataonly usages (it used to forbid setting the base library-relevant "reserved" ones, and now allows it only for dataonly. But it's bloat to manualy list them anyway). It also fixes a regression in commit 248e6cf4736ef9ec636228da66c28f9be03aa74f which caused libdir to not be set, and to be unsettable, if the pkg-config file has no libraries but uses the ${libdir} expansion in a custom variable. This could be considered likely a case for dataonly, but it's not guaranteed.
2022-02-01pkgconfig: set libdir only if usedAndrea Pappacoda1-1/+2
This should address some concerns outlined in https://github.com/yhirose/cpp-httplib/pull/1182
2021-12-22pkgconfig: Fix linking to a custom targetXavier Claessens1-1/+2
When generating pkgconfig file for a library that links to an uninstalled static library built by custom_target() Meson was crashing when trying to access some attributes that does not exist on that class. Also fix is_internal() implementation, it only really make sense on a CustomTargetIndex or if CustomTarget has only a single output.
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz1-5/+5
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-4/+4
2021-10-10pkgconfig module: correctly generate Libs search path with absolute install_dirEli Schwartz1-4/+6
For example the OpenRC build files install libraries to install_dir: '/lib' and this works, but causes the generated pkg-config to say: prefix=/usr Libs: -L${prefix}//lib which is both ugly (double //) and resolves to /usr/lib which is exactly what does not work.
2021-10-04f-stringsEli Schwartz1-2/+1
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker1-4/+5
This does not convert the build side, or remove any of the checking it does. We still need that for other callers of custom target. What we'll do for those is add an internal interface that defaults things, then we'll be able to have those callers do their own validation, and the CustomTarget validation machinary can be removed. Fixes #9096
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker1-6/+10
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
2021-09-06mintro: add installed_planFilipe Laíns1-2/+4
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-08-17Add install tagsXavier Claessens1-1/+1
Fixes: #7007.
2021-07-13modules/pkgconfig: remove handling of .pcdepDylan Baker1-11/+1
Nothing uses this anymore, so don't check for it.
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger1-18/+1
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
2021-06-18holders: remove unholderDaniel Mensinger1-7/+8
2021-06-18holders: Introduce BothLibrariesDaniel Mensinger1-7/+22
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-1/+1
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-05-28modules: Add methods dict everywhereXavier Claessens1-0/+5
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-18pkgconfig: Do not escape custom variablesXavier Claessens1-5/+13
We need to escape space in variables that gets into cflags or libs because otherwise we cannot split compiler args when paths contains spaces. But custom variables are unlikely to be path that gets used in cflags/libs, and escaping them cause regression in GStreamer that use space as separator in a list variable.
2021-04-19pkgconfig: Add support for CustomTarget objects in generatorXavier Claessens1-6/+18
Fixes: #8618.
2021-04-18pkgconfig: Fix broken paths in -uninstalled.pc on WindowsXavier Claessens1-11/+6
Fixes: #8668
2021-03-26pkgconfig: Allow setting prefix in dataonly pc fileXavier Claessens1-2/+4
Some variables are reserved because meson set them automatically. But we are not setting them for dataonly pc files, so there is no reason to reserve them. Fixes: #8583.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-5/+5
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-03pkgconfig: Add missing permitted kwargsXavier Claessens1-1/+1
Fixes #8462
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens1-1/+1
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker1-1/+1
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-5/+5
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2020-11-20use real pathlib moduleDylan Baker1-1/+1
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-11-04pkgconfig: Make external deps of static library publicXavier Claessens1-3/+6
This fix a regression caused by https://github.com/mesonbuild/meson/pull/7837, it wanted to make InternalDependency's external_deps private but has side effect of making StatisLibrary's external_deps private too. It is technically correct to make them private, but Meson used to make StaticLibrary deps public so they are usable without `pkg-config --static` when we know there is only a static library available. Fixes: #7929.
2020-10-22pkgconfig: Define libdir and includedir in -uninstalled.pc filesXavier Claessens1-6/+5
This fixes glib-2.0-uninstalled.pc file. GLib does `extra_cflags : ['-I${libdir}/glib-2.0/include']` because some of its headers gets installed there. But when used uninstalled that path makes no sense and pkg-config aborts because ${libdir} is not defined. This cannot be worked around by GLib because Meson does not allow setting different `extra_cflags` for -uninstalled.pc, and does not allow setting libdir in `uninstalled_variables`.
2020-10-17pkgconfig: InternalDependency's ext_deps should be private by defaultXavier Claessens1-1/+1
This fixes a regression introduced by https://github.com/mesonbuild/meson/pull/7488. InternalDependency's ext_deps previously where simply ignored, but that PR has effect to add many more public Requires in generated pc files.
2020-10-16Fix consistency in variables kwargXavier Claessens1-19/+7
Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().