diff options
| -rw-r--r-- | gnu/packages/installers.scm | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/gnu/packages/installers.scm b/gnu/packages/installers.scm index fb8b71be79..a95d6e823d 100644 --- a/gnu/packages/installers.scm +++ b/gnu/packages/installers.scm @@ -85,41 +85,23 @@ (string delimiter))) (define (mingw-path? path) (string-prefix? (assoc-ref %build-inputs "mingw-w64") path)) + (define (xgcc-path? path) + (string-prefix? (assoc-ref %build-inputs "xgcc") path)) + (define (cross-toolchain-path? path) + (or (xgcc-path? path) (mingw-path? path))) + (for-each (lambda (env-name) (let ((env-val (getenv env-name))) - ;; Remove all mingw-w64 paths from env vars meant + ;; Remove all mingw-w64 and xgcc paths from env vars meant ;; for native toolchain (setenv env-name - (filter-delimited-string env-val (negate mingw-path?))) + (filter-delimited-string env-val (negate cross-toolchain-path?))) ;; Add the removed paths back into CROSS_-prefixed ;; version of env vars (setenv (string-append "CROSS_" env-name) - (filter-delimited-string env-val mingw-path?)))) - '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH")) - ;; Hack to place mingw-w64 path at the end of search - ;; paths. Could probably use a specfile and dirafter - (setenv "CROSS_C_INCLUDE_PATH" - (string-join - `(,@(map (cut string-append - (assoc-ref %build-inputs "xgcc") - "/lib/gcc/" ,triplet "/" - ,(package-version xgcc) <>) - '("/include" - "/include-fixed")) - ,(getenv "CROSS_C_INCLUDE_PATH")) - ":")) - (setenv "CROSS_CPLUS_INCLUDE_PATH" - (string-join - `(,@(map (cut string-append (assoc-ref %build-inputs "xgcc") <>) - `("/include/c++" - ,(string-append "/include/c++/" ,triplet) - "/include/c++/backward" - ,@(map (cut string-append "/lib/gcc/" ,triplet "/" ,(package-version xgcc) <>) - '("/include" - "/include-fixed")))) - ,(getenv "CROSS_CPLUS_INCLUDE_PATH")) - ":")))) + (filter-delimited-string env-val cross-toolchain-path?)))) + '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH")))) (add-before 'build 'fix-target-detection (lambda _ ;; NSIS target detection is screwed up, manually change |
