source: trunk/base/src/port1.0/portmain.tcl @ 40803

Last change on this file since 40803 was 40803, checked in by jmr@…, 12 years ago

Move default frameworks_dir under prefix, and use it in portgroups

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# portmain.tcl
3# $Id: portmain.tcl 40803 2008-10-15 10:17:48Z jmr@macports.org $
4#
5# Copyright (c) 2002 - 2003 Apple Computer, Inc.
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions
10# are met:
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
17#    may be used to endorse or promote products derived from this software
18#    without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30# POSSIBILITY OF SUCH DAMAGE.
31#
32
33# the 'main' target is provided by this package
34# main is a magic target and should not be replaced
35
36package provide portmain 1.0
37package require portutil 1.0
38
39set org.macports.main [target_new org.macports.main main]
40target_provides ${org.macports.main} main
41target_state ${org.macports.main} no
42
43# define options
44options prefix name version revision epoch categories maintainers
45options long_description description homepage
46options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
47options universal_variant os.universal_supported
48
49# Export options via PortInfo
50options_export name version revision epoch categories maintainers platforms description long_description homepage
51
52# Assign option procedure to default_variants
53option_proc default_variants handle_default_variants
54
55# Hard coded version number for resource location
56default portresourcepath {[file join $portsharepath resources/port1.0]}
57default distpath {[file join $portdbpath distfiles]}
58default workpath {[getportworkpath_from_buildpath $portbuildpath]}
59default worksymlink {[file join $portpath work]}
60default prefix /opt/local
61default x11prefix /usr/X11R6
62default applications_dir /Applications/MacPorts
63default frameworks_dir {${prefix}/Library/Frameworks}
64default destdir destroot
65default destpath {${workpath}/${destdir}}
66# destroot is provided as a clearer name for the "destpath" variable
67default destroot {${destpath}}
68default filesdir files
69default revision 0
70default epoch 0
71default distname {${portname}-${portversion}}
72default worksrcdir {$distname}
73default filespath {[file join $portpath $filesdir]}
74default worksrcpath {[file join $workpath $worksrcdir]}
75
76# Configure settings
77default install.user {${portutil::autoconf::install_user}}
78default install.group {${portutil::autoconf::install_group}}
79
80# Compatibility namespace
81default portname {$name}
82default portversion {$version}
83default portrevision {$revision}
84default portepoch {$epoch}
85
86# Platform Settings
87set os_arch $tcl_platform(machine)
88if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
89if {$os_arch == "i586" || $os_arch == "i686"} { set os_arch "i386" }
90set os_version $tcl_platform(osVersion)
91set os_major [lindex [split $os_version .] 0]
92set os_platform [string tolower $tcl_platform(os)]
93
94default os.platform {$os_platform}
95default os.version {$os_version}
96default os.major {$os_major}
97default os.arch {$os_arch}
98# Remove trailing "Endian"
99default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]}
100default os.universal_supported no
101
102set macosx_version {}
103if {$os_platform == "darwin"} {
104    # This will probably break when Apple changes versioning
105    set macosx_version [expr 10.0 + ($os_major - 4) / 10.0]
106}
107
108default macosx_deployment_target {$macosx_version}
109
110default universal_variant yes
111
112# Select implicit variants
113if {[info exists os.platform] && ![info exists variations(${os.platform})]} { variant_set ${os.platform}}
114if {[info exists os.arch] && ![info exists variations(${os.arch})]} { variant_set ${os.arch} }
115if {[info exists os.platform] && (${os.platform} == "darwin") && ![file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(puredarwin)]} { variant_set puredarwin }
116if {[info exists os.platform] && (${os.platform} == "darwin") && [file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(macosx)]} { variant_set macosx }
117if {[info exists variations(macosx)] && $variations(macosx) == "+"} {
118    # the universal variant itself is now created in
119    # add_default_universal_variant, which is called from mportopen
120    option os.universal_supported yes
121
122    if {[info exists variations(universal)] && $variations(universal) == "+"} {
123        # cannot go into the variant, due to the amount of ports overriding it
124        global configure.universal_target
125        if {[info exists configure.universal_target]} {
126            eval macosx_deployment_target ${configure.universal_target}
127        }
128    }
129}
130
131proc main {args} {
132    return 0
133}
Note: See TracBrowser for help on using the repository browser.