#!/bin/bash # Generate build.ninja that builds the docs/stats/… corpusdir=corpus layouts="ar-lulua ar-asmo663 ar-linux ar-malas ar-phonetic ar-osman ar-khorshid ar-osx ar-idlebi ar-alramly ar-ergoarabic ar-qtaish" layoutsXmodmap="ar-lulua" corpora="`ls ${corpusdir}`" cat < \$out rule render-svg command = lulua-render -l \$layout svg \$out rule render-svg-print command = lulua-render -l \$layout svg -s lulua/data/render-svg-print.css \$out rule svg2pdf command = rsvg-convert -f pdf \$in > \$out rule render-svg-heat command = lulua-render -l \$layout svg --heatmap=\$in \$out rule render-xmodmap command = lulua-render -l \$layout xmodmap \$out rule analyze-heat command = lulua-analyze -l \$layout keyheatmap < \$in > \$out rule write-bbcarabic command = find \$in | lulua-write \$layout file brotli tar bbcarabic | lulua-analyze combine > \$out pool = write rule write-aljazeera command = find \$in | lulua-write \$layout file brotli tar aljazeera | lulua-analyze combine > \$out pool = write rule write-epub command = find \$in | lulua-write \$layout epub | lulua-analyze combine > \$out pool = write rule write-tanzil command = find \$in | lulua-write \$layout file text | lulua-analyze combine > \$out pool = write rule write-tei2 command = find \$in | lulua-write \$layout file brotli tar xml tei2 | lulua-analyze combine > \$out pool = write rule write-opensubtitles command = find \$in | lulua-write \$layout file brotli tar xml opensubtitles | lulua-analyze combine > \$out pool = write rule write-arwiki command = \$wikiextractor -ns 0 --json -o - \$in 2>/dev/null | jq .text | lulua-write \$layout json | lulua-analyze combine > \$out pool = write rule write-osm command = \$osmconvert --csv='name:ar' \$in | sort -u | lulua-write \$layout lines | lulua-analyze combine > \$out pool = write rule combine command = cat \$in | lulua-analyze combine > \$out rule mkdir command = mkdir -p \$out rule letterfreq command = lulua-analyze -l ar-lulua letterfreq < \$in > \$out rule analyze-layoutstats command = lulua-analyze -l \$layout layoutstats < \$in > \$out rule analyze-corpusstats command = lulua-analyze -l ar-lulua corpusstats \$metadata < \$stats > \$out rule wordlist command = lulua-analyze -l ar-lulua latinime < \$in > \$out rule analyze-triadeffortdata command = lulua-analyze -l \$layout triadeffortdata < \$in > \$out rule analyze-triadeffortplot command = cat \$in | lulua-analyze -l ar-lulua triadeffortplot > \$out rule report command = lulua-report -c \$corpus -l \$layoutstats > \$out rule cp command = cp \$in \$out rule gz command = gzip -c \$in > \$out rule configure-make command = cd \$in && autoreconf --install && ./configure && make rule zipR command = ./makezip.sh \$in \$out rule render-winkbd command = lulua-render -l ar-lulua winkbd \$out rule render-klavaro command = lulua-render -l ar-lulua klavaro \$out rule ninjaC command = ninja -C \$dir ### build targets ### build \$reportdir: mkdir build \$reportdir/fonts: mkdir build \$tempdir: mkdir build \$reportdir/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle || \$reportdir build \$reportdir/style.css: cp \$datadir/report/style.css || \$reportdir build \$reportdir/lulua-logo.svg: cp \$datadir/report/lulua-logo.svg || \$reportdir # wordlist build \$tempdir/lulua.combined: wordlist \$statsdir/ar-lulua/all.pickle || \$tempdir build \$reportdir/lulua.combined.gz: gz \$tempdir/lulua.combined || \$reportdir build \$reportdir/fonts/IBMPlexSansArabic-Regular.woff2: cp \$fontdir/IBMPlexSansArabic-Regular.woff2 || \$reportdir/fonts build \$reportdir/fonts/IBMPlexSansArabic-Thin.woff2: cp \$fontdir/IBMPlexSansArabic-Thin.woff2 || \$reportdir/fonts # build osmconvert build \$osmconvert: configure-make 3rdparty/osmctools # Klavaro keyboard build \$reportdir/lulua_ar.kbd: render-klavaro || \$reportdir layout = ${l} # windows drivers build \$tempdir/winkbd: mkdir lulua/data/winkbd EOF # Create dependencies for the non-customized files for f in $(ls lulua/data/winkbd/); do echo "build \$tempdir/winkbd/$f: cp lulua/data/winkbd/$f || \$tempdir/winkbd" w64infiles+=" \$tempdir/winkbd/$f" done w64infiles+=" \$tempdir/winkbd/keyboard.c" cat <