Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap script for req packages on ubuntu 2204 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions bootstrap-ubuntu-2204.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

[ ! -z "$DEBUG" ] || set -x

set -ue


function ubuntu_2204_install_deps () {
echo 'Installing required packages for Ubuntu 22.04 with extreme prejudice...'
(set -x;
sudo su -c 'apt-get update && \
apt-get install -y \
libgtk-4-dev \
libglib2.0-dev-* \
libgtksourceview-5-dev \
libnautilus-extension-dev \
libadwaita-1-dev')
}


function linux_detected_p () {
echo 'Checking we are on a Linux...'
if [[ "linux-gnu" == "${OSTYPE}" ]]; then
return 0
else
return 1
fi
}


function linux_load_etc_os_release {
echo 'Loading info from /etc/os-release...'
if test -f /etc/os-release ; then
set -a && . /etc/os-release && set +a
else
echo 'Did not detect an /etc/os-release. Sorry, cannot proceed!' >&2
exit 1
fi
}


function ubuntu_2204_detected_p () {
echo 'Inspecting for Ubuntu 22.04...'
linux_load_etc_os_release
if [[ "jammy" == "${UBUNTU_CODENAME}" ]] ; then
return 0
else
return 1
fi
}


function main () {
if linux_detected_p && ubuntu_2204_detected_p ; then
ubuntu_2204_install_deps
else
echo "Sorry but this script currently only works for Ubuntu 22.04 Linux."
fi
}


main