From 718fde54d22e1bf486cd56463866a70cd1d18429 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 13 Feb 2024 22:00:32 -0600 Subject: [PATCH] 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. --- src/meson.build | 17 ++++------------- src/{powerprofilesctl.in => powerprofilesctl} | 4 +--- 2 files changed, 5 insertions(+), 16 deletions(-) rename src/{powerprofilesctl.in => powerprofilesctl} (99%) diff --git a/src/meson.build b/src/meson.build index ee17d8f..49a5fa4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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, diff --git a/src/powerprofilesctl.in b/src/powerprofilesctl similarity index 99% rename from src/powerprofilesctl.in rename to src/powerprofilesctl index a4ecc99..7eb86f8 100755 --- a/src/powerprofilesctl.in +++ b/src/powerprofilesctl @@ -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"