From patchwork Thu Jan 26 11:22:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 647087 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp185451pvb; Thu, 26 Jan 2023 03:23:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIWgxjNFRINZYkt2a+zyDL49zJMv7Bf3rTtcQ2miY3W8ncqTaSQNgXawwV1u4+qOA5GvXY X-Received: by 2002:a05:622a:6090:b0:3b6:92ce:b4f7 with SMTP id hf16-20020a05622a609000b003b692ceb4f7mr32187217qtb.37.1674732196310; Thu, 26 Jan 2023 03:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674732196; cv=none; d=google.com; s=arc-20160816; b=XcEexa1+ij+OS4uMGjnlnzQ5uzoT70DogYhpesgx0hSl/FSRQ3o1l/FvN8Fh59XJsu fktGtjPwZWqZaZpEJMRGDyDGoOWDiSj1+rLzM1Jj/qqX8W/iI+N5KcnWyI40X4iy6fb7 QQ48r7PMrJR5+3DHhwEemZYVXjzEC8E84lfzzkZKGaD34AZCj0JNoQOXre/kXQ2eq8hR +BXSVGSNOsOyjSrOHdkBqCxMMpudsdIa9e4JGoJuMvtR7KgQtVoGMKJAw3dtcwaWsZnK vOOKHps1RYzWTLSFowgHFkKdamPXEdYnTI7RaJVulK87tvpBGZ0oFfZjK97hsb0PrRAn qJpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OuzaFTwfGMNndbyVLGZzkIKY+y7zC81Hu7O+CK8pY9I=; b=VBfymIxTmWeA0jjXIBFB1AmopqRrom66DpvHCFV65u6G6HSEQZ3dbmz5oR8x3WlxE4 zl7V1IvB45jC681yndzue1v7eArzCTQfEPvvXlem6AqDos1MFCkr6EeT/hXOgBqwqKBE AMPzRusmUVsX0Q5ltmmH/gzo00radGq23wtfLeO9x5EsRg8/PdytWS/U11JvUi/aCvv0 YcGgXkpUqjuNVp2+31K6GGAHT4jkgc6AztEOw+cciwQxfm2T8gVu2/wtiDDcmJ5QKjRL Le0msRZeId5F63xfDhhtX0AWjsXIwNc/Ol+zreoBQByYQHT90o3YVX86rR73gPibiyKM 3K8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0gVdMoq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n4-20020ac85a04000000b0039af5489abdsi578762qta.554.2023.01.26.03.23.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Jan 2023 03:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0gVdMoq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL0LR-0002e9-Nl; Thu, 26 Jan 2023 06:23:05 -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 1pL0LK-0001ig-Aa for qemu-devel@nongnu.org; Thu, 26 Jan 2023 06:22:58 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pL0LI-0003iq-0F for qemu-devel@nongnu.org; Thu, 26 Jan 2023 06:22:57 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bk16so1403964wrb.11 for ; Thu, 26 Jan 2023 03:22:55 -0800 (PST) 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=OuzaFTwfGMNndbyVLGZzkIKY+y7zC81Hu7O+CK8pY9I=; b=d0gVdMoqTUoCEp5YC3rTiOUpturM6eilLiAPl2kjoc3JmjykAuWSjxbgyLolPUe6Mb jvEcfrwh8h83sP1T6nTLz8q0FAcKToJkOLT4zOmDnHsXd1m0VHcQjb6rh2Jv5H9rWwng V5mIV6FcWYPu5ApsN2FZCShK1suoWypteZdC+GRT7w+WJav2Hwjrq06hlzUQBelFk+N5 4f8FsSrLmDblEMrAnH8Yx5fkGaEWik06g+hlTTCFbv2L4Qo7lxXlDouA51ucXaI+S5eB dREWmmHfuBGxpxHtj1bJHppCVL+kOAieGDmW4omA79RlMkiKcCwPJE4ONARMu9IPs6vL OJbw== 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=OuzaFTwfGMNndbyVLGZzkIKY+y7zC81Hu7O+CK8pY9I=; b=ZagNQ6WjLXQD6QfcTeTnw4M7WgBsDHtehtuyzG3IEXl8yOhe64Vvu3i3ChUpssMX7H +DQkG2xRz5EER9AuhrfcJ3UnX4QEB4tc0GI7E2Gs5DOk8+iMdiMv5ioP98DMWl9SWWLr 9O1dpwJsOuBUcwoStPaiClcCpNFo0LbtZyQbM3d6BIFiOiBqd8rrOuKT+2J8Gal74afV hMLxeP7bvUiQOernRqfbuIeJNf6N1lfjIZO34500GgkX97vKmv3wjHk51vcdN2DOvfuj dCKhfkFRYuJjt4XLi6sjA4j4OVNVIScAZBT9w5VXoZOJkFFu4G8XmMM0IYja4dC258eJ 3ktg== X-Gm-Message-State: AO0yUKUfc2MyoPcInDGIM4QMYeJtyHIIxcY8OtRVgycITUZHkARIvkWG QvyNEAiq8m8Q+6AQtv8YDBjkag== X-Received: by 2002:a5d:65c5:0:b0:2bf:c338:8673 with SMTP id e5-20020a5d65c5000000b002bfc3388673mr2181792wrw.41.1674732174564; Thu, 26 Jan 2023 03:22:54 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id d3-20020adfe2c3000000b002bc7fcf08ddsm974494wrj.103.2023.01.26.03.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 03:22:53 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 138351FFB7; Thu, 26 Jan 2023 11:22:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , John Snow , Cleber Rosa Subject: [PULL 05/35] build-sys: fix crlf-ending C code Date: Thu, 26 Jan 2023 11:22:20 +0000 Message-Id: <20230126112250.2584701-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126112250.2584701-1-alex.bennee@linaro.org> References: <20230126112250.2584701-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Marc-André 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é Lureau Acked-by: Thomas Huth Message-Id: <20230110132700.833690-2-marcandre.lureau@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20230124180127.1881110-6-alex.bennee@linaro.org> 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 += configure_file(output: 'config-host.h', configuration: config_host_data) hxtool = find_program('scripts/hxtool') -shaderinclude = find_program('scripts/shaderinclude.pl') +shaderinclude = find_program('scripts/shaderinclude.py') qapi_gen = find_program('scripts/qapi-gen.py') qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/commands.py', 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 = shift; -open FILE, "<", $file or die "open $file: $!"; -my $name = $file; -$name =~ s|.*/||; -$name =~ s/[-.]/_/g; -print "static GLchar ${name}_src[] =\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 = args[1] + basename = os.path.basename(file_path) + varname = basename.replace('-', '_').replace('.', '_') + + with os.fdopen(sys.stdout.fileno(), "wt", closefd=False, newline='\n') as stdout: + with open(file_path, "r", encoding='utf-8') as file: + print(f'static GLchar {varname}_src[] =', file=stdout) + for line in file: + line = line.rstrip() + print(f' "{line}\\n"', file=stdout) + print(' "\\n";', file=stdout) + + +if __name__ == '__main__': + sys.exit(main(sys.argv))