From 23091864683390d49ca710373b205e89004ef065 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 2 Jun 2020 21:52:57 +0430 Subject: [PATCH] Move unicode tables update script to its own make file Also downloads things needed for unicode tables generators --- src/Makefile.am | 35 +------------------- src/update-unicode-tables.make | 59 ++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 34 deletions(-) create mode 100755 src/update-unicode-tables.make diff --git a/src/Makefile.am b/src/Makefile.am index f5a71f56d..633e993bf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -258,42 +258,9 @@ GENERATORS = \ $(NULL) EXTRA_DIST += $(GENERATORS) -unicode-tables: \ - arabic-table \ - emoji-table \ - indic-table \ - tag-table \ - ucd-table \ - use-table \ - vowel-constraints \ - $(NULL) - -arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \ - || ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false) -emoji-table: gen-emoji-table.py emoji-data.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ - || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) -indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \ - || ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false) -tag-table: gen-tag-table.py languagetags language-subtag-registry - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \ - || ($(RM) $(srcdir)/hb-ot-tag-table.hh; false) -ucd-table: gen-ucd-table.py ucd.nounihan.grouped.zip hb-common.h - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ucd-table.hh \ - || ($(RM) $(srcdir)/hb-ucd-table.hh; false) -use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \ - || ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false) -vowel-constraints: gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt Scripts.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \ - || ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false) - - built-sources: $(BUILT_SOURCES) -.PHONY: unicode-tables arabic-table indic-table tag-table use-table vowel-constraints emoji-table built-sources +.PHONY: built-sources RAGEL_GENERATED = \ $(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \ diff --git a/src/update-unicode-tables.make b/src/update-unicode-tables.make new file mode 100755 index 000000000..519e38e2d --- /dev/null +++ b/src/update-unicode-tables.make @@ -0,0 +1,59 @@ +#!/usr/bin/env -S make -f + +all: packtab arabic-table emoji-table indic-table tag-table ucd-table use-table vowel-constraints + +.PHONY: all clean packtab arabic-table emoji-table indic-table tag-table ucd-table use-table vowel-constraints + +arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt + ./$^ > hb-ot-shape-complex-arabic-table.hh || (rm hb-ot-shape-complex-arabic-table.hh; false) +emoji-table: gen-emoji-table.py emoji-data.txt + ./$^ > hb-unicode-emoji-table.hh || (rm hb-unicode-emoji-table.hh; false) +indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt + ./$^ > hb-ot-shape-complex-indic-table.cc || (rm hb-ot-shape-complex-indic-table.cc; false) +tag-table: gen-tag-table.py languagetags language-subtag-registry + ./$^ > hb-ot-tag-table.hh || (rm hb-ot-tag-table.hh; false) +ucd-table: gen-ucd-table.py ucd.nounihan.grouped.zip hb-common.h + ./$^ > hb-ucd-table.hh || (rm hb-ucd-table.hh; false) +use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt + ./$^ > hb-ot-shape-complex-use-table.cc || (rm hb-ot-shape-complex-use-table.cc; false) +vowel-constraints: gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt Scripts.txt + ./$^ > hb-ot-shape-complex-vowel-constraints.cc || (hb-ot-shape-complex-vowel-constraints.cc; false) + +packtab: + /usr/bin/env python3 -c "import packTab" 2>/dev/null || /usr/bin/env pip3 install git+https://github.com/harfbuzz/packtab + +ArabicShaping.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/ArabicShaping.txt + +UnicodeData.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt + +Blocks.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/Blocks.txt + +emoji-data.txt: + curl -O https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt + +IndicSyllabicCategory.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/IndicSyllabicCategory.txt + +IndicPositionalCategory.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/IndicPositionalCategory.txt + +languagetags: + curl -O https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags + +language-subtag-registry: + curl -O https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry + +ucd.nounihan.grouped.zip: + curl -O https://unicode.org/Public/UCD/latest/ucdxml/ucd.nounihan.grouped.zip + +Scripts.txt: + curl -O https://unicode.org/Public/UCD/latest/ucd/Scripts.txt + +clean: + $(RM) \ + ArabicShaping.txt UnicodeData.txt Blocks.txt emoji-data.txt \ + IndicSyllabicCategory.txt IndicPositionalCategory.txt \ + languagetags language-subtag-registry ucd.nounihan.grouped.zip Scripts.txt