on iko/ghcjs-patch-master help sign in
Patch gcc version fix on macOS
commit0e66dbd17fa1a97f1f146fd5d03706ec70d2d22a authorHideaki Kawai <kayhide@gmail.com> dateMon 25 Nov 2019, 09:16 (7 years ago) parent83966f3
2 files changed+12
overlays/bootstrap.nix+1 overlays/patches/ghc/ghc-darwin-gcc-version-fix.patch+11
overlays/bootstrap.nix+1
@@ -98,6 +98,7 @@ in {
9898 ++ self.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch
9999 ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch
100100 ++ self.lib.optional (versionAtLeast "8.6.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-macOS-loadArchive-fix.patch
101+ ++ self.lib.optional (versionAtLeast "8.4.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-darwin-gcc-version-fix.patch
101102 ;
102103 in ({
103104 ghc844 = self.callPackage ../compiler/ghc {
overlays/patches/ghc/ghc-darwin-gcc-version-fix.patchnew file+11
@@ -0,0 +1,11 @@
1+--- a/aclocal.m4
2++++ b/aclocal.m4
3+@@ -1285,7 +1285,7 @@ AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
4+ [
5+ # Be sure only to look at the first occurrence of the "version " string;
6+ # Some Apple compilers emit multiple messages containing this string.
7+- fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p'`"
8++ fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p' | head -n 1`"
9+ FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.4],
10+ [AC_MSG_ERROR([Need at least gcc version 4.4 (4.7+ recommended)])])
11+ FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.6], GccLT46=YES)