aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2015-03-15 21:28:38 +0300
committerZyX <kp-pav@yandex.ru>2015-07-26 22:59:46 +0300
commit8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1 (patch)
tree375b3470f6b6852d46131045aa216f2ff6b9cd20
parentc31b3339ffb83c59a10c92c6ece6e54cf7036ed6 (diff)
downloadrneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.tar.gz
rneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.tar.bz2
rneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.zip
Create script that downloads and commits UNIDATA files
-rwxr-xr-xscripts/download-unicode-files.sh35
-rw-r--r--src/nvim/CMakeLists.txt34
-rw-r--r--unicode/Copyright.txt37
3 files changed, 82 insertions, 24 deletions
diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh
new file mode 100755
index 0000000000..cb15270cf8
--- /dev/null
+++ b/scripts/download-unicode-files.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+
+files="UnicodeData.txt CaseFolding.txt EastAsianWidth.txt"
+
+UNIDIR_DEFAULT=unicode
+DOWNLOAD_URL_BASE_DEFAULT='http://unicode.org/Public/UNIDATA'
+
+if test x$1 = 'x--help' ; then
+ echo 'Usage:'
+ echo " $0[ TARGET_DIRECTORY[ URL_BASE]]"
+ echo
+ echo "Downloads files $files to TARGET_DIRECTORY."
+ echo "Each file is downloaded from URL_BASE/\$filename."
+ echo
+ echo "Default target directory is $PWD/${UNIDIR_DEFAULT}."
+ echo "Default URL base is ${DOWNLOAD_URL_BASE_DEFAULT}."
+fi
+
+UNIDIR=${1:-$UNIDIR_DEFAULT}
+DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT}
+
+for filename in $files ; do
+ curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/$filename"
+ (
+ cd "$UNIDIR"
+ git add $filename
+ )
+done
+
+(
+ cd "$UNIDIR"
+ git commit -m "Update unicode files" -- $files
+)
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 7348e1475a..598f19d19d 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -28,15 +28,10 @@ set(EVENTS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua)
set(EX_CMDS_DEFS_FILE ${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua)
set(OPTIONS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/options.lua)
set(UNICODE_TABLES_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genunicodetables.lua)
-set(UNICODE_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/unicode)
-set(DOWNLOAD_URL_BASE "http://unicode.org/Public/UNIDATA")
-set(UNICODEDATA_BASENAME UnicodeData.txt)
-set(CASEFOLDING_BASENAME CaseFolding.txt)
-set(EASTASIANWIDTH_BASENAME EastAsianWidth.txt)
-set(DOWNLOADED_UNICODEDATA ${UNICODE_DOWNLOAD_DIR}/${UNICODEDATA_BASENAME})
-set(DOWNLOADED_CASEFOLDING ${UNICODE_DOWNLOAD_DIR}/${CASEFOLDING_BASENAME})
-set(DOWNLOADED_EASTASIANWIDTH
- ${UNICODE_DOWNLOAD_DIR}/${EASTASIANWIDTH_BASENAME})
+set(UNICODE_DIR ${PROJECT_SOURCE_DIR}/unicode)
+set(UNICODEDATA_FILE ${UNICODE_DIR}/UnicodeData.txt)
+set(CASEFOLDING_FILE ${UNICODE_DIR}/CaseFolding.txt)
+set(EASTASIANWIDTH_FILE ${UNICODE_DIR}/EastAsianWidth.txt)
set(GENERATED_UNICODE_TABLES ${GENERATED_DIR}/unicode_tables.generated.h)
include_directories(${GENERATED_DIR})
@@ -57,8 +52,6 @@ file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/msgpack_rpc)
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/tui)
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/event)
-file(MAKE_DIRECTORY ${UNICODE_DOWNLOAD_DIR})
-
file(GLOB NEOVIM_SOURCES *.c os/*.c api/*.c api/private/*.c msgpack_rpc/*.c
tui/*.c event/*.c)
file(GLOB_RECURSE NEOVIM_HEADERS *.h)
@@ -156,24 +149,17 @@ foreach(sfile ${NEOVIM_SOURCES}
endif()
endforeach()
-file(DOWNLOAD ${DOWNLOAD_URL_BASE}/${UNICODEDATA_BASENAME}
- ${DOWNLOADED_UNICODEDATA})
-file(DOWNLOAD ${DOWNLOAD_URL_BASE}/${CASEFOLDING_BASENAME}
- ${DOWNLOADED_CASEFOLDING})
-file(DOWNLOAD ${DOWNLOAD_URL_BASE}/${EASTASIANWIDTH_BASENAME}
- ${DOWNLOADED_EASTASIANWIDTH})
-
add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES}
COMMAND ${LUA_PRG} ${UNICODE_TABLES_GENERATOR}
- ${DOWNLOADED_UNICODEDATA}
- ${DOWNLOADED_CASEFOLDING}
- ${DOWNLOADED_EASTASIANWIDTH}
+ ${UNICODEDATA_FILE}
+ ${CASEFOLDING_FILE}
+ ${EASTASIANWIDTH_FILE}
${GENERATED_UNICODE_TABLES}
DEPENDS
${UNICODE_TABLES_GENERATOR}
- ${DOWNLOADED_UNICODEDATA}
- ${DOWNLOADED_CASEFOLDING}
- ${DOWNLOADED_EASTASIANWIDTH}
+ ${UNICODEDATA_FILE}
+ ${CASEFOLDING_FILE}
+ ${EASTASIANWIDTH_FILE}
)
add_custom_command(OUTPUT ${MSGPACK_DISPATCH}
diff --git a/unicode/Copyright.txt b/unicode/Copyright.txt
new file mode 100644
index 0000000000..bfae4154b6
--- /dev/null
+++ b/unicode/Copyright.txt
@@ -0,0 +1,37 @@
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2015 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in
+http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software,
+(b) this copyright and permission notice appear in associated
+documentation, and
+(c) there is clear notice in each modified Data File or in the Software
+as well as in the documentation associated with the Data File(s) or
+Software that the data or software has been modified.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder. \ No newline at end of file