-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add meson build system support #134
base: master
Are you sure you want to change the base?
Conversation
`env2mfile` requires meson 0.62.0, but Ubuntu 22.04's meson is 0.61.2
#135 is the test case for this pr, here's the example for adding meson package: from renpybuild.context import Context
from renpybuild.task import task, annotator
version = "package_version"
@task(platforms="all")
def unpack(c: Context):
c.clean()
c.var("version", version)
c.run("tar xf {{source}}/package_name-{{version}}.tar.gz")
@task(platforms="all")
def build(c: Context):
c.var("version", version)
c.chdir("package_name-{{version}}")
c.run("""
{{ meson_configure }} {{ meson_args }}
--prefix={{install}}
--default-library={shared,static,both}
-D{package_specific_options}
{build_dir}
""")
c.run("{{ meson_compile }} -C {build_dir}")
c.run("meson install -C {build_dir}") |
Why would we want meson support? |
Ah, never mind - saw the second comment. Let me think about this one, as I don't know if there's enough software using meson to be worth it. (Compared to using an older version of fribidi, a low dependency library.) |
#136 is the main reason for adding meson build system support, but some of the packages used by renpy have gradually switched to meson, such as freetype2 (experimental) and harfbuzz (official). |
To integrate meson build system, a cross-file is required, the easiest way to do this is to use meson's
env2mfile
command, which eliminates the need to generate a cross-file manually.env2mfile
requires meson 0.62.0, but Ubuntu 22.04's meson version is 0.61.2, so using pip to install the latest version of mesonFor maintaining each platform and architecture, the following variables need to be set to generate the cross-file:
meson_cross_system
: https://mesonbuild.com/Reference-tables.html#operating-system-namesmeson_cross_subsystem
: Not needed, if not set, will be set asmeson_cross_system
, https://mesonbuild.com/Reference-tables.html#subsystem-names-since-120meson_cross_kernel
: https://mesonbuild.com/Reference-tables.html#kernel-names-since-120meson_cross_cpu_family
: https://mesonbuild.com/Reference-tables.html#cpu-familiesmeson_cross_cpu
: There is no reference for, so it has to manually find the appropriate valueRequires meson 1.4.1 because there is a bug before this version, which made not able to use meson's
-Dc_std
,-Dcpp_std
to set c/cxx default standard version.