1*4882a593SmuzhiyunSUMMARY = "The X.Org X server" 2*4882a593SmuzhiyunHOMEPAGE = "http://www.x.org" 3*4882a593SmuzhiyunSECTION = "x11/base" 4*4882a593SmuzhiyunLICENSE = "MIT" 5*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun# xf86-*-* packages depend on an X server built with the xfree86 DDX 8*4882a593Smuzhiyun# so we have a virtual to represent that: 9*4882a593Smuzhiyun# deprecated, we should use virtual/xserver instead 10*4882a593SmuzhiyunPROVIDES = "virtual/xserver-xf86" 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun# Other packages tend to just care that there is *an* X server: 13*4882a593SmuzhiyunPROVIDES += "virtual/xserver" 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunPE = "2" 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunXORG_PN = "xorg-server" 18*4882a593SmuzhiyunSRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.xz" 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunUPSTREAM_CHECK_REGEX = "xorg-server-(?P<pver>\d+(\.(?!99)\d+)+)\.tar" 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunCVE_PRODUCT = "xorg-server x_server" 23*4882a593Smuzhiyun# This is specific to Debian's xserver-wrapper.c 24*4882a593SmuzhiyunCVE_CHECK_IGNORE += "CVE-2011-4613" 25*4882a593Smuzhiyun# As per upstream, exploiting this flaw is non-trivial and it requires exact 26*4882a593Smuzhiyun# timing on the behalf of the attacker. Many graphical applications exit if their 27*4882a593Smuzhiyun# connection to the X server is lost, so a typical desktop session is either 28*4882a593Smuzhiyun# impossible or difficult to exploit. There is currently no upstream patch 29*4882a593Smuzhiyun# available for this flaw. 30*4882a593SmuzhiyunCVE_CHECK_IGNORE += "CVE-2020-25697" 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunS = "${WORKDIR}/${XORG_PN}-${PV}" 33*4882a593Smuzhiyun 34*4882a593Smuzhiyuninherit meson pkgconfig 35*4882a593Smuzhiyun 36*4882a593Smuzhiyuninherit features_check 37*4882a593SmuzhiyunREQUIRED_DISTRO_FEATURES = "x11" 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunLIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess libxcvt libtirpc" 40*4882a593SmuzhiyunDEPENDS = "xorgproto ${LIB_DEPS} font-util" 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun# Split out some modules and extensions from the main package 43*4882a593Smuzhiyun# These aren't needed for basic operations and only take up space: 44*4882a593Smuzhiyun# 32.0k libdri.so 45*4882a593Smuzhiyun# 91.0k libexa.so 46*4882a593Smuzhiyun# 336.0k libglx.so 47*4882a593Smuzhiyun# 1360k libint10.so 48*4882a593Smuzhiyun# 180.0k libwfb.so 49*4882a593Smuzhiyun# 320.0k libxaa.so 50*4882a593Smuzhiyun# 124.0k libxf1bpp.so 51*4882a593Smuzhiyun# 84.0k libxf4bpp.so 52*4882a593Smuzhiyun# librecord.so 53*4882a593Smuzhiyun# libextmod.so 54*4882a593Smuzhiyun# libdbe.so 55*4882a593Smuzhiyun 56*4882a593SmuzhiyunPACKAGES =+ "${PN}-sdl \ 57*4882a593Smuzhiyun ${PN}-fbdev \ 58*4882a593Smuzhiyun ${PN}-xvfb \ 59*4882a593Smuzhiyun ${PN}-utils \ 60*4882a593Smuzhiyun ${PN}-xephyr \ 61*4882a593Smuzhiyun ${PN}-xwayland \ 62*4882a593Smuzhiyun ${PN}-multimedia-modules \ 63*4882a593Smuzhiyun ${PN}-extension-dri \ 64*4882a593Smuzhiyun ${PN}-extension-dri2 \ 65*4882a593Smuzhiyun ${PN}-extension-glx \ 66*4882a593Smuzhiyun ${PN}-extension-record \ 67*4882a593Smuzhiyun ${PN}-extension-extmod \ 68*4882a593Smuzhiyun ${PN}-extension-dbe \ 69*4882a593Smuzhiyun ${PN}-module-libint10 \ 70*4882a593Smuzhiyun ${PN}-module-libafb \ 71*4882a593Smuzhiyun ${PN}-module-libwfb \ 72*4882a593Smuzhiyun ${PN}-module-libmfb \ 73*4882a593Smuzhiyun ${PN}-module-libcfb \ 74*4882a593Smuzhiyun ${PN}-module-exa \ 75*4882a593Smuzhiyun ${PN}-module-xaa \ 76*4882a593Smuzhiyun ${PN}-module-libxf1bpp \ 77*4882a593Smuzhiyun ${PN}-module-libxf4bpp \ 78*4882a593Smuzhiyun xf86-video-modesetting" 79*4882a593Smuzhiyun 80*4882a593SmuzhiyunSUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver" 81*4882a593SmuzhiyunINSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi" 82*4882a593Smuzhiyun 83*4882a593SmuzhiyunXSERVER_RDEPENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput" 84*4882a593SmuzhiyunRDEPENDS:${PN} += "${XSERVER_RDEPENDS}" 85*4882a593SmuzhiyunRDEPENDS:${PN}-xwayland += "${XSERVER_RDEPENDS}" 86*4882a593SmuzhiyunRDEPENDS:${PN}-xvfb += "xkeyboard-config" 87*4882a593SmuzhiyunRDEPENDS:${PN}-module-exa = "${PN} (= ${EXTENDPKGV})" 88*4882a593Smuzhiyun 89*4882a593SmuzhiyunFILES:${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" 90*4882a593SmuzhiyunFILES:${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la" 91*4882a593SmuzhiyunFILES:${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled" 92*4882a593SmuzhiyunFILES:${PN}-sdl = "${bindir}/Xsdl" 93*4882a593SmuzhiyunFILES:${PN}-fbdev = "${bindir}/Xfbdev" 94*4882a593SmuzhiyunFILES:${PN}-xvfb = "${bindir}/Xvfb" 95*4882a593SmuzhiyunFILES:${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*4882a593SmuzhiyunFILES:${PN}-xephyr = "${bindir}/Xephyr" 97*4882a593SmuzhiyunFILES:${PN}-xwayland = "${bindir}/Xwayland" 98*4882a593SmuzhiyunFILES:${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*" 99*4882a593SmuzhiyunFILES:${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so" 100*4882a593SmuzhiyunFILES:${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so" 101*4882a593SmuzhiyunFILES:${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so" 102*4882a593SmuzhiyunFILES:${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so" 103*4882a593SmuzhiyunFILES:${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so" 104*4882a593SmuzhiyunFILES:${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so" 105*4882a593SmuzhiyunFILES:${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so" 106*4882a593SmuzhiyunFILES:${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so" 107*4882a593SmuzhiyunFILES:${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so" 108*4882a593SmuzhiyunFILES:${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so" 109*4882a593SmuzhiyunFILES:${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so" 110*4882a593SmuzhiyunFILES:${PN}-module-exa = "${libdir}/xorg/modules/libexa.so" 111*4882a593SmuzhiyunFILES:${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so" 112*4882a593SmuzhiyunFILES:${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so" 113*4882a593SmuzhiyunFILES:${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so" 114*4882a593SmuzhiyunFILES:xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so" 115*4882a593Smuzhiyun 116*4882a593SmuzhiyunEXTRA_OEMESON += " \ 117*4882a593Smuzhiyun -Dxnest=false \ 118*4882a593Smuzhiyun -Dxvfb=true \ 119*4882a593Smuzhiyun -Ddtrace=false \ 120*4882a593Smuzhiyun -Dint10=x86emu \ 121*4882a593Smuzhiyun -Dxkb_output_dir=/var/lib/xkb \ 122*4882a593Smuzhiyun" 123*4882a593Smuzhiyun 124*4882a593SmuzhiyunOPENGL_PKGCONFIGS = "dri glx glamor dri3" 125*4882a593SmuzhiyunPACKAGECONFIG ??= "dga dri2 udev ${XORG_CRYPTO} \ 126*4882a593Smuzhiyun ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \ 127*4882a593Smuzhiyun ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-logind', '', d)} \ 128*4882a593Smuzhiyun" 129*4882a593Smuzhiyun 130*4882a593SmuzhiyunPACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev" 131*4882a593SmuzhiyunPACKAGECONFIG[dga] = "-Ddga=true,-Ddga=false" 132*4882a593SmuzhiyunPACKAGECONFIG[dri] = "-Ddri1=true,-Ddri1=false,virtual/mesa" 133*4882a593SmuzhiyunPACKAGECONFIG[dri2] = "-Ddri2=true,-Ddri2=false" 134*4882a593SmuzhiyunPACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false" 135*4882a593SmuzhiyunPACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11" 136*4882a593SmuzhiyunPACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl" 137*4882a593SmuzhiyunPACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" 138*4882a593SmuzhiyunPACKAGECONFIG[systemd-logind] = "-Dsystemd_logind=true,-Dsystemd_logind=false,dbus," 139*4882a593SmuzhiyunPACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false" 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun# Xorg requires a SHA1 implementation, pick one 142*4882a593SmuzhiyunXORG_CRYPTO ??= "openssl" 143*4882a593SmuzhiyunPACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl" 144*4882a593SmuzhiyunPACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle" 145*4882a593SmuzhiyunPACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt" 146*4882a593Smuzhiyun 147*4882a593Smuzhiyundo_install:append () { 148*4882a593Smuzhiyun sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5 149*4882a593Smuzhiyun} 150*4882a593Smuzhiyun 151*4882a593Smuzhiyun# Add runtime provides for the ABI versions of the video and input subsystems, 152*4882a593Smuzhiyun# so that drivers can depend on the relevant version. 153*4882a593Smuzhiyunpython populate_packages:prepend() { 154*4882a593Smuzhiyun import subprocess 155*4882a593Smuzhiyun 156*4882a593Smuzhiyun # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going 157*4882a593Smuzhiyun # into the new package, not the staged ones. 158*4882a593Smuzhiyun newenv = dict(os.environ) 159*4882a593Smuzhiyun newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/") 160*4882a593Smuzhiyun 161*4882a593Smuzhiyun def get_abi(name): 162*4882a593Smuzhiyun abis = { 163*4882a593Smuzhiyun "video": "abi_videodrv", 164*4882a593Smuzhiyun "input": "abi_xinput" 165*4882a593Smuzhiyun } 166*4882a593Smuzhiyun p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name], 167*4882a593Smuzhiyun shell=True, env=newenv, stdout=subprocess.PIPE) 168*4882a593Smuzhiyun stdout, stderr = p.communicate() 169*4882a593Smuzhiyun output = stdout.decode("utf-8").split(".")[0] 170*4882a593Smuzhiyun mlprefix = d.getVar('MLPREFIX') or '' 171*4882a593Smuzhiyun return "%sxorg-abi-%s-%s" % (mlprefix, name, output) 172*4882a593Smuzhiyun 173*4882a593Smuzhiyun pn = d.getVar("PN") 174*4882a593Smuzhiyun d.appendVar("RPROVIDES:" + pn, " " + get_abi("input")) 175*4882a593Smuzhiyun d.appendVar("RPROVIDES:" + pn, " " + get_abi("video")) 176*4882a593Smuzhiyun} 177