-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
83 lines (68 loc) · 2.04 KB
/
Makefile
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
PREFIX = /usr/local
DESTDIR =
HOME-DESTDIR = $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
UUID = [email protected]
DIST-EXTRA-SRC = LICENSE-GPL2 LICENSE-MPL2
BLUEPRINTS = $(wildcard ui/*.blp)
UIDEFS = $(addsuffix .ui,$(basename $(BLUEPRINTS)))
.PHONY: dist
dist: compile
mkdir -p ./dist/
mkdir -p ./build/ui
cp -t ./build/ui $(UIDEFS)
pnpm dist:format
gnome-extensions pack --force --out-dir dist build \
--extra-source=../metadata.json \
--extra-source=ui --extra-source=lib \
$(addprefix --extra-source=../,$(DIST-EXTRA-SRC)) \
$(addprefix --schema=../,$(wildcard schemas/*.gschema.xml))
# Make a reproducible dist package
.PHONY: dist-repro
dist-repro: dist
strip-nondeterminism dist/$(UUID).shell-extension.zip
# Install to local home directory; this simply unpacks the zip file as GNOME would do
.PHONY: install-home
install-home: dist
mkdir -p $(HOME-DESTDIR)
gnome-extensions install -f dist/$(UUID).shell-extension.zip
.PHONY: uninstall-home
uninstall-home:
rm -rf $(HOME-DESTDIR)
# Install as a system-wide installation schema, into a separate directory
# Intended for distribution packaging
.PHONY: install-package
install-package: dist
install -d \
$(DESTDIR)/$(PREFIX)/share/gnome-shell/extensions/$(UUID) \
$(DESTDIR)/$(PREFIX)/share/glib-2.0/
bsdtar -xf dist/$(UUID).shell-extension.zip \
-C $(DESTDIR)/$(PREFIX)/share/gnome-shell/extensions/$(UUID) --no-same-owner
mv -T --no-clobber \
$(DESTDIR)/$(PREFIX)/share/gnome-shell/extensions/$(UUID)/schemas \
$(DESTDIR)/$(PREFIX)/share/glib-2.0/schemas
mv -T --no-clobber \
$(DESTDIR)/$(PREFIX)/share/gnome-shell/extensions/$(UUID)/locale \
$(DESTDIR)/$(PREFIX)/share/locale
.PHONY: compile
compile: $(UIDEFS)
pnpm compile
.PHONY: clean
clean:
rm -rf ./dist/ ./build/
.PHONY: format
format:
pnpm format --write
.PHONY: lint
lint:
pnpm lint
.PHONY: check-types
check-types:
pnpm check:types
.PHONY: check
check: lint check-types
pnpm format --check
.PHONY: fix
fix: format
pnpm lint --fix
$(UIDEFS): %.ui: %.blp
blueprint-compiler compile --output $@ $<