pmaports/main/unl0kr/APKBUILD
Caleb Connolly c99a360a6e
unl0kr: add pmtest (MR 4420)
Add a test for CI that:
* ensures unl0kr runs for 10 seconds without crashing
* ensures that it doesn't print any errors

This sure isn't an "ideal" test, but it at least validates that the
framebuffer interface doesn't die horribly...

With a little more effort we should be able to run unl0kr and then pull
the framebuffer and check it against some known good unl0kr screenshot.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2023-10-31 19:54:17 +00:00

98 lines
3.6 KiB
Text

# Maintainer: Johannes Marbach <n0-0ne+gitlab@mailbox.org>
pkgname=unl0kr
pkgver=2.0.2
pkgrel=1
_commit_lvgl=2f294aa76c8fece98a4fa72304bc6f267ed2a228
_commit_lv_drivers=7e3135bcae37cbd03c2f003fcc96278671bd8632
_commit_squeek2lvgl=b67685dfede0771d2a237e1d8d4e784fcf406a70
pkgdesc="Framebuffer-based disk unlocker for the initramfs based on LVGL"
url="https://gitlab.com/cherrypicker/unl0kr"
arch="all"
license="GPL-3.0-or-later"
depends="
cryptsetup
inih
libinput-libs
libxkbcommon
!osk-sdl
"
makedepends="
eudev-dev
inih-dev
libinput-dev
libxkbcommon-dev
linux-headers
meson
scdoc
"
source="
https://gitlab.com/cherrypicker/unl0kr/-/archive/$pkgver/unl0kr-$pkgver.tar.gz
lvgl-$_commit_lvgl.tar.gz::https://github.com/lvgl/lvgl/archive/$_commit_lvgl.tar.gz
lv_drivers-$_commit_lv_drivers.tar.gz::https://github.com/calebccff/lv_drivers/archive/$_commit_lv_drivers.tar.gz
squeek2lvgl-$_commit_squeek2lvgl.tar.gz::https://gitlab.com/cherrypicker/squeek2lvgl/-/archive/$_commit_squeek2lvgl.tar.gz
unl0kr.conf
unl0kr.files
unlock.sh
30-unl0kr-test.sh
"
options="!check" # No tests
provides="postmarketos-fde-unlocker"
provider_priority=1000
subpackages="$pkgname-doc $pkgname-pmtest"
prepare() {
default_prepare
mkdir -p lvgl lv_drivers squeek2lvgl
mv "$srcdir"/lvgl-"$_commit_lvgl"/* lvgl
mv "$srcdir"/lv_drivers-"$_commit_lv_drivers"/* lv_drivers
mv "$srcdir"/squeek2lvgl-"$_commit_squeek2lvgl"/* squeek2lvgl
}
build() {
abuild-meson build
meson compile ${JOBS:+-j ${JOBS}} -C build
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C build
install -Dm644 "$srcdir"/unl0kr.conf \
"$pkgdir"/etc/unl0kr.conf
install -Dm755 "$srcdir"/unlock.sh \
"$pkgdir"/bin/fde-unlock
touch unl0kr
install -Dm644 unl0kr \
"$pkgdir"/usr/share/mkinitfs-triggers/unl0kr
# TODO: Figure out why this is needed
touch dummy
install -Dm644 dummy \
"$pkgdir"/etc/unl0kr.conf.d/dummy
install -Dm644 "$srcdir"/unl0kr.files \
"$pkgdir"/usr/share/mkinitfs/files-extra/30-unl0kr.files
}
pmtest() {
install_if="$pkgname=$pkgver-r$pkgrel postmarketos-mkinitfs-hook-ci"
install -Dm755 "$srcdir"/30-unl0kr-test.sh \
"$subpkgdir"/usr/libexec/pmos-tests-initramfs/30-unl0kr-test.sh
# We need the files in the core initramfs for this, no -extra in CI
install -Dm644 "$srcdir"/unl0kr.files \
"$subpkgdir"/usr/share/mkinitfs/files/30-unl0kr.files
}
sha512sums="
ce85363b7c388921f89ee198f78861247ffe115a2b5747d5c9ad25e6fb2d5de1c592cc665405c9a2af3e5e90771ac78bfa55779bab96b89b99264175b7b6a152 unl0kr-2.0.2.tar.gz
fbc71bb804d5b766cd515533afd4f44092ffa023b248ac447b743618fa700a95bca8f9aa2ff20b033545f1ad745b31673e4a8b75e0991e8b6978327dfd65bf14 lvgl-2f294aa76c8fece98a4fa72304bc6f267ed2a228.tar.gz
9eaa710fa9e9be05fad591e51b6a0ee29415b7a9c3e55bfd5fc7e9aa0afe9961f4ef81c1f35238823418624d861cf079fb3967baa5704ea7ddb69a3c80589adf lv_drivers-7e3135bcae37cbd03c2f003fcc96278671bd8632.tar.gz
97bd9cfb8eb9d3b5cd5c29356533b5387469509464ed454c1fcbd470f4f89009b394c1b36be20beb6e6192c56e1351ad377ca16ddf23e73085a95d30d23d880b squeek2lvgl-b67685dfede0771d2a237e1d8d4e784fcf406a70.tar.gz
7155c2f95dcf3716c0f392cf5717e96f1414c383a1f7c2ed30a1f8518dfe0b17c3c0e0e93f6476a342504aa855404099e2f5444eeb099023491c9a9a26fa3d90 unl0kr.conf
521379c06843d31304c7317d083472bb0105da7e9360d7a303cb98c84112919278fa8b50c3781d9cf43bb057b7eb7d52a4f4d900be69a0c0d70f97f2e9843140 unl0kr.files
5386f434cd4f1fb9e0d561a8689e5e85d6a8b3c562823122c082d4932d2fb0ad4edcd635f14f0c61e5c8b5e53648c9937b042409c21683007700faea8894c750 unlock.sh
407180b49c1a05f12bd6ee6e59dca0a6e74fe7b01f195087dcf2865598c47827d0bb569afdba55defa2f9a16437230fa62aa64f35111508b906bcbf9537acba4 30-unl0kr-test.sh
"