From nobody Mon Feb 9 08:49:17 2026 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1674156908; cv=none; d=zohomail.com; s=zohoarc; b=j7OSEjUV39JPIC72Xz5f0ZXbh8viMWrDG4ak6pSFLdXhjE1n4u5nvjZoweuKFF1XxhueqCMmdYd6166TnY3sp+PFWWHbhrjsG7WGA5FTvH0Fs1Zcw/9HGLRe3ickZOEz11xG3bVsIHYsQxItoCxtzPkbkj2DnSKFDSjk+4DrrbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674156908; 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=TseWXLLVLdaVHAb6N/tVCJv6wFOZdD280J8VfGZpAXE=; b=RB6cPhzVmHS3hQ8WcjkXd8Zt5Zo1QyyWh6Piiw+XV7paVYyDGkh+5Igcy7Uc5HIxKkc5wPhsfkUN89AfEhgWwi5WerfbBx4ZZV9mdgGPJRX4IZH+NY/p9iQ52UEOjs+tqJDlo1E5/fKF8J/LtpZUo5QNsytlF3NUcETfD8yxl6M= 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+importer=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 1674156907738744.7190551237524; Thu, 19 Jan 2023 11:35:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIZHC-0003MV-PR; Thu, 19 Jan 2023 13:04:38 -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 1pIZH3-0003I7-4s for qemu-devel@nongnu.org; Thu, 19 Jan 2023 13:04:29 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIZH0-00011E-5L for qemu-devel@nongnu.org; Thu, 19 Jan 2023 13:04:28 -0500 Received: by mail-wm1-x334.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso1876001wms.3 for ; Thu, 19 Jan 2023 10:04:23 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id n37-20020a05600c502500b003db03725e86sm5840059wmr.8.2023.01.19.10.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 10:04:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F26BF1FFBD; Thu, 19 Jan 2023 18:04:19 +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=TseWXLLVLdaVHAb6N/tVCJv6wFOZdD280J8VfGZpAXE=; b=eSJw+hJBHtPSGXVQ7/8jLjhoY0ZN2iPx/CAg8+10YbXk9Ftffk2mSbK9kuLJPThUlM ZzAb62vmdtn2ySG+CQo/gFPEN6K2CIWq6HjZW7EVUELjINUqzZLIsTbuCOcvEZbKjp2d 5WnitmLOrz3ocHWEdx814De3FK70DyB0H+v4r7FSpvVRpH2HoNUFIbK1TFDLAEjP0Emj 3Si3BPHqnyPJOIOLIRPGVXFZ0SNfse/Gba8rPN7qivE4/JZ2xTGhYYUtPXLgYEJPP6Gu WiqiPbfcszp9rjZVRBfW0aMNKD/qJIM/hJcLIW1CGZSm204k2Ink2bvFDuvAQEWDuL7/ b/8A== 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=TseWXLLVLdaVHAb6N/tVCJv6wFOZdD280J8VfGZpAXE=; b=dJQ2SMNhKwzaMcEQA1lM9Eg2aR5vW6kiR9X3bUjGU88j1Xq0J3DS60vK+oREHAeiHI wVhvs3n/0p+OxalQuFJZ5RbGB+EVanf/vPwJ8NIP+rcnI4hcFMum+8vVEwC8M+wagaYe dWZ67TBqaFiBXwxmFoWcZQs8NsqaoqZ4netqNASYZb8ppVmKwStpAZqltmfUDsFtwesr T6ukZedIQOHpGDlumLQY+RxYKcxy3MNI4h7SFqjk5ZLempG77M4EaZ8yx6THoadtNQsQ hrjKV1beyOLdkkcV/mO/0WFWLFD4eudu/Ids28a2ON71hU8D9lUcIVTDtGDQBCvcV5EW JQ2g== X-Gm-Message-State: AFqh2krlwtNyJ3dZsWt5xjXkLoltcf0sSzP8jK32H4d3kMyugvYOZI/5 49LITZprnE/mC6MmX9zHC/B5+g== X-Google-Smtp-Source: AMrXdXvrSHJLF7vZzYHov+77c6dqJ++6P5yoJhFo5jWYrKeoND8hCKQ11VwigJSpHkLKy6uMi7LRpw== X-Received: by 2002:a05:600c:3ca6:b0:3d1:caf1:3f56 with SMTP id bg38-20020a05600c3ca600b003d1caf13f56mr19809041wmb.9.1674151462788; Thu, 19 Jan 2023 10:04:22 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Peter Maydell , Bandan Das , Qiuhao Li , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Michael Roth , Cleber Rosa , Alexander Bulekov , Darren Kenny , Stefan Hajnoczi , Markus Armbruster , John Snow , Ed Maste , Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Li-Wen Hsu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH 05/18] build-sys: fix crlf-ending C code Date: Thu, 19 Jan 2023 18:04:06 +0000 Message-Id: <20230119180419.30304-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230119180419.30304-1-alex.bennee@linaro.org> References: <20230119180419.30304-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1674156909120100001 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 58d8cd68a6..ac8c8f2cc9 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