Skip to content

Commit 7b170e9

Browse files
committed
added installation scripts for inspector setup
1 parent 01a7d61 commit 7b170e9

2 files changed

Lines changed: 74 additions & 2 deletions

File tree

Framework/Built_In_Automation/Desktop/Linux/BuiltInFunctions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
from pyatspi.action import Action
1515
from pyatspi.editabletext import EditableText, Text
1616
except ImportError:
17-
install_missing_modules(["python3-pyatspi", "pygobject"])
17+
install_missing_modules(["python3-pyatspi==1.19.0", "pygobject==3.50.1"])
1818
try:
1919
import pyatspi
2020
from pyatspi.action import Action
2121
from pyatspi.editabletext import EditableText, Text
2222
except ImportError:
23-
sys.stderr.write("Error: pyatspi module is not installed. Please install it to use this script.\n")
23+
sys.stderr.write("Error: system dependency is not installed. Install them by running Installer/setup_linux_inspector.sh.\n")
2424
sys.exit(1)
2525

2626
from Framework.Utilities import CommonUtil

Installer/setup_linux_inspector.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# List of required packages for each package manager
6+
APT_PACKAGES=(
7+
build-essential
8+
cmake
9+
pkg-config
10+
libgirepository1.0-dev
11+
libcairo2-dev
12+
xdotool
13+
)
14+
15+
DNF_PACKAGES=(
16+
cmake
17+
pkgconf-pkg-config
18+
gobject-introspection-devel
19+
cairo-devel
20+
xdotool
21+
python3-devel
22+
cairo-gobject-devel
23+
)
24+
25+
PACMAN_PACKAGES=(
26+
gcc
27+
meson
28+
cmake
29+
pkgconf
30+
cairo
31+
xdotool
32+
gobject-introspection
33+
)
34+
35+
BREW_PACKAGES=(
36+
cmake
37+
pkg-config
38+
cairo
39+
xdotool
40+
gobject-introspection
41+
)
42+
43+
# Function to join array into space-separated string
44+
join_packages() {
45+
local IFS=" "
46+
echo "$*"
47+
}
48+
49+
# Detect and install using the available package manager
50+
if command -v apt >/dev/null 2>&1; then
51+
echo "Using APT (Debian/Ubuntu-based)"
52+
sudo apt update
53+
sudo apt install -y $(join_packages "${APT_PACKAGES[@]}")
54+
55+
elif command -v dnf >/dev/null 2>&1; then
56+
echo "Using DNF (Fedora-based)"
57+
sudo dnf install -y $(join_packages "${DNF_PACKAGES[@]}")
58+
59+
elif command -v pacman >/dev/null 2>&1; then
60+
echo "Using Pacman (Arch-based)"
61+
sudo pacman -Sy --noconfirm $(join_packages "${PACMAN_PACKAGES[@]}")
62+
63+
elif command -v brew >/dev/null 2>&1; then
64+
echo "Using Homebrew (macOS)"
65+
brew install $(join_packages "${BREW_PACKAGES[@]}")
66+
67+
else
68+
echo "❌ No supported package manager found (apt, dnf, pacman, brew)"
69+
exit 1
70+
fi
71+
72+
echo "✅ Installation complete."

0 commit comments

Comments
 (0)