diff options
Diffstat (limited to 'meta/recipes-graphics/xorg-xserver')
-rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-abi.inc | 48 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-xorg.inc | 32 |
2 files changed, 54 insertions, 26 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-abi.inc b/meta/recipes-graphics/xorg-xserver/xserver-abi.inc new file mode 100644 index 0000000000..9731185649 --- /dev/null +++ b/meta/recipes-graphics/xorg-xserver/xserver-abi.inc | |||
@@ -0,0 +1,48 @@ | |||
1 | # Add runtime provides for the ABI versions, so that drivers can depend on the | ||
2 | # relevant version. This should be called from PACKAGEFUNCS. | ||
3 | python add_xorg_abi_provides() { | ||
4 | import subprocess | ||
5 | |||
6 | pn = d.getVar("PN") | ||
7 | mlprefix = d.getVar("MLPREFIX") or "" | ||
8 | |||
9 | # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going | ||
10 | # into the new package, not the staged ones. | ||
11 | newenv = dict(os.environ) | ||
12 | newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/:") + newenv["PKG_CONFIG_PATH"] | ||
13 | |||
14 | # Get the list of ABIs that the pc file declares | ||
15 | cmd = ("pkg-config", "--print-variables", "xorg-server") | ||
16 | output = subprocess.run(cmd, check=True, capture_output=True, text=True, env=newenv).stdout | ||
17 | abis = [var for var in output.splitlines() if var.startswith("abi_")] | ||
18 | |||
19 | # Set RPROVIDES for those ABIs with the major version | ||
20 | for abi in abis: | ||
21 | cmd = ("pkg-config", "--variable", abi, "xorg-server") | ||
22 | version = subprocess.run(cmd, check=True, capture_output=True, text=True, env=newenv).stdout | ||
23 | major = version.split(".")[0] | ||
24 | |||
25 | provides = " %sxorg-%s-%s" % (mlprefix, abi.replace("_", "-"), major) | ||
26 | d.appendVar("RPROVIDES:" + pn, provides) | ||
27 | } | ||
28 | |||
29 | # Add the specified ABI dependency to the specified package. | ||
30 | # If package is not set then PN is used. | ||
31 | # This should be called via a shim function in PACKAGEFUNCS. | ||
32 | def _add_xorg_abi_depends(d, abi, package=None): | ||
33 | import subprocess | ||
34 | |||
35 | if not package: | ||
36 | package = d.getVar("PN") | ||
37 | |||
38 | # Set PKG_CONFIG_PATH to cater for the case where xserver is | ||
39 | # itself providing drivers. | ||
40 | newenv = dict(os.environ) | ||
41 | newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/:") + newenv["PKG_CONFIG_PATH"] | ||
42 | |||
43 | mlprefix = d.getVar("MLPREFIX") or "" | ||
44 | cmd = ("pkg-config", "xorg-server", "--variable=abi_%s" % abi) | ||
45 | output = subprocess.run(cmd, text=True, capture_output=True, check=True, env=newenv).stdout | ||
46 | abi = "%sxorg-abi-%s-%s" % (mlprefix, abi, output.split(".")[0]) | ||
47 | |||
48 | d.appendVar('RDEPENDS:' + package, ' ' + abi) | ||
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc index e2754426cf..3eb0de7b35 100644 --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc | |||
@@ -79,7 +79,6 @@ PACKAGES =+ "${PN}-sdl \ | |||
79 | xf86-video-modesetting" | 79 | xf86-video-modesetting" |
80 | 80 | ||
81 | SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver" | 81 | SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver" |
82 | INSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi" | ||
83 | 82 | ||
84 | XSERVER_RDEPENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput" | 83 | XSERVER_RDEPENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput" |
85 | RDEPENDS:${PN} += "${XSERVER_RDEPENDS}" | 84 | RDEPENDS:${PN} += "${XSERVER_RDEPENDS}" |
@@ -149,31 +148,12 @@ do_install:append () { | |||
149 | sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5 | 148 | sed -i -e 's,${libdir}/xorg/modules,${prefix}/lib*/xorg/modules,' ${D}${mandir}/man5/xorg.conf.5 |
150 | } | 149 | } |
151 | 150 | ||
152 | # Add runtime provides for the ABI versions of the video and input subsystems, | 151 | require xserver-abi.inc |
153 | # so that drivers can depend on the relevant version. | 152 | |
154 | python populate_packages:prepend() { | 153 | python add_xorg_abi_depends() { |
155 | import subprocess | 154 | _add_xorg_abi_depends(d, "videodrv", d.expand("${MLPREFIX}xf86-video-modesetting")) |
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) | ||
169 | stdout, stderr = p.communicate() | ||
170 | output = stdout.decode("utf-8").split(".")[0] | ||
171 | mlprefix = d.getVar('MLPREFIX') or '' | ||
172 | return "%sxorg-abi-%s-%s" % (mlprefix, name, output) | ||
173 | |||
174 | pn = d.getVar("PN") | ||
175 | d.appendVar("RPROVIDES:" + pn, " " + get_abi("input")) | ||
176 | d.appendVar("RPROVIDES:" + pn, " " + get_abi("video")) | ||
177 | } | 155 | } |
178 | 156 | ||
157 | PACKAGEFUNCS =+ "add_xorg_abi_provides add_xorg_abi_depends" | ||
158 | |||
179 | CVE_STATUS[CVE-2023-5574] = "${@bb.utils.contains('PACKAGECONFIG', 'xvfb', 'unpatched', 'not-applicable-config: specific to Xvfb', d)}" | 159 | CVE_STATUS[CVE-2023-5574] = "${@bb.utils.contains('PACKAGECONFIG', 'xvfb', 'unpatched', 'not-applicable-config: specific to Xvfb', d)}" |