blob: 085fcaf87a543d32bad70c7c1feeb9fda67ec615 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The X.Org X server"
2HOMEPAGE = "http://www.x.org"
3SECTION = "x11/base"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004LICENSE = "MIT"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005LIC_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"
Andrew Geissler8f840682023-07-21 09:09:43 -050023
24CVE_STATUS[CVE-2011-4613] = "not-applicable-platform: This is specific to Debian's xserver-wrapper.c"
25CVE_STATUS[CVE-2020-25697] = "upstream-wontfix: \
26As per upstream, exploiting this flaw is non-trivial and it requires exact \
27timing on the behalf of the attacker. Many graphical applications exit if their \
28connection to the X server is lost, so a typical desktop session is either \
29impossible or difficult to exploit. There is currently no upstream patch \
30available for this flaw."
31CVE_STATUS[CVE-2022-3553] = "cpe-incorrect: This is specific to XQuartz, which is the macOS X server port"
Brad Bishop19323692019-04-05 15:28:33 -040032
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033S = "${WORKDIR}/${XORG_PN}-${PV}"
34
Andrew Geissler595f6302022-01-24 19:11:47 +000035inherit meson pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Brad Bishop6dbb3162019-11-25 09:41:34 -050037inherit features_check
Patrick Williamsf1e5d692016-03-30 15:21:19 -050038REQUIRED_DISTRO_FEATURES = "x11"
39
Andrew Geissler595f6302022-01-24 19:11:47 +000040LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess libxcvt libtirpc"
Brad Bishop08902b02019-08-20 09:16:51 -040041DEPENDS = "xorgproto ${LIB_DEPS} font-util"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042
43# Split out some modules and extensions from the main package
44# These aren't needed for basic operations and only take up space:
45# 32.0k libdri.so
46# 91.0k libexa.so
47# 336.0k libglx.so
48# 1360k libint10.so
49# 180.0k libwfb.so
50# 320.0k libxaa.so
51# 124.0k libxf1bpp.so
52# 84.0k libxf4bpp.so
53# librecord.so
54# libextmod.so
55# libdbe.so
56
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057PACKAGES =+ "${PN}-sdl \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058 ${PN}-fbdev \
59 ${PN}-xvfb \
60 ${PN}-utils \
61 ${PN}-xephyr \
62 ${PN}-xwayland \
63 ${PN}-multimedia-modules \
64 ${PN}-extension-dri \
65 ${PN}-extension-dri2 \
66 ${PN}-extension-glx \
67 ${PN}-extension-record \
68 ${PN}-extension-extmod \
69 ${PN}-extension-dbe \
70 ${PN}-module-libint10 \
71 ${PN}-module-libafb \
72 ${PN}-module-libwfb \
73 ${PN}-module-libmfb \
74 ${PN}-module-libcfb \
75 ${PN}-module-exa \
76 ${PN}-module-xaa \
77 ${PN}-module-libxf1bpp \
78 ${PN}-module-libxf4bpp \
79 xf86-video-modesetting"
80
Patrick Williams213cb262021-08-07 19:21:33 -050081SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver"
82INSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
Patrick Williams2390b1b2022-11-03 13:47:49 -050084XSERVER_RDEPENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
85RDEPENDS:${PN} += "${XSERVER_RDEPENDS}"
86RDEPENDS:${PN}-xwayland += "${XSERVER_RDEPENDS}"
Patrick Williams213cb262021-08-07 19:21:33 -050087RDEPENDS:${PN}-xvfb += "xkeyboard-config"
88RDEPENDS:${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089
Andrew Geissler595f6302022-01-24 19:11:47 +000090FILES:${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 -050091FILES:${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la"
92FILES:${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled"
93FILES:${PN}-sdl = "${bindir}/Xsdl"
94FILES:${PN}-fbdev = "${bindir}/Xfbdev"
95FILES:${PN}-xvfb = "${bindir}/Xvfb"
96FILES:${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
97FILES:${PN}-xephyr = "${bindir}/Xephyr"
98FILES:${PN}-xwayland = "${bindir}/Xwayland"
99FILES:${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
100FILES:${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
101FILES:${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
102FILES:${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
103FILES:${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so"
104FILES:${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so"
105FILES:${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so"
106FILES:${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
107FILES:${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
108FILES:${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
109FILES:${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
110FILES:${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
111FILES:${PN}-module-exa = "${libdir}/xorg/modules/libexa.so"
112FILES:${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
113FILES:${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
114FILES:${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
115FILES:xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500116
Andrew Geissler595f6302022-01-24 19:11:47 +0000117EXTRA_OEMESON += " \
118 -Dxnest=false \
119 -Dxvfb=true \
120 -Ddtrace=false \
121 -Dint10=x86emu \
122 -Dxkb_output_dir=/var/lib/xkb \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123"
124
Andrew Geissler595f6302022-01-24 19:11:47 +0000125OPENGL_PKGCONFIGS = "dri glx glamor dri3"
Brad Bishop08902b02019-08-20 09:16:51 -0400126PACKAGECONFIG ??= "dga dri2 udev ${XORG_CRYPTO} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500127 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \
Andrew Geissler595f6302022-01-24 19:11:47 +0000128 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-logind', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129"
130
Andrew Geissler595f6302022-01-24 19:11:47 +0000131PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev"
132PACKAGECONFIG[dga] = "-Ddga=true,-Ddga=false"
133PACKAGECONFIG[dri] = "-Ddri1=true,-Ddri1=false,virtual/mesa"
134PACKAGECONFIG[dri2] = "-Ddri2=true,-Ddri2=false"
135PACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false"
136PACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11"
137PACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl"
138PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind"
139PACKAGECONFIG[systemd-logind] = "-Dsystemd_logind=true,-Dsystemd_logind=false,dbus,"
140PACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500142# Xorg requires a SHA1 implementation, pick one
143XORG_CRYPTO ??= "openssl"
Andrew Geissler595f6302022-01-24 19:11:47 +0000144PACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl"
145PACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle"
146PACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500147
Patrick Williams213cb262021-08-07 19:21:33 -0500148do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500149 sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500150}
151
152# Add runtime provides for the ABI versions of the video and input subsystems,
153# so that drivers can depend on the relevant version.
Patrick Williams213cb262021-08-07 19:21:33 -0500154python populate_packages:prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155 import subprocess
156
157 # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
158 # into the new package, not the staged ones.
159 newenv = dict(os.environ)
160 newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
161
162 def get_abi(name):
163 abis = {
164 "video": "abi_videodrv",
165 "input": "abi_xinput"
166 }
167 p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
168 shell=True, env=newenv, stdout=subprocess.PIPE)
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600169 stdout, stderr = p.communicate()
170 output = stdout.decode("utf-8").split(".")[0]
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500171 mlprefix = d.getVar('MLPREFIX') or ''
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600172 return "%sxorg-abi-%s-%s" % (mlprefix, name, output)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500173
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500174 pn = d.getVar("PN")
Patrick Williams213cb262021-08-07 19:21:33 -0500175 d.appendVar("RPROVIDES:" + pn, " " + get_abi("input"))
176 d.appendVar("RPROVIDES:" + pn, " " + get_abi("video"))
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177}