-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (33 loc) · 1.45 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
SEARXNG:=searxng/dist/searxng-$(shell cd searxng && python -c 'from searx import version; print(version.VERSION_TAG)')-py3-none-any.whl
LOCALES:=$(patsubst %.po,%.mo,$(wildcard locales/*/LC_MESSAGES/*.po))
.PHONY: build
build: $(LOCALES) static/style.css static/htmx.min.js env domains.txt
.PHONY: run
run: build
env/bin/uvicorn searchengine:app --reload
.PHONY: test
test: env/dev build
env/bin/python -m pytest tests
.PHONY: extract-locales
extract-locales: env
env/bin/pybabel extract -F locales/babel.cfg -o locales/messages.pot .
.PHONY: update-locales
update-locales: env
env/bin/pybabel update -d locales -i locales/messages.pot
$(LOCALES)&: $(patsubst %.mo,%.po,$(LOCALES)) | env
env/bin/pybabel compile -d locales
static/%.css: scss/%.scss scss/*.scss
sass -s compressed $<:$@
static/htmx.min.js:
wget https://unpkg.com/[email protected]/dist/htmx.min.js -O static/htmx.min.js
env: requirements.txt $(SEARXNG)
rm -rf env
python -m venv env || (rm -r env && false)
env/bin/pip install $(patsubst %.txt,-r %.txt,$^) || (rm -r env && false)
env/dev: dev-requirements.txt env
env/bin/pip install -r dev-requirements.txt || (rm -r env && false)
touch env/dev
$(SEARXNG):
cd searxng && ./manage py.build
domains.txt:
(wget -O- https://raw.githubusercontent.com/rimu/no-qanon/master/domains.txt && wget -O- https://raw.githubusercontent.com/quenhus/uBlock-Origin-dev-filter/main/dist/other_format/domains/global.txt) > domains.txt || (rm domains.txt && false)