-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_dependencies.py
More file actions
196 lines (175 loc) · 5.97 KB
/
Copy pathinstall_dependencies.py
File metadata and controls
196 lines (175 loc) · 5.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/usr/bin/env python3
import subprocess
import sys
import os
def detect_distro():
try:
with open('/etc/os-release', 'r') as f:
os_release = f.read().lower()
if 'ubuntu' in os_release or 'debian' in os_release:
return 'ubuntu'
elif 'fedora' in os_release:
return 'fedora'
elif 'arch' in os_release or 'manjaro' in os_release:
return 'arch'
except FileNotFoundError:
pass
print("Error: Could not detect distribution. Supported: Ubuntu, Fedora, Arch Linux")
sys.exit(1)
def run_command(cmd, use_sudo=True):
if use_sudo and os.geteuid() != 0:
cmd = ['sudo'] + cmd
print(f"Running: {' '. join(cmd)}")
try:
subprocess.run(cmd, check=True)
return True
except subprocess.CalledProcessError as e:
print(f"Error running command: {e}")
return False
def install_ubuntu():
print("Installing dependencies for Ubuntu/Debian...")
packages = [
'build-essential',
'meson',
'ninja-build',
'pkg-config',
'valac',
'libglib2.0-dev',
'libgee-0.8-dev',
'libjson-glib-dev',
'libwayland-dev',
'libgtk-4-dev',
'libadwaita-1-dev',
'libgtk4-layer-shell-dev',
# lumen-settings' Wayfire plugin pages parse the metadata XML.
'libxml2-dev',
'wayfire',
# C++ Wayfire plugins: headers + wlroots, plus glm which the Wayfire
# headers #include but wayfire.pc does not list.
'wayfire-dev',
'libwlroots-dev',
'libglm-dev',
'xdg-desktop-portal',
'xdg-desktop-portal-gtk',
'xdg-desktop-portal-wlr',
# lumen-lockscreen: PAM (build) + keyring/accounts (runtime).
# gtk4-session-lock is NOT in Debian/Ubuntu repos — build from source
# (https://github.com/wmww/gtk4-session-lock); the lockscreen is
# auto-skipped by meson until it is present.
'libpam0g-dev',
'gnome-keyring',
'accountsservice',
# lumen-polkit-agent: PolicyKit authentication agent (build-time .pc +
# headers). Runtime libs are pulled in by the base system.
'libpolkit-agent-1-dev',
'libpolkit-gobject-1-dev',
]
cmd = ['apt-get', 'install', '-y'] + packages
return run_command(cmd)
def install_fedora():
print("Installing dependencies for Fedora...")
packages = [
'gcc',
'gcc-c++',
'make',
'meson',
'ninja-build',
'pkgconfig',
'vala',
'glib2-devel',
'libgee-devel',
'json-glib-devel',
'wayland-devel',
'gtk4-devel',
'libadwaita-devel',
'gtk4-layer-shell-devel',
# lumen-settings' Wayfire plugin pages parse the metadata XML.
'libxml2-devel',
'wayfire',
# C++ Wayfire plugins: headers + wlroots, plus glm which the Wayfire
# headers #include but wayfire.pc does not list.
'wayfire-devel',
'wlroots-devel',
'glm-devel',
'xdg-desktop-portal',
'xdg-desktop-portal-gtk',
'xdg-desktop-portal-wlr',
# lumen-lockscreen: PAM (build) + keyring/accounts (runtime).
# gtk4-session-lock is NOT in Fedora repos — build from source
# (https://github.com/wmww/gtk4-session-lock); the lockscreen is
# auto-skipped by meson until it is present.
'pam-devel',
'gnome-keyring',
'accountsservice',
# lumen-polkit-agent: PolicyKit authentication agent build-time deps
# (polkit-agent-1.pc / polkit-gobject-1.pc + headers). The Vala bindings
# ship with vala; the runtime libs come with the base polkit package.
'polkit-devel',
]
cmd = ['dnf', 'install', '-y'] + packages
return run_command(cmd)
def install_arch():
print("Installing dependencies for Arch Linux...")
packages = [
'base-devel',
'meson',
'ninja',
'pkgconf',
'vala',
'glib2',
'libgee',
'json-glib',
'wayland',
'gtk4',
'libadwaita',
'gtk4-layer-shell',
# lumen-settings' Wayfire plugin pages parse the metadata XML.
'libxml2',
# Arch's `wayfire` ships the headers; the C++ plugins also need wlroots
# and glm (the Wayfire headers #include glm but wayfire.pc omits it).
'wayfire',
'wlroots0.19',
'glm',
'xdg-desktop-portal',
'xdg-desktop-portal-gtk',
'xdg-desktop-portal-wlr',
# lumen-lockscreen: PAM (build) + keyring/accounts (runtime).
# gtk4-session-lock is in the AUR (gtk4-session-lock) — install with an
# AUR helper; the lockscreen is auto-skipped by meson until it is present.
'pam',
'gnome-keyring',
'accountsservice',
# lumen-polkit-agent: PolicyKit authentication agent. Arch's `polkit`
# ships both the runtime libs and the development .pc/headers.
'polkit',
]
cmd = ['pacman', '-S', '--needed', '--noconfirm'] + packages
return run_command(cmd)
def main():
print("Lumen Dependency Installation Script")
print("=" * 50)
if os.geteuid() != 0:
print("Note: This script will use 'sudo' to install packages.")
print("You may be prompted for your password.")
print()
distro = detect_distro()
print(f"Detected distribution: {distro. capitalize()}")
print()
success = False
if distro == 'ubuntu':
success = install_ubuntu()
elif distro == 'fedora':
success = install_fedora()
elif distro == 'arch':
success = install_arch()
# Print result
print()
print("=" * 50)
if success:
print("✓ All dependencies installed successfully!")
else:
print("✗ Failed to install some dependencies.")
print("Please check the error messages above.")
sys.exit(1)
if __name__ == '__main__':
main()