From patchwork Fri Oct 14 16:46:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17607 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D6D76C0DA4 for ; Fri, 14 Oct 2022 16:46:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 04A5B62DC2; Fri, 14 Oct 2022 18:46:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665765996; bh=EQfA1JafmskkUdereEO/M+gJCaboYN9SrrfEdH1WRzc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZKCWOBD8y2B3BlJvfYy0AYVhQX4UUiaaRm5lisZ0+sDBh7K2vVnjaex3fpk5f2o88 abNy0T5loI+3NsrnWlIuxbxcSUEJnydlv/tVrjtxJz1q8K7fgfXEqMf3yetZ0Wc4g+ mdUY1FbWO/b3aFhz7rYenvuUF3Od+VEoq0M695/Kk9DWdNtWvJq6WvFGDfABGqLWpc ZCfn4tQumQ3KlfzJeovVRIcVOglRp7O3KguE5eD43TbTyKBRkJZGYgr1oSmfzeu2Jg rpAMm9vFcm/90Dtwc8qL6BxncD/1/wLOHTPmPxw6v3UdxqFvmUiQA5x6SSh/a632kd UzU2gw5I5BEcA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B196662D8E for ; Fri, 14 Oct 2022 18:46:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KOuSAn4T"; dkim-atps=neutral Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 12A856DE; Fri, 14 Oct 2022 18:46:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665765994; bh=EQfA1JafmskkUdereEO/M+gJCaboYN9SrrfEdH1WRzc=; h=From:To:Cc:Subject:Date:From; b=KOuSAn4TAV5A5WIQ1p6AHcStwl0BaNJyLJ/H6/ce3SCMbnHCMpLApHKEmIEsAQovF si/cw8bo9lxs3WEMoxU3EtHDWwobOphj1gOymC/V7bZN/8xaZ/Fk3pIlNHcyu8z9sm M+AnL75PGstdtSbS4Am0KQhr8eZz2BUdNc0ltqEw= To: libcamera devel Date: Fri, 14 Oct 2022 17:46:30 +0100 Message-Id: <20221014164630.2847301-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] meson: Rewrite .replace usage X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Meson introduces a .replace() method in version 0.58.0. However we aim to restrict ourselves to 0.56 meson features, as released by Debian stable. The recent introduction of release management infrastructure makes use of the .replace() method to fix up the version string when there is a mis-match between the release version and any (lack) of tags in the git version description. This breaks when built on systems with only meson 0.56. Refactor this to use a concatenation of the project version and a stripped git version to regenerate the full source version string that will be reported by libcamera. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 56910698988d..f218b8c2b296 100644 --- a/meson.build +++ b/meson.build @@ -38,8 +38,10 @@ if libcamera_version != meson.project_version() }, bool_yn : true, section : 'Versions') - libcamera_git_version = libcamera_git_version.replace(libcamera_version, - meson.project_version()) + # Replace the version components reported by git with the release version, + # but keep all trailing information supplied by git. + libcamera_git_version = (meson.project_version() + + libcamera_git_version.strip(libcamera_version)) libcamera_version = meson.project_version() # Append a marker to show we have modified this version string