Subject: [bug#53833] [PATCH] gnu: Add qbe.

From: Liliana Marie Prikler <[email-masked]>
Date: Mon, 07 Feb 2022 10:47:08 +0100

Am Sonntag, dem 06.02.2022 um 20:13 -0500 schrieb jgart:
> * gnu/packages/c.scm (qbe): New variable.
> ---
>  gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
> index 459d996fa2..8966b7b8d0 100644
> --- a/gnu/packages/c.scm
> +++ b/gnu/packages/c.scm
> @@ -142,6 +142,36 @@ (define-public pcc
>      ;; preferred.  See http://pcc.ludd.ltu.se/licenses/ for more
> details.
>      (license (list license:bsd-2 license:bsd-3))))
>  
> +(define-public qbe
> +  (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e")
> +        (revision "0"))
> +    (package
> +      (name "qbe")
> +      (version (git-version "0.0" revision commit))
>From the homepage: "QBE is in constant change. It is a young project
and I still have many ideas to try."  As always, I don't think it's too
good of an idea to package projects that tell you "this edge will make
you bleed".  Or in the words of the manual

> Occasionally, we package snapshots of upstream’s version control
> system (VCS) instead of formal releases.  This should remain
> exceptional, because it is up to upstream developers to clarify what
> the stable release is.
I think upstream is very clear here that QBE is not yet stable and
therefore not something you'd want in a distro.  Of course, since the
recipe is a rather simple one, you can easily maintain it in your own
channel -- or not package it at all and use it from source with just a
C compiler.

> +      (source
> +        (origin
> +          (method git-fetch)
> +          (uri
> +            (git-reference
> +              (url "git://c9x.me/qbe")
> +              (commit commit)))
> +          (file-name (git-file-name name version))
> +          (sha256
> +           (base32
> +           
> "0qbnsrwk10v0s42vzxy2wvksd8xl8bmxfzqv2a4j4zjaklqgfd6j"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:tests? #f ; Tests require a running qemu?
You should be able to add qemu to native-inputs if that's all it takes.
> +         #:make-flags (list (string-append "CC=" ,(cc-for-target))
> +                            (string-append "PREFIX=" %output))
> +         #:phases
> +         (modify-phases %standard-phases
> +           (delete 'configure))))
> +      (synopsis "Backend compiler")
> +      (description "@code{qbe} is a compiler backend.")
It'd be nice if the description was more descriptive :)
Also the synopsis should probably not invert the ordering of "compiler"
and "backend".
> +      (home-page "https://c9x.me/compile/")
> +      (license license:expat))))
> +
>  (define-public libbytesize
>    (package
>      (name "libbytesize")

Cheers