summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-03-24 11:35:25 -0700
committerKhem Raj <raj.khem@gmail.com>2024-03-24 11:36:17 -0700
commit742c3da8747b291e9624fc83948d5dc3ba04a33e (patch)
treeb0ac71289f1b19ccb4a1d68ee9a7f43c5e7c8de0 /meta-multimedia/recipes-multimedia
parent150451eeaf5bf34e0d884ff0a9067268f3f7e093 (diff)
downloadmeta-openembedded-742c3da8747b291e9624fc83948d5dc3ba04a33e.tar.gz
libcamera: Fix build on musl systems
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia/recipes-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-ipu3-Use-posix-basename.patch71
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb1
2 files changed, 72 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-ipu3-Use-posix-basename.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-ipu3-Use-posix-basename.patch
new file mode 100644
index 000000000..9e4adf3d8
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-ipu3-Use-posix-basename.patch
@@ -0,0 +1,71 @@
1From 35d2acc61b1b27c0810a80cd21de65f29dc79df7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 24 Mar 2024 11:27:21 -0700
4Subject: [PATCH] ipu3: Use posix basename
5
6musl does not implement GNU basename extention and with latest musl
7the prototype from string.h is also removed [1] which now results in
8compile errors e.g.
9
10../git/utils/ipu3/ipu3-pack.c:21:47: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
11
12These utilities are using this function in usage() which is used just
13before program exit. Always use the basename APIs from libgen.h which is
14posix implementation
15
16[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
17
18Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2024-March/041180.html]
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 utils/ipu3/ipu3-pack.c | 4 ++--
22 utils/ipu3/ipu3-unpack.c | 3 ++-
23 2 files changed, 4 insertions(+), 3 deletions(-)
24
25diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c
26index decbfc6c..23d2db8b 100644
27--- a/utils/ipu3/ipu3-pack.c
28+++ b/utils/ipu3/ipu3-pack.c
29@@ -8,6 +8,7 @@
30
31 #include <errno.h>
32 #include <fcntl.h>
33+#include <libgen.h>
34 #include <stdint.h>
35 #include <stdio.h>
36 #include <string.h>
37@@ -15,9 +16,8 @@
38 #include <sys/types.h>
39 #include <unistd.h>
40
41-static void usage(const char *argv0)
42+static void usage(char *argv0)
43 {
44-
45 printf("Usage: %s input-file output-file\n", basename(argv0));
46 printf("Convert unpacked RAW10 Bayer data to the IPU3 packed Bayer formats\n");
47 printf("If the output-file '-', output data will be written to standard output\n");
48diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c
49index 9d2c1200..1505a970 100644
50--- a/utils/ipu3/ipu3-unpack.c
51+++ b/utils/ipu3/ipu3-unpack.c
52@@ -8,6 +8,7 @@
53
54 #include <errno.h>
55 #include <fcntl.h>
56+#include <libgen.h>
57 #include <stdint.h>
58 #include <stdio.h>
59 #include <string.h>
60@@ -15,7 +16,7 @@
61 #include <sys/types.h>
62 #include <unistd.h>
63
64-static void usage(const char *argv0)
65+static void usage(char *argv0)
66 {
67 printf("Usage: %s input-file output-file\n", basename(argv0));
68 printf("Unpack the IPU3 raw Bayer format to 16-bit Bayer\n");
69--
702.44.0
71
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
index b96e69eeb..45d6be31e 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
@@ -13,6 +13,7 @@ SRC_URI = " \
13 file://0001-media_device-Add-bool-return-type-to-unlock.patch \ 13 file://0001-media_device-Add-bool-return-type-to-unlock.patch \
14 file://0002-options-Replace-use-of-VLAs-in-C.patch \ 14 file://0002-options-Replace-use-of-VLAs-in-C.patch \
15 file://0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch \ 15 file://0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch \
16 file://0001-ipu3-Use-posix-basename.patch \
16" 17"
17 18
18SRCREV = "89227a428a82e724548399d35c98ea89566f9045" 19SRCREV = "89227a428a82e724548399d35c98ea89566f9045"