Package Details: libcamera-git r3989.e0e54965-1

Git Clone URL: https://aur.archlinux.org/libcamera-git.git (read-only, click to copy)
Package Base: libcamera-git
Description: A complex camera support library for Linux, Android, and ChromeOS
Upstream URL: http://libcamera.org/
Licenses: LGPL2.1
Conflicts: libcamera
Provides: libcamera
Submitter: fordprefect
Maintainer: gmy
Last Packager: gmy
Votes: 13
Popularity: 0.004334
First Submitted: 2018-12-06 09:51 (UTC)
Last Updated: 2022-10-11 08:56 (UTC)

Dependencies (22)

Required by (32)

Sources (1)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

nyanpasu64 commented on 2021-12-07 00:07 (UTC)

I talked on #libcamera:irc.oftc.net:

[13:27] <nyanpasu64_> On Arch, when I build the libcamera-git AUR package, makepkg by default runs the libcamera test suite, where the `single_stream_test` test fails if no webcam is plugged in (breaking the build).
[13:28] <nyanpasu64_> Should the libcamera test suite skip the failing test when no webcam is plugged in, or should the AUR package PKGBUILD skip that test (or ignore all failing tests) when checking, or should I run `makepkg --nocheck` (which is not possible when running paru -Syu)?
[13:42] <pinchartl> good question
[13:43] <pinchartl> the unit tests were designed for development, so we don't really handle the case where no camera is present well
[13:43] <pinchartl> especially given that most tests rely on vimc, vim2m or vivid, which can always be present
[13:44] <pinchartl> running unit tests when those three virtual drivers are not loaded kind of defeats the point of unit tests
[13:44] <pinchartl> as there's not much to test anymore :-)
[13:51] <pinchartl> we could skip tests when no camera is detected, but that would prevent catching bugs that cause no camera to be detected
[14:24] <nyanpasu64_> perhaps somehow pick a subset of tests that work without system libcamera installed, and without a webcam? and have the PKGBUILD run that subset?
[14:31] <pinchartl> that could be one option. I suppose requiring vivid, vimc and vim2m on the packaging host isn't an option ?

I found out that when you run ninja -C build test, around half of the tests are actually skipped (even with a webcam plugged in) unless you run modprobe vimc; modprobe vivid; modprobe vim2m as root beforehand. So I think that running the current test suite in check() isn't actually very useful.

[16:01] <nyanpasu64_> Is it better to not run unit tests at all at build time, since half of them are skipped
[16:01] <nyanpasu64_> or to skip single_stream_test unless vivid/vimc/vim2m are loaded?
[16:01] <nyanpasu64_> so the libcamera-git PKGBUILD can be left as-is
[16:02] <pinchartl> as most tests are skipped I don't think there's much value in running the test suite. only the most basic tests that don't require a camera would run

Perhaps check() should be removed?

souravdas142 commented on 2021-12-06 15:50 (UTC) (edited on 2021-12-07 05:47 (UTC) by souravdas142)

@nyanpasu64

Everything is okey here..
Possibly This is because your webcam is unavailable or other process is using it.
Free webcamera from other process or connect a webcamera. and try to build it again.

Or if you can't both, patch PKGBUILD like this...

