Patch Detail
Show a patch.
GET /api/1.1/patches/1254/?format=api
{ "id": 1254, "url": "https://patchwork.libcamera.org/api/1.1/patches/1254/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1254/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20190522161740.24718-1-laurent.pinchart@ideasonboard.com>", "date": "2019-05-22T16:17:40", "name": "[libcamera-devel,v2] libcamera: Auto-generate libcamera.h", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e959986750755177b8a99078e374ed3694d47df3", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1254/mbox/", "series": [ { "id": 316, "url": "https://patchwork.libcamera.org/api/1.1/series/316/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=316", "date": "2019-05-22T16:17:40", "name": "[libcamera-devel,v2] libcamera: Auto-generate libcamera.h", "version": 2, "mbox": "https://patchwork.libcamera.org/series/316/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1254/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1254/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 780B260C02\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 May 2019 18:18:01 +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 001E1443\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 May 2019 18:18:00 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558541881;\n\tbh=IEkITrgtbZ2GOQjLEYUZTBoliAXjhWnkU3sIw4X+U6I=;\n\th=From:To:Subject:Date:From;\n\tb=WG127JOIEMXbM+DwWoVBZld/zX/TCP4iXZNs6wBWwyCAu0D7oGtZY2LSFzlDf0kEf\n\twzdj5WxBkLljZf68WfZ1EXkiQjhH4ULPSL8GLtH5z8n7TKHpTEfGjvv2/bg+3/JQOO\n\tLIVchNpIeXqHD0T/ltMHCuCXiUsAGx0FxOwctscc=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 22 May 2019 19:17:40 +0300", "Message-Id": "<20190522161740.24718-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2] libcamera: Auto-generate libcamera.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 16:18:01 -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\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 3 files changed, 36 insertions(+), 21 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..8aa7043eb438 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+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')\n", "prefixes": [ "libcamera-devel", "v2" ] }