Ticket #25558: Portfile.4

File Portfile.4, 4.1 KB (added by kitchen.andy@…, 12 years ago)

GHC 7.4.2 portfile

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$
3
4PortSystem          1.0
5
6name                ghc
7set canonicalname       ghc
8version             7.4.2
9categories              lang haskell
10maintainers             auastro
11license                 BSD
12platforms               darwin
13
14description     The Glorious Glasgow Haskell Compilation System
15long_description        \
16                The Glasgow Haskell Compiler is a robust,               \
17                fully-featured, optimising compiler and interactive     \
18                environment for Haskell 98, GHC compiles Haskell to     \
19                either native code or C.  It implements numerous        \
20                experimental language extensions to Haskell 98,         \
21                for example: concurrency, a foreign language interface, \
22                multi-parameter type classes, scoped type variables,    \
23                existential and universal quantification, unboxed       \
24                types, exceptions, weak pointers, and so on.            \
25                GHC comes with a generational garbage collector,        \
26                and a space and time profiler.
27
28homepage            http://haskell.org/${canonicalname}
29master_sites    ${homepage}/dist/${version}/
30distname        ${canonicalname}-${version}-src
31worksrcdir      ${canonicalname}-${version}
32
33checksums       rmd160  c1caf17de353d3f805966ea64235a8341a8e071e \
34                sha256  f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d \
35         
36
37use_bzip2           yes
38
39depends_build   port:ghc-bootstrap
40
41depends_lib         port:gmp           \
42                        port:ncurses       \
43                        port:libiconv
44
45use_parallel_build  no
46
47# -- BEGIN gcc variants
48
49variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
50    configure.compiler macports-gcc-4.3
51    depends_lib-append port:gcc43
52}
53
54variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
55    configure.compiler macports-gcc-4.4
56    depends_lib-append port:gcc44
57}
58
59variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
60    configure.compiler macports-gcc-4.5
61    depends_lib-append port:gcc45
62}
63
64variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {Compile with gcc 4.6} {
65    configure.compiler macports-gcc-4.6
66    depends_lib-append port:gcc46
67}
68
69variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46  description {Compile with gcc 4.7} {
70    configure.compiler macports-gcc-4.7
71    depends_lib-append port:gcc47
72}
73
74if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
75    default_variants +gcc45
76}
77
78# -- END gcc variants
79
80pre-configure {
81    set bootstraproot ${prefix}/share/ghc-bootstrap
82    configure.args  --with-ghc=${bootstraproot}/bin/ghc     \
83                    --with-gcc=${configure.cc}              \
84                    --with-iconv-includes=${prefix}/include \
85                    --with-iconv-libraries=${prefix}/lib    \
86                    --with-gmp-includes=${prefix}/include   \
87                    --with-gmp-libraries=${prefix}/lib
88   
89    # OK so because the bootstrap binary has been prebuilt for libraries
90    # in /usr/lib we search these before macports stuff to prevent
91    # link errors, ghc _should_ actually compile itself in stage2
92    # using paths from the command line arguments
93
94    compiler.cpath /usr/include:${compiler.cpath} 
95    compiler.library_path /usr/lib:${compiler.cpath} 
96}
97
98pre-build {
99    compiler.cpath /usr/include:${compiler.cpath} 
100    compiler.library_path /usr/lib:${compiler.cpath} 
101}
102
103post-destroot {
104    set prefixlib ${prefix}/lib/${worksrcdir}
105    set destlib   ${destroot}/${prefixlib}
106    set libver    ${canonicalname}${version}
107
108    variable libs [ list                               \
109                    libHSrts-${libver}.dylib           \
110                    libHSrts_debug-${libver}.dylib     \
111                    libHSrts_thr-${libver}.dylib       \
112                    libHSrts_thr_debug-${libver}.dylib ]
113
114    system "install_name_tool -id ${prefixlib}/libffi.dylib ${destlib}/libffi.dylib"
115
116    foreach lib $libs {
117      regexp -line {[^[:space:]]*/libffi.*\.dylib} [exec otool -L ${destlib}/${lib}] oldlib
118      system "install_name_tool -change ${oldlib} ${prefixlib}/libffi.dylib ${destlib}/$lib"
119    }
120}