diff --git a/PKGBUILD b/PKGBUILD
index c377d1c..41a3a20 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -79,7 +79,7 @@ build() {

 check() {
     cd "$srcdir/$_pkgname"
-    ninja -C build test
+    ninja -C build test || true
 }

 package() {

It will skip the test Even they are failed. I don't recommend it but If you have no option then only try it.

nyanpasu64 commented on 2021-12-06 15:28 (UTC)

This package can't build, is this a package bug or upstream bug, and should I report to https://bugs.libcamera.org/?

>>> MALLOC_PERTURB_=166 /home/nyanpasu64/.cache/paru/clone/libcamera-git/src/libcamera/build/test/gstreamer/single_stream_test
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
stderr:
[52:41:13.105283750] [1004539]  INFO IPAManager ipa_manager.cpp:138 libcamera is not installed. Adding '/home/nyanpasu64/.cache/paru/clone/libcamera-git/src/libcamera/build/src/ipa' to the IPA search path
[52:41:13.106340795] [1004539]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3331-294663ee-dirty (2021-12-06T07:25:23-08:00)
Unable to set the pipeline to the playing state.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

...

Summary of Failures:

11/66 libcamera:gstreamer / single_stream_test                   FAIL            1.27s   (exit status 255 or signal 127 SIGinvalid)


Ok:                 34  
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            31  
Timeout:            0   

Full log written to /home/nyanpasu64/.cache/paru/clone/libcamera-git/src/libcamera/build/meson-logs/testlog.txt
FAILED: meson-test 
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in check().
    Aborting...
error: failed to build 'libcamera-git-r3331.f8d2f17a-1': 
error: packages failed to build: libcamera-git-r3331.f8d2f17a-1

souravdas142 commented on 2021-12-02 12:45 (UTC) (edited on 2021-12-02 12:53 (UTC) by souravdas142)

@gmy Yeah Sure. "Sourav Das <souravdas142@gmail.com>" I feel honored. Thank you.

Wow.. You make it more robust, cleaner with space efficient. Thank you.
I'm maintaing this for ubuntu/debian directly from git in launchpad.
I feel sorry that I can't apply your changes there due to more close env. :D

gmy commented on 2021-12-02 01:25 (UTC) (edited on 2021-12-02 01:26 (UTC) by gmy)

@souravdas142, thank you for your input! I've applied PKGBUILD updates based on you patch with few modifications:

  • used sed to comment out gtest URLs instead of patch since it might be more robust solution in case gtest.wrap file ever changes

  • download gtest and patch as package sources

  • put gtest version into a separate variable for easier maintenance.

Would you mind if I mention you as contributor in PKGBUILD? Usually mentioning consists of a full name and email.

souravdas142 commented on 2021-11-28 11:13 (UTC) (edited on 2021-11-28 12:53 (UTC) by souravdas142)

Hi @gmy Look at below PKGBUILD patch file to solve https://github.com/kbingham/libcamera/pull/33

The Idea is : (For more see : https://github.com/souravdas142/dotfiles/tree/libcamera/libcamera-git)

gtest: provide binaries to subprojects/packagefiles to avoid downloading

  1. In this way we can use `arch-meson` with `--wrap-mode nodownload`

  2. All gtest binaries is not frequrently relasing So we need not
     to worry about frequent change in PKBBUILD. [1] [2]

  3. `gtest_offline_wrap-file.patch` is provided which patch
 `subprojects/gtest.wrap` to disable downloadable url.

  4. As of now option `b_lto` is disabled without it test is
     Always failing, I don't know why..

[1] : https://github.com/google/googletest/releases
[2] : https://mesonbuild.com/Wrapdb-projects.html

Here is the PKGBUILD Patch file :

--- pb2 2021-11-28 16:06:22.740050392 +0530
+++ PKGBUILD    2021-11-28 18:18:39.155309742 +0530
@@ -1,7 +1,7 @@
 pkgname=libcamera-git
 _pkgname=libcamera
-pkgver=r3240.f2a18172
-pkgrel=3
+pkgver=r3267.cb1de399
+pkgrel=1
 pkgdesc='A complex camera support library for Linux, Android, and ChromeOS'
 arch=('x86_64' 'i686' 'aarch64' )
 url='http://libcamera.org/'
@@ -30,8 +30,18 @@
 )
 license=('LGPL2.1')
 options=('!buildflags')
-source=('git://linuxtv.org/libcamera.git/')
-md5sums=('SKIP')
+source=(
+   'git://linuxtv.org/libcamera.git/'
+   'gtest_offline_wrap-file.patch'
+    'gtest_1.11.0-1_patch.zip' 
+   'gtest-1.11.0.zip'
+)
+md5sums=('SKIP'
+         'SKIP'
+         '6008e7d9e573b9aabc43874a61a55b47'
+         '52943a59cefce0ae0491d4d2412c120b'
+)
+
 provides=("$_pkgname")
 conflicts=("$_pkgname")

@@ -40,12 +50,19 @@
     printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

-build() {
-    cd "$_pkgname"
+prepare(){
+   
+   cd "$srcdir/$_pkgname"
+   patch -p1 -i ../gtest_offline_wrap-file.patch
+    mkdir -p subprojects/packagefiles
+    cp -va ../gtest_1.11.0-1_patch.zip ../gtest-1.11.0.zip subprojects/packagefiles/ 

-    meson setup build \
-        --prefix        /usr \
-        --buildtype     plain \
+}
+
+build() {
+    cd "$srcdir/$_pkgname"
+    arch-meson build \
+        -D             b_lto=false \
         -D              werror=false \
         -D              documentation=disabled \
         -D              tracing=disabled
@@ -53,7 +70,7 @@
 }

 check() {
-    cd "$_pkgname"
+    cd "$srcdir/$_pkgname"
     ninja -C build test
 }

gmy commented on 2021-11-20 06:26 (UTC)

Created a PR to upstream, since it must be ignoring system gtest library unless some specific (non straightforward) build options are set: https://github.com/kbingham/libcamera/pull/33.

gmy commented on 2021-11-19 16:02 (UTC)

@zany130, please, try now. I've temporarily disabled lc-compliance feature which affected the build until I find a better solution.

zany130 commented on 2021-11-18 02:36 (UTC) (edited on 2021-11-18 02:36 (UTC) by zany130)

build fails with

src/lc-compliance/meson.build:19:4: ERROR: Automatic wrap-based subproject downloading is disabled

A full log can be found at /home/zany130/.cache/paru/clone/libcamera-git/src/libcamera/build/meson-logs/meson-log.txt
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'libcamera-git-r3070.e00149fc-1':
error: packages failed to build: libcamera-git-r3070.e00149fc-1