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

Fix getting python install path #953

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,18 @@ endif
dependency('glib-2.0')
dependency('libadwaita-1', version: '>= 1.5.0')

# from https://github.com/AsavarTzeth/pulseeffects/blob/master/meson.build
# Support Debian non-standard python paths
# Fallback to Meson python module if command fails
# Get Python installation paths
message('Getting python install path')
py3_purelib = ''
r = run_command(
python_bin.full_path(),
'-c',
'from distutils.sysconfig import get_python_lib; print(get_python_lib(prefix=""))',
check: false,
)
py3_purelib = python_bin.get_path('purelib')
py3_stdlib = python_bin.get_path('stdlib')

if r.returncode() != 0
py3_purelib = python_bin.get_path('purelib')
if not py3_purelib.endswith('site-packages')
error('Cannot find python install path')
endif
python_dir = py3_purelib
else
python_dir = r.stdout().strip()
# Validate and use paths
if not py3_purelib.endswith('site-packages')
error('Cannot find python install path')
endif

python_dir = py3_purelib

# Python 3 required modules
python3_required_modules = ['distro', 'peewee', 'mutagen', 'gi']

Expand Down