Merge branch 'sg/line-log-tree-diff-optim'
[git/git.git] / contrib / update-unicode / update_unicode.sh
CommitLineData
9c94389c
TB
1#!/bin/sh
2#See http://www.unicode.org/reports/tr44/
3#
4#Me Enclosing_Mark an enclosing combining mark
5#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
6#Cf Format a format control character
7#
f3eb5492 8cd "$(dirname "$0")"
e233bef4 9UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode-width.h
b79e28e3 10
fef54f31
BB
11wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \
12 http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt &&
b79e28e3 13if ! test -d uniset; then
3f0a3863
BB
14 git clone https://github.com/depp/uniset.git &&
15 ( cd uniset && git checkout 4b186196dd )
b79e28e3 16fi &&
f3eb5492 17(
b79e28e3
BB
18 cd uniset &&
19 if ! test -x uniset; then
20 autoreconf -i &&
21 ./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
9c94389c 22 fi &&
b79e28e3
BB
23 make
24) &&
25UNICODE_DIR=. && export UNICODE_DIR &&
26cat >$UNICODEWIDTH_H <<-EOF
27static const struct interval zero_width[] = {
3fe57991 28 $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD)
b79e28e3
BB
29};
30static const struct interval double_width[] = {
31 $(uniset/uniset --32 eaw:F,W)
32};
33EOF