mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-29 21:58:36 +02:00
embed custom-gcc
This commit is contained in:
parent
4b8288b7e2
commit
98f234d557
1 changed files with 37 additions and 0 deletions
|
@ -58,6 +58,43 @@
|
|||
)
|
||||
|
||||
|
||||
(define* (custom-gcc gcc name languages
|
||||
#:optional
|
||||
(search-paths (package-native-search-paths gcc))
|
||||
#:key (separate-lib-output? #t))
|
||||
"Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
|
||||
as the 'native-search-paths' field."
|
||||
(package (inherit gcc)
|
||||
(name name)
|
||||
(outputs (if separate-lib-output?
|
||||
(package-outputs gcc)
|
||||
(delete "lib" (package-outputs gcc))))
|
||||
(native-search-paths search-paths)
|
||||
(properties (alist-delete 'hidden? (package-properties gcc)))
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments gcc)
|
||||
((#:modules modules %gnu-build-system-modules)
|
||||
`(,@modules
|
||||
(srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(ice-9 regex)))
|
||||
((#:configure-flags flags)
|
||||
`(cons (string-append "--enable-languages="
|
||||
,(string-join languages ","))
|
||||
(remove (cut string-match "--enable-languages.*" <>)
|
||||
,flags)))
|
||||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
(add-after 'install 'remove-broken-or-conflicting-files
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(for-each delete-file
|
||||
(find-files (string-append (assoc-ref outputs "out") "/bin")
|
||||
".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
|
||||
#t))))))))
|
||||
|
||||
|
||||
|
||||
|
||||
(define-public gfortran-11
|
||||
(hidden-package
|
||||
(custom-gcc gcc-11 "gfortran" '("fortran")
|
||||
|
|
Loading…
Add table
Reference in a new issue