Ticket #44891: ghc-ghc-bootstrap-update.diff
File ghc-ghc-bootstrap-update.diff, 15.9 KB (added by neverpanic (Clemens Lang), 10 years ago) |
---|
-
ghc/Portfile
5 5 PortGroup active_variants 1.1 6 6 7 7 name ghc 8 set canonicalname ghc9 8 # Do not update GHC separate from Haskell Platform. 10 9 # When updating GHC, make sure to revbump all Haskell ports. 11 version 7.6.3 12 revision 4 10 version 7.8.3 13 11 categories lang haskell 14 12 maintainers gmail.com:kitchen.andy cal openmaintainer 15 13 license BSD … … 29 27 GHC comes with a generational garbage collector, \ 30 28 and a space and time profiler. 31 29 32 homepage http://haskell.org/${ canonicalname}30 homepage http://haskell.org/${name} 33 31 master_sites ${homepage}/dist/${version}/ 34 distname ${ canonicalname}-${version}-src35 worksrcdir ${ canonicalname}-${version}32 distname ${name}-${version}-src 33 worksrcdir ${name}-${version} 36 34 37 35 use_bzip2 yes 38 36 39 distfiles ${ canonicalname}-${version}-src${extract.suffix} \40 ${ canonicalname}-${version}-testsuite${extract.suffix}37 distfiles ${name}-${version}-src${extract.suffix} \ 38 ${name}-${version}-testsuite${extract.suffix} 41 39 42 checksums ghc-7. 6.3-src.tar.bz2 \43 rmd160 82a673ed38b7cf9a59afeb01057625fc761a822b\44 sha256 bd43823d31f6b5d0b2ca7b74151a8f98336ab0800be85f45bb591c9c26aac998\45 ghc-7. 6.3-testsuite.tar.bz2 \46 rmd160 e1d7536b1b0799a6c069eb89be41ceb56692b68d\47 sha256 870d8f50a1b569b0f93d0c7c6b80225280841988f1d779aafe847bcf02d7625640 checksums ghc-7.8.3-src.tar.bz2 \ 41 rmd160 464d31d924a8c1e23e94b3cae810c4e41dad4b75 \ 42 sha256 2358826f8424bf571dcc313bd882422fe108a340d6e37db4339ff6d5d6ac3f37 \ 43 ghc-7.8.3-testsuite.tar.bz2 \ 44 rmd160 abc39b71e2f3926b80c681428c447f39599d7d83 \ 45 sha256 9cfef874adf5b895701ae52e507f07049a64246af120ac15200e7bf612521122 48 46 49 47 depends_build port:ghc-bootstrap \ 50 48 port:libxslt 51 49 52 50 depends_lib port:gmp \ 53 51 port:ncurses \ 54 port:libiconv 55 56 patchfiles patch-configure-disable-docbook-ps-and-pdf.diff \ 57 patch-utils__mkdirhier__mkdirhier.sh.diff \ 58 patch-includes_HsFFI.h.diff 52 port:libiconv \ 53 port:llvm-3.5 59 54 55 patchfiles patch-configure-workaround-bsdsed-incompatibility.diff \ 56 patch-configure-disable-docs.diff 60 57 61 58 livecheck.type none 62 59 test.run yes 63 use_parallel_build no64 65 # -- BEGIN gcc variants66 67 variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.3} {68 configure.compiler macports-gcc-4.369 configure.args-append --with-gcc=${configure.cc}70 require_active_variants ghc-bootstrap gcc4371 }72 73 variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.4} {74 configure.compiler macports-gcc-4.475 configure.args-append --with-gcc=${configure.cc}76 require_active_variants ghc-bootstrap gcc4477 }78 79 variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.5} {80 configure.compiler macports-gcc-4.581 configure.args-append --with-gcc=${configure.cc}82 require_active_variants ghc-bootstrap gcc4583 }84 85 variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 gcc49 description {Compile with gcc 4.6} {86 configure.compiler macports-gcc-4.687 configure.args-append --with-gcc=${configure.cc}88 require_active_variants ghc-bootstrap gcc4689 }90 91 variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 gcc49 description {Compile with gcc 4.7} {92 configure.compiler macports-gcc-4.793 configure.args-append --with-gcc=${configure.cc}94 require_active_variants ghc-bootstrap gcc4795 }96 97 variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc49 description {Compile with gcc 4.8} {98 configure.compiler macports-gcc-4.899 configure.args-append --with-gcc=${configure.cc}100 require_active_variants ghc-bootstrap gcc48101 }102 103 variant gcc49 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 description {Compile with gcc 4.9} {104 configure.compiler macports-gcc-4.9105 configure.args-append --with-gcc=${configure.cc}106 require_active_variants ghc-bootstrap gcc49107 }108 109 if {![variant_isset gcc43] && ![variant_isset gcc44] &&110 ![variant_isset gcc45] && ![variant_isset gcc46] &&111 ![variant_isset gcc47] && ![variant_isset gcc49]} {112 default_variants +gcc48113 }114 115 # -- END gcc variants116 60 117 61 set bootstraproot ${prefix}/share/ghc-bootstrap 62 set llvmPrefix ${prefix}/libexec/llvm-3.5 118 63 configure.args --with-ghc=${bootstraproot}/bin/ghc \ 119 64 --with-iconv-includes=${prefix}/include \ 120 65 --with-iconv-libraries=${prefix}/lib \ 121 66 --with-gmp-includes=${prefix}/include \ 122 --with-gmp-libraries=${prefix}/lib 67 --with-gmp-libraries=${prefix}/lib \ 68 --with-gcc="${configure.cc}" \ 69 --with-llc=${llvmPrefix}/bin/llc \ 70 --with-opt=${llvmPrefix}/bin/opt 71 123 72 124 73 # OK so because the bootstrap binary has been prebuilt for libraries 125 74 # in /usr/lib we search these before macports stuff to prevent … … 128 77 compiler.cpath /usr/include 129 78 compiler.library_path /usr/lib 130 79 80 build.args VERBOSE=1 81 destroot.args VERBOSE=1 82 131 83 post-destroot { 132 84 set prefixlib ${prefix}/lib/${worksrcdir} 133 85 set destlib ${destroot}/${prefixlib} 134 set libver ${ canonicalname}${version}86 set libver ${name}${version} 135 87 136 88 variable libs [ list \ 137 89 libHSrts-${libver}.dylib \ … … 173 125 # delete old ${prefix}/lib/ghc-${version} directories 174 126 foreach fullpath [glob -directory ${prefix}/lib ghc-*] { 175 127 if {$fullpath ne $libprefix} { 176 ui_ debug"Cleaning up remnant GHC library directory ${fullpath}"128 ui_info "Cleaning up remnant GHC library directory ${fullpath}" 177 129 delete $fullpath 178 130 } 179 131 } … … 202 154 fs-traverse file $packageconfd { 203 155 foreach pattern $deletefiles { 204 156 if {[string match $pattern $file]} { 205 ui_ debug "Removing remnant package registration file ${file}"157 ui_info "Removing remnant package registration file ${file}" 206 158 delete $file 207 159 } 208 160 } -
ghc/files/patch-configure-workaround-bsdsed-incompatibility.diff
1 --- configure.orig 2014-09-17 22:40:16.000000000 +0200 2 +++ configure 2014-09-17 22:40:40.000000000 +0200 3 @@ -4075,7 +4075,7 @@ 4 $as_echo "$as_me: Building in-tree ghc-pwd" >&6;} 5 rm -rf utils/ghc-pwd/dist-boot 6 mkdir utils/ghc-pwd/dist-boot 7 - GHC_LDFLAGS=`echo $LDFLAGS | sed 's/\(^\| \)\([^ ]\)/\1-optl\2/g'` 8 + GHC_LDFLAGS= # this breaks our build with BSD sed, and we don't need the LDFLAGS here 9 if ! "$WithGhc" $GHC_LDFLAGS -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd 10 then 11 as_fn_error $? "Building ghc-pwd failed" "$LINENO" 5 -
ghc-bootstrap/Portfile
5 5 6 6 name ghc-bootstrap 7 7 set canonicalname ghc 8 version 7.0.4 9 revision 1 8 # Note: 7.6.3 doesn't have a i386 darwin version at http://www.haskell.org/ghc/dist/7.6.3 9 version 7.6.2 10 10 categories lang haskell 11 11 maintainers gmail.com:kitchen.andy cal openmaintainer 12 12 license BSD … … 27 27 use_bzip2 yes 28 28 29 29 checksums ${canonicalname}-${version}-i386-apple-darwin${extract.suffix} \ 30 rmd160 ed4cb136a30455e57ca4526d89b019fe4ce638f3\31 sha256 c 316fcd59166f1075675d7365b06cca973aec6623254a4a7fb28e74c352c4462\30 rmd160 232b3aa4ed9e2ff09d520f4ae02fa572a671178a \ 31 sha256 c1da502fa7d99f3d87370c65d705a7e8ee4c900fdb62df6f71696c5432047059 \ 32 32 ${canonicalname}-${version}-x86_64-apple-darwin${extract.suffix} \ 33 rmd160 14f4c6a044eaa3d04f1645324f9255eebff9a49d \34 sha256 74580b919b5205007901d15da88635e4b2dcc887086fb16d238eeb7011a255d433 rmd160 b0870a4a292fae7248f9b0be485affa4a5a76a2d \ 34 sha256 eb0dd19bd5a6eede332d58de219437b9c2b186c72a1fc0c60fa1095b0c2d2789 35 35 36 # -- BEGIN gcc variants 37 38 variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.3} { 39 configure.compiler macports-gcc-4.3 40 } 41 42 variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.4} { 43 configure.compiler macports-gcc-4.4 44 } 45 46 variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 gcc49 description {Compile with gcc 4.5} { 47 configure.compiler macports-gcc-4.5 48 } 49 50 variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 gcc49 description {Compile with gcc 4.6} { 51 configure.compiler macports-gcc-4.6 52 } 53 54 variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 gcc49 description {Compile with gcc 4.7} { 55 configure.compiler macports-gcc-4.7 56 } 57 58 variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc49 description {Compile with gcc 4.8} { 59 configure.compiler macports-gcc-4.8 60 } 61 62 variant gcc49 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 description {Compile with gcc 4.9} { 63 configure.compiler macports-gcc-4.9 64 } 65 66 if {![variant_isset gcc43] && ![variant_isset gcc44] && 67 ![variant_isset gcc45] && ![variant_isset gcc46] && 68 ![variant_isset gcc47] && ![variant_isset gcc49]} { 69 default_variants +gcc48 36 post-extract { 37 # Copy clang-wrapper for re-inplace during configure 38 xinstall -m 644 ${filespath}/clang-wrapper ${workpath}/clang-wrapper 70 39 } 71 40 72 # -- END gcc variants73 74 41 configure.pre_args --prefix=${prefix}/share/ghc-bootstrap 42 configure.args --with-gcc=${configure.cc} 75 43 76 44 pre-configure { 77 45 # OK so because this binary has been prebuilt for libraries … … 79 47 # weird things don't happen 80 48 configure.ldflags -L/usr/lib 81 49 configure.cppflags -I/usr/include 50 51 # patch clang-wrapper and make sure it is used by patching settings.in 52 reinplace "s#@clang@#${configure.cc}#g" ${workpath}/clang-wrapper 53 reinplace "s#@SettingsCCompilerCommand@#${prefix}/share/ghc-bootstrap/libexec/clang-wrapper#g" ${worksrcpath}/settings.in 82 54 } 83 55 84 56 build {} 85 57 86 58 post-destroot { 59 # install clang-wrapper to libexec 60 xinstall -d -m 755 ${destroot}${prefix}/share/ghc-bootstrap/libexec 61 xinstall -m 755 ${workpath}/clang-wrapper ${destroot}${prefix}/share/ghc-bootstrap/libexec 62 87 63 # Delete dylibs; they aren't used by the bootstrap ghc and are incorrectly 88 # linked against /usr/local, causing rev-upgrade to complain. 89 # This problem might only be reproducible in i386; the x86_64 version 90 # apparently doesn't ship any dylibs. 64 # linked against /usr/local, causing rev-upgrade to complain. This problem 65 # might only be reproducible in i386; the x86_64 version apparently doesn't 66 # ship any dylibs. 67 68 # We also delete all the .html files, because we really don't need the 69 # documentation in a bootstrap port. 91 70 fs-traverse f ${destroot}${prefix} { 92 71 if {[file isfile ${f}]} { 93 if {[file extension ${f}] == ".dylib"} { 72 set ext [file extension ${f}] 73 if {${ext} eq ".dylib" || ${ext} eq ".html"} { 94 74 delete ${f} 95 75 } 96 76 } 97 77 } 98 78 } 99 79 100 # TODO don't install documentation101 102 80 livecheck.type none -
ghc-bootstrap/files/clang-wrapper
1 #!/usr/bin/python 2 # vim:ts=4:sts=4:sw=4:et:tw=120 3 # Explicitly using /usr/bin/python, not /usr/bin/env python here. 4 5 ########## 6 # README # 7 ########## 8 # This script wraps clang for GHC. GHC won't compile with clang's preprocessor unless the flags 9 # -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs 10 # are passed (in addition to -E -undef -traditional, which are already passed in by GHC). Furthermore, if a compilation 11 # language is passed and it is C (i.e., -x c), it is replaced with -x assembler-with-cpp. 12 # 13 # There is a popular script fulfilling the same purpose on Github, but the script does not specify a license and can 14 # thus not be re-distributed and used in MacPorts. To avoid the same problem with this script further down the road: 15 # 16 ########### 17 # LICENSE # 18 ########### 19 # 20 # SPDX-License-Identifier: BSD-2-Clause 21 # 22 # Copyright (c) 2014, Clemens Lang <cal@macports.org> 23 # All rights reserved. 24 # 25 # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 26 # following conditions are met: 27 # 28 # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 29 # disclaimer. 30 # 31 # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 32 # disclaimer in the documentation and/or other materials provided with the distribution. 33 # 34 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 35 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 37 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 38 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 39 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 40 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 42 import sys 43 import os 44 45 # To be reinplaced on installation, should hold the absolute path to clang 46 __clang_path = '@clang@' 47 48 # The set of flags to be added in preprocessor mode 49 __clang_cpp_flags = ['-Wno-invalid-pp-token', '-Wno-unicode', '-Wno-trigraphs'] 50 51 def filterLanguageFlag(args): 52 lastArgWasLanguage = False 53 # Start at 1, because index 0 is the program basename, and we don't want to check that for -x 54 for idx in range(1, len(args)): 55 if lastArgWasLanguage and args[idx].lower() == 'c': 56 args[idx] = 'assembler-with-cpp' 57 lastArgWasLanguage = args[idx] == '-x' 58 return args 59 60 # copy argv for modification 61 args = sys.argv[:] 62 63 # Don't check for -E, -undef, -traditional in sys.argv[0] 64 # But check for the presence of all -E, -undef, and -traditional in the other flags 65 if all(needle in sys.argv[1:] for needle in ['-E', '-undef', '-traditional']): 66 # We're in preprocessor mode, replace "-x c" with "-x assembler-with-cpp" and append __clang_cpp_flags 67 args = filterLanguageFlag(args) 68 args.extend(__clang_cpp_flags) 69 70 # Replace args[0] with the real path to clang and exec that instead 71 args[0] = __clang_path 72 #print >> sys.stderr, "Executing: %s" % repr(args) 73 os.execv(args[0], args)