aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
AgeCommit message (Collapse)AuthorFilesLines
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().
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1
2020-07-30pkgconfig: Fix various corner casesXavier Claessens1-19/+72
See unit tests for the exact scenarios this PR fixes.
2020-06-24pkgconfig: Add missing cflags in uninstalled filesXavier Claessens1-16/+11
Fixes: #7365
2020-05-27Fix lack of space after 'Cflags:' in pkgconfig filesSoapux1-1/+1
2020-05-14use FeatureNew.single_useDylan Baker1-3/+3
This is just slightly cleaner looking
2020-05-14modules/pkgconfig: Remove duplicate FeatureNewDylan Baker1-2/+0
2020-03-09pkgconfig: Document conflicts keywordFini Jastrow1-1/+1
[why] Sometimes one want to set the 'Conflicts:' field in .pc files. This is possible by using the 'conflicts' keyword argument in the pkgconfig module. The feature is not documented on mesonbuild.org, though. But a warning is issued: WARNING: Passed invalid keyword argument "conflicts". WARNING: This will become a hard error in the future. History: It has been added along with kwarg 'url' with commit 309041918 pkgconfig: Add missing 'URL' and 'Conflicts' entries Later the kwargs check has been introduced with 80d665e8d Converted some modules. but both 'url' and 'conflicts' were missing. With commit 2acf737b pkgconfig: Document url keyword the 'url' kwarg has been added to the checks, but not 'conflicts'. [how] Add 'conflicts' to the allowed kwargs. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2020-03-05mesonlib: Replace unholder argument to listifyDylan Baker1-2/+2
listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
2020-03-03pkgconfig: Fix deprecation message (fixes #6720)Stéphane Cerveau1-2/+1
Deprecation warning was unable to display because of patch c8f8d58273a40d94c820dccab54a7ae2d948cb8a fixes #6720
2020-02-20Introduce dataonly for the pkgconfig moduleRohan Garg1-22/+38
This allows users to disable writing out the inbuilt variables to the pkg-config file as they might actualy not be required. One reason to have this is for architecture-independent pkg-config files in projects which also have architecture-dependent outputs. For example : https://gitlab.freedesktop.org/wayland/weston/issues/269 Fixes #4011
2020-02-05pkgconfig: Generate -uninstalled.pc filesXavier Claessens1-17/+61
Closes: #3472.
2020-02-05pkgconfig: Fix code that make relative pathXavier Claessens1-2/+6
When subdir is '/foo/bar' and prefix '/foo' it was returning '/bar', which is an absolute path. It was then constructing '-L${prefix}//bar' with bogus double slash. When subdir is '/fooo/bar' and prefix '/foo' it was returning 'o/bar'.
2020-01-29dependencies: Use a DependencyFactory for threadsDylan Baker1-4/+2
This lets us make a number of uses of threads safer, because we can use the threads_factory instead of the ThreadDependency
2020-01-09pkgconfig module: add FeatureNew for requires: dependency('foo')Eli Schwartz1-2/+5
Introduced in https://github.com/mesonbuild/meson/pull/3131
2019-11-07pkgconfig: only check import_filename for shared librariesRyan Lucia1-1/+1
2019-11-05Change default pkgconfig directory on FreeBSDsghctoma1-1/+4
FreeBSD uses ${PREFIX}/libdata/pkgconfig as default pkgconf search path for non-base libraries. This commit makes that directory the default install_dir in the pkgconfig module on FreeBSD.
2019-10-01pkgconfig: Do not include uninstalled static librariesXavier Claessens1-2/+2