Skip to content

Commit

Permalink
Remove duplicate CI crud from installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jun 24, 2024
1 parent e1e4c3a commit 9c728a8
Showing 1 changed file with 78 additions and 103 deletions.
181 changes: 78 additions & 103 deletions Tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FONT_PACKAGES=(\
fonts-noto-mono \
xfonts-base \
fonts-urw-base35 \
fonts-droid-fallback\
fonts-droid-fallback \
)

EXTRA_PACKAGES=()
Expand All @@ -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 \
)
;;

*)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9c728a8

Please sign in to comment.