feat: Remove autotools and adapt docu and scripts

We will only use Meson from now on.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
This commit is contained in:
Michael Vetter
2026-03-27 21:23:49 +01:00
parent 5e8987274f
commit bc777c56b2
17 changed files with 120 additions and 1344 deletions

View File

@@ -9,16 +9,16 @@ Central validation script mainly for local development.
- **Usage:** `./scripts/lint-and-test.sh [options]`
- **Options:**
- `--fix-formatting`: Automatically apply `clang-format` fixes.
- `--autotools` / `--meson`: Run unit tests using the specified build system.
- `--tests`: Run unit tests using Meson.
- `--hook`: Run in "hook mode" (checks only staged files).
- `--install`: Install the script as a git `pre-commit` hook.
## `build-configuration-matrix.sh`
Exhaustive build configuration matrix testing. It ensures that Profanity compiles and passes unit tests across a variety of feature configurations for both Autotools and Meson.
Exhaustive build configuration matrix testing. It ensures that Profanity compiles and passes unit tests across a variety of feature configurations for Meson.
- **Purpose:** Verifies architectural compatibility by testing many combinations of build flags.
- **Usage:** `./scripts/build-configuration-matrix.sh [autotools|meson] [extra-args]`
- **Extra Arguments:** Any arguments passed after the build system are forwarded directly to the configuration command (`./configure` or `meson setup`).
- **Usage:** `./scripts/build-configuration-matrix.sh [extra-args]`
- **Extra Arguments:** Any arguments are forwarded directly to the configuration command (`meson setup`).
- **Environment:** Primarily used in CI (GitHub Actions), but can be run locally to verify all configurations.
## `changelog-helper.py`

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# Exhaustive build configuration matrix testing for Profanity
# Supports both Autotools and Meson
set -e
@@ -24,18 +23,12 @@ error_handler() {
ERR_CODE=$?
echo -e "${RED}Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting.${NC}"
if [ "$BUILD_SYSTEM" == "autotools" ]; then
log_content ./config.log
log_content ./test-suite.log
log_content ./test-suite-memcheck.log
else
for log in build_run/meson-logs/testlog.txt build_valgrind/meson-logs/testlog.txt; do
if [ -f "$log" ]; then
echo "--- Meson Test Log ($log) ---"
cat "$log"
fi
done
fi
for log in build_run/meson-logs/testlog.txt build_valgrind/meson-logs/testlog.txt; do
if [ -f "$log" ]; then
echo "--- Meson Test Log ($log) ---"
cat "$log"
fi
done
exit ${ERR_CODE}
}
@@ -49,155 +42,72 @@ num_cores() {
}
usage() {
echo "Usage: $0 [autotools|meson] [extra-args]"
echo "Usage: $0 [extra-args]"
echo ""
echo "Run exhaustive build matrix tests for the specified build system."
echo "Default build system is 'autotools'."
echo "Run exhaustive build matrix tests."
echo ""
echo "Extra arguments are passed directly to the configuration command:"
echo " - Autotools: ./configure [extra-args]"
echo " - Meson: meson setup [extra-args]"
echo "Extra arguments are passed directly to: meson setup [extra-args]"
exit 0
}
# Determine build system
BUILD_SYSTEM="autotools"
if [[ "$1" == "autotools" || "$1" == "meson" ]]; then
BUILD_SYSTEM="$1"
shift
fi
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
usage
fi
# Compatibility with old script that took autotools|meson as first arg
if [[ "$1" == "meson" ]]; then
shift
elif [[ "$1" == "autotools" ]]; then
echo -e "${RED}Error: Autotools is no longer supported.${NC}"
exit 1
fi
ARCH="$(uname | tr '[:upper:]' '[:lower:]')"
EXTRA_ARGS="$*"
if [ "$BUILD_SYSTEM" == "autotools" ]; then
echo -e "${YELLOW}---> Starting Autotools build matrix...${NC}"
./bootstrap.sh
# Build Matrix
echo -e "${YELLOW}---> Starting build matrix...${NC}"
MAKE="make --quiet -j$(num_cores)"
CC="gcc"
tests=(
"-Dnotifications=enabled -Dicons-and-clipboard=enabled -Dotr=enabled -Dpgp=enabled -Domemo=enabled -Dc-plugins=enabled -Dpython-plugins=enabled -Dxscreensaver=enabled -Domemo-qrcode=enabled -Dgdk-pixbuf=enabled"
""
"-Dnotifications=disabled"
"-Dicons-and-clipboard=disabled"
"-Dotr=disabled"
"-Dpgp=disabled"
"-Domemo=disabled -Domemo-qrcode=disabled"
"-Dpgp=disabled -Dotr=disabled"
"-Dpgp=disabled -Dotr=disabled -Domemo=disabled"
"-Dpython-plugins=disabled"
"-Dc-plugins=disabled"
"-Dc-plugins=disabled -Dpython-plugins=disabled"
"-Dxscreensaver=disabled"
"-Dgdk-pixbuf=disabled"
)
case "$ARCH" in
linux*)
tests=(
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
--enable-omemo --enable-plugins --enable-c-plugins
--enable-python-plugins --with-xscreensaver --enable-omemo-qrcode --enable-gdk-pixbuf"
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
--disable-omemo --disable-plugins --disable-c-plugins
--disable-python-plugins --without-xscreensaver"
"--disable-notifications"
"--disable-icons-and-clipboard"
"--disable-otr"
"--disable-pgp"
"--disable-omemo --disable-omemo-qrcode"
"--disable-pgp --disable-otr"
"--disable-pgp --disable-otr --disable-omemo"
"--disable-plugins"
"--disable-python-plugins"
"--disable-c-plugins"
"--disable-c-plugins --disable-python-plugins"
"--without-xscreensaver"
"--disable-gdk-pixbuf"
"")
source /etc/profile.d/debuginfod.sh 2>/dev/null || true
;;
*)
# Darwin, OpenBSD, etc.
if [ "$ARCH" == "openbsd*" ]; then
MAKE="gmake"
CC="egcc -std=gnu99 -fexec-charset=UTF-8"
fi
tests=(
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
--enable-omemo --enable-plugins --enable-c-plugins
--enable-python-plugins"
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
--disable-omemo --disable-plugins --disable-c-plugins
--disable-python-plugins"
"--disable-notifications"
"--disable-icons-and-clipboard"
"--disable-otr"
"--disable-pgp"
"--disable-omemo"
"--disable-pgp --disable-otr"
"--disable-pgp --disable-otr --disable-omemo"
"--disable-plugins"
"--disable-python-plugins"
"--disable-c-plugins"
"--disable-c-plugins --disable-python-plugins"
"")
;;
esac
# Valgrind check (Linux only)
if [[ "$ARCH" == linux* ]]; then
echo -e "${YELLOW}--> Building with ./configure ${tests[0]} --enable-valgrind --disable-functional-tests ${EXTRA_ARGS}${NC}"
./configure ${tests[0]} --enable-valgrind --disable-functional-tests ${EXTRA_ARGS}
$MAKE CC="${CC}"
$MAKE check-valgrind
$MAKE distclean
fi
for features in "${tests[@]}"
do
echo -e "${YELLOW}--> Building with ./configure ${features} --disable-functional-tests ${EXTRA_ARGS}${NC}"
./configure $features --disable-functional-tests ${EXTRA_ARGS}
$MAKE CC="${CC}"
$MAKE check-unit
./profanity -v
$MAKE clean
done
else
# Meson Build Matrix
echo -e "${YELLOW}---> Starting Meson build matrix...${NC}"
tests=(
"-Dnotifications=enabled -Dicons-and-clipboard=enabled -Dotr=enabled -Dpgp=enabled -Domemo=enabled -Dc-plugins=enabled -Dpython-plugins=enabled -Dxscreensaver=enabled -Domemo-qrcode=enabled -Dgdk-pixbuf=enabled"
""
"-Dnotifications=disabled"
"-Dicons-and-clipboard=disabled"
"-Dotr=disabled"
"-Dpgp=disabled"
"-Domemo=disabled -Domemo-qrcode=disabled"
"-Dpgp=disabled -Dotr=disabled"
"-Dpgp=disabled -Dotr=disabled -Domemo=disabled"
"-Dpython-plugins=disabled"
"-Dc-plugins=disabled"
"-Dc-plugins=disabled -Dpython-plugins=disabled"
"-Dxscreensaver=disabled"
"-Dgdk-pixbuf=disabled"
)
BACKEND_OPT=""
if [ -n "${OMEMO_BACKEND}" ]; then
BACKEND_OPT="-Domemo-backend=${OMEMO_BACKEND}"
fi
# Valgrind check (Linux only)
if [[ "$ARCH" == linux* ]]; then
echo -e "${YELLOW}--> Running Valgrind check with full features ${BACKEND_OPT} ${EXTRA_ARGS}${NC}"
rm -rf build_valgrind
meson setup build_valgrind ${tests[0]} ${BACKEND_OPT} -Dtests=true -Db_sanitize=address,undefined ${EXTRA_ARGS}
meson compile -C build_valgrind
meson test -C build_valgrind "unit tests" --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected"
rm -rf build_valgrind
fi
for features in "${tests[@]}"
do
echo -e "${YELLOW}--> Building with: ${features} ${BACKEND_OPT} ${EXTRA_ARGS}${NC}"
rm -rf build_run
meson setup build_run ${features} ${BACKEND_OPT} -Dtests=true ${EXTRA_ARGS}
meson compile -C build_run
meson test -C build_run "unit tests" --print-errorlogs
./build_run/profanity -v
done
BACKEND_OPT=""
if [ -n "${OMEMO_BACKEND}" ]; then
BACKEND_OPT="-Domemo-backend=${OMEMO_BACKEND}"
fi
# Valgrind check (Linux only)
if [[ "$ARCH" == linux* ]]; then
echo -e "${YELLOW}--> Running Valgrind check with full features ${BACKEND_OPT} ${EXTRA_ARGS}${NC}"
rm -rf build_valgrind
meson setup build_valgrind ${tests[0]} ${BACKEND_OPT} -Dtests=true -Db_sanitize=address,undefined ${EXTRA_ARGS}
meson compile -C build_valgrind
meson test -C build_valgrind "unit tests" --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected"
rm -rf build_valgrind
fi
for features in "${tests[@]}"
do
echo -e "${YELLOW}--> Building with: ${features} ${BACKEND_OPT} ${EXTRA_ARGS}${NC}"
rm -rf build_run
meson setup build_run ${features} ${BACKEND_OPT} -Dtests=true ${EXTRA_ARGS}
meson compile -C build_run
meson test -C build_run "unit tests" --print-errorlogs
./build_run/profanity -v
done
echo -e "${GREEN}Build configuration matrix testing successful!${NC}"

