Skip to content

Conversation

@pierre-labastie
Copy link
Collaborator

Initial commit. Should work for build and install, but not yet for tests

Initial commit. Should work for build and install, but not yet for tests
@pierre-labastie pierre-labastie marked this pull request as draft February 8, 2025 07:50
data/meson.build Outdated
install_data(blocaled_conf, install_dir: sysconfdir)

serv_cfg=configuration_data()
serv_cfg.set('libexecdir', prefix + '/' + get_option('libexecdir'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
serv_cfg.set('libexecdir', prefix + '/' + get_option('libexecdir'))
serv_cfg.set('libexecdir', prefix / get_option('libexecdir'))

The a / b operator is syntactic sugar for join_paths(a, b), it guarantees "smart" path joining regardless of edge cases such as "libexecdir lies outside of prefix so it ends up being an absolute path" (may be relevant on NixOS??) and is also just more readable if you ask me. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your kind review. I am not an expert in meson/python, and I'm learning while doing this. Will apply.

Apply the changes proposed by eli-schwartz:
replace "+'/'+" with just " / " in path constructions.
remove a test that is done by the gnome module
@pierre-labastie
Copy link
Collaborator Author

Completed the transition in tests at 185b0cb. There may be things to add for meson dist, but otherwise, everything seems ok.

We use errno, but define it nowhere. We could include <errno.h>, but
this is done automatically starting with glib-2.61 (glib.h includes
gtestutils.h, which includes errno.h). So bump minimal version to 2.61.
This is almost 6 years old, so not a big requirement, I think.
For tests, we recompile ùain.c with different config.h. The source is
in src, so we had "meson.project_source_root() / 'src/main.c'" as the
source. It is better to use the files function to obtain a "file"
object that can be used in any directory, letting meson do the work
of defining paths to it.
We now use errno without including <errno.h>. This is possible because
glib.h includes gtestutils.h, which includes errno.h. But this was added
in glib-2.61. So we should have this version as minimal. We could of
course include errno.h ourselves, but we do not have ways to test older
versions of glib anyway. And glib-2.61 is almost five years old, so
I don't think it is a big requirement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants