Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python-packaging to mesa-asahi-edge's makedepends #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nosada
Copy link

@nosada nosada commented Jun 13, 2024

It seems makepkg fails on mesa-asahi-edge with the following error:

...
Program python3 found: YES (/usr/bin/python3)

mesa-asahi-20230904/meson.build:876:2: ERROR: Problem encountered: Python (3.x) mako module >= 0.8.0 required to build mesa.

https://gitlab.freedesktop.org/asahi/mesa/-/blob/asahi-20230904/meson.build?ref_type=tags#L867-L877 requires distutils, but newer Python (>= 3.12) doesn't have distutils due to PEP 632:

prog_python = import('python').find_installation('python3')
has_mako = run_command(
  prog_python, '-c',
  '''
from distutils.version import StrictVersion
import mako
assert StrictVersion(mako.__version__) >= StrictVersion("0.8.0")
  ''', check: false)
if has_mako.returncode() != 0
  error('Python (3.x) mako module >= 0.8.0 required to build mesa.')
endif

This can be fixed to use packaging (python-packaging in Arch) as PEP 632 says:

  • distutils.version — use the packaging package

@nosada nosada force-pushed the add-python-packaging-as-makedepends-on-mesa-asahi-edge branch from 85ce58c to 8646f0f Compare June 13, 2024 17:25
@nosada nosada force-pushed the add-python-packaging-as-makedepends-on-mesa-asahi-edge branch from 8646f0f to 76a9e06 Compare June 13, 2024 17:26
@mkurz
Copy link

mkurz commented Jun 13, 2024

The current mesa-asahi-edge package in the main branch is totally outdated. I recommend to use the updated package from

which ships with latest features including Opengl 4.6 support

@nosada
Copy link
Author

nosada commented Jun 13, 2024

Thank you for your comment, but the issue can reproduce in #42 (joske:mesa):

...
Program python3 found: YES (/usr/bin/python3)

mesa-asahi-20240527/meson.build:958:2: ERROR: Problem encountered: Python (3.x) mako module >= 0.8.0 required to build mesa.

meson.build has changed in L946 -- L959 at mesa-asahi-20240527 to use distutils or packaging like below:

prog_python = import('python').find_installation('python3')
has_mako = run_command(
  prog_python, '-c',
  '''
try:
  from packaging.version import Version
except:
  from distutils.version import StrictVersion as Version
import mako
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.')
endif

but packaging still be missed, that's why for reproducing, I think

I'll try to make PR to https://github.com/joske/PKGBUILDs/tree/mesa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants