Skip to content

Commit 00be2a5

Browse files
authored
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
1 parent c6ba839 commit 00be2a5

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

auto-cpufreq-installer

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,19 @@ function tool_install {
7676
header "Setting up Python environment"
7777
}
7878

79-
if [ -f /etc/debian_version ]; then
80-
detected_distro "Debian based"
81-
apt install python3-dev python3-pip python3-venv python3-setuptools dmidecode libgirepository1.0-dev libcairo2-dev libgtk-3-dev gcc -y
79+
if [ -f /etc/debian_version ]; then
80+
VERSION=$(cat /etc/debian_version)
81+
# VERSION="CSCS"
82+
if [[ "$VERSION" =~ ^12(\.[0-9]+)?$ || ("$VERSION" =~ ^[0-9]+$ && "$VERSION" -lt 12) ]]; then
83+
LIB_GI_REPO="libgirepository1.0-dev"
84+
else
85+
LIB_GI_REPO="libgirepository-2.0-dev"
86+
fi
87+
88+
echo $LIB_GI_REPO needs to be installed for version $VERSION
89+
echo '---- '
90+
apt install -y python3-dev python3-pip python3-venv python3-setuptools dmidecode \
91+
"$LIB_GI_REPO" libcairo2-dev libgtk-3-dev gcc
8292

8393
elif [ -f /etc/redhat-release ]; then
8494
detected_distro "RedHat based"
@@ -132,6 +142,17 @@ elif [ -f /etc/os-release ];then
132142
source "$venv_dir/bin/activate"
133143
python3 -m pip install --upgrade pip wheel
134144

145+
146+
# debian specific PyGObject Installation
147+
if [ -f /etc/debian_version ]; then
148+
VERSION=$(cat /etc/debian_version | cut -d'.' -f1)
149+
150+
if [[ "$VERSION" =~ ^12(\.[0-9]+)?$ ]]; then
151+
python3 -m pip install PyGObject==3.50.0
152+
fi
153+
fi
154+
python3 -m pip install PyGObject
155+
135156
header "Installing auto-cpufreq tool"
136157

137158
git config --global --add safe.directory $(pwd)

0 commit comments

Comments
 (0)