From 37fcc691b5da6ad2aef8e56b241383cb7976f92b Mon Sep 17 00:00:00 2001 From: RHL120 <60626307+RHL120@users.noreply.github.com> Date: Mon, 24 Jul 2023 22:59:11 +0200 Subject: [PATCH] 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 --- setup.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 664bff30..a4b4fa1c 100755 --- a/setup.sh +++ b/setup.sh @@ -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