blob: 9d37f474e93ba05af04c413e32b658aece41a3a7 [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001DESCRIPTION = "This repository contains the source code for the ARM side \
2libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib \
3and includes source for the ARM side code to interface to: EGL, mmal, GLESv2,\
4vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG."
5LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://LICENCE;md5=0448d6488ef8cc380632b1569ee6d196"
7
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008PROVIDES += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "virtual/libgles2 virtual/egl", d)}"
Andrew Geissler062316f2020-05-15 14:19:14 -05009PROVIDES += "virtual/libomxil"
Patrick Williams8b8bc412016-08-17 15:02:23 -050010
Patrick Williams213cb262021-08-07 19:21:33 -050011RPROVIDES:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "libgles2 egl libegl libegl1 libglesv2-2", d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012COMPATIBLE_MACHINE = "^rpi$"
Patrick Williams8b8bc412016-08-17 15:02:23 -050013
14SRCBRANCH = "master"
15SRCFORK = "raspberrypi"
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050016SRCREV = "54fd97ae4066a10b6b02089bc769ceed328737e0"
Brad Bishop316dfdd2018-06-25 12:45:53 -040017
18# Use the date of the above commit as the package version. Update this when
19# SRCREV is changed.
Patrick Williamsde0582f2022-04-08 10:23:27 -050020PV = "20220323"
Patrick Williams8b8bc412016-08-17 15:02:23 -050021
22SRC_URI = "\
Andrew Geissler595f6302022-01-24 19:11:47 +000023 git://github.com/${SRCFORK}/userland.git;protocol=https;branch=${SRCBRANCH} \
Patrick Williamsde0582f2022-04-08 10:23:27 -050024 file://0001-mmal-Do-not-use-Werror.patch \
Patrick Williams8b8bc412016-08-17 15:02:23 -050025 file://0001-Allow-applications-to-set-next-resource-handle.patch \
26 file://0002-wayland-Add-support-for-the-Wayland-winsys.patch \
27 file://0003-wayland-Add-Wayland-example.patch \
28 file://0004-wayland-egl-Add-bcm_host-to-dependencies.patch \
29 file://0005-interface-remove-faulty-assert-to-make-weston-happy-.patch \
30 file://0006-zero-out-wl-buffers-in-egl_surface_free.patch \
31 file://0007-initialize-front-back-wayland-buffers.patch \
32 file://0008-Remove-RPC_FLUSH.patch \
33 file://0009-fix-cmake-dependency-race.patch \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060034 file://0010-Fix-for-framerate-with-nested-composition.patch \
35 file://0011-build-shared-library-for-vchostif.patch \
36 file://0012-implement-buffer-wrapping-interface-for-dispmanx.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037 file://0013-Implement-triple-buffering-for-wayland.patch \
38 file://0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch \
39 file://0015-EGL-glplatform.h-define-EGL_CAST.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040040 file://0016-Allow-multiple-wayland-compositor-state-data-per-pro.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041 file://0017-khronos-backport-typedef-for-EGL_EXT_image_dma_buf_i.patch \
42 file://0018-Add-EGL_IMG_context_priority-related-defines.patch \
Brad Bishop26bdd442019-08-16 17:08:17 -040043 file://0019-libfdt-Undefine-__wordsize-if-already-defined.patch \
Andrew Geissler062316f2020-05-15 14:19:14 -050044 file://0020-openmaxil-add-pkg-config-file.patch \
45 file://0021-cmake-Disable-format-overflow-warning-as-error.patch \
Andrew Geissler26e4bea2020-11-30 19:54:03 -060046 file://0022-all-host_applications-remove-non-existent-projects.patch \
47 file://0023-hello_pi-optionally-build-wayland-specific-app.patch \
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060048 file://0024-userland-Sync-needed-defines-for-weston-build.patch \
Patrick Williams8b8bc412016-08-17 15:02:23 -050049"
Andrew Geissler6454e372020-10-30 15:41:26 -050050
Patrick Williams213cb262021-08-07 19:21:33 -050051SRC_URI:remove:toolchain-clang = "file://0021-cmake-Disable-format-overflow-warning-as-error.patch"
Andrew Geissler6454e372020-10-30 15:41:26 -050052
Patrick Williams8b8bc412016-08-17 15:02:23 -050053S = "${WORKDIR}/git"
54
55inherit cmake pkgconfig
56
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060057ASNEEDED = ""
58
Patrick Williams8b8bc412016-08-17 15:02:23 -050059EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed' \
60 -DVMCS_INSTALL_PREFIX=${exec_prefix} \
61"
62
Patrick Williams213cb262021-08-07 19:21:33 -050063EXTRA_OECMAKE:append:aarch64 = " -DARM64=ON "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060064
65
Patrick Williams8b8bc412016-08-17 15:02:23 -050066PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
67
68PACKAGECONFIG[wayland] = "-DBUILD_WAYLAND=TRUE -DWAYLAND_SCANNER_EXECUTABLE:FILEPATH=${STAGING_BINDIR_NATIVE}/wayland-scanner,,wayland-native wayland"
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060069PACKAGECONFIG[allapps] = "-DALL_APPS=true,,,"
Patrick Williams8b8bc412016-08-17 15:02:23 -050070
Patrick Williamsde0582f2022-04-08 10:23:27 -050071CFLAGS:append = " -fPIC -Wno-unused-but-set-variable"
Patrick Williams8b8bc412016-08-17 15:02:23 -050072
Patrick Williams213cb262021-08-07 19:21:33 -050073do_install:append () {
Patrick Williams8b8bc412016-08-17 15:02:23 -050074 for f in `find ${D}${includedir}/interface/vcos/ -name "*.h"`; do
75 sed -i 's/include "vcos_platform.h"/include "pthreads\/vcos_platform.h"/g' ${f}
76 sed -i 's/include "vcos_futex_mutex.h"/include "pthreads\/vcos_futex_mutex.h"/g' ${f}
77 sed -i 's/include "vcos_platform_types.h"/include "pthreads\/vcos_platform_types.h"/g' ${f}
78 done
Brad Bishop19323692019-04-05 15:28:33 -040079 rm -rf ${D}${prefix}${sysconfdir}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080080 if [ "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" = "1" ]; then
81 rm -rf ${D}${libdir}/libEGL*
82 rm -rf ${D}${libdir}/libGLES*
83 rm -rf ${D}${libdir}/libwayland-*
84 rm -rf ${D}${libdir}/pkgconfig/egl.pc ${D}${libdir}/pkgconfig/glesv2.pc \
85 ${D}${libdir}/pkgconfig/wayland-egl.pc
86 rm -rf ${D}${includedir}/EGL ${D}${includedir}/GLES* ${D}${includedir}/KHR
Andrew Geissler062316f2020-05-15 14:19:14 -050087 else
88 ln -sf brcmglesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
89 ln -sf brcmegl.pc ${D}${libdir}/pkgconfig/egl.pc
90 ln -sf brcmvg.pc ${D}${libdir}/pkgconfig/vg.pc
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080091 fi
Patrick Williams213cb262021-08-07 19:21:33 -050092 # Currently man files are installed in /usr/man instead of /usr/share/man, see comments in:
93 # https://github.com/raspberrypi/userland/commit/45a0022ac64b4d0788def3c5230c972430f6fc23
94 mkdir -pv ${D}${datadir}
95 mv -v ${D}${prefix}/man ${D}${mandir}
Patrick Williams8b8bc412016-08-17 15:02:23 -050096}
97
98# Shared libs from userland package build aren't versioned, so we need
99# to force the .so files into the runtime package (and keep them
100# out of -dev package).
101FILES_SOLIBSDEV = ""
Patrick Williams213cb262021-08-07 19:21:33 -0500102INSANE_SKIP:${PN} += "dev-so"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500103
Patrick Williams213cb262021-08-07 19:21:33 -0500104FILES:${PN} += " \
Patrick Williams8b8bc412016-08-17 15:02:23 -0500105 ${libdir}/*.so \
106 ${libdir}/plugins"
Patrick Williams213cb262021-08-07 19:21:33 -0500107FILES:${PN}-dev += "${includedir} \
Patrick Williams8b8bc412016-08-17 15:02:23 -0500108 ${prefix}/src"
Patrick Williams213cb262021-08-07 19:21:33 -0500109FILES:${PN}-doc += "${datadir}/install"
110FILES:${PN}-dbg += "${libdir}/plugins/.debug"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500111
Patrick Williams213cb262021-08-07 19:21:33 -0500112RDEPENDS:${PN} += "bash"
113RDEPENDS:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "libegl-mesa", "", d)}"