aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
AgeCommit message (Collapse)AuthorFilesLines
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
2019-09-17pkgconfig: Fix ordering of public librariesXavier Claessens1-3/+8
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 Gurtovoy1-1/+1
2019-09-02Handle case of dependency('threads') in 'requires'Simon Allen1-0/+2
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-1/+1
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-8myd73491-1/+1
2019-03-09pkgconfig.generate: add FeatureNew and documentation for implict versionEli Schwartz1-1/+3
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 Chauhan1-12/+20
See: https://github.com/mesonbuild/meson/pull/4630#issuecomment-459235498
2019-01-31pkgconfig: Avoid deprecation warning when using new syntaxXavier Claessens1-5/+6
When using pkg.generate(mylib, library : publicdep) it is pretty clear we don't want to associate publicdep to this generated pkg-config file. This is a small behaviour break in theory, but also fixes real bug in the case publicdep is later used to generate another pkg-config file that does not depend on mylib, that would write a wrong `Requires: mylib` in the genarated pkg-config file. This fix unavoidable deprecation warning when glib is cross built for Android. Glib does `pkg.generate(libglib, libraries : [libintl], ...)` which wrongly associates libintl to the generated glib-2.0.pc, so when later it generates gio-2.0.pc file that depends on libglib, it will warn about libintl being associated with libglib. This does not happen in normal glib build because libintl is usually provided by glibc and is only an internal library when it fallbacks to a subproject.
2019-01-29pep8 py37Michael Hirsch, Ph.D1-1/+1
2019-01-05pkgconfig: Fix flag deduplicationXavier Claessens1-1/+5
This is a regression introduced by 2cbf7caf5, generated pkg-config files have many duplicated '-pthread' flags.
2018-12-12pkgconfig: Fix link order of library dependenciesNiklas Haas1-2/+2
Since `_process_libs` appends the lib's dependencies this list already, the final return value of `_process_libs` will end up after its dependencies, which is the wrong way around. (The lib must come first, then its dependencies) The easiest solution is to simply pre-pend the return value of `_process_libs` rather than appending it, so that its dependencies come after the library itself. Closes #4091.
2018-12-04pkgconfig: Improve and document generator behaviourXavier Claessens1-8/+40
- Add libraries from InternalDependency.libraries - Deprecate association of libraries from the "libraries" keyword argument to the generated pkg-config file.
2018-12-03pkgconfig: do not generated dependency on itselfLuca Boccassi1-1/+1
If a project generates a single pc file but multiple shared libraries with dependencies on each other, the generated pc name will be used to generate a Requires.private dependency, which means the project will depend on itself. This breaks at least some versions of pkg-config (0.27 in RHEL7) which cannot handle the recursion and error out. When adding the dependency using the pc name, check that it's not on the project itself. Fixes #4583
2018-11-21pkgconfig: add support for pkgconfig generation for c#Marcel Hollerbach1-5/+12
this adds support for generating pkgconfig files for c#. The difference to c and cpp is that the -I flag is not known to the c# compiler, but rather the -r flag which is used to link a .dll file into the compiled library. However this opens the question of validating which pkgconfig files can be generated (depending on the language). This implements 4409.
2018-07-02FeatureNew: Make all checks subproject-specificNirbheek Chauhan1-2/+2
We now pass the current subproject to every FeatureNew and FeatureDeprecated call. This requires a bunch of rework to: 1. Ensure that we have access to the subproject in the list of arguments when used as a decorator (see _get_callee_args). 2. Pass the subproject to .use() when it's called manually. 3. We also can't do feature checks for new features in meson_options.txt because that's parsed before we know the meson_version from project()
2018-07-01Nirbheek/fix pkgconfig library dedup (#3813)Nirbheek Chauhan1-4/+6
* Add a test case for bad de-dup of -framework args https://github.com/mesonbuild/meson/issues/3800 * pkgconfig: Don't naively de-dup all arguments Honestly don't know what I was smoking. Of course the `Libs:` field in a pkg-config file can have arguments other than -l and -L Closes https://github.com/mesonbuild/meson/issues/3800 * pkgconfig module: Fix needlessly aggressive de-dup
2018-06-01Add 0.46.0 featuresSalamandar1-1/+2
2018-06-01Add 0.42.0 featuresSalamandar1-0/+1
2018-06-01Add 0.41.0 featuresSalamandar1-1/+4
2018-05-02pkgconfig: Don't expose internal libraries in .pc filesNirbheek Chauhan1-2/+2
Libraries that have been linked with link_whole: are internal implementation details and should never be exposed to the outside world in either Libs: or Libs.private: Closes https://github.com/mesonbuild/meson/issues/3509
2018-05-02Keep separator spaces in pkg-config declarations. Closes #3479.Jussi Pakkanen1-2/+4
2018-04-20regression: pkgconfig module: Fix Fix regression in Requires.private generation.Martin Hostettler1-1/+1
The fix for Requires generation in #3406 missed a second code path with the same problem. Passing a pkgconfig dependency to requires would produce Q, t, 5, C, o,r, e' instead of 'Qt5Core'. This was introduced in 8efd940.
2018-04-15Updated all modules to work with the new API.Jussi Pakkanen1-2/+2