mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
meson: Support for both packaging and distutils
distutils was deprecated and is now gone on modern systems.
so the default behavior is to use the supported thing, which is packaging.version, and when on an old system, fallback to the old distutils.version.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9943
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26746>
(cherry picked from commit 670a799ebf)
This commit is contained in:
parent
0b44ec8648
commit
92cdf6cb5f
2 changed files with 6 additions and 3 deletions
|
|
@ -2464,7 +2464,7 @@
|
|||
"description": "meson: Support for both packaging and distutils",
|
||||
"nominated": false,
|
||||
"nomination_type": 3,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -886,9 +886,12 @@ prog_python = import('python').find_installation('python3')
|
|||
has_mako = run_command(
|
||||
prog_python, '-c',
|
||||
'''
|
||||
from distutils.version import StrictVersion
|
||||
try:
|
||||
from packaging.version import Version
|
||||
except:
|
||||
from distutils.version import StrictVersion as Version
|
||||
import mako
|
||||
assert StrictVersion(mako.__version__) >= StrictVersion("0.8.0")
|
||||
assert Version(mako.__version__) >= Version("0.8.0")
|
||||
''', check: false)
|
||||
if has_mako.returncode() != 0
|
||||
error('Python (3.x) mako module >= 0.8.0 required to build mesa.')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue