From 00be2a5d91832519823990deb7b87af85fc78017 Mon Sep 17 00:00:00 2001 From: Aman Rawat Date: Sun, 30 Mar 2025 14:39:03 +0530 Subject: [PATCH] A Fix for GUI not launching in some cases and dependency management (#826) * proposing addition of libgirepository-2.0-dev and PyGObject for GUI not launching on Linux mint and similar distros * Update auto-cpufreq-installer * here are the proposed changes, please make changes necessary * rev of prescribed changes * rev * formatting --- auto-cpufreq-installer | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/auto-cpufreq-installer b/auto-cpufreq-installer index c41f1bb..5ccfa19 100755 --- a/auto-cpufreq-installer +++ b/auto-cpufreq-installer @@ -76,9 +76,19 @@ function tool_install { header "Setting up Python environment" } - if [ -f /etc/debian_version ]; then - detected_distro "Debian based" - apt install python3-dev python3-pip python3-venv python3-setuptools dmidecode libgirepository1.0-dev libcairo2-dev libgtk-3-dev gcc -y + if [ -f /etc/debian_version ]; then + VERSION=$(cat /etc/debian_version) + # VERSION="CSCS" + if [[ "$VERSION" =~ ^12(\.[0-9]+)?$ || ("$VERSION" =~ ^[0-9]+$ && "$VERSION" -lt 12) ]]; then + LIB_GI_REPO="libgirepository1.0-dev" + else + LIB_GI_REPO="libgirepository-2.0-dev" + fi + + echo $LIB_GI_REPO needs to be installed for version $VERSION + echo '---- ' + apt install -y python3-dev python3-pip python3-venv python3-setuptools dmidecode \ + "$LIB_GI_REPO" libcairo2-dev libgtk-3-dev gcc elif [ -f /etc/redhat-release ]; then detected_distro "RedHat based" @@ -132,6 +142,17 @@ elif [ -f /etc/os-release ];then source "$venv_dir/bin/activate" python3 -m pip install --upgrade pip wheel + + # debian specific PyGObject Installation + if [ -f /etc/debian_version ]; then + VERSION=$(cat /etc/debian_version | cut -d'.' -f1) + + if [[ "$VERSION" =~ ^12(\.[0-9]+)?$ ]]; then + python3 -m pip install PyGObject==3.50.0 + fi + fi + python3 -m pip install PyGObject + header "Installing auto-cpufreq tool" git config --global --add safe.directory $(pwd)