Workbench
Workbench copied to clipboard
vala: Port Vala to Meson
This PR ports Vala from scripts to Meson, and introduces a minimal Vala template with the Workbench API file and a meson build file.
Fixes https://github.com/workbenchdev/Workbench/issues/964 Fixes #913
@sonnyp Existing sessions and all the demos work as expected. Projects don't, because meson won't accept the file paths given by a portal. I tested this with Rust/cargo and it happens too.
A possible solution might be copying the Vala sources to a temporary folder that meson accepts (like the cache directory) and compile it there. The source files are usually small so it shouldn't be expensive. What do you think?
meson won't accept the file paths given by a portal
why not?
Same as #846 unfortunately :(
Same as https://github.com/workbenchdev/Workbench/issues/846 unfortunately :(
I see
A possible solution might be copying the Vala sources to a temporary folder that meson accepts (like the cache directory) and compile it there. The source files are usually small so it shouldn't be expensive. What do you think?
Sounds interesting, perhaps we can solve https://github.com/workbenchdev/Workbench/issues/846 the same way if it turns out to be a good idea.
I'm also interested to avoid having a builddir in the project directory.
Wanna give it a try?
I tested this and besides projects it seems to work great. I also merged main into your branch and fixed conflicts.
I'm also interested to avoid having a builddir in the project directory.
I think it would be better too, since Meson's builddirs can break between major versions, and old projects may break as a consequence of this.
I'll give it a try this week :)
I think this PR is ready! A little summary of the changes:
- Vala projects will be built in the
/tmp/valadirectory, instead of the working directory of the session. - The
/tmp/valafolder will contain all the files necessary to compile a session. Every time Run is clicked, themain.valafile in the tmp folder will be replaced by the demo's/project'smain.vala. Probably we can do this with Rust too, so we don't have to grant filesystem permissions to compile projects.
Also updated the newer demos in https://github.com/workbenchdev/demos/pull/187, tested locally and CI passed, so this is ready for review.