[PATCH 1/2] gnu: Add qbe.

  • Done
  • quality assurance status badge
Details
3 participants
  • Antero Mejr
  • Liliana Marie Prikler
  • Maxime Devos
Owner
unassigned
Submitted by
Antero Mejr
Severity
normal
Merged with
A
A
Antero Mejr wrote on 24 May 2022 03:21
(address . guix-patches@gnu.org)(name . Antero Mejr)(address . antero@mailbox.org)
20220524012155.48729-1-antero@mailbox.org
* gnu/packages/c.scm (qbe): New variable.
---
Hare + QBE builds, tested running a Hello World program using the stdlib.

gnu/packages/c.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index e14e56ad71..01fd2e9a96 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2021 David Dashyan <mail@davie.li>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1096,3 +1097,37 @@ (define-public utf8-h
C and C++. The functions it provides are like those from the C header
string.h, but with a utf8* prefix instead of the str* prefix.")
(license license:unlicense))))
+
+(define-public qbe
+ (let ((commit "9a3e131cf713f8619705f906caf28c5809708ad0") (revision "0"))
+ (package
+ (name "qbe")
+ (version (git-version "0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://c9x.me/qbe.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04dhdm2j84h9hlqj934wh9v456v3kzh0ayxs1gncyh4inv3b41cf"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;no test suite
+ #:make-flags
+ (list (string-append "CC="
+ ,(cc-for-target))
+ (string-append "DESTDIR="
+ (assoc-ref %outputs "out"))
+ "PREFIX=")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)))) ;no configure script
+ (supported-systems (list "x86_64-linux" "aarch64-linux" "riscv64-linux"))
+ (home-page "https://c9x.me/compile/")
+ (synopsis "Compiler backend written in C")
+ (description
+ "QBE aims to be a pure C embeddable backend that provides 70% of the
+performance of advanced compilers in 10% of the code.")
+ (license license:expat))))
--
2.36.1
L
L
Liliana Marie Prikler wrote on 24 May 2022 08:43
(address . control@debbugs.gnu.org)
8fdea3aaa79939d25f1fbe1a7b92b7f73ae20cc1.camel@ist.tugraz.at
merge 53833 55151 55605
merge 55187 55606
block 55187 by 53833
block 53834 by 53833
thanks
M
M
Maxime Devos wrote on 24 May 2022 18:56
e0761282f92bb1e5ab86aaef9db258b0c448c802.camel@telenet.be
Antero Mejr via Guix-patches via schreef op ma 23-05-2022 om 21:21 [-
0400]:
Toggle quote (9 lines)
> +      (arguments
> +       `(#:tests? #f ;no test suite
> +         #:make-flags
> +         (list (string-append "CC="
> +                              ,(cc-for-target))
> +               (string-append "DESTDIR="
> +                              (assoc-ref %outputs "out"))
> +               "PREFIX=")

Guix doesn't use this kind of staging, "PREFIX=" (assoc-ref %outputs
"out") should be sufficient, no need for DESTDIR. And the somewhat
obscure 'assoc-ref' can be eliminated and the strata made more explicit
with gexps:

(arguments
(list #:tests? #f ;...
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target))
(string-append "PREFIX=" #$output))))
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYo0OUhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7usLAP4sO2dDYit5oC5Aoo/MsLZWJ3et
HN7zbMJqbYUdrIaywwD+OcQjnVwKl+vt8Rlu45e0v76HShbQYTeNS2cEexGCEwY=
=NPXX
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 24 May 2022 23:06
cbcd996ccd5664fa04f777dece3e1a4b178503b8.camel@telenet.be
Antero Mejr via Guix-patches via schreef op ma 23-05-2022 om 21:21 [-
0400]:
Toggle quote (2 lines)
> * gnu/packages/c.scm (qbe): New variable.

Looks like someone wrote a patch for this previously (+ applied):
https://issues.guix.gnu.org/53833. The 'hare' part hasn't been done
yet though.

For future reference, you can use
to look if a patch already exists for the package.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYo1I4BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mzLAP0STfVm1uxnOIu7usiSROk6N6xd
PfJChlm1kgeeegn3lwD/eUBG6gIp6tZhoFhaKLtNkLcrEGF978ZNqm1zN/VboQo=
=Y6WH
-----END PGP SIGNATURE-----


?
Your comment

This issue is archived.

To comment on this conversation send an email to 55605@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 55605
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch