gn_git.bb 1.0 KB

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