source: trunk/dports/_resources/port1.0/group/haskell-1.0.tcl @ 106872

Last change on this file since 106872 was 106872, checked in by cal@…, 5 years ago

c2hs: move to hs-c2hs, update to 0.16.4, forces rebuild with new GHC, add dependency language-c < 0.4, modify haskell portgroup to support not running register scripts

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: haskell-1.0.tcl 106872 2013-06-09 13:23:06Z cal@macports.org $
2#
3# Copyright (c) 2009 The MacPorts Project
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of The MacPorts Project nor the names of its
16#    contributors may be used to endorse or promote products derived from
17#    this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31#
32# Usage:
33# PortGroup       haskell 1.0
34# haskell.setup   haskell_package version [haskell_compiler]
35# where haskell_package is the name of the package (eg, digest), version
36# is the version for it, and haskell_compiler is which compiler to use
37# (ghc is the default if not specified, and currently the only option).
38# This automatically defines name, version, categories, homepage,
39# master_sites, distname, and depends_build as appropriate, and sets up
40# the configure, build, destroot, and post-activate stages.  It can do
41# pre-deactivate if that ever becomes an option in MacPorts.
42#
43
44# List of supported compilers
45set haskell.compiler_list {ghc}
46
47# Configuration for each compiler
48array set haskell.compiler_configuration {
49    ghc {port       ghc
50         compiler   ${prefix}/bin/ghc}
51}
52
53proc haskell.setup {package version {compiler ghc} {register_scripts "yes"}} {
54    global haskell.compiler_list
55    global haskell.compiler_configuration
56    global homepage prefix configure.cmd destroot worksrcpath name master_sites configure.cc
57
58    if {![info exists haskell.compiler_configuration($compiler)]} {
59        return -code error "Compiler ${compiler} not currently supported"
60    }
61    array set compiler_config [lindex [array get haskell.compiler_configuration $compiler] 1]
62    name                hs-[string tolower ${package}]
63    version             ${version}
64    categories          devel haskell
65    homepage            http://hackage.haskell.org/package/${package}
66    master_sites        http://hackage.haskell.org/packages/archive/${package}/${version}
67    distname            ${package}-${version}
68    depends_lib         port:${compiler_config(port)}
69    configure.cmd       runhaskell
70    configure.pre_args
71    configure.args      Setup configure \
72                        --prefix=${prefix} \
73                        --with-compiler=[subst ${compiler_config(compiler)}] \
74                        -v \
75                        --enable-library-profiling \
76                        --with-gcc=${configure.cc}
77    build.cmd           ${configure.cmd}
78    build.args          Setup build -v
79    build.target
80    destroot.cmd        ${configure.cmd}
81    destroot.destdir
82    destroot.target     Setup copy --destdir=${destroot}
83        if {${register_scripts} == "yes"} {
84                post-destroot {
85                        system "cd ${worksrcpath} && ${configure.cmd} Setup register --gen-script"
86                        system "cd ${worksrcpath} && ${configure.cmd} Setup unregister --gen-script"
87                        xinstall -m 755 -d ${destroot}${prefix}/libexec/${name}
88                        xinstall -m 755 -W ${worksrcpath} register.sh unregister.sh \
89                                ${destroot}${prefix}/libexec/${name}
90                }
91                post-activate {
92                        system "${prefix}/libexec/${name}/register.sh"
93                }
94                pre-deactivate {
95                        system "${prefix}/libexec/${name}/unregister.sh"
96                }
97        }
98
99    livecheck.type      regex
100    livecheck.url       http://hackage.haskell.org/cgi-bin/hackage-scripts/package/${package}
101    livecheck.regex     /packages/archive/${package}/.*/${package}-(.*)\.tar\.gz
102
103    universal_variant   no
104}
105
Note: See TracBrowser for help on using the repository browser.