summaryrefslogtreecommitdiffstats
path: root/runtime/spell
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-10 22:09:11 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-10 22:09:11 +0100
commit5ef1c6a4838a9629b793f3ae676f72a764171b00 (patch)
treef496545a97dd3ce594f7771891c4471700cdcbe9 /runtime/spell
parenta9aa86ff951b7908b615a61a0e216901b96bc0eb (diff)
Update runtime files
Diffstat (limited to 'runtime/spell')
-rw-r--r--runtime/spell/main.aap2
-rw-r--r--runtime/spell/tr/main.aap68
2 files changed, 69 insertions, 1 deletions
diff --git a/runtime/spell/main.aap b/runtime/spell/main.aap
index 269c710bc3..410b5f365c 100644
--- a/runtime/spell/main.aap
+++ b/runtime/spell/main.aap
@@ -7,7 +7,7 @@
# "hu" is at the end, because it takes a very long time.
LANG = af am bg br ca cs cy da de el en eo es fr fo ga gd gl he hr id it
ku la lt lv mg mi ms nb nl nn ny pl pt ro ru rw sk sl sv sw
- tet th tl tn uk yi zu hu
+ tet th tl tn tr uk yi zu hu
# TODO:
# Finnish doesn't work, the dictionary fi_FI.zip file contains hyphenation...
diff --git a/runtime/spell/tr/main.aap b/runtime/spell/tr/main.aap
new file mode 100644
index 0000000000..073cf2a169
--- /dev/null
+++ b/runtime/spell/tr/main.aap
@@ -0,0 +1,68 @@
+# Aap recipe for Turkish Vim spell files.
+
+# Use a freshly compiled Vim if it exists.
+@if os.path.exists('../../../src/vim'):
+ VIM = ../../../src/vim
+@else:
+ :progsearch VIM vim
+
+SPELLDIR = ..
+FILES = tr_TR.aff tr_TR.dic
+
+all: $SPELLDIR/tr.utf-8.spl
+
+$SPELLDIR/tr.utf-8.spl : $FILES
+ :sys env LANG=tr_TR.UTF-8
+ $VIM -u NONE -e -c "mkspell! $SPELLDIR/tr tr_TR" -c q
+
+# Fetching LibreOffice spell files
+FILE = https://github.com/bitigchi/bitigchi.github.io/raw/master/vim-tr-spell/tr_TR.zip
+:attr {fetch = $FILE} tr_TR.zip
+
+# The files don't depend on the .zip file so that we can delete it.
+# Only download the zip file if the targets don't exist.
+tr_TR.aff tr_TR.dic: {buildcheck=}
+ :assertpkg unzip patch
+ :fetch tr_TR.zip
+ :sys $UNZIP tr_TR.zip
+ :delete tr_TR.zip
+ @if not os.path.exists('tr_TR.orig.aff'):
+ :copy tr_TR.aff tr_TR.orig.aff
+ @if not os.path.exists('tr_TR.orig.dic'):
+ :copy tr_TR.dic tr_TR.orig.dic
+ @if os.path.exists('tr_TR.diff'):
+ :sys patch <tr_TR.diff
+
+# Generate diff files
+diff:
+ :assertpkg diff
+ :sys {force} diff -a -C 1 tr_TR.orig.aff tr_TR.aff >tr_TR.diff
+ :sys {force} diff -a -C 1 tr_TR.orig.dic tr_TR.dic >>tr_TR.diff
+
+# Check for updated LibreOffice spell files. When there are changes the
+# ".new.aff" and ".new.dic" files are left behind for manual inspection.
+check:
+ :assertpkg unzip diff
+ :fetch tr_TR.zip
+ :mkdir tmp
+ :cd tmp
+ @try:
+ @import stat
+ :sys $UNZIP ../tr_TR.zip
+ :sys {force} diff ../tr_TR.orig.aff tr_TR.aff >d
+ @if os.stat('d')[stat.ST_SIZE] > 0:
+ :copy tr_TR.aff ../tr_TR.new.aff
+ :sys {force} diff ../tr_TR.orig.dic tr_TR.dic >d
+ @if os.stat('d')[stat.ST_SIZE] > 0:
+ :copy tr_TR.dic ../tr_TR.new.dic
+ @finally:
+ :cd ..
+ :delete {r}{f}{q} tmp
+ :delete tr_TR.zip
+
+# Remove all the downloaded and generated files.
+clean:
+ :delete tr_TR.aff
+ :delete tr_TR.dic
+ :delete tr_TR.orig.aff
+ :delete tr_TR.orig.dic