Add meson build system support#134
Open
brainos233 wants to merge 8 commits intorenpy:masterfrom
Open
Conversation
`env2mfile` requires meson 0.62.0, but Ubuntu 22.04's meson is 0.61.2
Contributor
Author
|
#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}") |
Member
|
Why would we want meson support? |
Member
|
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.) |
Contributor
Author
#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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To integrate meson build system, a cross-file is required, the easiest way to do this is to use meson's
env2mfilecommand, which eliminates the need to generate a cross-file manually.env2mfilerequires 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_stdto set c/cxx default standard version.