From 33c77c7e1377eb1f9fd346d2a94e0f23ff74e3c9 Mon Sep 17 00:00:00 2001 From: Zach C Date: Sun, 13 Aug 2023 12:04:11 -0500 Subject: [PATCH 1/2] Fedora support in building --- install_linux_prerequisites.sh | 24 +++++++++++++++++++++--- setup_linux.sh | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/install_linux_prerequisites.sh b/install_linux_prerequisites.sh index e804a928..ec09e0b3 100755 --- a/install_linux_prerequisites.sh +++ b/install_linux_prerequisites.sh @@ -6,9 +6,27 @@ if [ $(id -u) -eq 0 ]; then exit fi -# Install APT dependencies -sudo apt update -y -sudo apt install -y openjdk-11-jdk-headless iproute2 curl build-essential cmake libssl-dev openssl file git pkg-config libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev checkinstall unzip llvm wabt checkinstall +if [ ! -z "$(command -v apt)" ]; then + # Install APT dependencies + sudo apt update -y + sudo apt install -y openjdk-11-jdk-headless iproute2 curl build-essential cmake libssl-dev openssl file git pkg-config libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev checkinstall unzip llvm wabt +elif [ ! -z "$(command -v dnf)" ]; then + # DNF (formerly yum) + sudo dnf update -y + # libgirepository -> gobject-introspection + # iproute2 -> iproute + # openjdk-11-jdk-headless -> java-11-openjdk-headless + # checkinstall does not appear to be a thing in Fedora 38 repos + # + # Seems like iproute and file might come preinstalled but I put + # them in anyway + # + # Also Fedora doesn't come with pip + sudo dnf install -y java-11-openjdk-headless iproute curl cmake openssl-devel openssl git file pkg-config dbus-devel dbus-glib gobject-introspection-devel cairo-devel unzip llvm wabt python3-pip gcc-c++ + # build-essentials + sudo dnf groupinstall -y 'Development Tools' +fi + # Install Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -c clippy --profile default diff --git a/setup_linux.sh b/setup_linux.sh index 7aafc081..5fe5f8b5 100755 --- a/setup_linux.sh +++ b/setup_linux.sh @@ -8,7 +8,7 @@ if [[ "$(uname)" != "Linux" ]]; then exit 1 fi -if [ "$(lsb_release -d | grep -qEi 'debian|buntu|mint')" ]; then +if ! lsb_release -d | grep -qEi 'debian|buntu|mint' && [ -z "$(command -v dnf)" ]; then echo Not a supported Linux exit 1 fi From 382b4f9786ea7c1b1e0aa6a11d14f1803ad58206 Mon Sep 17 00:00:00 2001 From: Zach C Date: Sun, 13 Aug 2023 12:25:15 -0500 Subject: [PATCH 2/2] protoc distribution cannot `make install` so do the `cp -r` just like the checkinstall part does --- scripts/earthly/install_protoc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/earthly/install_protoc.sh b/scripts/earthly/install_protoc.sh index 49c48605..272008f5 100755 --- a/scripts/earthly/install_protoc.sh +++ b/scripts/earthly/install_protoc.sh @@ -10,7 +10,7 @@ if [ "$EUID" -ne 0 ]; then sudo checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/ cp *.deb ~ else - sudo make install + sudo cp -r bin include /usr/local/ fi popd sudo rm -rf /tmp/protoc-install @@ -19,7 +19,7 @@ else checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/ cp *.deb ~ else - make install + cp -r bin include /usr/local/ fi popd rm -rf /tmp/protoc-install