View File

@@ -17,7 +17,7 @@ usage() {
echo ""
echo "Description:"
echo " Code quality checks (spelling, formatting, and unit tests)."
echo " Works with autotools and meson and can be used as a git"
echo " Works with meson and can be used as a git"
echo " pre-commit hook."
echo ""
echo "Options:"
@@ -25,8 +25,7 @@ usage() {
echo " --no-format Skip the formatting check/fix entirely. Use this if your local"
echo " clang-format version produces different results than the CI."
echo " Can also be set via SKIP_FORMAT=1 environment variable."
echo " --autotools Run unit tests using Autotools (make check-unit)"
echo " --meson Run unit tests using Meson (meson test)"
echo " --tests Run unit tests using Meson (meson test)"
echo " --hook Git hook mode: Checks only staged files for spelling and"
echo " formatting. Does not run tests to ensure fast commits."
echo " --install Install this script as a git pre-commit hook"
@@ -37,10 +36,7 @@ run_tests() {
local system=$1
echo -e "${YELLOW}---> Running unit tests...${NC}"
if [ "$system" == "autotools" ]; then
echo "Using Autotools..."
make check-unit
elif [ "$system" == "meson" ]; then
if [ "$system" == "meson" ]; then
echo "Using Meson..."
# Uses build_run
meson test -C build_run "unit tests"
@@ -111,8 +107,7 @@ while [[ "$#" -gt 0 ]]; do
case $1 in
--fix-formatting) MODE="fix" ;;
--no-format) INTERNAL_SKIP_FORMAT=true ;;
--autotools) BUILD_SYSTEM="autotools" ;;
--meson) BUILD_SYSTEM="meson" ;;
--tests) BUILD_SYSTEM="meson" ;;
--hook) HOOK=true ;;
--install)
echo "Installing pre-commit hook..."