From 7b37ff92304bf72d7b77976016b022a17b3df0be Mon Sep 17 00:00:00 2001 From: X4X5 <50627538+X4X5@users.noreply.github.com> Date: Tue, 9 May 2023 00:27:53 -0400 Subject: [PATCH] Add Fedora to `install.sh` (#1049) * Update install.sh * Update install.sh I'll work on this when I don't feel like I'm losing braincells * Update install.sh Get `--extra` up for Fedora * Update install.sh * Update install.sh Imagine typos * Update install.sh Finished! --- install.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/install.sh b/install.sh index f2cdd51230..204166c8ba 100755 --- a/install.sh +++ b/install.sh @@ -59,6 +59,56 @@ if cat /etc/os-release | grep -E 'ID=debian|ID_LIKE=(.*)debian' &> /dev/null; th fi fi +# Fedora (dnf) +if cat /etc/os-release | grep -E ID=fedora &> /dev/null; then + supported=true + + echo "Installing packages for Fedora (dnf)" + + ${SUDO} dnf install -y curl git python3 python3-pip python3-setuptools ninja-build gcc-mips64-linux-gnu libyaml-devel zlib-devel || exit 1 + ${SUDO} dnf group info "C Development Tools and Libraries" "Development Tools" || exit 1 + # Install binutils if required + if ! command -v mips-linux-gnu-ar &> /dev/null; then + PKG="mips-linux-gnu-binutils" + + RETURNDIR="$(pwd)" + cd "$(mktemp -d)" + + wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.35.tar.bz2 + tar -xf binutils-2.35.tar.bz2 + + cd binutils-2.35 + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure + ./configure --target=mips-linux-gnu \ + --with-sysroot=/usr/mips-linux-gnu \ + --prefix=/usr \ + --disable-multilib \ + --with-gnu-as \ + --with-gnu-ld \ + --disable-nls \ + --enable-ld=default \ + --enable-plugins \ + --enable-deterministic-archives \ + --disable-werror + ${SUDO} make + ${SUDO} make install + + cd .. + # delete temp directory we made + rm -rf "$(pwd)" + # go back to old dir + cd "${RETURNDIR}" + fi + python3 -m pip install -U -r requirements.txt + cp tools/precommit_check_no_assets.sh "$(git rev-parse --git-path hooks)/pre-commit" || exit 1 + + if [[ $1 == "--extra" ]]; then + echo "Installing extra" + ${SUDO} dnf install -y clang-tools-extra astyle doxygen || exit 1 + python3 -m pip install -U -r requirements_extra.txt || exit 1 + fi +fi + # Arch Linux and derivatives (pacman) if cat /etc/os-release | grep -E 'ID=arch|ID_LIKE=arch' &> /dev/null; then supported=true @@ -198,6 +248,7 @@ if [ "$supported" != true ]; then echo "- Arch Linux (pacman)" echo "- openSUSE (zypper)" echo "- Alpine Linux (apk)" + echo "- Fedora (dnf)" echo "Please consider contributing and adding an installation script for your distro." exit 1 fi