From 684c75deae28dac4e6f1fa6208dfa5950aaabce1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 11 Jun 2021 00:52:10 +0300 Subject: [PATCH] configure.sh: Look for AFDKO. Debian-like distributions install AFDKO's executables into libexec and provide an `afdko` helper to call them. Python's pip installs the executables in bin. Let's support both. --- build/makefile_base.mak | 6 +++--- configure.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 8f51d4db..9287d88d 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -865,11 +865,11 @@ $(FONTS_OBJ)/%.sfd: $(LIBERATION_SRCDIR)/%.sfd | $(FONTS_OBJ) #The use of "YaHei" for compatibility with programs that require that exact string. This font is not Microsoft YaHei. $(SOURCE_HAN_SANS_REGULAR_OTF): $(SOURCE_HAN_SANS_REGULAR_CIDFONTINFO) $(SOURCE_HAN_SANS_REGULAR_CIDFONT) \ $(SOURCE_HAN_SANS_REGULAR_FEATURES) $(SOURCE_HAN_SANS_REGULAR_SEQUENCES) $(SOURCE_HAN_SANS_REGULAR_UNISOURCE) $(YAHEI_MENUNAMEDB) - makeotf -f $(SOURCE_HAN_SANS_REGULAR_CIDFONT) -omitMacNames -ff $(SOURCE_HAN_SANS_REGULAR_FEATURES) \ + $(AFDKO_VERB) makeotf -f $(SOURCE_HAN_SANS_REGULAR_CIDFONT) -omitMacNames -ff $(SOURCE_HAN_SANS_REGULAR_FEATURES) \ -fi $(SOURCE_HAN_SANS_REGULAR_CIDFONTINFO) -mf $(YAHEI_MENUNAMEDB) -r -nS -cs 25 -ch $(SOURCE_HAN_SANS_REGULAR_UNISOURCE) \ -ci $(SOURCE_HAN_SANS_REGULAR_SEQUENCES) -o $(SOURCE_HAN_SANS_REGULAR_OTF) - tx -cff +S -no_futile $(SOURCE_HAN_SANS_REGULAR_CIDFONT) $(FONTS_OBJ)/CFF.OTC.SC - sfntedit -a CFF=$(FONTS_OBJ)/CFF.OTC.SC $(SOURCE_HAN_SANS_REGULAR_OTF) + $(AFDKO_VERB) tx -cff +S -no_futile $(SOURCE_HAN_SANS_REGULAR_CIDFONT) $(FONTS_OBJ)/CFF.OTC.SC + $(AFDKO_VERB) sfntedit -a CFF=$(FONTS_OBJ)/CFF.OTC.SC $(SOURCE_HAN_SANS_REGULAR_OTF) fonts: $(FONTS_OBJ)/LiberationSans-Regular.ttf fonts: $(FONTS_OBJ)/LiberationSans-Bold.ttf diff --git a/configure.sh b/configure.sh index c5660c31..8e8121b7 100755 --- a/configure.sh +++ b/configure.sh @@ -46,6 +46,17 @@ dependency_command() { fi } +dependency_afdko() { + if command -v makeotf &> /dev/null; then + AFDKO_VERB= + elif command -v afdko &> /dev/null; then + AFDKO_VERB=afdko + else + err "Couldn't find 'afdko'. Install it and make sure that 'makeotf' is in your PATH or 'afdko makeotf' works." + MISSING_DEPENDENCIES=1 + fi +} + # # Configure # @@ -90,6 +101,8 @@ function configure() { dependency_command git dependency_command python3 + dependency_afdko + if [ "$MISSING_DEPENDENCIES" -ne 0 ]; then die "Missing dependencies, cannot continue." fi @@ -113,6 +126,8 @@ function configure() { echo "DOCKER_OPTS := $arg_docker_opts" fi + echo "AFDKO_VERB := $AFDKO_VERB" + # Include base echo "" echo "include \$(SRCDIR)/build/makefile_base.mak"