Ticket #8139: gnustep-1.0.4.tcl

File gnustep-1.0.4.tcl, 5.0 KB (added by yves@…, 19 years ago)

PortGroup again and again and again

Line 
1# et:ts=4
2# gnustep.tcl
3#
4# $Id: gnustep-1.0.tcl,v 1.7 2005/09/29 14:55:18 yves Exp $
5#
6# Copyright (c) 2006 Yves de Champlain <yves@opendarwin.org>,
7# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are
11# met:
12#
13# 1. Redistributions of source code must retain the above copyright
14#    notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16#    notice, this list of conditions and the following disclaimer in the
17#    documentation and/or other materials provided with the distribution.
18# 3. Neither the name of Apple Computer, Inc. nor the names of its
19#    contributors may be used to endorse or promote products derived from
20#    this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33#
34
35# Group code for GNUstep ports.
36
37#
38# Overview of gnustep 1.0 PortGroup
39#
40# default categories            gnustep
41# default homepage              http://www.gnustep.org/
42# default master_sites          gnustep:core/
43#
44# array set gnustep.post_flags  Apple CC two-level namespaces requires all
45#                               symbols to be resolved at link time,
46#                               so most of the patches are just that.
47#                               Setting the gnustep.post_flags array makes this
48#                               simple beyond common understanding !
49#                               ex:
50#                               platform darwin {
51#                                   array set gnustep.post_flags {
52#                                       BundleSubDir  "-lfoo -lbar"
53#                                   }
54#                               }
55#                               
56# default use_configure         no
57# default configure.args        ""
58#
59# default build.type            gnu
60# default build.args            messages=yes
61#
62# default destroot.args         messages=yes
63# default destroot.destdir      GNUSTEP_INSTALLATION_DIR=${destroot}${prefix}/GNUstep/System
64# variant with_docs             GNUstep programs providing documentation should
65#                               all follow the same pattern
66#
67
68
69# Options this group provides:
70
71default categories                      gnustep
72default homepage            http://www.gnustep.org/
73
74default master_sites        gnustep:core/
75
76default use_configure           no
77default configure.args      ""
78
79default build.type          gnu
80default build.args          messages=yes
81
82default destroot.args       messages=yes
83default destroot.destdir \
84    GNUSTEP_INSTALLATION_DIR=${destroot}${prefix}/GNUstep/System
85
86# for Darwin's linker
87
88array set gnustep.post_flags {}
89post-patch {
90    foreach {src_subdir post_libs} [array get gnustep.post_flags] {
91        set fl [ open ${worksrcpath}/$src_subdir/GNUmakefile.preamble a ]
92        puts $fl "SHARED_LD_POSTFLAGS += $post_libs"
93        close $fl
94    }
95}
96
97# GNUstep stages commands
98
99configure {
100    cd ${worksrcpath}
101    system "\
102        . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
103        && \
104        ./configure ${configure.pre_args} ${configure.args}"
105}
106   
107build {
108    cd ${worksrcpath}
109    system "\
110        . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
111        && \
112        ${build.cmd} ${build.target} ${build.args}"
113}
114
115destroot {
116    cd ${worksrcpath} 
117    system "\
118        . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
119        && \
120        ${destroot.cmd} ${destroot.target} \
121            ${destroot.args} ${destroot.destdir}"
122}
123
124# To build and install documentation provided by the port
125
126variant with_docs {
127    depends_build-append \
128        bin:texi2pdf:texinfo \
129        bin:texi2html:texi2html \
130        bin:pdftex:teTeX \
131        port:gnustep-base
132    post-destroot {
133        if {[file exists ${worksrcpath}/Documentation/GNUmakefile]} {
134            ui_msg "Making Documentation for ${name} ..."
135            cd ${worksrcpath}/Documentation
136            system "\
137                . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
138                && \
139                ${destroot.cmd} ${destroot.target} \
140                    ${destroot.args} ${destroot.destdir}"
141        } else {
142            ui_msg "No Documentation for ${name}."
143        }
144    }   
145}
146
147