me
/
guix
Archived
1
0
Fork 0

gnu: Parameterize libgccjit.

* gnu/packages/gcc.scm (make-libgccjit): New variable.
(libgccjit): Define in terms of make-libgccjit.
master
Liliana Marie Prikler 2022-08-05 05:29:58 +02:00
parent 1da91705b0
commit bf33a77ea7
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87
1 changed files with 21 additions and 17 deletions

View File

@ -968,31 +968,33 @@ as the 'native-search-paths' field."
(custom-gcc gcc-11 "gdc" '("d") (custom-gcc gcc-11 "gdc" '("d")
%generic-search-paths))) %generic-search-paths)))
(define-public libgccjit (define-public (make-libgccjit gcc)
(package (package
(inherit gcc-9) (inherit gcc)
(name "libgccjit") (name "libgccjit")
(outputs (delete "lib" (package-outputs gcc))) (outputs (delete "lib" (package-outputs gcc)))
(properties (alist-delete 'hidden? (package-properties gcc))) (properties (alist-delete 'hidden? (package-properties gcc)))
(arguments (arguments
(substitute-keyword-arguments `(#:modules ((guix build gnu-build-system) (substitute-keyword-arguments (package-arguments gcc)
(guix build utils) ((#:modules _ '())
(ice-9 regex) '((guix build gnu-build-system)
(srfi srfi-1) (guix build utils)
(srfi srfi-26)) (ice-9 regex)
,@(package-arguments gcc)) (srfi srfi-1)
(srfi srfi-26)))
((#:configure-flags flags) ((#:configure-flags flags)
`(append `("--enable-host-shared" #~(cons* "--enable-host-shared"
,(string-append "--enable-languages=jit")) "--enable-languages=jit"
(remove (cut string-match "--enable-languages.*" <>) (remove (cut string-match "--enable-languages.*" <>)
,flags))) #$flags)))
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases #~(modify-phases #$phases
(add-after 'install 'remove-broken-or-conflicting-files (add-after 'install 'remove-broken-or-conflicting-files
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(for-each delete-file (for-each delete-file
(find-files (string-append (assoc-ref outputs "out") "/bin") (find-files
".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)")))))))) (string-append (assoc-ref outputs "out") "/bin")
".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))))))))
(synopsis "GCC library generating machine code on-the-fly at runtime") (synopsis "GCC library generating machine code on-the-fly at runtime")
(description (description
"This package is part of the GNU Compiler Collection and provides an "This package is part of the GNU Compiler Collection and provides an
@ -1003,6 +1005,8 @@ It can also be used for ahead-of-time code generation for building standalone
compilers. The just-in-time (jit) part of the name is now something of a compilers. The just-in-time (jit) part of the name is now something of a
misnomer."))) misnomer.")))
(define-public libgccjit (make-libgccjit gcc-9))
(define (make-gccgo gcc) (define (make-gccgo gcc)
"Return a gccgo package based on GCC." "Return a gccgo package based on GCC."
(let ((gccgo (custom-gcc gcc "gccgo" '("go") %generic-search-paths))) (let ((gccgo (custom-gcc gcc "gccgo" '("go") %generic-search-paths)))