Commit graph

6396 commits

Author SHA1 Message Date
Simon McVittie
e2f2c5dd42 build: Change how we create symlinks from Meson
Use install_symlink() in Meson versions that support it, or a script
with similar invocation in versions that do not. This will make it
straightforward to migrate to install_symlink() when we drop support
for Meson versions older than 0.61.0.

Based on an implementation in the game-data-packager package, which used
a shell script.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
abef795081 build: Don't replace prefix in .pc file if relocation is disabled
Replacing the prefix with a path relative to ${pcfiledir} can be harmful
if the number of path components between the prefix and the ${libdir}
is not what we expect, in particular on Debian-derived systems where the
${libdir} is normally lib/x86_64-linux-gnu or similar.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
47deeb4a9e doc: Don't install introspect.xsl for now
Maybe this should be installed, but for now maintain parity with
Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
b47263d0ab bus: Install example systemd hardening when using Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
08348e9e46 test: Install transient-services.sh into a subdirectory
This is what we do with Autotools, and keeping Meson the same means we
can diff the installed trees more easily.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c74504fb7e doc: Make Meson yelp-build invocation compatible with older versions
Older versions of yelp-build like the one in Debian 11 do not allow
permuting arguments, so all options (in this case -o) must appear
before all positional parameters.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
29ae675978 doc: Write absolute path to DTDS into XML catalog
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
77312171b9 test: libdbus-testutils depends on GIO, not just GLib
This matters when we build against GLib as a Meson subproject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
179669fa7c build: Define x11 to an empty dependency if X11 autolaunch is disabled
Otherwise, we can't build successfully for Windows with X11 autolaunch
explicitly disabled.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
78d359dbb6 test: Make environment variables consistent with Autotools
DBUS_SESSION_BUS_LISTEN_ADDRESS is the same as in non-test files:
the test data distinguishes between DBUS_SESSION_BUS_LISTEN_ADDRESS,
the real session bus configuration, and TEST_LISTEN, the test-only
configuration.

DBUS_TEST_HOMEDIR and HOME should be in the build directory, not
the source directory.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
4fbdb14987 subprojects: Allow expat and GLib to be built as subprojects
This should let us build everything with a mingw-w64 toolchain, without
having to use prebuilt dependencies from MSYS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
37e1728638 maintainer-upload-docs: Remove assumptions about source, build dirs
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
4655d00952 maintainer-upload-docs: Fail if an undefined variable is referenced
"Unofficial strict mode" for shell scripting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
0c948dc744 maintainer-upload-docs: Allow servers and directories to be overridden
This lets maintainers test the script without putting changes
directly into production!

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
9a64c6c095 build: Make update-authors convenience target runnable from Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
6e5f42be4d build: Remove a misleading comment
It's fine to define DBUS_COMPILATION for anything that is being
compiled as part of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
ff92efa389 build: Implement a runtime_dir option
If the prefix is /usr, then this defaults to /run, similar to the
special cases for /var and /etc built into Meson. This is correct for
typical modern Linux distributions implementing FHS 3.0. This is
intentionally not consistent with Autotools and CMake: if distributions
are transitioning to a different way to build dbus, then that's a good
time to re-evaluate their build options.

Otherwise, this defaults to LOCALSTATEDIR/run, consistent with Autotools
and CMake.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
e75d8a7cbc test: Correct generation of .test metadata
If a helper executable is not, in itself, a test-case, then we should
not generate metadata that tells ginsttest-runner to run it as a
test-case.

Meanwhile, we were previously generating foo_with_config.test metadata
for tests that don't get installed; stop doing that.

We also need to distinguish between the abstract name of the test
(which usually does not start with test-), the name of the .test file
(which does start with test- for compiled executables), and the name
of the executable (which may include .exe as well). To make validation
against the Autotools build system as straightforward as possible,
generate exactly the same names as in Autotools. We can consider removing
the test- prefix later, if we remove the Autotools build system.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c8ecf552c8 test: Allow for scripts that don't get installed
At the moment there aren't any like this, but it seems reasonable that
we might get some later.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
fad7a62c39 test: Don't run integration tests at build-time
Some items listed in the tests array are helper executables rather
than actually being tests, and should not be run as a test at any time.
Those have {"test": false}. Expand this special case to the scripts
array for completeness (although currently, no scripts need this).

