-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (80 loc) · 2.67 KB
/
Makefile
File metadata and controls
103 lines (80 loc) · 2.67 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
NAME = flickernaut
UUID = $(NAME)@imoize.github.io
BLP_FILES := $(shell find resources/ui -name '*.blp')
UI_FILES := $(patsubst resources/ui/%.blp,src/ui/%.ui,$(BLP_FILES))
UI_SRC := $(shell find src/ui -name '*.ui')
UI_DST := $(patsubst src/ui/%,dist/ui/%,$(UI_SRC))
.PHONY: all build build-ui pot pot-merge mo pack install test test-py test-shell remove clean
all: pack
node_modules: package.json
npm install
build: node_modules
npx tsc
@$(MAKE) build-ui
build-ui: $(UI_FILES)
$(UI_FILES): src/ui/%.ui: resources/ui/%.blp
@mkdir -p $(dir $@)
@echo "Compiling Blueprint: $< → $@"
@blueprint-compiler compile $< --output $@
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.${NAME}.gschema.xml
glib-compile-schemas schemas
copy-ui: $(UI_DST)
$(UI_DST): dist/ui/%: src/ui/%
@mkdir -p $(dir $@)
@cp $< $@
pot:
@echo "Generating POT file for translations..."
@xgettext --from-code=UTF-8 \
--package-name=$(UUID) \
--output=po/${UUID}.pot \
src/ui/**/*.ui
@xgettext --from-code=UTF-8 \
--package-name=$(UUID) \
--output=po/${UUID}.pot \
--join-existing \
nautilus-extension/**/*.py
@xgettext --from-code=UTF-8 \
--package-name=$(UUID) \
--output=po/${UUID}.pot \
--language=JavaScript \
--join-existing \
$(shell find src -name '*.ts')
pot-merge:
@echo "Merging translations into existing PO files..."
@for file in po/*.po; do \
msgmerge -q -U --backup=off $$file po/${UUID}.pot; \
done;
mo:
@echo "Compiling PO files into MO files..."
@for file in po/*.po; do \
locale=$$(basename $$file .po); \
dir="dist/locale/$$locale/LC_MESSAGES"; \
mkdir -p $$dir; \
msgfmt -o $$dir/${UUID}.mo $$file; \
done;
pack: build schemas/gschemas.compiled copy-ui mo
@cp metadata.json dist/
@cp -r schemas dist/
@cp -r nautilus-extension/* dist/
@cp -r resources/ui/icons dist/ui/
@(cd dist && zip ../$(UUID).shell-extension.zip -9r .)
install: pack
gnome-extensions install -f $(UUID).shell-extension.zip
test: pack
@rm -rf $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
@cp -r dist $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
gnome-extensions prefs $(UUID)
test-py:
@rm -rf $(HOME)/.local/share/gnome-shell/extensions/$(UUID)/Flickernaut
@rm -rf $(HOME)/.local/share/gnome-shell/extensions/$(UUID)/nautilus-flickernaut.py
@cp -r nautilus-extension/* $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
test-shell:
@env GNOME_SHELL_SLOWDOWN_FACTOR=2 \
MUTTER_DEBUG_DUMMY_MODE_SPECS=1500x1000 \
MUTTER_DEBUG_DUMMY_MONITOR_SCALES=1 \
dbus-run-session -- gnome-shell --nested --wayland
remove:
@rm -rf $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
clean:
@rm -rf dist $(UUID).shell-extension.zip
@rm -rf schemas/gschemas.compiled