1SUMMARY = "X driver"
2HOMEPAGE = "http://www.x.org"
3BUGTRACKER = "https://bugs.freedesktop.org"
4SECTION = "x11/drivers"
5LICENSE = "MIT"
6
7PE = "2"
8
9DEPENDS = "virtual/xserver xorgproto util-macros"
10
11XORG_DRIVER_COMPRESSOR ?= ".tar.bz2"
12SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}${XORG_DRIVER_COMPRESSOR}"
13
14FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so"
15
16XORGBUILDCLASS ??= "autotools"
17inherit ${XORGBUILDCLASS} pkgconfig features_check
18
19# depends on virtual/xserver
20REQUIRED_DISTRO_FEATURES = "x11"
21
22# FIXME: We don't want to include the libtool archives (*.la) from modules
23# directory, as they serve no useful purpose. Upstream should fix Makefile.am
24do_install:append() {
25	find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f --
26}
27
28# Function to add the relevant ABI dependency to drivers, which should be called
29# from a PACKAGEFUNC.
30def _add_xorg_abi_depends(d, name):
31    # Map of ABI names exposed in the dependencies to pkg-config variables
32    abis = {
33      "video": "abi_videodrv",
34      "input": "abi_xinput"
35    }
36
37    output = os.popen("pkg-config xorg-server --variable=%s" % abis[name]).read()
38    mlprefix = d.getVar('MLPREFIX') or ''
39    abi = "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
40
41    pn = d.getVar("PN")
42    d.appendVar('RDEPENDS:' + pn, ' ' + abi)
43
44SECURITY_LDFLAGS = "${SECURITY_X_LDFLAGS}"
45