Ticket #25558: Portfile.5

File Portfile.5, 4.0 KB (added by neverpanic (Clemens Lang), 12 years ago)
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         FIXME
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
36use_bzip2       yes
37
38depends_build   port:ghc-bootstrap
39
40depends_lib     port:gmp           \
41                port:ncurses       \
42                port:libiconv
43
44use_parallel_build  no
45
46# -- BEGIN gcc variants
47
48variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
49    configure.compiler macports-gcc-4.3
50    depends_lib-append port:gcc43
51}
52
53variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
54    configure.compiler macports-gcc-4.4
55    depends_lib-append port:gcc44
56}
57
58variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
59    configure.compiler macports-gcc-4.5
60    depends_lib-append port:gcc45
61}
62
63variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {Compile with gcc 4.6} {
64    configure.compiler macports-gcc-4.6
65    depends_lib-append port:gcc46
66}
67
68variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46  description {Compile with gcc 4.7} {
69    configure.compiler macports-gcc-4.7
70    depends_lib-append port:gcc47
71}
72
73if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
74    default_variants +gcc45
75}
76
77# -- END gcc variants
78
79set bootstraproot ${prefix}/share/ghc-bootstrap
80configure.args  --with-ghc=${bootstraproot}/bin/ghc     \
81                --with-gcc=${configure.cc}              \
82                --with-iconv-includes=${prefix}/include \
83                --with-iconv-libraries=${prefix}/lib    \
84                --with-gmp-includes=${prefix}/include   \
85                --with-gmp-libraries=${prefix}/lib
86
87# OK so because the bootstrap binary has been prebuilt for libraries
88# in /usr/lib we search these before macports stuff to prevent
89# link errors, ghc _should_ actually compile itself in stage2
90# using paths from the command line arguments
91
92compiler.cpath /usr/include:${compiler.cpath} 
93compiler.library_path /usr/lib:${compiler.cpath} 
94
95post-destroot {
96    set prefixlib ${prefix}/lib/${worksrcdir}
97    set destlib   ${destroot}/${prefixlib}
98    set libver    ${canonicalname}${version}
99
100    variable libs [ list                               \
101                    libHSrts-${libver}.dylib           \
102                    libHSrts_debug-${libver}.dylib     \
103                    libHSrts_thr-${libver}.dylib       \
104                    libHSrts_thr_debug-${libver}.dylib ]
105
106    system "install_name_tool -id ${prefixlib}/libffi.dylib ${destlib}/libffi.dylib"
107
108    foreach lib $libs {
109      regexp -line {[^[:space:]]*/libffi.*\.dylib} [exec otool -L ${destlib}/${lib}] oldlib
110      system "install_name_tool -change ${oldlib} ${prefixlib}/libffi.dylib ${destlib}/$lib"
111    }
112}