Commit graph

30 commits

Author SHA1 Message Date
Íñigo Huguet ef2438414f meson: remove deprecated ExternalProgram.path
Replaced by full_path:
https://mesonbuild.com/Reference-manual_returned_external_program.html#external_programpath

ExternalProgram.full_path was added in meson 0.55 but we support meson
>= 0.51. Because of that, use path or full_path conditionally depending
on the meson version.

This gets rid of the following deprecation warning:
  NOTICE: Future-deprecated features used:
   * 0.48.0: {'module python3'}
   * 0.55.0: {'ExternalProgram.path'}
2024-04-04 08:13:38 +00:00
Íñigo Huguet 3b72f19694 meson: replace deprecated meson.source_root
Instead, meson.current_source_root or meson.project_source_root should
be used:
https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonsource_root

Also, the documentation referenced above suggest to use `files()` as a
better alternative to refer to files, so do that at the same time.

This gets rid of the deprecation warning:
  NOTICE: Future-deprecated features used:
   * 0.56.0: {'meson.source_root'}
2024-04-04 08:13:38 +00:00
Jan Vaclav ffb34d2485 build/meson: fix gtkdoc dependencies
This commit fixes the build process for the documentation that was previously
unable to build separately via meson due to a dependency issue.

Previously, trying to build the API documentation via `ninja NetworkManager-doc`
failed due to missing dependencies (for example, `nm-dbus-types.xml` was not built).
I believe this happens due to some different handling of static paths vs. custom_target
by meson in this case.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1801
Fixes: 03637ad8b5 ('build: add initial support for meson build system')
2023-11-24 07:40:44 +00:00
Íñigo Huguet fcfbbb9a32 Fix version error when building with an old meson version
Addition of list and string is allowed but only from version 0.60 of
meson. We claim to support building with meson 0.47, and there are
distributions like Debian and CentOS Stream 8 that uses versions older
than 0.60. Fix it by converting the offending string to a single item
list.

On newer versions, we get this warning only:
  Project targets '>= 0.47.2' but uses feature introduced in
  '0.60.0': list.<plus>. The right hand operand was not a list.

Fixes: 984642e33f ('build: meson: fix some missing dependencies')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1737
2023-09-22 10:34:24 +02:00
Íñigo Huguet 984642e33f build: meson: fix some missing dependencies
Some targets related to documentation generation had missing
dependencies, like xsl templates or the python generator. If these files
are changed, their output changes too, but as they were not listed as
dependencies (custom_target's input), meson wasn't aware.

In Makefile.am they already were correctly listed as dependencies.
2023-09-21 15:57:35 +02:00
Íñigo Huguet f4fbc59a16 man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.

Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.

Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-21 15:57:35 +02:00
Thomas Haller b7d0218ee1
docs: rework selecting properties with "generate-docs-nm-settings-docs-merge.py"
"generate-docs-nm-settings-docs-merge.py" merges properties from
multiple XMLs. It supported an argument "--only-from-first", to
only select properties that were in the first of the provided XMLs.

The idea is that the first XML would be "src/nmcli/gen-metadata-nm-settings-nmcli.xml"
which is generated from nmcli meta-data and exactly describes the
supported properties. For example, "connection.read-only", "user.data"
or "wireless.tx-power" exist as properties somewhere, but not supported
by nmcli.

Change that, to not tie the selected property to the first XML.
"gen-metadata-nm-settings-nmcli.xml" is the XML that contains which
properties to select from, but "src/libnm-client-impl/nm-property-infos-nmcli.xml"
contains hand crafted descriptions. The latter descriptions are
preferred. As the order of the XML is already relevant for which
description is preferred, the selection is orthogonal to that.

With this, prefer descriptions from "src/libnm-client-impl/nm-property-infos-nmcli.xml"
but still select properties from "src/nmcli/gen-metadata-nm-settings-nmcli.xml".

Note that the argument is only used to generate "man/nm-settings-docs-nmcli.xml",
and with the current input, there is no actual change in behavior.
2023-05-19 12:52:01 +02:00
Thomas Haller 1bfe908c2e
nmcli: rename "generate-docs-nm-settings-nmcli" to "gen-metadata-nm-settings-nmcli"
This is the better name, becuse this is not in particular about "docs".
It's about generating an XML with the information from the settings
meta data for nmcli.

We will do something similar with the libnm-core meta data.
2022-10-31 09:11:30 +01:00
Thomas Haller df94cb2116
man: add NetworkManager-wait-online.service.8 manual
NetworkManager-wait-online is a constant source of confusion,
as it seems to delay the boot (when it's often just the messenger
or either a network problem, a NetworkManager misconfiguration
or a misconfiguration of other systemd services).

Try to clear that up with a manual page.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1130
2022-03-02 16:09:16 +01:00
Thomas Haller 9c0c0ac966
man: split NetworkManager-dispatcher(8) manual page out of NetworkManager(8)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/784
2021-03-16 17:01:53 +01:00
Thomas Haller 977ea352a0
all: update deprecated SPDX license identifiers
These SPDX license identifiers are deprecated ([1]). Update them.

[1] https://spdx.org/licenses/

  sed \
     -e '1 s%^/\* SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+ \*/$%/* SPDX-License-Identifier: \1-or-later */%' \
     -e '1,2 s%^\(--\|#\|//\) SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+$%\1 SPDX-License-Identifier: \2-or-later%' \
     -i \
     $(git grep -l SPDX-License-Identifier -- \
         ':(exclude)shared/c-*/' \
         ':(exclude)shared/n-*/' \
         ':(exclude)shared/systemd/src' \
         ':(exclude)src/systemd/src')
2021-01-05 09:46:21 +01:00
Thomas Haller a4f1fa0893
man: add man 8 nm-cloud-setup
https://bugzilla.redhat.com/show_bug.cgi?id=1867997
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ ## 600
2020-12-11 17:36:38 +01:00
Beniamino Galvani 639f2e36b0 docs: fix build with meson
Fix the following build error with meson:

/usr/bin/python3 /home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py man/nm-settings-docs-nmcli.xml --only-from-first clients/cli/generate-docs-nm-settings-nmcli.xml libnm/nm-propery-infos-nmcli.xml libnm/nm-settings-docs-gir.xml
Traceback (most recent call last):
  File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <module>
    xml_roots = list([ET.parse(f).getroot() for f in gl_input_files])
  File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <listcomp>
    xml_roots = list([ET.parse(f).getroot() for f in gl_input_files])
  File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 584, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '--only-from-first'

Fixes: 3c11116c48 ('docs: in "generate-docs-nm-settings-docs-merge.py" only take properties from first setting')
2020-06-12 16:01:45 +02:00
Thomas Haller 3c11116c48
docs: in "generate-docs-nm-settings-docs-merge.py" only take properties from first setting
Especially for "nm-settings-docs-nmcli.xml", the first XML to merge is
"clients/cli/generate-docs-nm-settings-nmcli.xml". That file is
generated with the meta data from nmcli, and it contains all the
properties that are supported. Properties from other XML files,
that are passed as additional arguments should not be merged.

In most cases, there is no difference. It only matters for
"ipv6.dad-timeout" and "user.data". For example, "ipv6.dad-timeout"
is supported by GObject (part of "libnm/nm-settings-docs-gir.xml"),
but not by nmcli. Don't include it in the manual.

This also drops the now empty settings "dummy", "user", and "generic".
2020-06-12 10:26:27 +02:00
Thomas Haller 10020a9466
docs: generate nm-settings-docs-nmcli.xml based on nmcli meta data
We have the correct meta-data of supported properties for nmcli. It is
in clients/common. Use that for generating the manual page instead of
the properties that are part of libnm (some properties may be in libnm
but not supported by nmcli, or some properties may not be GObject
properties, and not detected as by GObject introspection).
2020-06-11 10:53:50 +02:00
Thomas Haller 87edf2f298
docs: move generate-docs scripts from "libnm/" to "tools/"
They are not only used in "libnm/" directory. Move to "tools/".
2020-06-11 10:53:50 +02:00
Thomas Haller d2f8d5a4fa
docs: move "nm-settings-docs-{dbus,nmcli}.xml" from "libnm/" to "man/"
"nm-settings-docs-nmcli.xml" will be generated by a tool that depends on
"clients/common/". The file should thus not be in libnm directory, otherwise
there is a circular dependency.

Move the file to "man/" directory.

For consistency, also move "nm-settings-docs-dbus.xml". Note that we
cannot move "nm-settings-docs-gir.xml" to "man/", because that one is
needed for building clients.
2020-06-11 10:53:50 +02:00
Thomas Haller 47d39a7fb7
docs: add more nm-settings manpages (dbus,nmcli,keyfile,ifcfg-rh)
A significant part of NetworkManager's API are the connection profiles, documented
in `man nm-settings*`. But there are different aspects about profiles, depending
on what you are interested. There is the D-Bus API, nmcli options, keyfile format,
and ifcfg-rh format. Additionally, there is also libnm API.

Add distinct manual pages for the four aspects. Currently the two new manual
pages "nm-settings-dbus" and "nm-settings-nmcli" are still identical to the
former "nm-settings.5" manual. In the future, they will diverge to
account for the differences.

There are the following aspects:

 - "dbus"
 - "keyfile"
 - "ifcfg-rh"
 - "nmcli"

For "libnm" we don't generate a separate "nm-settings-libnm" manual
page. That is instead documented via gtk-doc.

Currently the keyfile and ifcfg-rh manual pages only detail settings
which differ. But later I think also these manual pages should contain
all settings that apply.
2020-06-11 10:53:49 +02:00
Thomas Haller d8992ce931
docs: rename "nm-settings-docs.xml" to "nm-settings-docs-dbus.xml"
"nm-settings-docs-dbus.xml" is "nm-settings-docs-gir.xml" merged with
"nm-property-infos-dbus.xml". The name should reflect that, also because
we will get more files with this naming scheme.
2020-06-11 10:53:49 +02:00
Thomas Haller a9001261fb
docs: rename "nm-property-infos" doc files
The naming was inconsistent. Rename.

- all the property infos of this kind a now consistently called
  "libnm/nm-property-infos-$TAG.xml".

- the script to generate files "libnm/nm-property-infos-$TAG.xml" is
  now called "libnm/generate-docs-nm-property-infos.pl".
2020-06-11 10:53:49 +02:00
Iñigo Martínez 648155e4a1 license: Add license using SPDX identifiers to meson build files
License is missing in meson build files. This has been added using
SPDX identifiers and licensed under LGPL-2.1+.
2020-02-17 13:16:57 +01:00
Thomas Haller 6d7270e222 build/meson: cleanup configuration_data() for paths
We don't need such data duplicated. The build setup should
have only one configuration_data() for patching such values.

Now we only have one global, immutable data_conf dictionary with
configuration values. Note that none of the users of data_conf uses all
entries, but as the entries are basically only dependent on the
meson/configure option and valid for the entire project, this simplifies
to handling.
2019-11-22 15:59:31 +01:00
Iñigo Martínez bfbcf8f3fe meson: Use generators placeholders
Functions derived from generators as `configure_file`,
`custom_target` and `i18n.merge_file` can use placeholders like
`@BASENAME@` that removes the extension from the input filename
string.

The output string has been replaced by this placeholder that
allows in some cases the use of less variables.
2019-10-01 09:49:33 +02:00
Iñigo Martínez 35171b3c3f build: meson: Add trailing commas
Add missing trailing commas that avoids getting noise when another
file/parameter is added and eases reviewing changes[0].

[0] https://gitlab.gnome.org/GNOME/dconf/merge_requests/11#note_291585
2018-12-20 13:50:34 +01:00
Thomas Haller ac90593cc2 man: fix "no-auto-default" state dir in NetworkManager.conf manual
Quote from `man NetworkManager.conf`:

  When the default wired connection is deleted or saved to a new
  persistent connection by a plugin, the device is added to a list in the
  file /run/NetworkManager/no-auto-default.state to prevent creating
  the default connection for that device again.

"/run" is obviously wrong. Fix it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/33
2018-10-25 15:24:38 +02:00
Beniamino Galvani dcfddeef7a build: meson: fix generation of api docs
We need to copy all introspection files to the same directory when
building the documentation.

Note that we only require Meson 0.44, but for the documentation at
least 0.46 is needed because of a new functionality of
gnome.gdbus_codegen(). In this way we can still build on Travis CI
(without documentation).
2018-09-28 17:25:46 +02:00
Beniamino Galvani 929298333e build: meson: add missing man file
Fixes: 9f9609555d
2018-09-28 17:23:23 +02:00
Beniamino Galvani c06a6aec1a build: meson: gtk-doc needs common.ent 2018-09-19 16:03:32 +02:00
Beniamino Galvani c8636449b3 build: meson: man files depend on common.ent 2018-09-19 16:03:32 +02:00
Iñigo Martínez 03637ad8b5 build: add initial support for meson build system
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

[thaller@redhat.com: rebased patch and adjusted for iwd support]

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
2017-12-13 15:48:50 +01:00