[PATCH i-g-t] scripts: Create script for installing build deps on Ubuntu

Kamil Konieczny <[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
Create script that will help with installing packages on Ubuntu
for compilation of igt sources, based on already existing
container configuration files.

Signed-off-by: Kamil Konieczny <[email protected]>
---
 scripts/install-ubuntu-build-deps.sh | 62 ++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100755 scripts/install-ubuntu-build-deps.sh

diff --git a/scripts/install-ubuntu-build-deps.sh b/scripts/install-ubuntu-build-deps.sh
new file mode 100755
index 000000000..8329120d2
--- /dev/null
+++ b/scripts/install-ubuntu-build-deps.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+#
+# Copyright © 2026 Intel Corporation
+#
+
+build=Dockerfile.build-debian
+#Dockerfile.build-debian-minimal
+minimal=${build}-minimal
+
+bpath=./
+
+get_help() {
+	bname=`basename $0`
+        echo "Install igt-dev build dependances on Ubuntu"
+        echo " "
+        echo " You can call this script from igt sources root dir or from scripts/"
+	echo " Usage example: \"./${bname}"
+        echo " You can find logs in igt-log.PACKAGE-NAME files"
+}
+
+check_build_file()
+{
+        if [ -f ${build} ]; then
+		bpath=.
+        else
+		if [ -f ../${build} ]; then
+			bpath=..
+		else
+                        printf "Warning: Cannot find path to container file %s\n" ${build}
+                        get_help
+                        exit 1
+                fi
+        fi
+}
+
+get_debs()
+{
+	nline=$(grep -n 'apt-get install' ${bpath}/${1} | sed -e 's/:/ /' | cut -f1 -d' ')
+	debs=$(tail -n+${nline} ${bpath}/${1} | sed -e /apt-get/d | sed -e /^$/d | sed -e 's/\\//')
+}
+
+deb_install()
+{
+	echo "================="
+	echo "Packages names taken from $1"
+	echo "${debs}"
+	echo "${debs}" | xargs -n1 apt-get install -y >> igt-log.$1 2>&1
+}
+
+
+do_install()
+{
+	get_debs $1
+	deb_install $1
+}
+
+check_build_file
+
+do_install ${build}
+do_install ${minimal}
+
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.