source: trunk/dports/lang/ghc/Portfile

Last change on this file was 150013, checked in by mf2k@…, 5 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: 6.5 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
8# Do not update GHC separate from Haskell Platform.
9# When updating GHC, make sure to revbump all Haskell ports.
10# Also make sure to update the version in the Haskell PortGroup.
11version             7.8.3
12revision            4
13categories          lang haskell
14maintainers         cal openmaintainer
15license             BSD
16platforms           darwin
17
18description The Glorious Glasgow Haskell Compilation System
19long_description    \
20        The Glasgow Haskell Compiler is a robust,       \
21        fully-featured, optimising compiler and interactive \
22        environment for Haskell 98, GHC compiles Haskell to \
23        either native code or C.  It implements numerous    \
24        experimental language extensions to Haskell 98,     \
25        for example: concurrency, a foreign language interface, \
26        multi-parameter type classes, scoped type variables,    \
27        existential and universal quantification, unboxed   \
28        types, exceptions, weak pointers, and so on.        \
29        GHC comes with a generational garbage collector,    \
30        and a space and time profiler.
31
32homepage        http://haskell.org/${name}
33master_sites    ${homepage}/dist/${version}/
34distname        ${name}-${version}-src
35worksrcdir      ${name}-${version}
36
37use_bzip2       yes
38
39distfiles       ${name}-${version}-src${extract.suffix} \
40                ${name}-${version}-testsuite${extract.suffix}
41
42checksums       ghc-7.8.3-src.tar.bz2 \
43                rmd160  464d31d924a8c1e23e94b3cae810c4e41dad4b75 \
44                sha256  2358826f8424bf571dcc313bd882422fe108a340d6e37db4339ff6d5d6ac3f37 \
45                ghc-7.8.3-testsuite.tar.bz2 \
46                rmd160  abc39b71e2f3926b80c681428c447f39599d7d83 \
47                sha256  9cfef874adf5b895701ae52e507f07049a64246af120ac15200e7bf612521122
48
49depends_build   port:ghc-bootstrap \
50                port:libxslt
51
52depends_lib     port:gmp           \
53                port:ncurses       \
54                port:libiconv      \
55                port:llvm-3.5       \
56                port:libffi
57
58patchfiles      patch-configure-workaround-bsdsed-incompatibility.diff \
59                patch-configure-disable-docs.diff \
60                patch-unix_lib_osx_sandbox_compatibility.diff
61
62livecheck.type  none
63test.run        yes
64
65# Compilation fails with older versions of clang. clang-4.1 from Xcode 4.5 is
66# too old, clang-5.1 from from Xcode 5.1 works. I do not have any data points in
67# between, so I'm blacklisting everything lower than 5.1. If you want to test
68# the versions in between, be my guest.
69# Also avoid LLVM GCC 4.2 and GCC 4.2, which are before MacPorts' clang 3.4 in
70# the fallback list on some systems.
71# NOTE that it is actually the C compiler used in ghc-bootstrap that is
72# relevant here. This code block is duplicated in this port to avoid
73# inconsistencies.
74compiler.blacklist-append \
75                llvm-gcc-4.2 \
76                gcc-4.2 \
77                {clang < 503.0.38} \
78                macports-clang-3.3
79
80set bootstraproot ${prefix}/share/ghc-bootstrap
81set llvmPrefix  ${prefix}/libexec/llvm-3.5
82configure.args  --with-ghc=${bootstraproot}/bin/ghc \
83                --with-iconv-includes=${prefix}/include \
84                --with-iconv-libraries=${prefix}/lib \
85                --with-gmp-includes=${prefix}/include \
86                --with-gmp-libraries=${prefix}/lib \
87                --with-ffi-includes=${prefix}/lib/libffi-3.2.1/include \
88                --with-ffi-libraries=${prefix}/lib \
89                --with-system-libffi \
90                --with-gcc="${configure.cc}" \
91                --with-llc=${llvmPrefix}/bin/llc \
92                --with-opt=${llvmPrefix}/bin/opt
93
94# OK so because the bootstrap binary has been prebuilt for libraries in
95# /usr/lib we search these in addition to MacPorts' paths to prevent link
96# errors. GHC _should_ actually compile itself in stage2 using paths from the
97# command line arguments
98compiler.cpath /usr/include
99compiler.library_path /usr/lib
100
101build.args      VERBOSE=1
102destroot.args   VERBOSE=1
103
104pre-activate {
105    set obsoletes [list]
106
107    # Legacy port deactivation hack added 2012-12-08, hs-platform-ghc no longer exists
108    lappend obsoletes hs-platform-ghc
109    # Legacy port deactivation hack added 2013-08-11, hs-process is provided by base
110    lappend obsoletes hs-process
111    # Legacy port deactivation hack added 2013-08-14, hs-template-haskell is provided by base
112    lappend obsoletes hs-template-haskell
113    # Legacy port deactivation hack added 2015-01-05, hs-transformers, hs-xhtml
114    # and hs-binary are provided by base
115    lappend obsoletes hs-transformers
116    lappend obsoletes hs-xhtml
117    lappend obsoletes hs-binary
118
119    foreach obsolete $obsoletes {
120        if {![catch {set obsolete_installed [lindex [registry_active $obsolete] 0]}]} {
121            # $obsolete is installed and active
122            # force deactivation
123            registry_deactivate_composite $obsolete "" [list ports_nodepcheck 1]
124        }
125    }
126}
127
128post-activate {
129    set libprefix "${prefix}/lib/${name}-${version}"
130
131    # delete old ${prefix}/lib/ghc-${version} directories
132    foreach fullpath [glob -nocomplain -directory ${prefix}/lib ghc-*] {
133        if {$fullpath ne $libprefix} {
134            ui_info "Cleaning up remnant GHC library directory ${fullpath}"
135            catch {delete $fullpath}
136        }
137    }
138
139    # Walk the current package.conf.d and delete all files not belonging to any
140    # port, since haskell packages now directly drop it in packages.conf.d and
141    # register the file to themselves. The package cache is updated by the
142    # post-activate phase of the packages, which now runs ghc-pkg recache.
143    #
144    # This *will* cause pre-deactivation failures for all ports that still are
145    # correctly installed and would unregister themselves on uninstall.
146    # Unfortunately there is no good way around this now that the contents of
147    # PortGroups are stored together with Portfiles and used for deactivation
148    # (otherwise I could just edit the PortGroup and make unregistration
149    # failures non-fatal)
150    foreach configfile [glob -nocomplain -directory $libprefix/package.conf.d *] {
151        if {[registry_file_registered $configfile] == 0} {
152            # file is not registered to any port, remove it
153            catch {delete $configfile}
154        }
155    }
156
157    catch {system [list ${prefix}/bin/ghc-pkg -v recache]}
158}
Note: See TracBrowser for help on using the repository browser.