-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (63 loc) · 3.02 KB
/
Copy pathMakefile
File metadata and controls
77 lines (63 loc) · 3.02 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
# =============================================================================
# Agility Shell -- Root Makefile
# =============================================================================
PREFIX ?= /usr
DESTDIR ?=
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/agility-shell
LIBDIR = $(PREFIX)/lib/agility-shell
SYSTEMDDIR = $(PREFIX)/lib/systemd/user
APPLICATIONSDIR = $(PREFIX)/share/applications
PYTHON ?= python3
.PHONY: all clean install install-venv uninstall
all:
@echo "==> Compiling native snippet libraries..."
$(MAKE) -C snippets/blur/lib
$(MAKE) -C snippets/hacktk/lib
@echo "==> Build complete."
clean:
@echo "==> Cleaning snippet build artifacts..."
-$(MAKE) -C snippets/blur/lib clean
-$(MAKE) -C snippets/hacktk/lib clean
rm -rf __pycache__ */__pycache__ */*/__pycache__
install: all
@echo "==> Installing Agility Shell system-wide (PREFIX=$(PREFIX))..."
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(DATADIR)
mkdir -p $(DESTDIR)$(LIBDIR)
mkdir -p $(DESTDIR)$(SYSTEMDDIR)
mkdir -p $(DESTDIR)$(APPLICATIONSDIR)
# Install CLI and launcher binaries
install -m 755 agility-shell $(DESTDIR)$(BINDIR)/agility-shell
install -m 755 bin/agl $(DESTDIR)$(BINDIR)/agl
# Install compiled shared native libraries
install -m 755 snippets/blur/lib/libblur.so $(DESTDIR)$(LIBDIR)/libblur.so
install -m 755 snippets/hacktk/lib/libhacktk.so $(DESTDIR)$(LIBDIR)/libhacktk.so
# Install systemd user service unit
install -m 644 systemd/agility-shell.service $(DESTDIR)$(SYSTEMDDIR)/agility-shell.service
# Install desktop entry
install -m 644 agility-shell.desktop $(DESTDIR)$(APPLICATIONSDIR)/agility-shell.desktop
# Install application files and assets
cp -r main.py bar.py lockscreen.py plugin_loader.py user_options.py requirements.txt $(DESTDIR)$(DATADIR)/
cp -r bar_widgets desktop_applets windows services utils style themes config wallpapers icons svgs sounds snippets quickshell scripts $(DESTDIR)$(DATADIR)/
# Clean potential build leftovers in target directory
find $(DESTDIR)$(DATADIR) -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
find $(DESTDIR)$(DATADIR) -name "*.pyc" -delete 2>/dev/null || true
@echo "==> Installation to $(DESTDIR)$(PREFIX) complete."
install-venv:
@echo "==> Provisioning dedicated runtime virtualenv in $(DESTDIR)$(LIBDIR)/venv..."
mkdir -p $(DESTDIR)$(LIBDIR)
$(PYTHON) -m venv --system-site-packages $(DESTDIR)$(LIBDIR)/venv
$(DESTDIR)$(LIBDIR)/venv/bin/pip install --upgrade pip -q
$(DESTDIR)$(LIBDIR)/venv/bin/pip install --no-deps "fabric @ git+https://github.com/Fabric-Development/fabric.git" -q
$(DESTDIR)$(LIBDIR)/venv/bin/pip install -r requirements.txt -q
@echo "==> Virtual environment provisioned successfully."
uninstall:
@echo "==> Uninstalling Agility Shell from $(DESTDIR)$(PREFIX)..."
rm -f $(DESTDIR)$(BINDIR)/agility-shell
rm -f $(DESTDIR)$(BINDIR)/agl
rm -f $(DESTDIR)$(SYSTEMDDIR)/agility-shell.service
rm -f $(DESTDIR)$(APPLICATIONSDIR)/agility-shell.desktop
rm -rf $(DESTDIR)$(DATADIR)
rm -rf $(DESTDIR)$(LIBDIR)
@echo "==> Uninstall complete."