Show a patch.

GET /api/1.1/patches/20828/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20828,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20828/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20828/",
    "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": "<20240807164052.12888-1-laurent.pinchart@ideasonboard.com>",
    "date": "2024-08-07T16:40:52",
    "name": "meson: Store controls and properties YAML files in variables",
    "commit_ref": "b8d318ebeba0710d5a7f8292a02570bb9a886f8b",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "058cc6d09ccf3b46860557b1e87b7fda26e9ed64",
    "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/20828/mbox/",
    "series": [
        {
            "id": 4498,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4498/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4498",
            "date": "2024-08-07T16:40:52",
            "name": "meson: Store controls and properties YAML files in variables",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4498/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20828/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20828/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4BD6ABE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Aug 2024 16:41:18 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5A93163382;\n\tWed,  7 Aug 2024 18:41:17 +0200 (CEST)",
            "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 185F86337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Aug 2024 18:41:16 +0200 (CEST)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 03B422EC;\n\tWed,  7 Aug 2024 18:40:22 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"avs5kawz\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723048823;\n\tbh=GogwNySoWBSX/0Jye3lAd4RHG9m347W5v9kLAeBZh+U=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=avs5kawzUjmGrtnW3J1LOqbC8nDFomV7/ewOcokpQtvhIUVSjWqcJHQl0ikCoVf51\n\tpSvqYAnJgsS4NuCxJjwbYx2yhi/Gkp9VF+iBavkGQBWXSmHIUCO/LvmUtfcq3Spj/n\n\tJhfWT1JIsvuBXW+W9PvH05eTBtaThsROAz12cOlU=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Jaslo Ziska <jaslo@ziska.de>",
        "Subject": "[PATCH] meson: Store controls and properties YAML files in variables",
        "Date": "Wed,  7 Aug 2024 19:40:52 +0300",
        "Message-ID": "<20240807164052.12888-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When generating control headers, the YAML files to be used are\ndetermined dynamically based on the selected pipeline handlers. As part\nof this process, the build system populates an array of meson File\nobjects used an an input for the control headers generation custom\ntarget, as well as an array of file names (as strings). The file names\narray is later used to generate the control source files for the\nlibcamera core, as well as the source code for controls support in the\nPython bindings.\n\nBoth of the source code generators manually turn the array of file names\ninto File objects. This duplicates code and reduces readability. A third\nsimilar implementation has also been proposed to generate control\nsupport sources in the GStreamer element, making the issue worse.\n\nTo simplify this, store File objects instead of file names in the\ncontrols_files array. As the meson configuration summary doesn't support\nFile objects, create a separate controls_files_names to store the file\nnames for that sole purpose.\n\nThe exact same process occurs for properties, address them the same way.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/meson.build |  8 ++++++--\n meson.build                   |  4 ++--\n src/libcamera/meson.build     |  2 --\n src/py/libcamera/meson.build  | 15 ++-------------\n 4 files changed, 10 insertions(+), 19 deletions(-)\n\n\nbase-commit: 82c5ea24b0e6120b75cd2f21075a3cdcb9d3d7a2",
    "diff": "diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex c8c900eba66a..36de1c2a393c 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -47,7 +47,9 @@ controls_map = {\n \n control_headers = []\n controls_files = []\n+controls_files_names = []\n properties_files = []\n+properties_files_names = []\n \n foreach mode, entry : controls_map\n     files_list = []\n@@ -70,10 +72,12 @@ foreach mode, entry : controls_map\n     outfile = ''\n     if mode == 'controls'\n         outfile = 'control_ids.h'\n-        controls_files += files_list\n+        controls_files += input_files\n+        controls_files_names += files_list\n     else\n         outfile = 'property_ids.h'\n-        properties_files += files_list\n+        properties_files += input_files\n+        properties_files_names += files_list\n     endif\n \n     template_file = files(outfile + '.in')\ndiff --git a/meson.build b/meson.build\nindex 59293e478b00..432ae1337b4a 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -278,8 +278,8 @@ py_mod.find_installation('python3', modules : py_modules)\n summary({\n             'Enabled pipelines': pipelines,\n             'Enabled IPA modules': enabled_ipa_names,\n-            'Controls files': controls_files,\n-            'Properties files': properties_files,\n+            'Controls files': controls_files_names,\n+            'Properties files': properties_files_names,\n             'Hotplug support': libudev.found(),\n             'Tracing support': tracing_enabled,\n             'Android support': android_enabled,\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex c3efc5278ec8..79b8cbaf1311 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -134,8 +134,6 @@ controls_mode_files = {\n }\n \n foreach mode, input_files : controls_mode_files\n-    input_files = files(input_files)\n-\n     if mode == 'controls'\n         template_file = files('control_ids.cpp.in')\n     else\ndiff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\nindex 4807ca7d75ed..2e67407598db 100644\n--- a/src/py/libcamera/meson.build\n+++ b/src/py/libcamera/meson.build\n@@ -28,32 +28,21 @@ pycamera_sources = files([\n \n # Generate controls\n \n-gen_py_controls_input_files = []\n gen_py_controls_template = files('py_controls_generated.cpp.in')\n-\n gen_py_controls = files('gen-py-controls.py')\n \n-foreach file : controls_files\n-    gen_py_controls_input_files += files('../../libcamera/' + file)\n-endforeach\n-\n pycamera_sources += custom_target('py_gen_controls',\n-                                  input : gen_py_controls_input_files,\n+                                  input : controls_files,\n                                   output : ['py_controls_generated.cpp'],\n                                   command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n                                              '-t', gen_py_controls_template, '@INPUT@'])\n \n # Generate properties\n \n-gen_py_property_enums_input_files = []\n gen_py_properties_template = files('py_properties_generated.cpp.in')\n \n-foreach file : properties_files\n-    gen_py_property_enums_input_files += files('../../libcamera/' + file)\n-endforeach\n-\n pycamera_sources += custom_target('py_gen_properties',\n-                                  input : gen_py_property_enums_input_files,\n+                                  input : properties_files,\n                                   output : ['py_properties_generated.cpp'],\n                                   command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n                                              '-t', gen_py_properties_template, '@INPUT@'])\n",
    "prefixes": []
}