Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (55 loc) · 1.99 KB
/
Copy pathMakefile
File metadata and controls
78 lines (55 loc) · 1.99 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
PYTHON = python3
VENV = . .venv/bin/activate
prefix = /usr
datadir = $(prefix)/share
fontsdir = $(datadir)/fonts
sysconfdir = /etc
TARBALL = xfonts-terminus_4.48.orig.tar.gz
TARBALL_URI = http://ftp.cz.debian.org/debian/pool/main/x/xfonts-terminus/$(TARBALL)
TARBALL_DIR = xfonts-terminus-4.48.orig
SIZES = 12 14 16 18 20 22 24 28 32
ORIG_REGULAR = $(patsubst %, orig/ter-u%n.bdf, $(SIZES))
ORIG_BOLD = $(patsubst %, orig/ter-u%b.bdf, $(SIZES))
ORIG_FONTS = $(ORIG_REGULAR) $(ORIG_BOLD)
FONTS_REGULAR = $(patsubst %, ter-u%n.bdf, $(SIZES))
FONTS_BOLD = $(patsubst %, ter-u%b.bdf, $(SIZES))
GLYPHS = $(shell find glyph -name '*.png')
all: .venv ter-iast-regular.otb ter-iast-bold.otb
%.bdf: $(GLYPHS) $(ORIG_FONTS)
$(VENV); PYTHONPATH=$(shell pwd) $(PYTHON) bin/generate.py
%.png:
$(VENV); PYTHONPATH=$(shell pwd) $(PYTHON) bin/dump.py $*
$(TARBALL):
$(QUIET_GET) wget $(TARBALL_URI) -qO$@
$(ORIG_FONTS): $(TARBALL)
@mkdir -p orig
$(QUIET_UNTAR) tar --xform="s/$(TARBALL_DIR)/orig/" \
-xf $(TARBALL) $(TARBALL_DIR)/$(notdir $@) && touch $@
ter-iast-regular.otb: $(FONTS_REGULAR)
$(QUIET_GEN) fontforge -quiet -lang=ff -script fontmerge.ff $@ $^ 2>/dev/null
ter-iast-bold.otb: $(FONTS_BOLD)
$(QUIET_GEN) fontforge -quiet -lang=ff -script fontmerge.ff $@ $^ 2>/dev/null
.venv:
$(PYTHON) -m venv .venv
$(VENV); pip install -r requirements.txt
check: test mypy
mypy:
PYTHONPATH=$(shell pwd) mypy --strict .
test: .venv
$(VENV); PYTHONPATH=$(shell pwd) $(PYTHON) -m unittest discover -s tests
install:
install -m 0755 -d $(fontsdir)/opentype/terminus-iast $(sysconfdir)/fonts/conf.d
install -m 0644 *.otb $(fontsdir)/opentype/terminus-iast
install -m 0644 50-enable-terminus-iast.conf $(sysconfdir)/fonts/conf.d
uninstall:
$(RM) -r $(fontsdir)/opentype/terminus-iast
enable:
fc-cache -fv
clean:
$(RM) -r .venv */__pycache__ .mypy_cache orig
$(RM) $(TARBALL) *.bdf *.png *.otb
ifndef V
QUIET_GEN = @echo " GEN $@";
QUIET_GET = @echo " GET $@";
QUIET_UNTAR = @echo " UNTAR $@";
endif