From 333c1feb9ef346f8165c24bf7ca5a04e43a40d25 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 17:24:14 +0200 Subject: [PATCH] Add quick install script for dev env --- README.md | 18 ++++++++++++++++++ meson.build | 3 +++ scripts/install-development-environment | 5 +++++ test/copyright-license | 4 +++- test/shellcheck | 3 +++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 scripts/install-development-environment diff --git a/README.md b/README.md index f933980..a194d55 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,24 @@ need to ask for the distribution the user was having the issue on.)). You should use Arch Linux if you want to modify Cagebreak for yourself. +#### Development Environment + +Cloning the Cagebreak repository and building it is sufficient as a starting point. + +All other dependencies can be installed by invoking + +``` +meson compile devel-install -C build +``` + +if meson is already available or + +``` +./scripts/install-development-environment +``` + +otherwise. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index f9708e7..e9388c2 100644 --- a/meson.build +++ b/meson.build @@ -344,6 +344,9 @@ summary = [ ] message('\n'.join(summary)) +run_target('devel-install', + command : ['scripts/install-development-environment']) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/install-development-environment b/scripts/install-development-environment new file mode 100755 index 0000000..a5df5c4 --- /dev/null +++ b/scripts/install-development-environment @@ -0,0 +1,5 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +sudo pacman -Syu --noconfirm git meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev diff --git a/test/copyright-license b/test/copyright-license index 4fe517f..630f843 100644 --- a/test/copyright-license +++ b/test/copyright-license @@ -10,7 +10,9 @@ readonly test_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep test/ readonly examples_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep examples/) # shellcheck disable=2155,2164,2046 readonly example_scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep example_scripts/) -readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps}" +# shellcheck disable=2155,2164,2046 +readonly scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep scripts/) +readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps} ${scripts_deps}" # shellcheck disable=2046,2155 readonly curryear=$(date +%Y) diff --git a/test/shellcheck b/test/shellcheck index 0727178..cff3fff 100644 --- a/test/shellcheck +++ b/test/shellcheck @@ -13,4 +13,7 @@ shellcheck --source-path=../example_scripts/ $(ls -Itesting-configurations) || R cd "${MESONCURRENTCONFIGDIR}/example_scripts/" || RESULT=1 shellcheck ./* +cd "${MESONCURRENTCONFIGDIR}/scripts/" || RESULT=1 +shellcheck ./* + exit "${RESULT}"