Support the Meson build system

Bug #1805034 reported by Andreas Stöckel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvterm
New
Undecided
Unassigned

Bug Description

Meson is a relatively new and popular build system with a simple declaration language, integrated dependency management, and good cross-compilation support. Supporting Meson in libvterm allows developers to easily integrate libvterm into their own Meson-based project.

The only change that had to be done in libvterm to support Meson is to add an additional "--executable" parameter to run-test.pl, so that the unit-tests can be executed within an out-of-tree build.

Here are my patches:

[PATCH] Add --executable/-e flag to run-test.p
https://github.com/astoeckel/libvterm/commit/0e7e03060b97e3a4a8269544b72b630ede82495c.patch

[PATCH] Add meson.build
https://github.com/astoeckel/libvterm/commit/27c1bfe1c655cbcaf550e589a176aced6c1a4bfc.patch

[PATCH] Ignore "build" directory in bzr
https://github.com/astoeckel/libvterm/commit/efe673b6e44f9974cdbbb5bfbbdc89027a1dfcc4.patch

[PATCH] Symlink .bzrignore to .gitignore
https://github.com/astoeckel/libvterm/commit/c424d6539db642f14e0ef3a7fae00e4e7689153d.patch

Note that only the first two patches are really required, the last two patches are more quality-of-life improvements for myself.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

Patch (1/4) looks good; I've applied as bzr -r722

Patch (2/4) looks interesting - it hardcodes a full list of the test filenames. Is there not a way to glob the directory for all of them? That looks like it could be a problem to keep it maintained as more tests get added. Additionally, can you add a comment to the file giving some author information, so I can remember where to send questions to in case problems come up - since I didn't write that bit :)

Revision history for this message
Andreas Stöckel (andreas-stoeckel) wrote :

First of all, thank you for looking at this and sorry for the delay!

The rationale for the missing wildcard/globbing operator in Meson is documented here [1]. I have adapted the patch to use the workaround described in the Meson documentation, i.e. to use an external program to search for files. There is now a small Perl script "t/list-tests.pl" that lists all *.test files in the "t/" directory.

Here are the updated patches:

[PATCH] Add meson support
https://github.com/astoeckel/libvterm/commit/63003c4003b4c4bc2a48c27aa9a9c869ca470b14.patch

[PATCH] Ignore "build" directory in bzr
https://github.com/astoeckel/libvterm/commit/28fb821838515b547ba64c41410fd4b0f489e7d1.patch

[PATCH] Symlink .bzrignore to .gitignore
https://github.com/astoeckel/libvterm/commit/8aa668629799b91218155bc2435f60442327230e.patch

[1] https://mesonbuild.com/FAQ.html#why-cant-i-specify-target-files-with-a-wildcard

Revision history for this message
Andreas Stöckel (andreas-stoeckel) wrote :

Forgot to add: I also added some author information to the new files.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.