source: trunk/dports/lang/ghc-bootstrap/Portfile

Last change on this file was 150013, checked in by mf2k@…, 15 months ago

ghc ghc-bootstrap: Ports abandoned by kitchen.andy. (#51780)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 150013 2016-07-08 17:55:27Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compiler_blacklist_versions 1.0
6
7name                ghc-bootstrap
8set canonicalname   ghc
9# Note: 7.6.3 doesn't have a i386 darwin version at http://www.haskell.org/ghc/dist/7.6.3
10version             7.6.2
11revision            1
12categories          lang haskell
13maintainers         cal openmaintainer
14license             BSD
15platforms           darwin
16supported_archs     i386 x86_64
17universal_variant   no
18installs_libs       no
19
20description         The Glorious Glasgow Haskell Compilation System
21long_description    \
22                    This is a package that installs a binary \
23                    bootstrap ghc compiler.
24
25homepage            http://haskell.org/${canonicalname}
26master_sites        ${homepage}/dist/${version}/
27distname            ${canonicalname}-${version}-${build_arch}-apple-darwin
28worksrcdir          ${canonicalname}-${version}
29use_bzip2           yes
30
31checksums           ${canonicalname}-${version}-i386-apple-darwin${extract.suffix} \
32                        rmd160  232b3aa4ed9e2ff09d520f4ae02fa572a671178a \
33                        sha256  c1da502fa7d99f3d87370c65d705a7e8ee4c900fdb62df6f71696c5432047059 \
34                    ${canonicalname}-${version}-x86_64-apple-darwin${extract.suffix} \
35                        rmd160  b0870a4a292fae7248f9b0be485affa4a5a76a2d \
36                        sha256  eb0dd19bd5a6eede332d58de219437b9c2b186c72a1fc0c60fa1095b0c2d2789
37
38post-extract {
39    # Copy clang-wrapper for re-inplace during configure
40    xinstall -m 644 ${filespath}/clang-wrapper ${workpath}/clang-wrapper
41}
42
43# Compilation (of the final non-bootstrap GHC, which uses the C compiler
44# configured in this port) fails with older versions of clang. clang-4.1 from
45# Xcode 4.5 is too old, clang-5.1 from from Xcode 5.1 works. I do not have
46# any data points in between, so I'm blacklisting everything lower than 5.1.
47# If you want to test the versions in between, be my guest.
48# Also avoid LLVM GCC 4.2 and GCC 4.2, which are before MacPorts' clang 3.4
49# in the fallback list on some systems.
50compiler.blacklist-append \
51                    llvm-gcc-4.2 \
52                    gcc-4.2 \
53                    {clang < 503.0.38} \
54                    macports-clang-3.3
55
56configure.pre_args  --prefix=${prefix}/share/ghc-bootstrap
57configure.args      --with-gcc=${configure.cc}
58
59pre-configure {
60    # OK so because this binary has been prebuilt for libraries
61    # in /usr/lib we search these before macports stuff so (hopefully)
62    # weird things don't happen
63    configure.ldflags  -L/usr/lib
64    configure.cppflags -I/usr/include
65
66    # patch clang-wrapper and make sure it is used by patching settings.in
67    reinplace "s#@clang@#${configure.cc}#g" ${workpath}/clang-wrapper
68    reinplace "s#@SettingsCCompilerCommand@#${prefix}/share/ghc-bootstrap/libexec/clang-wrapper#g" ${worksrcpath}/settings.in
69}
70
71build {}
72
73post-destroot {
74    # install clang-wrapper to libexec
75    xinstall -d -m 755 ${destroot}${prefix}/share/ghc-bootstrap/libexec
76    xinstall -m 755 ${workpath}/clang-wrapper ${destroot}${prefix}/share/ghc-bootstrap/libexec
77
78    # Delete all .dylib files, because their load commands would have to be
79    # fixed or rev-upgrade complains and tries to rebuild the port. However, we
80    # cannot correctly fix all .dylibs, because the have not been built with
81    # -headerpad_max_install_names. Deleting them fixes the problem and GHC
82    # still seems to compile correctly.
83
84    # We also delete all the .html files, because we really don't need the
85    # documentation in a bootstrap port.
86
87    fs-traverse f ${destroot}${prefix} {
88        if {[file isfile ${f}]} {
89            set ext [file extension ${f}]
90            if {${ext} eq ".html" || ${ext} eq ".dylib"} {
91                delete ${f}
92            }
93        }
94    }
95}
96
97livecheck.type      none
Note: See TracBrowser for help on using the repository browser.