Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "The X.Org X server" |
| 2 | HOMEPAGE = "http://www.x.org" |
| 3 | SECTION = "x11/base" |
| 4 | LICENSE = "MIT-X" |
| 5 | LIC_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 |
| 10 | PROVIDES = "virtual/xserver-xf86" |
| 11 | |
| 12 | # Other packages tend to just care that there is *an* X server: |
| 13 | PROVIDES += "virtual/xserver" |
| 14 | |
| 15 | PE = "2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | |
| 17 | XORG_PN = "xorg-server" |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 18 | SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.xz" |
| 19 | |
| 20 | UPSTREAM_CHECK_REGEX = "xorg-server-(?P<pver>\d+(\.(?!99)\d+)+)\.tar" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 22 | CVE_PRODUCT = "xorg-server x_server" |
| 23 | # This is specific to Debian's xserver-wrapper.c |
| 24 | CVE_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. |
| 30 | CVE_CHECK_WHITELIST += "CVE-2020-25697" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 31 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | S = "${WORKDIR}/${XORG_PN}-${PV}" |
| 33 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 34 | inherit meson pkgconfig |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 36 | inherit features_check |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 37 | REQUIRED_DISTRO_FEATURES = "x11" |
| 38 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 39 | LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess libxcvt libtirpc" |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 40 | DEPENDS = "xorgproto ${LIB_DEPS} font-util" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | |
| 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 56 | PACKAGES =+ "${PN}-sdl \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | ${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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 80 | SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver" |
| 81 | INSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 82 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 83 | XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 84 | RRECOMMENDS:${PN} += "${XSERVER_RRECOMMENDS}" |
| 85 | RRECOMMENDS:${PN}-xwayland += "${XSERVER_RRECOMMENDS}" |
| 86 | RDEPENDS:${PN}-xvfb += "xkeyboard-config" |
| 87 | RDEPENDS:${PN}-module-exa = "${PN} (= ${EXTENDPKGV})" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 89 | FILES:${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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 90 | FILES:${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la" |
| 91 | FILES:${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled" |
| 92 | FILES:${PN}-sdl = "${bindir}/Xsdl" |
| 93 | FILES:${PN}-fbdev = "${bindir}/Xfbdev" |
| 94 | FILES:${PN}-xvfb = "${bindir}/Xvfb" |
| 95 | FILES:${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl" |
| 96 | FILES:${PN}-xephyr = "${bindir}/Xephyr" |
| 97 | FILES:${PN}-xwayland = "${bindir}/Xwayland" |
| 98 | FILES:${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*" |
| 99 | FILES:${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so" |
| 100 | FILES:${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so" |
| 101 | FILES:${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so" |
| 102 | FILES:${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so" |
| 103 | FILES:${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so" |
| 104 | FILES:${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so" |
| 105 | FILES:${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so" |
| 106 | FILES:${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so" |
| 107 | FILES:${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so" |
| 108 | FILES:${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so" |
| 109 | FILES:${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so" |
| 110 | FILES:${PN}-module-exa = "${libdir}/xorg/modules/libexa.so" |
| 111 | FILES:${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so" |
| 112 | FILES:${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so" |
| 113 | FILES:${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so" |
| 114 | FILES:xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 115 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 116 | EXTRA_OEMESON += " \ |
| 117 | -Dxnest=false \ |
| 118 | -Dxvfb=true \ |
| 119 | -Ddtrace=false \ |
| 120 | -Dint10=x86emu \ |
| 121 | -Dxkb_output_dir=/var/lib/xkb \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 122 | " |
| 123 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 124 | OPENGL_PKGCONFIGS = "dri glx glamor dri3" |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 125 | PACKAGECONFIG ??= "dga dri2 udev ${XORG_CRYPTO} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 126 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 127 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-logind', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 128 | " |
| 129 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 130 | PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev" |
| 131 | PACKAGECONFIG[dga] = "-Ddga=true,-Ddga=false" |
| 132 | PACKAGECONFIG[dri] = "-Ddri1=true,-Ddri1=false,virtual/mesa" |
| 133 | PACKAGECONFIG[dri2] = "-Ddri2=true,-Ddri2=false" |
| 134 | PACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false" |
| 135 | PACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11" |
| 136 | PACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl" |
| 137 | PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" |
| 138 | PACKAGECONFIG[systemd-logind] = "-Dsystemd_logind=true,-Dsystemd_logind=false,dbus," |
| 139 | PACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 140 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 141 | # Xorg requires a SHA1 implementation, pick one |
| 142 | XORG_CRYPTO ??= "openssl" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 143 | PACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl" |
| 144 | PACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle" |
| 145 | PACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 146 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 147 | do_install:append () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 148 | sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 149 | } |
| 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 153 | python populate_packages:prepend() { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 154 | 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 168 | stdout, stderr = p.communicate() |
| 169 | output = stdout.decode("utf-8").split(".")[0] |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 170 | mlprefix = d.getVar('MLPREFIX') or '' |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | return "%sxorg-abi-%s-%s" % (mlprefix, name, output) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 172 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 173 | pn = d.getVar("PN") |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 174 | d.appendVar("RPROVIDES:" + pn, " " + get_abi("input")) |
| 175 | d.appendVar("RPROVIDES:" + pn, " " + get_abi("video")) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 176 | } |