From patchwork Mon Oct 22 09:37:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] xorg-driver: add xserver driver ABI dependencies Date: Mon, 22 Oct 2012 09:37:25 -0000 From: Ross Burton X-Patchwork-Id: 38399 Message-Id: <317edf41e92630b775f728629e1a9612cdb195c8.1350898411.git.ross.burton@intel.com> To: openembedded-core@lists.openembedded.org At build time extract the xserver driver ABI versions that we're building against and add RDEPENDs on them, so the driver isn't used against an xserver with a different ABI (which won't work). Signed-off-by: Ross Burton --- .../xorg-driver/xorg-driver-common.inc | 17 ++++++++++++++++- .../xorg-driver/xorg-driver-input.inc | 4 ++++ .../xorg-driver/xorg-driver-video.inc | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc index 9a474b7..f9f25ff 100644 --- a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc +++ b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc @@ -5,7 +5,7 @@ SECTION = "x11/drivers" LICENSE = "MIT-X" PE = "2" -INC_PR = "r17" +INC_PR = "r18" DEPENDS = "virtual/xserver xproto randrproto util-macros" @@ -31,3 +31,18 @@ do_configure_prepend () { do_install_append() { find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f -- } + +# Function to add the relevant ABI dependency to drivers, which should be called +# from a populate_packages append/prepend. +def add_abi_depends(d, name): + # Map of ABI names exposed in the dependencies to pkg-config variables + abis = { + "video": "abi_videodrv", + "input": "abi_xinput" + } + + output = os.popen("pkg-config xorg-server --variable=%s" % abis[name]).read() + abi = "xorg-abi-%s-%s" % (name, output.split(".")[0]) + + pn = d.getVar("PN", True) + d.appendVar('RDEPENDS_' + pn, ' ' + abi) diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc index bf4ca6c..a544d71 100644 --- a/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc +++ b/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc @@ -2,5 +2,9 @@ include xorg-driver-common.inc DEPENDS += "inputproto kbproto " +python populate_packages_prepend() { + add_abi_depends(d, "input") +} + FILES_${PN} += " ${libdir}/xorg/modules/input/*.so" FILES_${PN}-dbg += " ${libdir}/xorg/modules/input/.debug" diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc index 57c80d1..4fe3349 100644 --- a/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc +++ b/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc @@ -2,3 +2,6 @@ include xorg-driver-common.inc DEPENDS =+ "renderproto videoproto xextproto fontsproto" +python populate_packages_prepend() { + add_abi_depends(d, "video") +}