mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Create script that downloads and commits UNIDATA files
This commit is contained in:
parent
c31b3339ff
commit
8f9b81059a
35
scripts/download-unicode-files.sh
Executable file
35
scripts/download-unicode-files.sh
Executable file
@ -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
|
||||
)
|
@ -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}
|
||||
|
37
unicode/Copyright.txt
Normal file
37
unicode/Copyright.txt
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user