H-M-H / Weylus

Use your tablet as graphic tablet/touch screen on your computer.
Other
6.81k stars 271 forks source link

Missing `libavcodec` in docker #238

Open Iey4iej3 opened 1 year ago

Iey4iej3 commented 1 year ago

I tried to compile Weylus in docker. It failed with missing libavcodec, if I remember correctly. Seemingly there is something misconfigured.

cben commented 3 months ago
root@5e4ba4212598:/Weylus# cargo build --release
   Compiling weylus v0.11.4 (/Weylus)
The following warnings were emitted during compilation:

warning: lib/encode_video.c:5:10: fatal error: libavcodec/avcodec.h: No such file or directory
warning:  #include <libavcodec/avcodec.h>
warning:           ^~~~~~~~~~~~~~~~~~~~~~
warning: compilation terminated.

error: failed to run custom build command for `weylus v0.11.4 (/Weylus)`

After sudo apt update; sudo apt install libavcodec-dev I'm still getting errors for other libraries. Looking if I can find a sufficient set of packages and add to Dockerfile...

Diordany commented 2 months ago

I ran into a similar problem related to the ffmpeg libraries which includes libavcodec. I didn't build it using Docker though.

I'm not sure if @Iey4iej3 and @cben are experiencing the same issue, but the build system was trying to link against static libraries (that weren't even built) instead of the available dynamic libraries on my system (e.g. /usr/lib/libavcodec.so). To correct this behaviour, I built Weylus with the --features ffmpeg-system argument as described in the readme:

Alternatively passing --features ffmpeg-system to cargo will build Weylus using the system's version of ffmpeg. This is disabled by default for compatibility reasons, on newer systems this should not pose a problem and using the system libraries is advised.

I hope this helps.