Control: retitle -1 libcamera-dev: cannot compile a trivial program against 
libcamera

On Fri, 05 Jun 2020 at 14:01:47 +0100, Simon McVittie wrote:
> ../spa/plugins/libcamera/libcamera_wrapper.cpp:46:10: fatal error: 
> libcamera/camera.h: No such file or directory
>    46 | #include <libcamera/camera.h>
>       |          ^~~~~~~~~~~~~~~~~~~~

Actually it seems the preferred header might be the
<libcamera/libcamera.h> meta-header.

> A simple compile/link/execute autopkgtest is an excellent way to detect
> this class of problem before it affects dependent packages. The one I
> contributed to libsndfile-dev in 1.0.28-8 is a recent example. If there
> isn't a minimal standalone test in the libcamera source package, just
> writing a main() that instantiates some simple object like PixelFormat
> should work.

I tried to do the equivalent of this, and in addition to the missing
-I/usr/include/libcamera, there seems to be a missing dependency on
something (I don't know what) that provides <linux/drm_fourcc.h>:

$ cat t.cpp
#include <libcamera/libcamera.h>

int main (void)
{
  libcamera::logSetStream(std::cerr);
  return 0;
}
$ g++ t.cpp `pkg-config --cflags --libs camera`
t.cpp:1:10: fatal error: libcamera/libcamera.h: No such file or directory
    1 | #include <libcamera/libcamera.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
$ g++ t.cpp `pkg-config --cflags --libs camera` -I/usr/include/libcamera
In file included from /usr/include/libcamera/libcamera/stream.h:17,
                 from /usr/include/libcamera/libcamera/camera.h:18,
                 from /usr/include/libcamera/libcamera/libcamera.h:13,
                 from t.cpp:1:
/usr/include/libcamera/libcamera/pixelformats.h:14:10: fatal error: 
linux/drm_fourcc.h: No such file or directory
   14 | #include <linux/drm_fourcc.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
$ dpkg -S linux/drm_fourcc.h
dpkg-query: no path found matching pattern *linux/drm_fourcc.h*
$ apt-file search linux/drm_fourcc.h
(no output)

Is this package usable as-is? Presumably it was tested in some way
before upload, but I'm not sure how it would have worked. If it isn't
usable, then this bug should probably be grave.

(It's possible that this is fixed in the latest source version in unstable,
but that version FTBFS due to #960758, so an updated libcamera-dev binary
package isn't currently available.)

    smcv

Reply via email to