aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBiswapriyo Nath <nathbappai@gmail.com>2023-05-15 00:42:45 +0530
committerDavid Gibson <david@gibson.dropbear.id.au>2023-05-16 19:30:09 +1000
commite8364666d5acc985c434fb574e92c5206d9a8d6b (patch)
tree749e7923420e08b2745744c34df83b017041b0b6 /scripts
parent3b02a94b486f998aa22d898b427820a805d0904f (diff)
downloaddtc-e8364666d5acc985c434fb574e92c5206d9a8d6b.zip
dtc-e8364666d5acc985c434fb574e92c5206d9a8d6b.tar.gz
dtc-e8364666d5acc985c434fb574e92c5206d9a8d6b.tar.bz2
CI: Add build matrix with multiple Linux distributions
set SETUPTOOLS_SCM_PRETEND_VERSION="0" variable because GitHub Actions does not copy the .git directory into the container. Without that, the build fails with the following error LookupError: setuptools-scm was unable to detect version for /__w/dtc/dtc. Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-deps.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh
new file mode 100755
index 0000000..4076310
--- /dev/null
+++ b/scripts/install-deps.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+if [ -f /etc/os-release ]
+then
+ . /etc/os-release
+else
+ echo "ERROR: OS name is not provided."
+ exit 1
+fi
+
+if [ "$NAME" = "Arch Linux" ]
+then
+ pacman -Syu --needed --noconfirm bison diffutils flex gcc git libyaml \
+ make pkgconf python python-setuptools-scm swig valgrind which
+elif [ "$NAME" = "Alpine Linux" ]
+then
+ apk add build-base bison coreutils flex git yaml yaml-dev python3-dev \
+ py3-setuptools_scm swig valgrind
+elif [ "$NAME" = "Fedora Linux" ]
+then
+ dnf install -y bison diffutils flex gcc git libyaml libyaml-devel \
+ make python3-devel python3-setuptools swig valgrind which
+elif [ "$NAME" = "Ubuntu" ]
+then
+ apt update
+ apt install -yq build-essential bison flex git libyaml-dev pkg-config \
+ python3-dev python3-setuptools python3-setuptools-scm swig valgrind
+else
+ echo "ERROR: OS name is not provided."
+ exit 1
+fi