From nobody Tue Jul 1 11:12:24 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1674583492; cv=none; d=zohomail.com; s=zohoarc; b=N6LMyy4UGU3ImZ65JahSjAEHlSNofaViUlrl3Py/+2rpIm/lLGzDHAcq9ghzstfpGsrd2lPvjc77GvsFThx2FyyiZ/1cmEPtu16jkdQuvKF5k+tWUUZ1CVVj6yNOWcnjAPYa/ljshYSYipyatjSLh/Xj66AiI7nx5SvE1TmAHYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674583492; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8rj1XFqYdBP8bTzv2NNI3bgWaWA6QH00/sFnhqecn/4=; b=dNDXymFrOfsQh4xiFzTJZH38EYCVeC4Fprsbm3dSOUNjW9raYOA556ssN1XE2lGN/a48yN4L+ec/XyL4xO15eaM84uLqlO7Us9te1mIMvSsmAcPmQ5k03BM7ZXLkl4l1yxiveiurZP7J1Occzy6+cawwTLiROYeRnXZX1gifeXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674583492366320.4919399116767; Tue, 24 Jan 2023 10:04:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKNc5-0001UA-R0; Tue, 24 Jan 2023 13:01:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKNc2-0001T3-Gw for qemu-devel@nongnu.org; Tue, 24 Jan 2023 13:01:38 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKNbw-00064T-QN for qemu-devel@nongnu.org; Tue, 24 Jan 2023 13:01:37 -0500 Received: by mail-wr1-x434.google.com with SMTP id z5so14702442wrt.6 for ; Tue, 24 Jan 2023 10:01:31 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id m15-20020adffa0f000000b0024cb961b6aesm2333179wrr.104.2023.01.24.10.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 10:01:29 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 23B0B1FFBD; Tue, 24 Jan 2023 18:01:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8rj1XFqYdBP8bTzv2NNI3bgWaWA6QH00/sFnhqecn/4=; b=IpTOz+qqzfoULxKhBIlCVdAtbqFdY6P2iJHLPS+ED1A3qKYgTAkrgx5qV2PrCGdzXl LqqXJC8LlO3SOu3XJJ+ZpXg9lEirmxA3p7hIEqhSoSqJiF0zPDBq8LjqW6DItlVuXgt+ CNG+t2qXQoMgFs9WJkYbRr0mJrPA8v8K6BoYTOHFtSzjexgLc90W4kIR43Vok8IxvKDu zRNub2+trPGdpq+I0iMbAuQxa0BcLj/C6Ft7sTjXLXFWHb4HwqJoEz7eipqd0zuEvLRz q2dO+GxtPZlzvmLGw458q/QWGtnfElZbPyurgtigpF8VqyV1g0weW/aT+mBTU5BEcmnG BjRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8rj1XFqYdBP8bTzv2NNI3bgWaWA6QH00/sFnhqecn/4=; b=PaMC/ey1tz+A5irUz2q3hUYjZVE8The9KnKJk3dcLZbsvdosavfi4Ja1SkaP0X1zUp OVXv46gp6/vIsgLoz/gebxw3lwl7xuK4W3fmrk8rPO8dCO7N+tq+nT6sbatfz/XQqcU4 nlE4N263FLKEN5ApU17M+xzYc2fjwOHo1LUARkP6bwncCY1r7FkPj6qVvF6dGA1XrsDZ YQZVJC7Kd7XvheEtOSw/YE5qXUpj2H4n/Toq4kK1gpIVkP7Z28D80JHTR0MOGT9dkD7W TPoQTLglOmVL5N5RevWtX2XJwRsIPaYiF7cSrayi7WYPm1nXG8JDryANuwBFo/c5Rp00 HBdA== X-Gm-Message-State: AFqh2kq2PFVOzYSaAWp37mnG5byRWo73yzrxKDsYixd3o1rkKMRcRw4f 4XxOIhCtkUC0fmJltwQGcX/8Ww== X-Google-Smtp-Source: AMrXdXvEo+JXBWdMiv3Y/7BVhm14fd3eyhzAu+v81jPhGle/YbJ0v+TwCeD0Xp0qKO4fvWLGxlsugg== X-Received: by 2002:adf:e98b:0:b0:2bc:804a:d1bb with SMTP id h11-20020adfe98b000000b002bc804ad1bbmr25115947wrm.49.1674583289843; Tue, 24 Jan 2023 10:01:29 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Ed Maste , Thomas Huth , Alexandre Iooss , Markus Armbruster , Jagannathan Raman , John G Johnson , Mahmoud Mandour , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Bandan Das , Elena Ufimtseva , Michael Roth , Eduardo Habkost , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Qiuhao Li , Stefan Hajnoczi , Alexander Bulekov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , Paolo Bonzini , Darren Kenny , qemu-arm@nongnu.org, Yanan Wang , Cleber Rosa , Wainer dos Santos Moschetta , Marcel Apfelbaum , Li-Wen Hsu , Peter Maydell Subject: [PATCH v2 05/35] build-sys: fix crlf-ending C code Date: Tue, 24 Jan 2023 18:00:57 +0000 Message-Id: <20230124180127.1881110-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230124180127.1881110-1-alex.bennee@linaro.org> References: <20230124180127.1881110-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1674583494384100002 From: Marc-Andr=C3=A9 Lureau On msys2, the shader-to-C script produces bad C: ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character= [-Werror] Fix it by changing the line ending from crlf to lf, and convert the script to Python (qemu build seems perl-free after that). Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Thomas Huth Message-Id: <20230110132700.833690-2-marcandre.lureau@redhat.com> Signed-off-by: Alex Benn=C3=A9e --- meson.build | 2 +- scripts/shaderinclude.pl | 16 ---------------- scripts/shaderinclude.py | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 17 deletions(-) delete mode 100644 scripts/shaderinclude.pl create mode 100644 scripts/shaderinclude.py diff --git a/meson.build b/meson.build index 6d3b665629..56320ae717 100644 --- a/meson.build +++ b/meson.build @@ -2779,7 +2779,7 @@ config_host_data.set('CONFIG_SLIRP', slirp.found()) genh +=3D configure_file(output: 'config-host.h', configuration: config_ho= st_data) =20 hxtool =3D find_program('scripts/hxtool') -shaderinclude =3D find_program('scripts/shaderinclude.pl') +shaderinclude =3D find_program('scripts/shaderinclude.py') qapi_gen =3D find_program('scripts/qapi-gen.py') qapi_gen_depends =3D [ meson.current_source_dir() / 'scripts/qapi/__init__= .py', meson.current_source_dir() / 'scripts/qapi/commands.p= y', diff --git a/scripts/shaderinclude.pl b/scripts/shaderinclude.pl deleted file mode 100644 index cd3bb40b12..0000000000 --- a/scripts/shaderinclude.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -my $file =3D shift; -open FILE, "<", $file or die "open $file: $!"; -my $name =3D $file; -$name =3D~ s|.*/||; -$name =3D~ s/[-.]/_/g; -print "static GLchar ${name}_src[] =3D\n"; -while () { - chomp; - printf " \"%s\\n\"\n", $_; -} -print " \"\\n\";\n"; -close FILE; diff --git a/scripts/shaderinclude.py b/scripts/shaderinclude.py new file mode 100644 index 0000000000..ab2aade2cd --- /dev/null +++ b/scripts/shaderinclude.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2023 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import sys +import os + + +def main(args): + file_path =3D args[1] + basename =3D os.path.basename(file_path) + varname =3D basename.replace('-', '_').replace('.', '_') + + with os.fdopen(sys.stdout.fileno(), "wt", closefd=3DFalse, newline=3D'= \n') as stdout: + with open(file_path, "r", encoding=3D'utf-8') as file: + print(f'static GLchar {varname}_src[] =3D', file=3Dstdout) + for line in file: + line =3D line.rstrip() + print(f' "{line}\\n"', file=3Dstdout) + print(' "\\n";', file=3Dstdout) + + +if __name__ =3D=3D '__main__': + sys.exit(main(sys.argv)) --=20 2.34.1