summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
AgeCommit message (Collapse)Author
2021-10-10pkgconfig module: correctly generate Libs search path with absolute install_dirEli Schwartz
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 Schwartz
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker
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 Baker
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íns
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-08-17Add install tagsXavier Claessens
Fixes: #7007.
2021-07-13modules/pkgconfig: remove handling of .pcdepDylan Baker
Nothing uses this anymore, so don't check for it.
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger
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 Mensinger
2021-06-18holders: Introduce BothLibrariesDaniel Mensinger
2021-06-03deps: Split dependencies.baseDaniel Mensinger
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-05-28modules: Add methods dict everywhereXavier Claessens
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 Claessens
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 Claessens
Fixes: #8618.
2021-04-18pkgconfig: Fix broken paths in -uninstalled.pc on WindowsXavier Claessens
Fixes: #8668
2021-03-26pkgconfig: Allow setting prefix in dataonly pc fileXavier Claessens
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 Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-03pkgconfig: Add missing permitted kwargsXavier Claessens
Fixes #8462
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens
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 Baker
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 Baker
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 Baker
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 Claessens
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 Claessens
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 Claessens
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 Claessens
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 Mensinger
2020-07-30pkgconfig: Fix various corner casesXavier Claessens
See unit tests for the exact scenarios this PR fixes.
2020-06-24pkgconfig: Add missing cflags in uninstalled filesXavier Claessens
Fixes: #7365
2020-05-27Fix lack of space after 'Cflags:' in pkgconfig filesSoapux
2020-05-14use FeatureNew.single_useDylan Baker
This is just slightly cleaner looking
2020-05-14modules/pkgconfig: Remove duplicate FeatureNewDylan Baker
2020-03-09pkgconfig: Document conflicts keywordFini Jastrow
[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 Baker
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 Cerveau
Deprecation warning was unable to display because of patch c8f8d58273a40d94c820dccab54a7ae2d948cb8a fixes #6720
2020-02-20Introduce dataonly for the pkgconfig moduleRohan Garg
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 Claessens
Closes: #3472.
2020-02-05pkgconfig: Fix code that make relative pathXavier Claessens
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 Baker
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 Schwartz
Introduced in https://github.com/mesonbuild/meson/pull/3131
2019-11-07pkgconfig: only check import_filename for shared librariesRyan Lucia
2019-11-05Change default pkgconfig directory on FreeBSDsghctoma
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 Claessens
2019-09-17pkgconfig: Fix ordering of public librariesXavier Claessens
The main library must come before extra libraries, because they are likely to be dependencies of the main library that get promoted from private to public. This was causing static link issues with glib-2.0.pc.
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy
2019-09-02Handle case of dependency('threads') in 'requires'Simon Allen
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-05-12Force pkgconfig to UTF-8myd7349
2019-03-09pkgconfig.generate: add FeatureNew and documentation for implict versionEli Schwartz
The documentation for this change was left out of its implementation in commit b4aee4675afd9f9f4a36aea628bab4249d7addbc and was later documented in commit f831c05b553d876a08dcf46478161b60b4e693c4 as if it had always existed.
2019-01-31pkgconfig: Only warn about deprecation at a location onceNirbheek Chauhan
See: https://github.com/mesonbuild/meson/pull/4630#issuecomment-459235498