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

Last change on this file since 50573 was 50573, checked in by jeremyhu@…, 11 years ago

base: No longer search for X11 SDK and remove reference to x11prefix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.8 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 50573 2009-05-04 19:31:06Z jeremyhu@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 portmain::main]
40target_provides ${org.macports.main} main
41target_state ${org.macports.main} no
42
43namespace eval portmain {
44}
45
46# define options
47options prefix macportsuser name version revision epoch categories maintainers
48options long_description description homepage
49options 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
50options universal_variant os.universal_supported
51
52# Export options via PortInfo
53options_export name version revision epoch categories maintainers platforms description long_description homepage
54
55# Assign option procedure to default_variants
56option_proc default_variants handle_default_variants
57
58default distpath {[file join $portdbpath distfiles]}
59default workpath {[getportworkpath_from_buildpath $portbuildpath]}
60default worksymlink {[file join $portpath work]}
61default prefix /opt/local
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 macportsuser {${portutil::autoconf::macportsuser}}
78default install.user {${portutil::autoconf::install_user}}
79default install.group {${portutil::autoconf::install_group}}
80
81# Compatibility namespace
82default portname {$name}
83default portversion {$version}
84default portrevision {$revision}
85default portepoch {$epoch}
86
87# Platform Settings
88set os_arch $tcl_platform(machine)
89if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
90if {$os_arch == "i586" || $os_arch == "i686"} { set os_arch "i386" }
91set os_version $tcl_platform(osVersion)
92set os_major [lindex [split $os_version .] 0]
93set os_platform [string tolower $tcl_platform(os)]
94
95default os.platform {$os_platform}
96default os.version {$os_version}
97default os.major {$os_major}
98default os.arch {$os_arch}
99# Remove trailing "Endian"
100default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]}
101default os.universal_supported no
102
103set macosx_version {}
104if {$os_platform == "darwin"} {
105    # This will probably break when Apple changes versioning
106    set macosx_version [expr 10.0 + ($os_major - 4) / 10.0]
107}
108
109ui_debug "OS Platform: [option os.platform]"
110ui_debug "OS Version: [option os.version]"
111if {$macosx_version != ""} {
112    ui_debug "Mac OS X Version: ${macosx_version}"
113}
114ui_debug "System Arch: [option os.arch]"
115
116default macosx_deployment_target {$macosx_version}
117
118default universal_variant yes
119
120# Select implicit variants
121if {[info exists os.platform] && ![info exists variations(${os.platform})]} { variant_set ${os.platform}}
122if {[info exists os.arch] && ![info exists variations(${os.arch})]} { variant_set ${os.arch} }
123if {[info exists os.platform] && (${os.platform} == "darwin") && ![file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(puredarwin)]} { variant_set puredarwin }
124if {[info exists os.platform] && (${os.platform} == "darwin") && [file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(macosx)]} { variant_set macosx }
125if {[info exists variations(macosx)] && $variations(macosx) == "+"} {
126    # the universal variant itself is now created in
127    # add_default_universal_variant, which is called from mportopen
128    option os.universal_supported yes
129
130    if {[info exists variations(universal)] && $variations(universal) == "+"} {
131        # cannot go into the variant, due to the amount of ports overriding it
132        eval macosx_deployment_target ${universal_target}
133    }
134}
135
136proc portmain::main {args} {
137    return 0
138}
Note: See TracBrowser for help on using the repository browser.