From cc9abdff120ccc5292431d82bdfcc5693a56c143 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 24 Dec 2012 14:47:06 +0000 Subject: [PATCH] Fetch UnicodeData.txt from unicode.org if not present to make the build fully automated. --- .gitignore | 1 + Makefile.am | 15 +++++++++++---- src/case.cpp | 2 +- src/categories.cpp | 2 +- tools/case.py | 2 +- tools/categories.py | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 3d6f555d..2a39e037 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ # build output: +data/ src/libucd.la tests/printucddata diff --git a/Makefile.am b/Makefile.am index 07930c27..bcd233ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,14 +54,21 @@ EXTRA_DIST += ChangeLog ############################# Unicode Character Database ###################### -src/case.cpp: tools/case.py tools/ucd.py - tools/case.py ${UCD_ROOTDIR} > $@ +UCD_VERSION=6.2.0 +UCD_ROOTDIR=data/ucd -src/categories.cpp: tools/categories.py tools/ucd.py - tools/categories.py ${UCD_ROOTDIR} > $@ +data/ucd/UnicodeData.txt: + mkdir -pv data/ucd + wget -O $@ http://www.unicode.org/Public/${UCD_VERSION}/ucd/UnicodeData.txt ############################# libucd ########################################## +src/case.cpp: tools/case.py tools/ucd.py data/ucd/UnicodeData.txt + tools/case.py ${UCD_ROOTDIR} ${UCD_VERSION} > $@ + +src/categories.cpp: tools/categories.py tools/ucd.py data/ucd/UnicodeData.txt + tools/categories.py ${UCD_ROOTDIR} ${UCD_VERSION} > $@ + libucd_includedir = $(includedir)/ucd libucd_include_HEADERS = \ src/include/ucd/ucd.h diff --git a/src/case.cpp b/src/case.cpp index 73d11297..b7935655 100644 --- a/src/case.cpp +++ b/src/case.cpp @@ -27,7 +27,7 @@ using namespace ucd; -// Unicode Character Data 6.2 +// Unicode Character Data 6.2.0 struct case_conversion_entry { diff --git a/src/categories.cpp b/src/categories.cpp index 1d7e1183..16647897 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -27,7 +27,7 @@ using namespace ucd; -// Unicode Character Data 6.2 +// Unicode Character Data 6.2.0 static const uint8_t categories_Cn[256] = { diff --git a/tools/case.py b/tools/case.py index 6c03aad5..16dbccbf 100755 --- a/tools/case.py +++ b/tools/case.py @@ -22,7 +22,7 @@ import sys import ucd ucd_rootdir = sys.argv[1] -ucd_version = ucd_rootdir.split('-')[-1] +ucd_version = sys.argv[2] unicode_chars = {} null = ucd.CodePoint('0000') diff --git a/tools/categories.py b/tools/categories.py index 6b53ec88..dac66853 100755 --- a/tools/categories.py +++ b/tools/categories.py @@ -22,7 +22,7 @@ import sys import ucd ucd_rootdir = sys.argv[1] -ucd_version = ucd_rootdir.split('-')[-1] +ucd_version = sys.argv[2] unicode_chars = {} for data in ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData'):