source: trunk/dports/_resources/port1.0/group/hocbinding-1.0.tcl @ 125633

Last change on this file since 125633 was 96776, checked in by blair@…, 7 years ago

group/*: trim trailing whitespace.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1# $Id: hocbinding-1.0.tcl 96776 2012-08-19 05:52:01Z blair@macports.org $
2#
3# Copyright (c) 2010 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# This PortGroup automatically sets all the fields of the various hs-HOC
33# bindings ports (e.g. hs-HOC-Foundation).
34#
35# Usage:
36#
37#   PortGroup        hocbinding 1.0
38#   hocbinding.setup framework version source
39#
40# where framework is the name of the bound framework (e.g. Foundation), version
41# is the version of the binding, and if the framework additional code is in HOC
42# source itself, source is "hoc"; otherwise don't use source.
43#
44# Example:
45#
46#   PortGroup        hocbinding 1.0
47#   hocbinding.setup Foundation 0.7-r413 hoc
48
49PortGroup haskell 1.0
50
51options hocbinding.framework
52options hocbinding.deps
53default hocbinding.deps {{}}
54
55proc hocbinding.setup {framework version {source ""}} {
56    global description name prefix worksrcpath
57
58    hocbinding.framework ${framework}
59
60    haskell.setup   HOC-${framework} ${version}
61    name            hs-HOC-${framework}
62    categories      devel
63    platforms       darwin
64
65    eval description ${framework} framework bindings for HOC
66    long_description ${description}
67
68    if {${source} eq "hoc"} {
69        homepage    http://code.google.com/p/hoc/
70
71        worksrcdir  hoc/Bindings/Generated/HOC-${framework}
72
73        post-extract {
74            xinstall -d ${worksrcpath}
75        }
76
77        depends_build-append \
78            port:hs-HOC
79
80        pre-configure {
81            set args ""
82            foreach dep ${hocbinding.deps} {
83                append args " -d ${dep}"
84            }
85
86            system "cd [file dirname ${worksrcpath}] && \
87                hoc-ifgen -f ${hocbinding.framework} -b ../binding-script.txt \
88                    -a ../AdditionalCode ${args}"
89        }
90
91        post-destroot {
92            set pidir ${prefix}/share/HOC
93            xinstall -d ${destroot}${pidir}
94            xinstall -m 0644 ${worksrcpath}/${hocbinding.framework}.pi \
95                ${destroot}${pidir}
96        }
97    }
98
99    universal_variant no
100}
Note: See TracBrowser for help on using the repository browser.