From b84efc5b838c48c2f36de9424ec103ed7f551e71 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Mon, 10 Dec 2018 22:39:07 -0500 Subject: 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 --- projects/dejavu-fonts/configs/unicode/ucd-files | 2 ++ projects/dejavu-fonts/configs/unicode/ucd-version | 1 + projects/dejavu-fonts/dejavu-fonts | 21 ++++++++++------- projects/dejavu-fonts/dejavu-fonts-helper | 28 +++++++++++++++++++++++ 4 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 projects/dejavu-fonts/configs/unicode/ucd-files create mode 100644 projects/dejavu-fonts/configs/unicode/ucd-version create mode 100644 projects/dejavu-fonts/dejavu-fonts-helper (limited to 'projects/dejavu-fonts') 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 +# +# 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 . + +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" "$@" +} -- cgit v1.2.3-70-g09d2