diff mbox series

[bug#37870] gnu: make-nsis: Fix cross-compilation.

Message ID lI5DwU353RX8yByF2S7GQy2TR3ndGe6sca1dTT0Wj0b3qR6vQK1ncG7juxeQjNHaIEbycrt_6lC4kbG2urSWIADaqzPkHbh9KfCWHCCK0x0=@carldong.me
State Accepted
Headers show
Series [bug#37870] gnu: make-nsis: Fix cross-compilation. | expand

Commit Message

Carl Dong Oct. 22, 2019, 4:14 p.m. UTC
Hi all, here's the somewhat hacky patch from #37801, I will follow up on #30756
about using `-idirafter` as a potentially cleaner fix for #30756, but this
should make nsis work for now!

* gnu/packages/installers.scm (make-nsis)[arguments]: Enforce correct
ordering of search paths (mingw-w64 last).
---
 gnu/packages/installers.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

--
2.23.0
diff mbox series

Patch

diff --git a/gnu/packages/installers.scm b/gnu/packages/installers.scm
index c987254d61..e5e38af152 100644
--- a/gnu/packages/installers.scm
+++ b/gnu/packages/installers.scm
@@ -92,7 +92,21 @@ 
                              ;; CROSS_-prefixed version of env vars
                              (setenv (string-append "CROSS_" env-name)
                                      (filter-delimited-string env-val mingw-path?))))
-                         '("CPLUS_INCLUDE_PATH" "LIBRARY_PATH" "C_INCLUDE_PATH"))))
+                         '("CPATH" "LIBRARY_PATH"))
+                        ;; Hack to place mingw-w64 path at the end of search
+                        ;; paths.  Could probably use a specfile and dirafter
+                        (setenv "CROSS_CPLUS_INCLUDE_PATH"
+                                (string-append
+                                 (string-join
+                                  (map (lambda (x) (string-append (assoc-ref %build-inputs "xgcc") x))
+                                       `("/include/c++"
+                                         ,(string-append "/include/c++/" ,triplet)
+                                         "/include/c++/backward"
+                                         "/lib/gcc/x86_64-w64-mingw32/7.4.0/include"
+                                         "/lib/gcc/x86_64-w64-mingw32/7.4.0/include-fixed"))
+                                  ":")
+                                 ":"
+                                 (getenv "CROSS_CPATH")))))
                     (add-before 'build 'fix-target-detection
                       (lambda _
                         ;; NSIS target detection is screwed up, manually