source: trunk/base/src/port1.0/resources/group/gnustep-1.0.tcl @ 26266

Last change on this file since 26266 was 26266, checked in by yves@…, 13 years ago

gnustep portgroup for gnustep-make-2.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.4 KB
Line 
1# et:ts=4
2# gnustep.tcl
3#
4# $Id: gnustep-1.0.tcl 26266 2007-06-17 22:13:54Z yves@macports.org $
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#
36# Group code for GNUstep ports.
37#
38
39#
40# Overview of gnustep 1.0 PortGroup :
41#
42
43#
44# default categories            gnustep
45# default homepage              http://www.gnustep.org/
46# default master_sites          gnustep:core
47# default depends_lib           port:gnustep-core
48#
49# array set gnustep.post_flags  Apple CC two-level namespaces requires all
50#                               symbols to be resolved at link time,
51#                               so most of the patches are just that.
52#                               Setting the gnustep.post_flags array makes this
53#                               simple beyond common understanding !
54#                               ex:
55#                               platform darwin {
56#                                   array set gnustep.post_flags {
57#                                       BundleSubDir  "-lfoo -lbar"
58#                                   }
59#                               }
60#
61#
62# proc set_gnustep_make         Sets GNUSTEP_MAKEFILES
63#                               according to the FilesystemLayout
64#
65# proc set_gnustep_env          Sets DYLD_LIBRARY_PATH and PATH
66#                               for the gnustep FilesystemLayout
67#
68#
69# default gnustep.cc            CC=gcc-dp-4.2
70#
71# default use_configure         no
72# default configure.env         Sets the environment for the gnustep FilesystemLayout
73# configure.pre_args-append     ${gnustep.cc} [set_gnustep_make]"
74#
75# default build.env             {[set_gnustep_env]}
76# default build.type            gnu
77# build.pre_args-append         "messages=yes [set_gnustep_make]"
78#
79# default destroot.env          {[set_gnustep_env]}
80# destroot.pre_args-append      "messages=yes [set_gnustep_make] [set_gnustep_domain]"
81#
82# variant with_docs             Most GNUstep programs providing documentation
83#                               follow the same pattern
84#
85
86#
87# GNUstep utilities
88#
89
90#
91# Adds SHARED_LD_POSTFLAGS for Darwin's linker
92#
93# Sets GNUSTEP_INSTALLATION_DOMAIN for ports using the
94# deprecated GNUSTEP_SYSTEM_ROOT variable
95#
96
97array set gnustep.post_flags {}
98
99post-patch {
100    foreach {src_subdir post_libs} [array get gnustep.post_flags] {
101        set fl [ open ${worksrcpath}/$src_subdir/GNUmakefile.preamble a ]
102        puts $fl "\nSHARED_LD_POSTFLAGS += $post_libs"
103        close $fl
104    }
105    foreach gmf [glob -nocomplain -directory ${worksrcpath} GNUmakefile*] {
106        reinplace \
107            "s|GNUSTEP_INSTALLATION_DIR = \$\(GNUSTEP_SYSTEM_ROOT\)|GNUSTEP_INSTALLATION_DOMAIN=SYSTEM|g" \
108                $gmf
109    }
110}
111
112#
113# Returns true (1) if current file layout is gnustep
114# Returns false (0) otherwise
115#
116
117proc gnustep_layout {} {
118    global prefix
119   
120    if {[file exists ${prefix}/GNUstep/System/Library/Makefiles]} {
121        return 1
122    }
123    return 0
124}
125
126#
127# Sets GNUSTEP_SYSTEM_LIBRARY according to the FilesystemLayout
128#
129
130proc set_system_library {} {
131    global prefix
132   
133    if {[gnustep_layout]} {
134        return "${prefix}/GNUstep/System/Library"
135    }
136    return "${prefix}/lib/GNUstep"
137}
138
139#
140# Sets GNUSTEP_LOCAL_LIBRARY according to the FilesystemLayout
141#
142
143proc set_local_library {} {
144    global prefix
145   
146    if {[gnustep_layout]} {
147        return "${prefix}/GNUstep/Local/Library"
148    }
149    return "${prefix}/lib/GNUstep"
150}
151
152#
153# Sets GNUSTEP_MAKEFILES according to the FilesystemLayout
154#
155
156proc set_gnustep_make {} {
157    global prefix
158   
159    if {[gnustep_layout]} {
160        return "GNUSTEP_MAKEFILES=${prefix}/GNUstep/System/Library/Makefiles"
161    }
162    return "GNUSTEP_MAKEFILES=${prefix}/share/GNUstep/Makefiles"
163}
164
165#
166# Sets DYLD_LIBRARY_PATH and PATH for the gnustep FilesystemLayout
167#
168
169proc set_gnustep_env {} {
170    global env prefix
171   
172    if {[gnustep_layout]} {
173        return "\
174            DYLD_LIBRARY_PATH=${prefix}/GNUstep/Local/Library/Libraries:${prefix}/GNUstep/System/Library/Libraries \
175            PATH=${prefix}/GNUstep/Local/Tools:${prefix}/GNUstep/System/Tools:$env(PATH) \
176        "
177    }
178    return
179}
180
181#
182# Options this group provides :
183#
184
185options gnustep.cc
186default gnustep.cc          CC=gcc-mp-4.2
187
188options system_library
189options local_library
190default system_library      [set_system_library]
191default local_library       [set_local_library]
192
193#
194# Default values for this group :
195#
196
197default categories          gnustep
198default homepage            http://www.gnustep.org/
199
200default master_sites        gnustep:core
201default depends_lib         port:gnustep-core
202
203default use_configure       no
204default configure.env       {[set_gnustep_env]}
205configure.pre_args-append   "${gnustep.cc} [set_gnustep_make]"
206
207default build.env           {[set_gnustep_env]}
208default build.type          gnu
209build.pre_args-append       "messages=yes [set_gnustep_make]"
210
211default destroot.env        {[set_gnustep_env]}
212destroot.pre_args-append    "messages=yes [set_gnustep_make]"
213
214#
215# To build and install documentation provided by the port
216#
217
218variant with_docs {
219    depends_build-append    bin:latex2html:latex2html \
220                            bin:texi2pdf:texinfo \
221                            bin:texi2html:texi2html \
222                            bin:pdftex:teTeX \
223                            port:gnustep-base
224
225    post-destroot {
226       
227        if {[file exists ${worksrcpath}/Documentation/GNUmakefile]} {
228           
229            ui_msg "--->  Making Documentation for ${name}"
230           
231            cd ${worksrcpath}/Documentation
232            system "${destroot.env} ${destroot.cmd} \
233                    ${destroot.pre_args} ${destroot.destdir}"
234           
235            set info_dir \
236                ${destroot}${prefix}/GNUstep/System/Library/Documentation/info
237            if {[file exists ${info_dir}/manual.info]} {
238                set manual_name [regsub {gnustep-} ${name} ""]
239                file rename ${info_dir}/manual.info \
240                    ${info_dir}/${manual_name}-manual.info
241            }
242        } else {
243            ui_msg "--->  No Documentation for ${name}"
244        }
245    }   
246}
247
248                   
Note: See TracBrowser for help on using the repository browser.