From 9c728a8d64f50c48b435ad16da8f66a7c3bfe0e4 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sat, 22 Jun 2024 08:49:17 +0100 Subject: [PATCH] Remove duplicate CI crud from installer --- Tools/install.sh | 181 ++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 103 deletions(-) diff --git a/Tools/install.sh b/Tools/install.sh index bcc4ad1c4e..05e13806c6 100755 --- a/Tools/install.sh +++ b/Tools/install.sh @@ -19,7 +19,7 @@ FONT_PACKAGES=(\ fonts-noto-mono \ xfonts-base \ fonts-urw-base35 \ - fonts-droid-fallback\ + fonts-droid-fallback \ ) EXTRA_PACKAGES=() @@ -44,7 +44,11 @@ for opt in "$@"; do ;; optional) - OPTIONAL_PACKAGES+=(clang-format-8) + OPTIONAL_PACKAGES+=(\ + clang-format-8 \ + "linux-modules-extra-$(uname -r)" \ + exfatprogs \ + ) ;; *) @@ -105,108 +109,79 @@ fi # Common install -if [ -n "$GITHUB_ACTIONS" ]; then - - case $DIST in - debian) - if [ ${#OPTIONAL_PACKAGES[@]} ]; then - # Provide repo. for clang-format-8 on Ubuntu 22.04 - sudo apt-add-repository -y 'deb http://mirrors.kernel.org/ubuntu focal main universe' - fi - sudo apt-get -y update - $PKG_INSTALL \ - g++-multilib \ - python3-setuptools \ - ninja-build \ - "linux-modules-extra-$(uname -r)" \ - exfatprogs \ - "${EXTRA_PACKAGES[@]}" \ - "${OPTIONAL_PACKAGES[@]}" - ;; - - darwin) - $PKG_INSTALL \ - binutils \ - coreutils \ - gnu-sed \ - ninja - ;; - +MACHINE_PACKAGES=() +case $DIST in + debian) + case $(uname -m) in + arm | aarch64) + ;; + *) + MACHINE_PACKAGES+=(g++-multilib) + ;; esac - -else - - MACHINE_PACKAGES=() - case $DIST in - debian) - case $(uname -m) in - arm | aarch64) - ;; - *) - MACHINE_PACKAGES+=(g++-multilib) - ;; - esac - sudo apt-get -y update || echo "Update failed... Try to install anyway..." - $PKG_INSTALL \ - cmake \ - curl \ - git \ - make \ - ninja-build \ - unzip \ - g++ \ - python3 \ - python3-pip \ - python3-setuptools \ - wget \ - "${MACHINE_PACKAGES[@]}" \ - "${EXTRA_PACKAGES[@]}" - - if [ -n "$OPTIONAL_PACKAGES" ]; then - $PKG_INSTALL "${OPTIONAL_PACKAGES[@]}" || printf "\nWARNING: Failed to install optional %s.\n\n" "$OPTIONAL_PACKAGES" - fi - ;; - - fedora) - case $(uname -m) in - x86_64) - MACHINE_PACKAGES=(\ - glibc-devel.i686 \ - libstdc++.i686 \ - ) - ;; - esac - $PKG_INSTALL \ - cmake \ - gawk \ - gcc \ - gcc-c++ \ - gettext \ - git \ - make \ - ninja-build \ - python3 \ - python3-pip \ - sed \ - unzip \ - wget \ - "${MACHINE_PACKAGES[@]}" - ;; - - darwin) - $PKG_INSTALL \ - binutils \ - coreutils \ - gnu-sed \ - ninja - ;; - - esac - - if [ "$DIST" != "darwin" ]; then - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100 - fi - + if [ ${#OPTIONAL_PACKAGES[@]} ]; then + # Provide repo. for clang-format-8 on Ubuntu 22.04 + sudo apt-add-repository -y 'deb http://mirrors.kernel.org/ubuntu focal main universe' + fi + sudo apt-get -y update || echo "Update failed... Try to install anyway..." + $PKG_INSTALL \ + cmake \ + curl \ + git \ + make \ + ninja-build \ + unzip \ + g++ \ + python3 \ + python3-pip \ + python3-setuptools \ + wget \ + "${MACHINE_PACKAGES[@]}" \ + "${EXTRA_PACKAGES[@]}" + + if [ -n "$OPTIONAL_PACKAGES" ]; then + $PKG_INSTALL "${OPTIONAL_PACKAGES[@]}" || printf "\nWARNING: Failed to install optional %s.\n\n" "$OPTIONAL_PACKAGES" + fi + ;; + + fedora) + case $(uname -m) in + x86_64) + MACHINE_PACKAGES=(\ + glibc-devel.i686 \ + libstdc++.i686 \ + ) + ;; + esac + $PKG_INSTALL \ + cmake \ + gawk \ + gcc \ + gcc-c++ \ + gettext \ + git \ + make \ + ninja-build \ + python3 \ + python3-pip \ + sed \ + unzip \ + wget \ + "${MACHINE_PACKAGES[@]}" + ;; + + darwin) + $PKG_INSTALL \ + binutils \ + coreutils \ + gnu-sed \ + ninja + ;; + +esac + +if [ "$DIST" != "darwin" ]; then + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100 fi set -e