From ae677cb64b4456ee336bc62484cbf022e9d6493f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 16 Jun 2021 19:18:13 +0200 Subject: [PATCH] [enh] ./manage node.env - check build tools first The node.env build environment require npm, ttfautohint and fontforge installed in the OS. These tools can be installed by:: sudo -H ./utils/searx.sh install buildhost If one of the tools is not installed, the script node.env stops with a appropriate message. BTW: We ignore CentOS-7 as developer & build platform Signed-off-by: Markus Heiser --- manage | 11 +++++++---- utils/searx.sh | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/manage b/manage index c042d8ebd..7019f429b 100755 --- a/manage +++ b/manage @@ -295,15 +295,18 @@ gecko.driver() { } node.env() { - # shellcheck disable=SC2230 - which npm &> /dev/null || die 1 'node.env - npm is not found!' + if ! required_commands npm fontforge ttfautohint; then + info_msg "to install build tools use::" + info_msg " sudo -H ./utils/searx.sh install buildhost" + die 1 "install needed build tools first" + fi ( set -e - build_msg INSTALL "theme: oscar" + build_msg INSTALL "searx/static/themes/oscar/package.json" npm --prefix searx/static/themes/oscar install - build_msg INSTALL "theme: simple" + build_msg INSTALL "searx/static/themes/simple/package.json" npm --prefix searx/static/themes/simple install ) dump_return $? diff --git a/utils/searx.sh b/utils/searx.sh index e1ff4beb0..69068b914 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -51,7 +51,8 @@ shellcheck" BUILD_PACKAGES_debian="\ firefox graphviz imagemagick texlive-xetex librsvg2-bin texlive-latex-recommended texlive-extra-utils fonts-dejavu -latexmk fontforge ttfautohint" +latexmk fontforge ttfautohint +npm" # pacman packages SEARX_PACKAGES_arch="\ @@ -62,7 +63,8 @@ shellcheck" BUILD_PACKAGES_arch="\ firefox graphviz imagemagick texlive-bin extra/librsvg -texlive-core texlive-latexextra ttf-dejavu fontforge ttfautohint" +texlive-core texlive-latexextra ttf-dejavu fontforge ttfautohint +npm" # dnf packages SEARX_PACKAGES_fedora="\ @@ -75,9 +77,16 @@ BUILD_PACKAGES_fedora="\ firefox graphviz graphviz-gd ImageMagick librsvg2-tools texlive-xetex-bin texlive-collection-fontsrecommended texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts -dejavu-sans-mono-fonts fontforge ttfautohint" +dejavu-sans-mono-fonts fontforge ttfautohint +npm" # yum packages +# +# hint: We do no longer support yum packages, it is to complex to maintain +# automate installation of packages like npm. In the firts step we ignore +# CentOS-7 as developer & build platform (the inital patch which brought +# CentOS-7 supports was not intended to be a developer platform). + SEARX_PACKAGES_centos="\ python36 python36-pip python36-lxml python-babel uwsgi uwsgi-plugin-python3 @@ -88,7 +97,7 @@ BUILD_PACKAGES_centos="\ firefox graphviz graphviz-gd ImageMagick librsvg2-tools texlive-xetex-bin texlive-collection-fontsrecommended texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts -dejavu-sans-mono-fonts fontforge ttfautohint" +dejavu-sans-mono-fonts" case $DIST_ID-$DIST_VERS in ubuntu-16.04|ubuntu-18.04)