Commit Graph

41 Commits

Author SHA1 Message Date
Xavier Claessens 340aedc0d9 hotdoc: Install devhelp files at the right location
When devhelp is enabled, hotdoc generates a devhelp/ subdir that needs
to be installed to /usr/share/devhelp/. Otherwise, the html/ subdir
needs to be installed to /usr/share/doc/<project>/html/
2023-03-16 10:36:33 -04:00
Eli Schwartz 43abd62ecc
hotdoc module: properly error out when configuring fails
We used to just abort during configure because we ran in-process and
hotdoc's argparse would leak into our own process space. Now we fail to
handle this case and succeed at configuring, only for building to fail
because the hotdoc config file doesn't exist.
2023-03-05 11:24:13 -05:00
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05:00
Eli Schwartz e5ce7f0770 hotdoc module: fix broken include paths
Since commit 32b14b1bb5, hotdoc is run
during configure as an external program. It turns out though, that in
some cases we passed NoneType in the cmd array, previously to
hotdoc.run_hotdoc.run() and now via subprocesses. The former "worked"
due to ignoring unknown arguments (?) but the latter was broken because
command line interfaces don't accept python NoneType objects, naturally.

End result: when for example building Meson's own documentation, this
fails with a python traceback.

The reason this happens to begin with turns out to be, once again,
because of the legacy debt of homebrewed kwargs parsing. We have a
function for `process_known_args` that handles args and ignores them if
they are NoneType, and then include_paths is handled via a custom
processor that internally adds them, then returns a *list* of NoneType
which then gets appended to the global cmd, because the logic ends up as
`[None, None] is None` which is a failed check, so we go ahead and add
it.

It's odd that we ever attempted to process it twice to begin with, so
let's simply not do that.
2022-11-20 23:08:44 +02:00
Eli Schwartz e0240515a6 hotdoc module: remove homebrew function-proxied OrderedSet
We are just using this dictionary to get keys, and we could also just
set it ourselves but with None values. But we have a code abstraction
for this already; use it.
2022-11-20 23:08:44 +02:00
Eli Schwartz 32b14b1bb5
hotdoc module: run hotdoc as an external command during configure
We need to run it as an external command at build time anyway, and we
detect it by looking it up as an ExternalProgram. It seems odd to then
import it into Meson's python interpreter and run the main function.

Moreover, this errors out when you are running two different pythons,
one for Meson and one for hotdoc. For example, when hotdoc is installed
normally, but you're testing Meson against a nondefault newer version of
python.
2022-11-17 16:17:40 -05:00
Eli Schwartz bcc127b3fd hotdoc module: add dedicated depends kwarg, deprecate file deps in dependencies
We consistently use the "dependencies" kwarg to refer to C-like
CFLAGS/LDFLAGS interfaces. And for hotdoc, we actually accept libraries
for this as well, as we may want to document their (generated?) sources,
so we want their CFLAGS too.

But we also accepted custom targets and just added a build order
dependency on these, which was odd and typically we call that "depends".
Let's deprecate this in favor of the depends kwarg.
2022-11-07 09:19:56 -05:00
Eli Schwartz 726353460a hotdoc module: use less confusing names
Internally we pass this as extra_depends to the CustomTarget
initializer, so it makes sense to call it that rather than confusing the
topic by referring to "dependencies", a term that indicates
CFLAGS/LDFLAGS interfaces.
2022-11-07 09:19:56 -05:00
Eli Schwartz c8aecc7685 hotdoc module: add partially typed kwargs
We accept a list of known kwargs of required types, but also arbitrary
kwargs understood by the hotdoc program (sometimes via extensions). Now
that we can partially type-check kwargs, do so here.
2022-10-24 15:16:02 +03:00
Nirbheek Chauhan 7912901acc hotdoc: Fix typo in argument 2022-10-14 05:14:46 +05:30
Dylan Baker df1b95cf2b
pylint: enable consider-merging-isinstance 2022-10-04 00:33:14 -04:00
David Ward ee5a729190 modules: Fix paths to (sub)project source/build directories
The subproject directory name (i.e. 'subprojects') was being added
to the path even for the main project.
2022-09-12 00:27:21 -04:00
Dylan Baker 6843f56f6b modules: use module level information about new and deprecation
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-08-17 16:25:36 -04:00
Xavier Claessens e33ec88ac7 Pass environment down to base Target class 2022-03-29 16:10:28 -04:00
Eli Schwartz c827462593
hotdoc module: use typed_pos_args to check positional arguments
We cannot use typed_kwargs though, because we allow fully arbitrary
kwargs and pass them as arguments to the hotdoc program.
2022-03-24 02:07:02 -04:00
Dylan Baker 11f9638035 build: replace kwargs in CustomTarget initializer
Because we don't want to pass the Interpreter kwargs into the build
layer. This turned out to be a mega commit, as there's really on elegant
way to make this change in an incremental way. On the nice side, mypy
made this change super easy, as nearly all of the calls to
`CustomTarget` are fully type checked!

