Add Buffyboard Man pages and Unify Build

This commit is contained in:
Undef 2024-07-26 16:40:49 +00:00 committed by Johannes Marbach
parent edeb5e4a35
commit 0eae2838dc
28 changed files with 243 additions and 191 deletions

View file

@ -80,30 +80,6 @@ For an example configuration file, see [unl0kr.conf].
- evdev kernel module
- [scdoc] (for generating the man page)
## Building & running
Some of unl0kr's dependencies are included as git submodules in this repository. You can clone the repository and initialise the submodules with
```
$ git clone https://gitlab.com/postmarketOS/buffybox.git
$ cd buffybox
$ git submodule init
$ git submodule update
```
When pulling changes from the remote later, either use `git pull --recurse-submodules` or manually run `git submodule update` as needed after pulling.
Once you have the sources, you can build the app and run it in a VT. Unless your user account has special privileges, `sudo` will be needed to access input device files.
```
$ meson _build
$ meson compile -C _build
$ sudo chvt 2
$ sudo ./_build/unl0kr
```
With meson <0\.55 use `ninja` instead of `meson compile`\.
## Valgrind
> Using C without Valgrind is like skydiving without a parachute.
@ -111,7 +87,7 @@ With meson <0\.55 use `ninja` instead of `meson compile`\.
To be able to use Valgrind, add `default_options: ['optimization=g']` in the `project` section of `meson.build` and rebuild. Afterwards you can run the application with Valgrind's leaks check enabled via
```
sudo valgrind --leak-check=yes ./_build/unl0kr
sudo valgrind --leak-check=yes ../_build/unl0kr/unl0kr
```
## Backends
@ -142,10 +118,10 @@ $ ./regenerate-layouts.sh
To generate screenshots in a variety of common sizes, install [fbcat], build unl0kr and then run
```
$ sudo ./regenerate-screenshots _build/unl0kr
$ sudo ./regenerate-screenshots ../_build/unl0kr/unl0kr
```
where `_build/unl0kr` is the location of the unl0kr binary.
where `../_build/unl0kr/unl0kr` is the location of the unl0kr binary.
## Screen recording

View file

@ -58,7 +58,7 @@ will be merged in the following order:
The character that will be used to obscure the password. Default: bullet.
## Theme
*default* = <breezy-light|breezy-dark|pmos-light|pmos-dark>
*default* = <adwaita-light|adwaita-dark|breezy-light|breezy-dark|nord-light|nord-dark|pmos-light|pmos-dark>
Selects the default theme on boot. Can be changed at runtime to the
alternative theme. Default: breezy-dark.

View file

@ -2,16 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
project(
'unl0kr',
'c',
version: '3.2.0',
default_options: 'warning_level=3',
meson_version: '>=0.53.0'
)
add_project_arguments('-DUL_VERSION="@0@"'.format(meson.project_version()), language: ['c'])
unl0kr_sources = [
'backends.c',
'command_line.c',

View file

@ -1 +0,0 @@
option('with-drm', type : 'feature', value : 'auto', description : 'Enable DRM backend')

View file

@ -1,5 +0,0 @@
#!/bin/bash
rm -rf _build
meson _build
meson compile -C _build

View file

@ -1,5 +0,0 @@
#!/bin/bash
rm -rf _build
meson _build -Dwith-drm=disabled
meson compile -C _build

View file

@ -1,25 +0,0 @@
#!/bin/bash
source "$(dirname "${BASH_SOURCE[0]}")/../../test/helpers.sh"
function run_unl0kr_async() {
local log=$1
local conf=$2
./_build/unl0kr -v -C "$conf" > "$log" 2>&1 &
pid=$!
sleep 3
kill -9 $pid
wait $pid > /dev/null 2>&1
}
function run_unl0kr_sync() {
local log=$1
shift
local conf=$2
shift
local args=$@
./_build/unl0kr -v -C "$conf" $@ > "$log" 2>&1
}

View file

@ -1,6 +0,0 @@
#!/bin/bash
root=$(dirname "${BASH_SOURCE[0]}")
"$root/test-with-drm.sh"
"$root/test-without-drm.sh"

View file

@ -1,30 +0,0 @@
#!/bin/bash
log=tmp.log
conf=tmp.conf
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
function clean_up() {
rm -f "$log" "$conf"
}
trap clean_up EXIT
info "Writing config"
cat << EOF > "$conf"
[general]
backend=drm
EOF
info "Running unl0kr"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using DRM backend" "$log"; then
error "Expected DRM backend to be selected"
cat "$log"
exit 1
fi
ok

View file

@ -1,23 +0,0 @@
#!/bin/bash
log=tmp.log
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
function clean_up() {
rm -f "$log"
}
trap clean_up EXIT
info "Running unl0kr"
run_unl0kr_async "$log"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then
error "Expected framebuffer backend to be selected"
cat "$log"
exit 1
fi
ok

View file

@ -1,30 +0,0 @@
#!/bin/bash
log=tmp.log
conf=tmp.conf
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
function clean_up() {
rm -f "$log" "$conf"
}
trap clean_up EXIT
info "Writing config"
cat << EOF > "$conf"
[general]
backend=drm
EOF
info "Running unl0kr"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then
error "Expected framebuffer backend to be selected"
cat "$log"
exit 1
fi
ok

View file

@ -1,30 +0,0 @@
#!/bin/bash
log=tmp.log
conf=tmp.conf
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
function clean_up() {
rm -f "$log" "$conf"
}
trap clean_up EXIT
info "Writing config"
cat << EOF > "$conf"
[general]
backend=fb
EOF
info "Running unl0kr"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then
error "Expected framebuffer backend to be selected"
cat "$log"
exit 1
fi
ok

View file

@ -1,37 +0,0 @@
#!/bin/bash
log=tmp.log
root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
function clean_up() {
rm -f "$log"
}
trap clean_up EXIT
info "Querying version from build.meson"
meson_version=$(read_version_from_meson)
info "Querying version from CHANGELOG.md"
changelog_version=$(read_version_from_changelog)
info "Verifying versions"
if [[ "$meson_version" != "$changelog_version" ]]; then
error "Version $meson_version from meson.build doesn't match version $changelog_version from CHANGELOG.md"
exit 1
fi
info "Running unl0kr"
run_unl0kr_sync "$log" "$conf" -V
info "Verifying output"
if ! grep "unl0kr $meson_version" "$log"; then
error "Expected version $meson_version"
cat "$log"
exit 1
fi
ok

View file

@ -1,11 +0,0 @@
#!/bin/bash
root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
run_script "$root/build-with-drm.sh"
run_script "$root/test-version-matches-meson-and-changelog.sh"
run_script "$root/test-uses-fb-backend-by-default.sh"
run_script "$root/test-uses-fb-backend-if-selected-via-config.sh"
run_script "$root/test-uses-drm-backend-if-selected-via-config-and-available.sh"

View file

@ -1,11 +0,0 @@
#!/bin/bash
root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
run_script "$root/build-without-drm.sh"
run_script "$root/test-version-matches-meson-and-changelog.sh"
run_script "$root/test-uses-fb-backend-by-default.sh"
run_script "$root/test-uses-fb-backend-if-selected-via-config.sh"
run_script "$root/test-uses-fb-backend-if-drm-selected-via-config-but-unavailable.sh"