blob: 437d5a886155dff16b6ca9523e215a865b0f4e8b [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The X.Org X server"
2HOMEPAGE = "http://www.x.org"
3SECTION = "x11/base"
4LICENSE = "MIT-X"
5LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
6
7# xf86-*-* packages depend on an X server built with the xfree86 DDX
8# so we have a virtual to represent that:
9# deprecated, we should use virtual/xserver instead
10PROVIDES = "virtual/xserver-xf86"
11
12# Other packages tend to just care that there is *an* X server:
13PROVIDES += "virtual/xserver"
14
15PE = "2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016
17XORG_PN = "xorg-server"
Andrew Geissler5f350902021-07-23 13:09:54 -040018SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.xz"
19
20UPSTREAM_CHECK_REGEX = "xorg-server-(?P<pver>\d+(\.(?!99)\d+)+)\.tar"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
Andrew Geissler595f6302022-01-24 19:11:47 +000022CVE_PRODUCT = "xorg-server x_server"
23# This is specific to Debian's xserver-wrapper.c
24CVE_CHECK_WHITELIST += "CVE-2011-4613"
25# As per upstream, exploiting this flaw is non-trivial and it requires exact
26# timing on the behalf of the attacker. Many graphical applications exit if their
27# connection to the X server is lost, so a typical desktop session is either
28# impossible or difficult to exploit. There is currently no upstream patch
29# available for this flaw.
30CVE_CHECK_WHITELIST += "CVE-2020-25697"
Brad Bishop19323692019-04-05 15:28:33 -040031
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032S = "${WORKDIR}/${XORG_PN}-${PV}"
33
Andrew Geissler595f6302022-01-24 19:11:47 +000034inherit meson pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
Brad Bishop6dbb3162019-11-25 09:41:34 -050036inherit features_check
Patrick Williamsf1e5d692016-03-30 15:21:19 -050037REQUIRED_DISTRO_FEATURES = "x11"
38
Andrew Geissler595f6302022-01-24 19:11:47 +000039LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess libxcvt libtirpc"
Brad Bishop08902b02019-08-20 09:16:51 -040040DEPENDS = "xorgproto ${LIB_DEPS} font-util"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
42# Split out some modules and extensions from the main package
43# These aren't needed for basic operations and only take up space:
44# 32.0k libdri.so
45# 91.0k libexa.so
46# 336.0k libglx.so
47# 1360k libint10.so
48# 180.0k libwfb.so
49# 320.0k libxaa.so
50# 124.0k libxf1bpp.so
51# 84.0k libxf4bpp.so
52# librecord.so
53# libextmod.so
54# libdbe.so
55
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050056PACKAGES =+ "${PN}-sdl \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 ${PN}-fbdev \
58 ${PN}-xvfb \
59 ${PN}-utils \
60 ${PN}-xephyr \
61 ${PN}-xwayland \
62 ${PN}-multimedia-modules \
63 ${PN}-extension-dri \
64 ${PN}-extension-dri2 \
65 ${PN}-extension-glx \
66 ${PN}-extension-record \
67 ${PN}-extension-extmod \
68 ${PN}-extension-dbe \
69 ${PN}-module-libint10 \
70 ${PN}-module-libafb \
71 ${PN}-module-libwfb \
72 ${PN}-module-libmfb \
73 ${PN}-module-libcfb \
74 ${PN}-module-exa \
75 ${PN}-module-xaa \
76 ${PN}-module-libxf1bpp \
77 ${PN}-module-libxf4bpp \
78 xf86-video-modesetting"
79
Patrick Williams213cb262021-08-07 19:21:33 -050080SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver"
81INSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082
Brad Bishop6e60e8b2018-02-01 10:27:11 -050083XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
Patrick Williams213cb262021-08-07 19:21:33 -050084RRECOMMENDS:${PN} += "${XSERVER_RRECOMMENDS}"
85RRECOMMENDS:${PN}-xwayland += "${XSERVER_RRECOMMENDS}"
86RDEPENDS:${PN}-xvfb += "xkeyboard-config"
87RDEPENDS:${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088
Andrew Geissler595f6302022-01-24 19:11:47 +000089FILES:${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/input/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d"
Patrick Williams213cb262021-08-07 19:21:33 -050090FILES:${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la"
91FILES:${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled"
92FILES:${PN}-sdl = "${bindir}/Xsdl"
93FILES:${PN}-fbdev = "${bindir}/Xfbdev"
94FILES:${PN}-xvfb = "${bindir}/Xvfb"
95FILES:${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
96FILES:${PN}-xephyr = "${bindir}/Xephyr"
97FILES:${PN}-xwayland = "${bindir}/Xwayland"
98FILES:${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
99FILES:${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
100FILES:${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
101FILES:${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
102FILES:${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so"
103FILES:${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so"
104FILES:${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so"
105FILES:${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
106FILES:${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
107FILES:${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
108FILES:${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
109FILES:${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
110FILES:${PN}-module-exa = "${libdir}/xorg/modules/libexa.so"
111FILES:${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
112FILES:${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
113FILES:${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
114FILES:xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115
Andrew Geissler595f6302022-01-24 19:11:47 +0000116EXTRA_OEMESON += " \
117 -Dxnest=false \
118 -Dxvfb=true \
119 -Ddtrace=false \
120 -Dint10=x86emu \
121 -Dxkb_output_dir=/var/lib/xkb \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500122"
123
Andrew Geissler595f6302022-01-24 19:11:47 +0000124OPENGL_PKGCONFIGS = "dri glx glamor dri3"
Brad Bishop08902b02019-08-20 09:16:51 -0400125PACKAGECONFIG ??= "dga dri2 udev ${XORG_CRYPTO} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500126 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \
Andrew Geissler595f6302022-01-24 19:11:47 +0000127 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-logind', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500128"
129
Andrew Geissler595f6302022-01-24 19:11:47 +0000130PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev"
131PACKAGECONFIG[dga] = "-Ddga=true,-Ddga=false"
132PACKAGECONFIG[dri] = "-Ddri1=true,-Ddri1=false,virtual/mesa"
133PACKAGECONFIG[dri2] = "-Ddri2=true,-Ddri2=false"
134PACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false"
135PACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11"
136PACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl"
137PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind"
138PACKAGECONFIG[systemd-logind] = "-Dsystemd_logind=true,-Dsystemd_logind=false,dbus,"
139PACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500141# Xorg requires a SHA1 implementation, pick one
142XORG_CRYPTO ??= "openssl"
Andrew Geissler595f6302022-01-24 19:11:47 +0000143PACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl"
144PACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle"
145PACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500146
Patrick Williams213cb262021-08-07 19:21:33 -0500147do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500148 sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500149}
150
151# Add runtime provides for the ABI versions of the video and input subsystems,
152# so that drivers can depend on the relevant version.
Patrick Williams213cb262021-08-07 19:21:33 -0500153python populate_packages:prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500154 import subprocess
155
156 # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
157 # into the new package, not the staged ones.
158 newenv = dict(os.environ)
159 newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
160
161 def get_abi(name):
162 abis = {
163 "video": "abi_videodrv",
164 "input": "abi_xinput"
165 }
166 p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
167 shell=True, env=newenv, stdout=subprocess.PIPE)
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600168 stdout, stderr = p.communicate()
169 output = stdout.decode("utf-8").split(".")[0]
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500170 mlprefix = d.getVar('MLPREFIX') or ''
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600171 return "%sxorg-abi-%s-%s" % (mlprefix, name, output)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500173 pn = d.getVar("PN")
Patrick Williams213cb262021-08-07 19:21:33 -0500174 d.appendVar("RPROVIDES:" + pn, " " + get_abi("input"))
175 d.appendVar("RPROVIDES:" + pn, " " + get_abi("video"))
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500176}