Don't modify powerprofilesctl at build time

Python version and binary used at build time might not be the same
as the installed OS.  Instead reference python3 from environment.
This commit is contained in:
Mario Limonciello 2024-02-13 22:00:32 -06:00
parent c750f7e791
commit 718fde54d2
2 changed files with 5 additions and 16 deletions

View file

@ -98,20 +98,11 @@ executable('power-profiles-daemon',
install_dir: libexecdir
)
python = import('python')
py_installation = python.find_installation('python3', required: true)
ppd_conf = configuration_data()
ppd_conf.set('VERSION', meson.project_version())
ppd_conf.set('PYTHON3', py_installation.full_path())
script = configure_file(
input: 'powerprofilesctl.in',
output: 'powerprofilesctl',
configuration: ppd_conf,
install_dir: get_option('bindir')
script = 'powerprofilesctl'
install_data(script,
install_dir: get_option('bindir')
)
script = join_paths(meson.current_source_dir(), script)
if get_option('pylint')
test('pylint-powerprofilesctl',
pylint,

View file

@ -1,12 +1,10 @@
#!@PYTHON3@
#!/usr/bin/env python3
import signal
import subprocess
import sys
from gi.repository import Gio, GLib
VERSION = "@VERSION@"
PP_NAME = "org.freedesktop.UPower.PowerProfiles"
PP_PATH = "/org/freedesktop/UPower/PowerProfiles"
PP_IFACE = "org.freedesktop.UPower.PowerProfiles"