Ticket #8139: gnustep-1.0.5.tcl

File gnustep-1.0.5.tcl, 5.8 KB (added by yves@…, 18 years ago)

gnustep 1.0 portgroup

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        CC-gcc-dp-4.1
58#
59# default build.type            gnu
60# default build.args            messages=yes
61#
62# default gnustep.domain        System
63# default destroot.args         messages=yes
64# default destroot.destdir      GNUSTEP_INSTALLATION_DIR=${destroot}${prefix}/GNUstep/$gnustep.domain
65# variant with_docs             GNUstep programs providing documentation should
66#                               all follow the same pattern
67#
68
69
70# Options this group provides :
71
72options gnustep.domain
73
74# Default values for this group :
75
76default categories                      gnustep
77default homepage            http://www.gnustep.org/
78
79default master_sites        gnustep:core
80default depends_lib         gnustep-back
81
82default use_configure           no
83default configure.args      CC=gcc-dp-4.1
84
85default build.type          gnu
86default build.args          messages=yes
87
88default gnustep.domain      System
89default destroot.args       messages=yes
90default destroot.destdir \
91    GNUSTEP_INSTALLATION_DIR=${destroot}${prefix}/GNUstep/${gnustep.domain}
92
93# for Darwin's linker
94
95array set gnustep.post_flags {}
96post-patch {
97    foreach {src_subdir post_libs} [array get gnustep.post_flags] {
98        set fl [ open ${worksrcpath}/$src_subdir/GNUmakefile.preamble a ]
99        puts $fl "\nSHARED_LD_POSTFLAGS += $post_libs"
100        close $fl
101    }
102}
103
104# GNUstep stages commands
105
106configure {
107    if { ${use_configure} == "yes" } {
108        cd ${worksrcpath}
109        ui_debug "./configure ${configure.pre_args} ${configure.args}"
110        system "\
111            . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
112            && \
113            ./configure ${configure.pre_args} ${configure.args}"
114    }
115}
116   
117build {
118    cd ${worksrcpath}
119    ui_debug "${build.cmd} ${build.target} ${build.args}"
120    system "\
121        . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
122        && \
123        ${build.cmd} ${build.target} ${build.args}"
124}
125
126destroot {
127    cd ${worksrcpath}
128    ui_debug "${destroot.cmd} ${destroot.target} \
129            ${destroot.args} ${destroot.destdir}"
130    system "\
131        . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
132        && \
133        ${destroot.cmd} ${destroot.target} \
134            ${destroot.args} ${destroot.destdir}"
135}
136
137# To build and install documentation provided by the port
138
139variant with_docs {
140    depends_build-append \
141        bin:texi2pdf:texinfo \
142        bin:texi2html:texi2html \
143        bin:pdftex:teTeX \
144        port:gnustep-base
145    post-destroot {
146        if {[file exists ${worksrcpath}/Documentation/GNUmakefile]} {
147            ui_msg "--->  Making Documentation for ${name}"
148            cd ${worksrcpath}/Documentation
149            system "\
150                . ${prefix}/GNUstep/System/Library/Makefiles/GNUstep.sh \
151                && \
152                ${destroot.cmd} ${destroot.target} \
153                    ${destroot.args} ${destroot.destdir}"
154            set info_dir \
155                ${destroot}${prefix}/GNUstep/System/Library/Documentation/info
156            if {[file exists ${info_dir}/manual.info]} {
157                set manual_name [regsub {gnustep-} ${name} ""]
158                file rename ${info_dir}/manual.info \
159                    ${info_dir}/${manual_name}-manual.info
160            }
161        } else {
162            ui_msg "--->  No Documentation for ${name}"
163        }
164    }   
165}
166
167