Show a patch.

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

{
    "id": 14524,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14524/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14524/",
    "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": "<20211014115951.2996808-3-naush@raspberrypi.com>",
    "date": "2021-10-14T11:59:51",
    "name": "[libcamera-devel,v4,2/2] build: Preserve upstream git versioning using meson dist",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d8e06483cbdffc16921f5619d6b34ffbca3e7173",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14524/mbox/",
    "series": [
        {
            "id": 2627,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2627/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2627",
            "date": "2021-10-14T11:59:49",
            "name": "Preserve SHA1 versioning",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/2627/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14524/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14524/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@ideasonboard.com>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": [
            "parsemail@patchwork.libcamera.org",
            "kbingham@ideasonboard.com"
        ],
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5B072BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Nov 2021 14:00:55 +0000 (UTC)",
            "from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 019DED8B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Nov 2021 15:00:54 +0100 (CET)",
            "from perceval.ideasonboard.com\n\tby perceval.ideasonboard.com with LMTP id 8D8lMr8baGF/RgAA4E0KoQ\n\t(envelope-from <libcamera-devel-bounces@lists.libcamera.org>)\n\tfor <kbingham@ideasonboard.com>; Thu, 14 Oct 2021 13:59:59 +0200",
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\tby perceval.ideasonboard.com (Postfix) with ESMTPS\n\tid B8F1A268;\tThu, 14 Oct 2021 13:59:59 +0200 (CEST)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 80C0568F52;\n\tThu, 14 Oct 2021 13:59:59 +0200 (CEST)",
            "from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D0D5A68F4E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 13:59:55 +0200 (CEST)",
            "by mail-wr1-x436.google.com with SMTP id t2so18656584wrb.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 04:59:55 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:26af:fb8f:5d03:5eab])\n\tby smtp.gmail.com with ESMTPSA id\n\ty191sm8658324wmc.36.2021.10.14.04.59.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 14 Oct 2021 04:59:54 -0700 (PDT)"
        ],
        "Authentication-Results": [
            "perceval.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"Y8alH7cY\"; dkim-atps=neutral",
            "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature\n\tverification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com header.b=\"Y8alH7cY\";\tdkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=mIcULU9fg47HvyfwA792JL/cDKHnNvB7uUSYd7Kqdns=;\n\tb=Y8alH7cYx82IDwTB5ZpF+pmV73VbQ1l+ky10jqjVztY4VdexwiteoCd+lKPB5yF3vr\n\tNLLRt0Sp7hwul3dsPgFpNFlYs7FlB8+ik7sulvq6kdoUsunCjjYF2sJGmgXt5CaJTF1K\n\tUQe428JIq3e6XxUFW+XY3lPEY5KBTVbyYGBOMc+TLKlAUOkOXsr9/tY91QI0jjiaW2Jr\n\tC/CPjnoC4CKAIGreAyId1wdstZajAJWmWpm3kDewgpoJ/Wy2gd+j6UPDDzQyHaZTbMV1\n\taCHvw6rveqJc8DMIgdNkPmFiHcdpAEhasJRF5/Ly8KQh/Ib5On7cQ+utBS/O7MJK67oT\n\tfkEA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=mIcULU9fg47HvyfwA792JL/cDKHnNvB7uUSYd7Kqdns=;\n\tb=4OShba5ulT4BoS/JmReaQUXumcoYngmmyQtw7WRQj2Psi2p2BO+4utgHl2LroDUD6k\n\t0bQ0jT7ZeuYErP7UHoLdcpH6OOv+ILhQmsMmbfR55PKiwS03lw6QRgfoh0KesnCnFDk/\n\tBf0jko1G1W6vxtnFk+54yIgFnbablOwHzZfV3NfxV9xlf2WxefBryedNyLNi6gRhPLGF\n\tsuGmKUr5sqfO9C9NZ5BDj2POo8Wms4WLcpxlO8iedXWZC8HkDtcRs+I5iF4V+mPhm2MZ\n\tgMhpFAqzpHWzn4lrPeoVz8oPVsOtM67Yf4B/EEWCkcKCbEh5WfQurj+p9a25BgbZXC7R\n\tfr+g==",
        "X-Gm-Message-State": "AOAM530YakBtM9Q95td5/209aNu+Ycs1frWY/5uak1Wdo6y+UeNky9rZ\n\tdGFmL6UOKc6o8Wrt7826imxNI+Gawq+Iipa1",
        "X-Google-Smtp-Source": "=?utf-8?q?ABdhPJz5pXAZ9vMZLDIBj4JTe2YcrU3BFux2zHMtH?=\n\t=?utf-8?q?87gFiGapz3is9fd50JPcfIYCOGGC103dd7b9A=3D=3D?=",
        "X-Received": "by 2002:a1c:9dd1:: with SMTP id\n\tg200mr18783443wme.42.1634212795301;\n\tThu, 14 Oct 2021 04:59:55 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 14 Oct 2021 12:59:51 +0100",
        "Message-Id": "<20211014115951.2996808-3-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211014115951.2996808-1-naush@raspberrypi.com>",
        "References": "<20211014115951.2996808-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 2/2] build: Preserve upstream git\n\tversioning using meson dist",
        "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>",
        "X-TUID": "HifRsnB1d4Fl",
        "Resent-From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "Resent-To": "parsemail@patchwork.libcamera.org"
    },
    "content": "When distributions build and package libcamera libraries, they may not\nnecessarily run the build in the upstream source tree. In these cases, the git\nSHA1 versioning information will be lost.\n\nThis change addresses that problem by requiring package managers to run\n'meson dist' to create a tarball of the source files and build from there.\nOn runing 'meson dist', the utils/run-dist.sh script will create a\n.tarball-version file in the release tarball with the version string generated\nfrom the existing utils/gen-version.sh script.\n\nThe utils/gen-version.sh script has been updated to check for the presence of\nthis .tarball-version file and read the version string from it instead of\ncreating one.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n meson.build          |  3 +++\n utils/gen-version.sh |  9 +++++++++\n utils/run-dist.sh    | 11 +++++++++++\n 3 files changed, 23 insertions(+)\n create mode 100644 utils/run-dist.sh",
    "diff": "diff --git a/meson.build b/meson.build\nindex 556a3f7c42f8..bd19bd836579 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -25,6 +25,9 @@ endif\n \n libcamera_version = libcamera_git_version.split('+')[0]\n \n+# This script gererates the .tarball-version file on a 'meson dist' command.\n+meson.add_dist_script('utils/run-dist.sh')\n+\n # Configure the build environment.\n cc = meson.get_compiler('c')\n cxx = meson.get_compiler('cpp')\ndiff --git a/utils/gen-version.sh b/utils/gen-version.sh\nindex da191691a7c5..8759e722ffe1 100755\n--- a/utils/gen-version.sh\n+++ b/utils/gen-version.sh\n@@ -6,6 +6,15 @@\n build_dir=\"$1\"\n src_dir=\"$2\"\n \n+# If .tarball-version exists, output the version string from the file and exit.\n+# This file is auto-generated on a 'meson dist' command from the run-dist.sh\n+# script.\n+if [ -f \"$src_dir\"/.tarball-version ]\n+then\n+\tcat \"$src_dir\"/.tarball-version\n+\texit 0\n+fi\n+\n # Bail out if the directory isn't under git control\n git rev-parse --git-dir > /dev/null 2>&1 || exit 1\n \ndiff --git a/utils/run-dist.sh b/utils/run-dist.sh\nnew file mode 100644\nindex 000000000000..e89c3733b56c\n--- /dev/null\n+++ b/utils/run-dist.sh\n@@ -0,0 +1,11 @@\n+#!/bin/sh\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# On a meson dist run, generate the version string and store it in a file.\n+# This will later be picked up by the utils/gen-version.sh script and used\n+# instead of re-generating it. This way, if we are not building in the upstream\n+# git source tree, the upstream version information will be preserved.\n+\n+cd \"$MESON_SOURCE_ROOT\" || return\n+./utils/gen-version.sh > \"$MESON_DIST_ROOT\"/.tarball-version\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "2/2"
    ]
}