userland_git.bb 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. DESCRIPTION = "This repository contains the source code for the ARM side \
  2. libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib \
  3. and includes source for the ARM side code to interface to: EGL, mmal, GLESv2,\
  4. vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG."
  5. LICENSE = "BSD-3-Clause"
  6. LIC_FILES_CHKSUM = "file://LICENCE;md5=0448d6488ef8cc380632b1569ee6d196"
  7. PROVIDES += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "virtual/libgles2 virtual/egl", d)}"
  8. PROVIDES += "virtual/libomxil"
  9. RPROVIDES:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "libgles2 egl libegl libegl1 libglesv2-2", d)}"
  10. COMPATIBLE_MACHINE = "^rpi$"
  11. SRCBRANCH = "master"
  12. SRCFORK = "raspberrypi"
  13. SRCREV = "cc1ca18fb0689b01cc2ca2aa4b400dcee624a213"
  14. # Use the date of the above commit as the package version. Update this when
  15. # SRCREV is changed.
  16. PV = "20230419"
  17. SRC_URI = "\
  18. git://github.com/${SRCFORK}/userland.git;protocol=https;branch=${SRCBRANCH} \
  19. file://0001-mmal-Do-not-use-Werror.patch \
  20. file://0001-Allow-applications-to-set-next-resource-handle.patch \
  21. file://0002-wayland-Add-support-for-the-Wayland-winsys.patch \
  22. file://0003-wayland-Add-Wayland-example.patch \
  23. file://0004-wayland-egl-Add-bcm_host-to-dependencies.patch \
  24. file://0005-interface-remove-faulty-assert-to-make-weston-happy-.patch \
  25. file://0006-zero-out-wl-buffers-in-egl_surface_free.patch \
  26. file://0007-initialize-front-back-wayland-buffers.patch \
  27. file://0008-Remove-RPC_FLUSH.patch \
  28. file://0009-fix-cmake-dependency-race.patch \
  29. file://0010-Fix-for-framerate-with-nested-composition.patch \
  30. file://0011-build-shared-library-for-vchostif.patch \
  31. file://0012-implement-buffer-wrapping-interface-for-dispmanx.patch \
  32. file://0013-Implement-triple-buffering-for-wayland.patch \
  33. file://0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch \
  34. file://0015-EGL-glplatform.h-define-EGL_CAST.patch \
  35. file://0016-Allow-multiple-wayland-compositor-state-data-per-pro.patch \
  36. file://0017-khronos-backport-typedef-for-EGL_EXT_image_dma_buf_i.patch \
  37. file://0018-Add-EGL_IMG_context_priority-related-defines.patch \
  38. file://0019-libfdt-Undefine-__wordsize-if-already-defined.patch \
  39. file://0020-openmaxil-add-pkg-config-file.patch \
  40. file://0021-cmake-Disable-format-overflow-warning-as-error.patch \
  41. file://0022-all-host_applications-remove-non-existent-projects.patch \
  42. file://0023-hello_pi-optionally-build-wayland-specific-app.patch \
  43. file://0024-userland-Sync-needed-defines-for-weston-build.patch \
  44. file://0025-CMakeLists.txt-.pc-respect-CMAKE_INSTALL_LIBDIR.patch \
  45. "
  46. SRC_URI:remove:toolchain-clang = "file://0021-cmake-Disable-format-overflow-warning-as-error.patch"
  47. inherit cmake pkgconfig
  48. ASNEEDED = ""
  49. EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed' \
  50. -DVMCS_INSTALL_PREFIX=${exec_prefix} \
  51. "
  52. EXTRA_OECMAKE:append:aarch64 = " -DARM64=ON "
  53. PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
  54. PACKAGECONFIG[wayland] = "-DBUILD_WAYLAND=TRUE -DWAYLAND_SCANNER_EXECUTABLE:FILEPATH=${STAGING_BINDIR_NATIVE}/wayland-scanner,,wayland-native wayland"
  55. PACKAGECONFIG[allapps] = "-DALL_APPS=true,,,"
  56. CFLAGS:append = " -fPIC -Wno-unused-but-set-variable"
  57. do_install:append () {
  58. for f in `find ${D}${includedir}/interface/vcos/ -name "*.h"`; do
  59. sed -i 's/include "vcos_platform.h"/include "pthreads\/vcos_platform.h"/g' ${f}
  60. sed -i 's/include "vcos_futex_mutex.h"/include "pthreads\/vcos_futex_mutex.h"/g' ${f}
  61. sed -i 's/include "vcos_platform_types.h"/include "pthreads\/vcos_platform_types.h"/g' ${f}
  62. done
  63. rm -rf ${D}${prefix}${sysconfdir}
  64. if [ "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" = "1" ]; then
  65. rm -rf ${D}${libdir}/libEGL*
  66. rm -rf ${D}${libdir}/libGLES*
  67. rm -rf ${D}${libdir}/libwayland-*
  68. rm -rf ${D}${libdir}/pkgconfig/egl.pc ${D}${libdir}/pkgconfig/glesv2.pc \
  69. ${D}${libdir}/pkgconfig/wayland-egl.pc
  70. rm -rf ${D}${includedir}/EGL ${D}${includedir}/GLES* ${D}${includedir}/KHR
  71. else
  72. ln -sf brcmglesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
  73. ln -sf brcmegl.pc ${D}${libdir}/pkgconfig/egl.pc
  74. ln -sf brcmvg.pc ${D}${libdir}/pkgconfig/vg.pc
  75. fi
  76. # Currently man files are installed in /usr/man instead of /usr/share/man, see comments in:
  77. # https://github.com/raspberrypi/userland/commit/45a0022ac64b4d0788def3c5230c972430f6fc23
  78. mkdir -pv ${D}${datadir}
  79. mv -v ${D}${prefix}/man ${D}${mandir}
  80. }
  81. # Shared libs from userland package build aren't versioned, so we need
  82. # to force the .so files into the runtime package (and keep them
  83. # out of -dev package).
  84. FILES_SOLIBSDEV = ""
  85. INSANE_SKIP:${PN} += "dev-so"
  86. FILES:${PN} += " \
  87. ${libdir}/*.so \
  88. ${libdir}/plugins"
  89. FILES:${PN}-dev += "${includedir} \
  90. ${prefix}/src"
  91. FILES:${PN}-doc += "${datadir}/install"
  92. FILES:${PN}-dbg += "${libdir}/plugins/.debug"
  93. RDEPENDS:${PN} += "bash"
  94. RDEPENDS:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "libegl-mesa", "", d)}"