diff options
author | Bart Ribbers <bribbers@disroot.org> | 2021-11-20 11:55:04 +0100 |
---|---|---|
committer | Bart Ribbers <bribbers@disroot.org> | 2021-12-20 12:33:02 +0000 |
commit | 332cc41b3eb5a1dc257fa941e79886b98c99ac7e (patch) | |
tree | cb293635a18bbbe61515cb0e41c06e864067a6d2 | |
parent | 7490accdcb712bb270d7a0ef9ba824932c6daad1 (diff) | |
download | aports-332cc41b3eb5a1dc257fa941e79886b98c99ac7e.tar.gz aports-332cc41b3eb5a1dc257fa941e79886b98c99ac7e.tar.bz2 aports-332cc41b3eb5a1dc257fa941e79886b98c99ac7e.tar.xz |
testing/libcamera: fix building of tests, add v4l2 support, split out more subpackages
-rw-r--r-- | testing/libcamera/0001-fix-unit-tests-build.patch | 31 | ||||
-rw-r--r-- | testing/libcamera/APKBUILD | 48 | ||||
-rw-r--r-- | testing/libcamera/qcam.desktop | 8 |
3 files changed, 74 insertions, 13 deletions
diff --git a/testing/libcamera/0001-fix-unit-tests-build.patch b/testing/libcamera/0001-fix-unit-tests-build.patch new file mode 100644 index 0000000000..c8906a951c --- /dev/null +++ b/testing/libcamera/0001-fix-unit-tests-build.patch @@ -0,0 +1,31 @@ +diff --git a/test/gstreamer/gstreamer_multi_stream_test.cpp b/test/gstreamer/gstreamer_multi_stream_test.cpp +index d3d7a9d3..dad01bb0 100644 +--- a/test/gstreamer/gstreamer_multi_stream_test.cpp ++++ b/test/gstreamer/gstreamer_multi_stream_test.cpp +@@ -80,11 +80,11 @@ protected: + + int run() override + { +- g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), NULL); ++ g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), nullptr); + + /* Build the pipeline */ + gst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_, +- stream0_, stream1_, NULL); ++ stream0_, stream1_, nullptr); + + g_autoptr(GstPad) src_pad = gst_element_get_static_pad(libcameraSrc_, "src"); + g_autoptr(GstPad) request_pad = gst_element_get_request_pad(libcameraSrc_, "src_%u"); +diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp +index a0dd12cf..66a265bf 100644 +--- a/test/gstreamer/gstreamer_single_stream_test.cpp ++++ b/test/gstreamer/gstreamer_single_stream_test.cpp +@@ -51,7 +51,7 @@ protected: + int run() override + { + /* Build the pipeline */ +- gst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_, stream0_, NULL); ++ gst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_, stream0_, nullptr); + if (gst_element_link(libcameraSrc_, stream0_) != TRUE) { + g_printerr("Elements could not be linked.\n"); + return TestFail; diff --git a/testing/libcamera/APKBUILD b/testing/libcamera/APKBUILD index ae0dc6ab38..de2b40da4e 100644 --- a/testing/libcamera/APKBUILD +++ b/testing/libcamera/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Luca Weiss <luca@z3ntu.xyz> pkgname=libcamera pkgver=0_git20211109 -pkgrel=0 +pkgrel=1 _commit="f2a1817275db8fb77acb5f2771b7577be8642194" pkgdesc="Linux camera framework" url="https://libcamera.org/" @@ -16,7 +16,9 @@ depends_dev=" gst-plugins-bad-dev qt5-qtbase-dev " +# upstream calls 'date' with a non-POSIX option so we pull in coreutils makedepends="$depends_dev + coreutils doxygen graphviz linux-headers @@ -31,10 +33,16 @@ subpackages=" $pkgname-dev $pkgname-doc qcam + $pkgname-gstreamer + $pkgname-v4l2 + $pkgname-raspberrypi " -source="https://dev.alpinelinux.org/archive/libcamera/libcamera-$_commit.tar.gz" +source="https://dev.alpinelinux.org/archive/libcamera/libcamera-$_commit.tar.gz + 0001-fix-unit-tests-build.patch + qcam.desktop + " +options="!check" # gstreamer tests fail builddir="$srcdir/libcamera" -options="!check" # Most tests don't run in the chroot _disturl="dev.alpinelinux.org:/archive/$pkgname/" @@ -49,27 +57,41 @@ snapshot() { } build() { - # tests are disabled due to build failures - # ../test/gstreamer/gstreamer_multi_stream_test.cpp:83:71: error: missing sentinel in function call abuild-meson \ - -Dtest=false \ - . build - meson compile -C build + -Dv4l2=true \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output } check() { - meson test -C build --print-errorlogs + meson test --no-rebuild -C output --print-errorlogs +} + +package() { + DESTDIR="$pkgdir" meson install --no-rebuild -C output } qcam() { - mkdir -p "$subpkgdir"/usr/bin/ - mv "$pkgdir"/usr/bin/qcam "$subpkgdir"/usr/bin/qcam + amove usr/bin/qcam + + install -Dm644 -t "$pkgdir"/usr/share/applications "$srcdir"/qcam.desktop } -package() { - DESTDIR="$pkgdir" meson install -C build +gstreamer() { + amove usr/lib/gstreamer-1.0 +} + +v4l2() { + amove usr/lib/v4l2-compat.so +} + +raspberrypi() { + amove usr/share/libcamera/ipa/raspberrypi + amove usr/libexec/libcamera/raspberrypi_ipa_proxy } sha512sums=" a3dd355eee982f8baec1a537ed022b8aabba0c6ea3f31053d70b23a1e92fb8327113c794c77c9a318943f12f46045b779fe736e09514f3663b47443c7396a399 libcamera-f2a1817275db8fb77acb5f2771b7577be8642194.tar.gz +869447f535f486a3a6d4b49631a628843fe9fd892e7d69df2d3afb9ee5eda43027504364b3abe5aea070a7ddb9bf6b5bb9c10b9aa8a9cbf9c19e4a3da5735b6b 0001-fix-unit-tests-build.patch +22167a4eceb6d1b40b0b7c45fdf116c71684f5340de7f767535cb8e160ad9d2ae0f00cb3d461f73a344520a48a4641cf46226841d78bee06bfbfd2a91337f754 qcam.desktop " diff --git a/testing/libcamera/qcam.desktop b/testing/libcamera/qcam.desktop new file mode 100644 index 0000000000..c3585419a8 --- /dev/null +++ b/testing/libcamera/qcam.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=QCam +GenericName=Camera Demo App +Comment=Take photos with camera exposed by libcamera +Exec=qcam +Type=Application +Terminal=false +StartupNotify=true |