diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2018-12-10 22:39:07 -0500 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2018-12-10 23:54:20 -0500 |
commit | b84efc5b838c48c2f36de9424ec103ed7f551e71 (patch) | |
tree | 87bc349e33a06fab4d780fe6fdd8c2beec7a91b1 /projects/dejavu-fonts | |
parent | 0ac8f1f31c34a573689c1857cda5a1657029aee8 (diff) | |
download | librebootfr-b84efc5b838c48c2f36de9424ec103ed7f551e71.tar.gz librebootfr-b84efc5b838c48c2f36de9424ec103ed7f551e71.zip |
Pull in Unicode data for a specific UCD version
Previously the dejavu-fonts script pulled in the latest versions
of UnicodeData.txt and Blocks.txt files from
https://www.unicode.org/Public/UNIDATA/ which are unversioned.
This is an issue because the files at this URI will change over time
as new UCD versions are released, making reproducible builds of
dejavu-fonts impossible.
The solution to this issue is to simply download the requisite files
from https://www.unicode.org/Public/$ucd_version/ucd/ where
$ucd_version is the version specified in
projects/dejavu-fonts/configs/unicode/ucd-version
Diffstat (limited to 'projects/dejavu-fonts')
-rw-r--r-- | projects/dejavu-fonts/configs/unicode/ucd-files | 2 | ||||
-rw-r--r-- | projects/dejavu-fonts/configs/unicode/ucd-version | 1 | ||||
-rwxr-xr-x | projects/dejavu-fonts/dejavu-fonts | 21 | ||||
-rw-r--r-- | projects/dejavu-fonts/dejavu-fonts-helper | 28 |
4 files changed, 44 insertions, 8 deletions
diff --git a/projects/dejavu-fonts/configs/unicode/ucd-files b/projects/dejavu-fonts/configs/unicode/ucd-files new file mode 100644 index 00000000..9b46bb9a --- /dev/null +++ b/projects/dejavu-fonts/configs/unicode/ucd-files @@ -0,0 +1,2 @@ +Blocks.txt +UnicodeData.txt diff --git a/projects/dejavu-fonts/configs/unicode/ucd-version b/projects/dejavu-fonts/configs/unicode/ucd-version new file mode 100644 index 00000000..275283a1 --- /dev/null +++ b/projects/dejavu-fonts/configs/unicode/ucd-version @@ -0,0 +1 @@ +11.0.0 diff --git a/projects/dejavu-fonts/dejavu-fonts b/projects/dejavu-fonts/dejavu-fonts index 037aa3d9..2c5f518b 100755 --- a/projects/dejavu-fonts/dejavu-fonts +++ b/projects/dejavu-fonts/dejavu-fonts @@ -26,17 +26,22 @@ usage() { download() { local repository="$project" + local sources_path="$(project_sources_path "$project" "$repository" "$@")" + local ucd_version="$(dejavu_fonts_ucd_version "$UNICODE" "$@")" + local ucd_files_path="$(dejavu_fonts_ucd_files_path "$UNICODE" "$@")" - project_download_git "$project" \ - "$repository" \ - 'https://github.com/dejavu-fonts/dejavu-fonts.git' \ - "$@" + local -a download_list + local -a ucd_files - local sources_path="$(project_sources_path "$project" "$repository" "$@")" + mapfile -t ucd_files < "$ucd_files_path" + + for file in "${ucd_files[@]}"; do + download_list+=("https://www.unicode.org/Public/$ucd_version/ucd/$file") + done + + project_download_git "$project" "$repository" https://github.com/dejavu-fonts/dejavu-fonts.git "$@" - download_wrapper "$sources_path/resources" \ - 'https://www.unicode.org/Public/UNIDATA/UnicodeData.txt' \ - 'https://www.unicode.org/Public/UNIDATA/Blocks.txt' + download_wrapper "$sources_path/resources" "${download_list[@]}" } download_check() { diff --git a/projects/dejavu-fonts/dejavu-fonts-helper b/projects/dejavu-fonts/dejavu-fonts-helper new file mode 100644 index 00000000..ff750588 --- /dev/null +++ b/projects/dejavu-fonts/dejavu-fonts-helper @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Copyright (C) 2018 Andrew Robbins <contact@andrewrobbins.info> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +UCD_FILES='ucd-files' +UCD_VERSION='ucd-version' +UNICODE='unicode' + +dejavu_fonts_ucd_version() { + project_file_contents "$project" "$CONFIGS" "$UCD_VERSION" "$@" +} + +dejavu_fonts_ucd_files_path() { + project_file_path "$project" "$CONFIGS" "$UCD_FILES" "$@" +} |