qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: "Cleber Rosa" <crosa@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>, "John Snow" <jsnow@redhat.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	pbonzini@redhat.com, "David Hildenbrand" <david@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	kraxel@redhat.com,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-s390x@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Beraldo Leal" <bleal@redhat.com>
Subject: Re: [PATCH 1/2] build-sys: fix crlf-ending C code
Date: Mon, 9 Jan 2023 13:20:27 +0100	[thread overview]
Message-ID: <a0b0e603-577c-f018-e8db-050200293e76@linaro.org> (raw)
In-Reply-To: <20230109112110.128967-2-marcandre.lureau@redhat.com>

On 9/1/23 12:21, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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 <marcandre.lureau@redhat.com>
> ---
>   meson.build              |  2 +-
>   scripts/shaderinclude.pl | 16 ----------------
>   scripts/shaderinclude.py | 22 ++++++++++++++++++++++
>   3 files changed, 23 insertions(+), 17 deletions(-)
>   delete mode 100644 scripts/shaderinclude.pl
>   create mode 100755 scripts/shaderinclude.py


> diff --git a/scripts/shaderinclude.py b/scripts/shaderinclude.py
> new file mode 100755
> index 0000000000..c314b7ac63
> --- /dev/null
> +++ b/scripts/shaderinclude.py
> @@ -0,0 +1,22 @@

Missing license boilerplate.

> +#!/usr/bin/env python3
> +
> +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)


  parent reply	other threads:[~2023-01-09 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 11:21 [PATCH 0/2] Fix win32/msys2 shader compilation marcandre.lureau
2023-01-09 11:21 ` [PATCH 1/2] build-sys: fix crlf-ending C code marcandre.lureau
2023-01-09 11:41   ` Thomas Huth
2023-01-09 11:47     ` Marc-André Lureau
2023-01-09 15:56       ` Paolo Bonzini
2023-01-09 15:59         ` Marc-André Lureau
2023-01-09 12:20   ` Philippe Mathieu-Daudé [this message]
2023-01-09 11:21 ` [PATCH 2/2] .gitlab-ci.d/windows: do not disable opengl marcandre.lureau
2023-01-09 11:42   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0b0e603-577c-f018-e8db-050200293e76@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=crosa@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).