Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

brainos233
Copy link
Contributor

@brainos233 brainos233 commented May 31, 2024

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 meson

For maintaining each platform and architecture, the following variables need to be set to generate the cross-file:

Requires 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.

@brainos233
Copy link
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}")

@renpytom
Copy link
Member

Why would we want meson support?

@renpytom
Copy link
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.)

@brainos233
Copy link
Contributor Author

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).

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.

2 participants