From 46879d0de00b912750dae3e7344ab7d7b9663088 Mon Sep 17 00:00:00 2001 From: Yann Dupont Date: Mon, 11 May 2020 13:32:23 +0200 Subject: [PATCH] WIP --- gnu/packages/glicid.scm | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/glicid.scm b/gnu/packages/glicid.scm index d914c76..ba575dc 100644 --- a/gnu/packages/glicid.scm +++ b/gnu/packages/glicid.scm @@ -188,6 +188,55 @@ ;; (make-gcc-toolchain gfortan)) +(define %generic-search-paths + ;; This is the language-neutral search path for GCC. Entries in $CPATH are + ;; not considered "system headers", which means GCC can raise warnings for + ;; issues in those headers. 'CPATH' is the only one that works for + ;; front-ends not in the C family. + (list (search-path-specification + (variable "CPATH") + (files '("include"))) + (search-path-specification + (variable "LIBRARY_PATH") + (files '("lib" "lib64"))))) + + + +(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 glicid-gfortran-9 (package (custom-gcc gcc-9 "gfortran" '("fortran")