source: trunk/dports/_resources/port1.0/group/haskellplatform-1.0.tcl @ 100372

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

haskell-platform: update to 2012.4.0.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1# $Id: haskellplatform-1.0.tcl 100372 2012-12-09 22:23:54Z cal@macports.org $
2#
3# Copyright (c) 2009-2012 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-platform 1.0
34# haskellplatform.setup     haskell_package version [register_scripts]
35# where haskell_package is the name of the package (eg, digest), version is the
36# version for it. This automatically defines name, version, categories,
37# homepage, master_sites, distname, and depends_build as appropriate, and sets
38# up the configure, build, destroot, and post-activate stages. It can do
39# pre-deactivate if that ever becomes an option in MacPorts. register_scripts
40# can be used to deactivate installing register.sh and unregister.sh as might be
41# needed for non-library parts of the haskell platform. Set it to "no" to
42# achieve this; defaults to "yes".
43
44
45proc haskellplatform.setup {package version {register_scripts "yes"}} {
46    global homepage prefix configure.cmd configure.cc destroot worksrcpath name master_sites
47
48    name                hs-platform-[string tolower ${package}]
49    version             ${version}
50    categories          devel haskell
51    homepage            http://hackage.haskell.org/package/${package}
52    master_sites        http://hackage.haskell.org/packages/archive/${package}/${version}
53    distname            ${package}-${version}
54    depends_lib         port:ghc
55    configure.args      Setup configure \
56                        --prefix=${prefix} \
57                        --with-compiler=${prefix}/bin/ghc \
58                        -v \
59                        --enable-library-profiling \
60                                                --with-gcc=${configure.cc}
61    configure.cmd       runhaskell
62    configure.pre_args
63
64    build.cmd           ${configure.cmd}
65    build.args          Setup build -v
66    build.target
67    destroot.cmd        ${configure.cmd}
68    destroot.destdir
69    destroot.target     Setup copy --destdir=${destroot}
70        if {${register_scripts} == "yes"} {
71                post-destroot {
72            system "cd ${worksrcpath} && ${configure.cmd} Setup register --gen-script"
73            system "cd ${worksrcpath} && ${configure.cmd} Setup unregister --gen-script"
74            xinstall -m 755 -d ${destroot}${prefix}/libexec/${name}
75            xinstall -m 755 -W ${worksrcpath} register.sh unregister.sh \
76                ${destroot}${prefix}/libexec/${name}
77        }
78        post-activate {
79            system "${prefix}/libexec/${name}/register.sh"
80        }
81        pre-deactivate {
82            system "${prefix}/libexec/${name}/unregister.sh"
83        }
84        }
85    universal_variant   no
86
87    livecheck.type      none
88}
89
Note: See TracBrowser for help on using the repository browser.