Patch Detail
Show a patch.
GET /api/patches/1263/?format=api
{ "id": 1263, "url": "https://patchwork.libcamera.org/api/patches/1263/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1263/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20190522212253.3307-3-laurent.pinchart@ideasonboard.com>", "date": "2019-05-22T21:22:53", "name": "[libcamera-devel,v3,3/3] libcamera: Auto-generate libcamera.h", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7fc9660fea69a299ff6e7652db3ed86c69cbbfc1", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1263/mbox/", "series": [ { "id": 318, "url": "https://patchwork.libcamera.org/api/series/318/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=318", "date": "2019-05-22T21:22:51", "name": "[libcamera-devel,v3,1/3] meson: Fix coding style in meson.build files", "version": 3, "mbox": "https://patchwork.libcamera.org/series/318/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1263/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1263/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D30860C1D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 May 2019 23:23:14 +0200 (CEST)", "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 22A45443\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 May 2019 23:23:14 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558560194;\n\tbh=VzOtaAjOmfoS6su8r6JKCyPW7Z3+33jnooamLgLJp1Y=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=EZbzS3R3ALKaH3Ix51c8ZMI0uIGwlfhw3w34r0o6bHXjA8P+FyMtIZVYqDi/JQuR+\n\tTzxtHW5BWgUu0nLX+IGHmjMO41DOXF4Ywp6dw7UnC+f8UFchxArJYAPhmpfZ2mH19Q\n\tFPbHzER+WgmmjKoPEsEx1VdlxdQmD5k6DM2w9B6s=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 23 May 2019 00:22:53 +0300", "Message-Id": "<20190522212253.3307-3-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190522212253.3307-1-laurent.pinchart@ideasonboard.com>", "References": "<20190522212253.3307-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 3/3] libcamera: Auto-generate\n\tlibcamera.h", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Wed, 22 May 2019 21:23:14 -0000" }, "content": "As shown by two missing includes, keeping the libcamera.h file in sync\nwhen adding or removing headers is an error-prone manual process.\nAutomate it by generating the header automatically.\n\nThe libcamera.h header is also added to the libcamera dependency\nlibcamera_dep to ensure that the headers gets generated before any\nsource depending on it gets compiled.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/gen-header.sh | 27 +++++++++++++++++++++++++++\n include/libcamera/libcamera.h | 20 --------------------\n include/libcamera/meson.build | 10 +++++++++-\n src/libcamera/meson.build | 2 +-\n 4 files changed, 37 insertions(+), 22 deletions(-)\n create mode 100755 include/libcamera/gen-header.sh\n delete mode 100644 include/libcamera/libcamera.h", "diff": "diff --git a/include/libcamera/gen-header.sh b/include/libcamera/gen-header.sh\nnew file mode 100755\nindex 000000000000..e171c08c20b8\n--- /dev/null\n+++ b/include/libcamera/gen-header.sh\n@@ -0,0 +1,27 @@\n+#!/bin/sh\n+\n+src_dir=\"$1\"\n+dst_file=\"$2\"\n+\n+cat <<EOF > \"$dst_file\"\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/* This file is auto-generated, do not edit! */\n+/*\n+ * Copyright (C) 2018-2019, Google Inc.\n+ *\n+ * libcamera.h - libcamera public API\n+ */\n+#ifndef __LIBCAMERA_LIBCAMERA_H__\n+#define __LIBCAMERA_LIBCAMERA_H__\n+\n+EOF\n+\n+for header in \"$src_dir\"/*.h ; do\n+\theader=$(basename \"$header\")\n+\techo \"#include <libcamera/$header>\" >> \"$dst_file\"\n+done\n+\n+cat <<EOF >> \"$dst_file\"\n+\n+#endif /* __LIBCAMERA_LIBCAMERA_H__ */\n+EOF\ndiff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h\ndeleted file mode 100644\nindex dda576e906fb..000000000000\n--- a/include/libcamera/libcamera.h\n+++ /dev/null\n@@ -1,20 +0,0 @@\n-/* SPDX-License-Identifier: LGPL-2.1-or-later */\n-/*\n- * Copyright (C) 2018, Google Inc.\n- *\n- * libcamera.h - libcamera public API\n- */\n-#ifndef __LIBCAMERA_LIBCAMERA_H__\n-#define __LIBCAMERA_LIBCAMERA_H__\n-\n-#include <libcamera/buffer.h>\n-#include <libcamera/camera.h>\n-#include <libcamera/camera_manager.h>\n-#include <libcamera/event_dispatcher.h>\n-#include <libcamera/event_notifier.h>\n-#include <libcamera/request.h>\n-#include <libcamera/signal.h>\n-#include <libcamera/stream.h>\n-#include <libcamera/timer.h>\n-\n-#endif /* __LIBCAMERA_LIBCAMERA_H__ */\ndiff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex cb64f0ca0f8b..1fcf6b509a1e 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -6,7 +6,6 @@ libcamera_api = files([\n 'event_notifier.h',\n 'geometry.h',\n 'ipa/ipa_module_info.h',\n- 'libcamera.h',\n 'object.h',\n 'request.h',\n 'signal.h',\n@@ -14,5 +13,14 @@ libcamera_api = files([\n 'timer.h',\n ])\n \n+gen_header = join_paths(meson.current_source_dir(), 'gen-header.sh')\n+\n+libcamera_h = custom_target('gen-header',\n+ input : 'meson.build',\n+ output : 'libcamera.h',\n+ command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],\n+ install : true,\n+ install_dir : 'include/libcamera')\n+\n install_headers(libcamera_api,\n subdir : 'libcamera')\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 0ebb25bcb821..6a73580d71f5 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -66,6 +66,6 @@ libcamera = shared_library('camera',\n include_directories : includes,\n dependencies : libudev)\n \n-libcamera_dep = declare_dependency(sources : libcamera_api,\n+libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_h],\n include_directories : libcamera_includes,\n link_with : libcamera)\n", "prefixes": [ "libcamera-devel", "v3", "3/3" ] }