Add support for FreeBSD (#1832)

* Use /bin/sh instead of /bin/bash

* Install the required freebsd packages and remove some bashisms

* Reuse bash

* Attempt to fix the linter

* Fix the linter
This commit is contained in:
RHL120 2023-07-24 22:59:11 +02:00 committed by GitHub
parent 04dea93798
commit 37fcc691b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -ex
# If we are a root in a container and `sudo` doesn't exist
@ -68,6 +68,11 @@ install_pacman() {
fi
}
install_freebsd() {
sudo pkg install git gdb python py39-pip cmake gmake
which rustc || sudo pkg install rust
}
usage() {
echo "Usage: $0 [--update]"
echo " --update: Install/update dependencies without checking ~/.gdbinit"
@ -138,6 +143,9 @@ if linux; then
}
fi
;;
"freebsd")
install_freebsd
;;
*) # we can add more install command for each distros.
echo "\"$distro\" is not supported distro. Will search for 'apt' or 'dnf' package managers."
if hash apt; then
@ -163,6 +171,7 @@ git submodule update --init --recursive
# Find the Python version used by GDB.
PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
PYTHON+=$(gdb -batch -q --nx -ex 'pi import sys; print(sys.executable)')
if ! osx; then
PYTHON+="${PYVER}"
fi