From nobody Tue Feb 10 02:00:50 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1673288146; cv=none; d=zohomail.com; s=zohoarc; b=BOAwU5OvOypGFtTkNUlevxrAYeXvUwvu+mECQ2Wkwv3txz7SFinF3uuPD4+g4gJKSZL42TmUAbADO6fOGcFHveRQItfsFSSQ9iXJgWKvwrpcDYe1WjxaSaVVvJbjeTnq9ynsLvj6ZEF5/V7J2mPe6NrYCA9CxLHreLLt4VTNS3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673288146; 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=Q3PlTL9irbvwvnRdoJfNW87UegtUzMbFLLdTRLDp1g8=; b=fr+v9gr+5yVRrOkTNKvu0lomtiw9f1F8KkQqvUDJRgEyn3xxLOVN3u+B00O6kzddLzVbcCAl8aQS6bAXDm4Nt8d4oKKzEeF/7BMESZakl+tBxaU+iT10le5S9LbhKtzHFaMabuEsB0Gfnm1eCnv3FsrMq9IL6kZ9juqCNZLv6T0= 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 167328814628936.80959409302886; Mon, 9 Jan 2023 10:15:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEwfm-0006aU-S1; Mon, 09 Jan 2023 13:15:02 -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 1pEwfl-0006aD-Qb for qemu-devel@nongnu.org; Mon, 09 Jan 2023 13:15:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEwfk-0005uK-7T for qemu-devel@nongnu.org; Mon, 09 Jan 2023 13:15:01 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-28-Yce7qKS0NTi-sSvDogIZog-1; Mon, 09 Jan 2023 13:14:56 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC2A83C38FE6; Mon, 9 Jan 2023 18:14:55 +0000 (UTC) Received: from localhost (unknown [10.39.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 925722166B26; Mon, 9 Jan 2023 18:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673288099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3PlTL9irbvwvnRdoJfNW87UegtUzMbFLLdTRLDp1g8=; b=Fh7ihrR8puaspjIxXaehoOaHfQopoxb4DHss6cj+P5GoCEHbgdGMB8QGxo1ykvJZE1UF03 qzNKHuF5RosOV0WCuUBuTSCro8URMqzMzEHa+sgs2NZMBPgJON1d1YFiZc5oaEzndhDvtv 0G4r0QvB4jjexnIs7z7r2qE7F0Tn/FQ= X-MC-Unique: Yce7qKS0NTi-sSvDogIZog-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Ed Maste , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Cornelia Huck , Eric Farman , John Snow , Halil Pasic , Christian Borntraeger , Thomas Huth , Cleber Rosa , Beraldo Leal , Li-Wen Hsu , David Hildenbrand , kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Richard Henderson , qemu-s390x@nongnu.org, Wainer dos Santos Moschetta , Michael Roth Subject: [PATCH v2 1/5] build-sys: fix crlf-ending C code Date: Mon, 9 Jan 2023 22:14:43 +0400 Message-Id: <20230109181447.235989-2-marcandre.lureau@redhat.com> In-Reply-To: <20230109181447.235989-1-marcandre.lureau@redhat.com> References: <20230109181447.235989-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1673288148104100003 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 --- 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 100755 scripts/shaderinclude.py diff --git a/meson.build b/meson.build index 175517eafd..b3c6db8343 100644 --- a/meson.build +++ b/meson.build @@ -2781,7 +2781,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 100755 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.39.0