Browse Source

[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 <markus.heiser@darmarit.de>
Markus Heiser 3 years ago
parent
commit
ae677cb64b
2 changed files with 20 additions and 8 deletions
  1. 7 4
      manage
  2. 13 4
      utils/searx.sh

+ 7 - 4
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 $?

+ 13 - 4
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)