aboutsummaryrefslogtreecommitdiff
path: root/tools/update-unicode/update_unicode.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-27 11:00:01 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-27 11:00:01 -0700
commitd1f07dd50087bef18246feffb963d73b23e2cdd6 (patch)
tree818b60e53f48bf6112eb0e834ef63a777f83de6b /tools/update-unicode/update_unicode.sh
parentebd8fa7e1291e4f82992db763e271ca261dd750b (diff)
parent671df48df895fdf259b48a7f90b70b7c75fc4059 (diff)
downloadgit-d1f07dd50087bef18246feffb963d73b23e2cdd6.tar.xz
Merge branch 'ps/build-tweaks'
Tweak the build infrastructure by moving tools around. * ps/build-tweaks: meson: precompile "git-compat-util.h" meson: compile compatibility sources separately git-compat-util.h: move warning infra to prepare for PCHs builds: move build scripts into "tools/" contrib: move "update-unicode.sh" script into "tools/" contrib: move "coverage-diff.sh" script into "tools/" contrib: move "coccinelle/" directory into "tools/" Introduce new "tools/" directory
Diffstat (limited to 'tools/update-unicode/update_unicode.sh')
-rwxr-xr-xtools/update-unicode/update_unicode.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/update-unicode/update_unicode.sh b/tools/update-unicode/update_unicode.sh
new file mode 100755
index 0000000000..aa90865bef
--- /dev/null
+++ b/tools/update-unicode/update_unicode.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#See http://www.unicode.org/reports/tr44/
+#
+#Me Enclosing_Mark an enclosing combining mark
+#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
+#Cf Format a format control character
+#
+cd "$(dirname "$0")"
+UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode-width.h
+
+wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \
+ http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt &&
+if ! test -d uniset; then
+ git clone https://github.com/depp/uniset.git &&
+ ( cd uniset && git checkout 4b186196dd )
+fi &&
+(
+ cd uniset &&
+ if ! test -x uniset; then
+ autoreconf -i &&
+ ./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
+ fi &&
+ make
+) &&
+UNICODE_DIR=. && export UNICODE_DIR &&
+cat >$UNICODEWIDTH_H <<-EOF
+static const struct interval zero_width[] = {
+ $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD)
+};
+static const struct interval double_width[] = {
+ $(uniset/uniset --32 eaw:F,W)
+};
+EOF