[PATCH] gnu: Add cproc.

  • Done
  • quality assurance status badge
Details
5 participants
  • jgart
  • Liliana Marie Prikler
  • Ludovic Courtès
  • Maxim Cournoyer
  • paren
Owner
unassigned
Submitted by
jgart
Severity
normal
Blocked by
J
J
jgart wrote on 7 Feb 2022 02:14
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20220207011414.28849-1-jgart@dismail.de
* gnu/packages/c.scm (cproc): New variable.
---

Hi Guixers,

This is a WIP in case anyone would like to help check/test/review this package.

cproc depends on qbe which is available from ticket 53833.

all best,

jgart

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

Toggle diff (45 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 8966b7b8d0..87a6d413bc 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -172,6 +172,38 @@ (define-public qbe
(home-page "https://c9x.me/compile/")
(license license:expat))))
+(define-public cproc
+ (let ((commit "51e61fa5fa3de8cabc2191a5c6ac4d18aaaaf049")
+ (revision "0"))
+ (package
+ (name "cproc")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://git.sr.ht/~mcf/cproc")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1fyyqxg2fphh104yrn15az0w7vipkljkgspi6kzv8lyddl5758nj"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:make-flags (list (string-append "CC=" ,(cc-for-target))
+ (string-append "PREFIX=" %output))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs
+ (list qbe))
+ (synopsis "C11 compiler")
+ (description "@code{cproc} is a C11 compiler using QBE as a backend.")
+ (home-page "https://sr.ht/~mcf/cproc")
+ (license license:expat))))
+
(define-public libbytesize
(package
(name "libbytesize")
--
2.35.0
L
L
Ludovic Courtès wrote on 5 Apr 2022 18:12
(name . jgart)(address . jgart@dismail.de)(address . 53834-done@debbugs.gnu.org)
87o81fldaq.fsf@gnu.org
jgart <jgart@dismail.de> skribis:

Toggle quote (4 lines)
> This is a WIP in case anyone would like to help check/test/review this package.
>
> cproc depends on qbe which is available from ticket 53833.

As with https://issues.guix.gnu.org/53833, please ping us when you
think that it can get in together with qbe.

Ludo’.
Closed
P
P
paren wrote on 7 May 2022 19:58
(address . control@debbugs.gnu.org)
fa86128a5aae32d030f101db64492a2cc9083344@disroot.org
unarchive 53834
Attachment: file
(
(
(unmatched-parenthesis wrote on 7 May 2022 20:04
(address . 53834@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220507180419.19617-1-paren@disroot.org
* gnu/packages/c.scm (cproc): New variable.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
gnu/packages/c.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 1e3296dae1..e03ea2e6eb 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -46,6 +46,7 @@ (define-module (gnu packages c)
#:use-module (gnu packages bison)
#:use-module (gnu packages check)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages perl)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages guile)
@@ -1097,3 +1098,48 @@ (define-public qbe
performance of advanced compilers such as LLVM and GCC in only 10% of the code.")
(home-page "https://c9x.me/compile/")
(license license:expat))))
+
+(define-public cproc
+ (let ((commit "70fe9ef1810cc6c05bde9eb0970363c35fa7e802")
+ (revision "1"))
+ (package
+ (name "cproc")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sr.ht/~mcf/cproc")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qmgzll7z7mn587azkj4cizyyd8ii6iznfxpc66ja08140sbn9yx"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags ,#~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output))
+ #:phases
+ ,#~(modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gcc-lib (assoc-ref inputs "gcc:lib"))
+ (ld #$(ld-for-target))
+ (host-system #$(nix-system->gnu-triplet (%current-system)))
+ (target-system
+ #$(nix-system->gnu-triplet (or (%current-target-system)
+ (%current-system)))))
+ (invoke "./configure"
+ (string-append "--prefix=" out)
+ (string-append "--host=" host-system)
+ (string-append "--target=" target-system)
+ (string-append "--with-ld=" ld)
+ (string-append "--with-gcc-libdir=" gcc-lib))))))))
+ (inputs `(("qbe" ,qbe)
+ ("gcc:lib" ,gcc "lib")))
+ (supported-systems (list "x86_64-linux" "aarch64-linux"))
+ (synopsis "Simple C11 compiler backed by QBE")
+ (description "@code{cproc} is a C compiler using QBE as a backend. It
+currently supports C11 along with some GCC and C2x extensions.")
+ (home-page "https://sr.ht/~mcf/cproc")
+ (license license:expat))))
--
2.36.0
(
(
(unmatched-parenthesis wrote on 8 May 2022 22:25
[PATCH v2] gnu: Add cproc.
(address . 53834@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220508202500.10449-1-paren@disroot.org
* gnu/packages/c.scm (cproc): New variable.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
This improved patch fixes some style nits.

Thanks to lilyp for pointing them out on #guix!

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

Toggle diff (63 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index c9a25eb801..216ddfef88 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -47,6 +47,7 @@ (define-module (gnu packages c)
#:use-module (gnu packages bison)
#:use-module (gnu packages check)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages perl)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages guile)
@@ -1108,3 +1109,48 @@ (define-public qbe
language as input.")
(home-page "https://c9x.me/compile/")
(license license:expat))))
+
+(define-public cproc
+ (let ((commit "70fe9ef1810cc6c05bde9eb0970363c35fa7e802")
+ (revision "1"))
+ (package
+ (name "cproc")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sr.ht/~mcf/cproc")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qmgzll7z7mn587azkj4cizyyd8ii6iznfxpc66ja08140sbn9yx"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output))
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gcc-lib (assoc-ref inputs "gcc:lib"))
+ (host-system #$(nix-system->gnu-triplet (%current-system)))
+ (target-system
+ #$(nix-system->gnu-triplet (or (%current-target-system)
+ (%current-system)))))
+ (invoke "./configure"
+ (string-append "--prefix=" out)
+ (string-append "--host=" host-system)
+ (string-append "--target=" target-system)
+ (string-append "--with-ld=" #$(ld-for-target))
+ (string-append "--with-gcc-libdir=" gcc-lib))))))))
+ (inputs `(("qbe" ,qbe)
+ ("gcc:lib" ,gcc "lib")))
+ (supported-systems (list "x86_64-linux" "aarch64-linux"))
+ (synopsis "Simple C11 compiler backed by QBE")
+ (description "@code{cproc} is a C compiler using QBE as a backend, supporting most of C11
+along with some GCC and C2x extensions.")
+ (home-page "https://sr.ht/~mcf/cproc")
+ (license license:expat))))
--
2.36.0
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
Maxim Cournoyer wrote on 7 Jul 2022 22:12
(name . (unmatched-parenthesis)(address . paren@disroot.org)(address . 53834-done@debbugs.gnu.org)
875yk8y94m.fsf_-_@gmail.com
Hello!

"(unmatched-parenthesis" <paren@disroot.org> writes:

Toggle quote (73 lines)
> * gnu/packages/c.scm (cproc): New variable.
>
> Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
> ---
> This improved patch fixes some style nits.
>
> Thanks to lilyp for pointing them out on #guix!
>
> gnu/packages/c.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
> index c9a25eb801..216ddfef88 100644
> --- a/gnu/packages/c.scm
> +++ b/gnu/packages/c.scm
> @@ -47,6 +47,7 @@ (define-module (gnu packages c)
> #:use-module (gnu packages bison)
> #:use-module (gnu packages check)
> #:use-module (gnu packages flex)
> + #:use-module (gnu packages gcc)
> #:use-module (gnu packages perl)
> #:use-module (gnu packages texinfo)
> #:use-module (gnu packages guile)
> @@ -1108,3 +1109,48 @@ (define-public qbe
> language as input.")
> (home-page "https://c9x.me/compile/")
> (license license:expat))))
> +
> +(define-public cproc
> + (let ((commit "70fe9ef1810cc6c05bde9eb0970363c35fa7e802")
> + (revision "1"))
> + (package
> + (name "cproc")
> + (version (git-version "0.0" revision commit))
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://git.sr.ht/~mcf/cproc")
> + (commit commit)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "1qmgzll7z7mn587azkj4cizyyd8ii6iznfxpc66ja08140sbn9yx"))))
> + (build-system gnu-build-system)
> + (arguments
> + (list #:make-flags
> + #~(list (string-append "CC=" #$(cc-for-target))
> + (string-append "PREFIX=" #$output))
> + #:phases
> + #~(modify-phases %standard-phases
> + (replace 'configure
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out"))
> + (gcc-lib (assoc-ref inputs "gcc:lib"))
> + (host-system #$(nix-system->gnu-triplet (%current-system)))
> + (target-system
> + #$(nix-system->gnu-triplet (or (%current-target-system)
> + (%current-system)))))
> + (invoke "./configure"
> + (string-append "--prefix=" out)
> + (string-append "--host=" host-system)
> + (string-append "--target=" target-system)
> + (string-append "--with-ld=" #$(ld-for-target))
> + (string-append "--with-gcc-libdir=" gcc-lib))))))))
> + (inputs `(("qbe" ,qbe)
> + ("gcc:lib" ,gcc "lib")))
> + (supported-systems (list "x86_64-linux" "aarch64-linux"))
> + (synopsis "Simple C11 compiler backed by QBE")
> + (description "@code{cproc} is a C compiler using QBE as a backend, supporting most of C11
> +along with some GCC and C2x extensions.")
> + (home-page "https://sr.ht/~mcf/cproc")
> + (license license:expat))))

Well done! I've adjusted slightly the source to fit under 80 columns,
and push as 96eb2337b5c3d43c99979222633987a8e45df4b9. Thank you!

Maxim
Closed
(
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 53834-done@debbugs.gnu.org)
CLA2I8B1RGJY.3KT0EXLP6PWWH@guix-aspire
On Thu Jul 7, 2022 at 9:12 PM BST, Maxim Cournoyer wrote:
Toggle quote (3 lines)
> Well done! I've adjusted slightly the source to fit under 80 columns,
> and push as 96eb2337b5c3d43c99979222633987a8e45df4b9. Thank you!

Thanks Maxim! :)

-- (
Closed
?