Meanwhile, some items listed in the scripts array are "as-installed"
integration tests which cannot safely be run at build-time, because
they make assertions about the state of the installed system.
Introduce {"build_time_test": false} for these, and expand this special
case to the tests array for completeness (although currently, no
compiled executables need this).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
0793e3be3d build: Propagate some comments from Autotools build into Meson
Comments like these represent hard-won knowledge which we should not
discard.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
7445af51a4 build: Add machine-readable licensing markers to the Meson build system
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
d9194ffb4d test: Try to create temporary XDG_RUNTIME_DIR with correct mode
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
e6e2370e9e doc: avoid Python injection if filenames contain quotes
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
1582f713a3 build: Distribute Meson build system in release tarballs
As long as we are treating Autotools as a first-class citizen, what we
release will be `make distcheck` output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
eefdbe86f8 build: Make the DBUS_MACHINE_UUID_FILE correctly absolute
get_option('localstatedir') might be relative.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c2b2e0e728 build: Resolve localstatedir, sysconfdir relative to prefix
If the prefix is something like /opt/dbus, then --localstatedir=var
should result in using /opt/dbus/var, and so on. However, if configured
with --localstatedir=/var, then the prefix is ignored.

Meson special-cases these to default to /var and /etc (respectively),
as absolute paths, if the prefix is /usr; so distribution builds will
typically still end up using /var and /etc.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
5e6706a530 build: Require yelp-build for ducktype docs, not Doxygen docs
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
6b2d1d65f3 doc: Build Ducktype documentation even if doxygen is not found
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c02d34555a cmake: Generate the same DBus1Config with Meson as with Autotools
DBus1Config.cmake.in relies on DBus1Targets.cmake, which is generated
by CMake. DBus1Config.pkgconfig.in uses pkg-config and is independent
of CMake.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
fa764fe4e9 test/data: Generate a separate installable set of data files
Some of the strings we need to substitute into these files are not
the same for as-installed testing as for build-time testing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
67b651d1c6 build-timestamp.py: Respect SOURCE_DATE_EPOCH
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
29a20c3284 build: Make modular_tests an auto feature
These don't alter the contents of the non-test executables, so we can
safely enable them whenever GLib is available.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
60afeaa5d6 test: Avoid arbitrary Python injection if compiled in a path with quotes
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
22b12cdb3f test: Disable sanitizers for test-segfault
This resolves the TODO comment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
4bce2c36f0 test: Expect TAP output for tests in name-test
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
43927ea002 test: Don't run test-autolaunch directly
It's intended to be run from run-test.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
83fbc01dca test: Sort test executables
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
3bfd184ab7 tools: Ship disable-uac.rc instead of generating it at build time
The Meson build system ships it anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
0fa6060ea5 .gitignore: Ignore __pycache__ directories anywhere in the tree
The Meson build system adds several Python scripts, some of which import
code from other Python scripts, which will result in __pycache__
directories appearing in the source tree.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
e7c1646661 README: update for meson build-sys 2022-07-13 20:36:13 +01:00
Félix Piédallu
cd2e382610 Add Meson build system
Signed-off-by: Félix Piédallu <felix@piedallu.me>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
b7a1da122a Merge branch 'spec-underscore-idn' into 'master'
spec: Document a recommendation for IDNs in reversed domain names

See merge request dbus/dbus!324
2022-07-13 17:32:45 +00:00
Simon McVittie
7bf5b2b5d6 spec: Document a recommendation for IDNs in reversed domain names
D-Bus names are in an ASCII subset, so IDNs have to be in their ACE
encoding (Punycode). ACE-encoded labels contain hyphen/minus characters,
and like any other label containing a hyphen/minus, we recommend
replacing those with underscores, to improve interoperability with
contexts that allow underscores but not hyphen/minus, such as
D-Bus object paths and Flatpak app-IDs.

Prompted by <https://github.com/flatpak/flatpak/issues/4974>.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 15:55:42 +01:00
Simon McVittie
59c082d45d Merge branch 'fixup' into 'master'
CI fixes

See merge request dbus/dbus!323
2022-07-11 11:17:53 +00:00
Marc-André Lureau
c79d428564 cmake: use -gdwarf-2
GCC 10.2.0 complains on opensuse mingw builds, ex:
disable-crash-handling.c: error: STABS debugging information is obsolete and not supported anymore [-Werror]

According to
https://gitlab.freedesktop.org/dbus/dbus/-/issues/133#note_129599,
-gdwarf-2 is the second best option.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-06 15:58:39 +04:00
Marc-André Lureau
505233a57f tools/ci: remove --{enable,disable}-containers
Fixes: 9d60676a ("Disable the Containers interface")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-06 15:43:52 +04:00
Simon McVittie
1aed6933c7 Merge branch 'test-autolaunch-win' into 'master'
Add autolaunch test on Windows

Closes #235

See merge request dbus/dbus!95
2022-06-27 18:18:53 +00:00
Ralf Habacker
b1dd6fa7a6 Add a test application for autostart on Windows implementation
The test application performs several individual tests to detect possible
problems with the autostart support under Windows. Connections are tested
with the standard scope, a 'custom' scope, the 'install path' scope and
the 'user' scope.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-06-27 15:34:23 +02:00
Ralf Habacker
556eb2ea1a sysdeps-win: display process id of started dbus-daemon
When verbose mode is enabled, this information is useful for debugging.
2022-06-27 15:32:07 +02:00