skia.bb 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. SUMMARY = "Skia is a complete 2D graphic library for drawing Text, Geometries, and Images."
  2. DESCRIPTION = "Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Flutter, and many other products."
  3. HOMEPAGE = "https://skia.org/"
  4. BUGTRACKER = "https://github.com/google/skia"
  5. LICENSE = "BSD"
  6. LIC_FILES_CHKSUM = "file://LICENSE;md5=d25bb58a1be2e1af9b58d31565a206dc"
  7. THEAD_LINUX_TAG ?= "${AUTOREV}"
  8. SRCREV = "${THEAD_LINUX_TAG}"
  9. SRC_URI = "git://git@gitee.com/thead-yocto/skia.git;branch=master;protocol=http;"
  10. S = "${WORKDIR}/git"
  11. DEPENDS = " llvm-native fontconfig freetype zlib libjpeg-turbo icu python3-native libxkbcommon wayland wayland-protocols wayland-native virtual/mesa vulkan-loader vulkan-headers "
  12. inherit cmake pkgconfig
  13. OECMAKE_SOURCEPATH = "${S}/out/config"
  14. EXTRA_OECMAKE += " \
  15. -DCMAKE_BUILD_TYPE=Release \
  16. -DGR_GL_LOG_CALLS=0 -DGR_GL_CHECK_ERROR=0 "
  17. OECMAKE_CXX_FLAGS:append = " \
  18. -Wno-error=stringop-overflow \
  19. -Wno-error=sizeof-pointer-memaccess \
  20. -Wno-error=stringop-truncation \
  21. -Wno-error=uninitialized \
  22. -Wno-error=format-truncation \
  23. -Wno-error=int-in-bool-context \
  24. -Wno-error=unused-result \
  25. -Wno-error=class-memaccess \
  26. -Wno-error=redundant-move \
  27. -Wno-error=deprecated-copy \
  28. -Wno-error=attributes \
  29. -fvisibility-inlines-hidden \
  30. -I${WORKDIR}/recipe-sysroot/usr/include/freetype2/ \
  31. -latomic "
  32. cmake_do_configure() {
  33. cd ${S}
  34. ./bin/gn gen ./out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py --args='target_cpu="riscv64" target_os="linux" skia_use_libwebp=false skia_use_sfntly=false skia_enable_tools=true skia_use_egl=true skia_use_freetype=true skia_use_fontconfig=true skia_use_vulkan=true skia_use_icu=false '
  35. cd -
  36. if [ "${OECMAKE_BUILDPATH}" ]; then
  37. bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
  38. fi
  39. if [ "${S}" != "${B}" ]; then
  40. rm -rf ${B}
  41. mkdir -p ${B}
  42. cd ${B}
  43. else
  44. find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete
  45. fi
  46. # Just like autotools cmake can use a site file to cache result that need generated binaries to run
  47. if [ -e ${WORKDIR}/site-file.cmake ] ; then
  48. oecmake_sitefile="-C ${WORKDIR}/site-file.cmake"
  49. else
  50. oecmake_sitefile=
  51. fi
  52. cmake \
  53. ${OECMAKE_GENERATOR_ARGS} \
  54. $oecmake_sitefile \
  55. ${OECMAKE_SOURCEPATH} \
  56. -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
  57. -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
  58. -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
  59. -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
  60. -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
  61. -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \
  62. -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
  63. -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
  64. -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
  65. -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
  66. -DPYTHON_EXECUTABLE:PATH=${PYTHON} \
  67. -DPython_EXECUTABLE:PATH=${PYTHON} \
  68. -DPython3_EXECUTABLE:PATH=${PYTHON} \
  69. -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
  70. -DCMAKE_INSTALL_SO_NO_EXE=0 \
  71. -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
  72. -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
  73. ${EXTRA_OECMAKE} \
  74. -Wno-dev
  75. }
  76. do_install() {
  77. mkdir -p ${D}${bindir}/
  78. mkdir -p ${D}${libdir}/
  79. cp ${WORKDIR}/build/SkiaSDLExample ${D}${bindir}/
  80. cp ${WORKDIR}/build/libskia.a ${D}${libdir}/
  81. }
  82. FILES:${PN} = "\
  83. ${bindir}/* \
  84. ${libdir}/libskia.a \
  85. "
  86. INSANE_SKIP:${PN} += "dev-so"