It also turns out that we're not handling install_tags in custom_target
correctly, since we're not converting the boolean values into Optional
values!
2022-01-28 15:53:20 -05:00
Eli Schwartz 038b31e72b
various manual conversion of percent-formatted strings to f-strings 2021-11-01 20:26:18 -04:00
Eli Schwartz d06cc042eb
f-strings 2021-10-04 16:29:32 -04:00
Daniel Mensinger 7cfe7ccc58
docs: Hook up the new RefMan generator to Meson 2021-10-03 11:46:34 +02:00
Xavier Claessens 8c5aa031b5 Add install tags
Fixes: #7007.
2021-08-17 15:19:18 -04:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 34c28dc92c holders: remove unholder 2021-06-18 23:48:33 +02:00
Xavier Claessens 2e02ef6592 modules: Add methods dict everywhere
This fix calling random internal methods from meson.build as long as
they were not prefixed by underscore.
2021-05-28 15:17:10 -04:00
Xavier Claessens a734bcfc83 modules: Stop using ModuleReturnValue where it's not needed
It is only needed in functions that need to add targets to the
interpreter.
2021-05-28 15:17:10 -04:00
Xavier Claessens 4e312c19e6 gnome: Fix gtkdoc generation
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it
was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was
relying on that behaviour, but it has always been broken in the case the
source or build directory contains spaces.

Fix this by changing get_include_args() to substitue paths directly
which will then get escaped correctly.

Add a unit test that builds GObject documentation which is where this
issue has been spotted.

Fixes: #8744
2021-05-12 15:54:37 -04:00
Dylan Baker 40e3577a65 split program related classes and functions out of dependencies
Dependencies is already a large and complicated package without adding
programs to the list. This also allows us to untangle a bit of spaghetti
that we have.
2021-03-19 08:47:10 -04:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Xavier Claessens 0626465ea8 Fix executable as script on Windows
On Windows this would fail because of missing DLL:
```
mylib = library(...)
exe = executable(..., link_with: mylib)
meson.add_install_script(exe)
```

The reason is on Windows we cannot rely on rpath to find libraries from
build directory, they are searched in $PATH. We already have all that
mechanism in place for custom_target() using ExecutableSerialisation
class, so reuse it for install/dist/postconf scripts too.

This has bonus side effect to also use exe_wrapper for those scripts.

Fixes: #8187
2021-01-30 09:51:06 +00:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
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).
2021-01-04 12:20:58 -08:00
Xavier Claessens 4d7ccd1399 Make werror per subproject option 2020-03-24 22:48:55 +02:00
Mathieu Duponchelle 4d51ac3220 hotdoc: work around argparse syntax ambiguity
Fixes #5800
2019-11-11 22:39:43 +02:00
Thibault Saunier 26e205293a hotdoc: Handle werror 2019-04-24 21:55:42 +03:00
Thibault Saunier 083a53815c hotdoc: Take into account boolean value to pass flag like arguments 2019-04-24 21:55:42 +03:00
Thibault Saunier c6012e3cc7 hotdoc: Set gi-c-source-root
The same way as we set '--sources-top-dirs' for gi
2019-03-10 14:09:50 +02:00
Thibault Saunier 301df38816 hotdoc: Fix has_extensions when several extensions are passed in 2018-11-15 22:50:11 +02:00
Thibault Saunier 87370e1c93 hotdoc: Add support for {Build,Custom}Target as sources 2018-09-23 11:24:15 +03:00
Thibault Saunier bd26c71845 hotdoc: Make project_version mandatory as it should always have been 2018-09-10 21:01:01 +03:00
Thibault Saunier 1ace8d8985 hotdoc: Handle IncludeDirs to specify directories 2018-09-10 21:01:01 +03:00
Thibault Saunier 6f72473b24 docs: Use meson to build documentation
Let's eat our own dogfood.
2018-08-28 18:18:40 -03:00
Thibault Saunier 378bd4df0e modules: Add an 'hotdoc' module
hotdoc: http://github.com/hotdoc/hotdoc/
2018-08-28 18:18:40 -03:00