xref: /openbmc/openbmc/meta-arm/meta-arm/recipes-devtools/gn/gn_git.bb (revision eaae0b339f806200d8722cb09e5e3b83c15a5956)
1SUMMARY = "GN is a meta-build system that generates build files for Ninja"
2DEPENDS += "ninja-native"
3
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
6
7UPSTREAM_CHECK_COMMITS = "1"
8
9SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
10SRCREV = "ab638bd7cbb9ac8468bf2fbe60c74ed4706a14a7"
11PV = "0+git"
12
13S = "${WORKDIR}/git"
14B = "${WORKDIR}/build"
15
16# Map from our _OS strings to the GN's platform values.
17def gn_platform(variable, d):
18    os = d.getVar(variable)
19    if "linux" in os:
20        return "linux"
21    elif "mingw" in os:
22        return "mingw"
23    else:
24        return os
25
26do_configure[cleandirs] += "${B}"
27do_configure() {
28    python3 ${S}/build/gen.py \
29        --platform=${@gn_platform("TARGET_OS", d)} \
30        --out-path=${B} \
31        --no-static-libstdc++ \
32        --no-strip
33}
34
35do_compile() {
36    ninja -C ${B} --verbose
37}
38
39do_install() {
40    install -d ${D}${bindir}
41    install ${B}/gn ${D}${bindir}
42}
43
44BBCLASSEXTEND = "native"
45
46COMPATIBLE_HOST = "^(?!riscv32).*"
47