source: trunk/dports/_resources/port1.0/group/crossbinutils-1.0.tcl @ 89608

Last change on this file since 89608 was 89608, checked in by pixilla@…, 8 years ago

_resources/port1.0/group:

  • Use gnu mirrors.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1# $Id: crossbinutils-1.0.tcl 89608 2012-02-03 23:21:07Z pixilla@macports.org $
2#
3# Copyright (c) 2010 The MacPorts Project
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of The MacPorts Project nor the names of its
16#    contributors may be used to endorse or promote products derived from
17#    this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31#
32# This PortGroup automatically sets all the fields of the various cross binutils
33# ports (e.g. spu-binutils).
34#
35# Usage:
36#
37#   PortGroup               crossbinutils 1.0
38#   crossbinutils.setup     spu 2.20.51.0.5
39
40options crossbinutils.target
41
42proc crossbinutils.setup {target version} {
43    global master_sites workpath worksrcpath extract.suffix
44
45    crossbinutils.target ${target}
46
47    name            ${target}-binutils
48    version         ${version}
49    categories      cross devel
50    platforms       darwin
51    license         GPL-3+
52    maintainers     nomaintainer
53
54    description     FSF Binutils for ${target} cross development
55    long_description \
56        Free Software Foundation development toolchain ("binutils") for \
57        ${target} cross development.
58
59    homepage        http://www.gnu.org/software/binutils/binutils.html
60    master_sites    gnu:binutils \
61                    http://mirrors.ibiblio.org/gnu/ftp/gnu/binutils/
62    dist_subdir     binutils
63    distname        binutils-${version}
64    use_bzip2       yes
65
66    post-extract {
67        delete ${worksrcpath}/etc
68        file mkdir ${workpath}/build
69    }
70
71    post-patch {
72        set infopages {
73            gas/doc         as
74            bfd/doc         bfd
75            binutils/doc    binutils
76            gprof           gprof
77            ld              ld
78        }
79
80        foreach {dir page} ${infopages} {
81            # Fix texinfo source file
82            set tex [glob -directory ${worksrcpath}/${dir} ${page}.texi*]
83            reinplace \
84                /setfilename/s/${page}/${crossbinutils.target}-${page}/ ${tex}
85            reinplace s/(${page})/(${crossbinutils.target}-${page})/g ${tex}
86            reinplace \
87                "s/@file{${page}}/@file{${crossbinutils.target}-${page}}/g" \
88                ${tex}
89            move ${tex} \
90                ${worksrcpath}/${dir}/${crossbinutils.target}-${page}[file extension ${tex}]
91
92            # Fix Makefile
93            reinplace -E \
94                s/\[\[:<:\]\]${page}\\.(info|texi)/${crossbinutils.target}-&/g \
95                ${worksrcpath}/${dir}/Makefile.in
96        }
97
98        # Fix packages' names.
99        foreach dir {bfd binutils gas gold gprof ld opcodes} {
100            reinplace "/^ PACKAGE=/s/=.*/=${crossbinutils.target}-${dir}/" \
101                ${worksrcpath}/${dir}/configure
102        }
103
104        # Do not install libiberty
105        reinplace {/^install:/s/ .*//} ${worksrcpath}/libiberty/Makefile.in
106    }
107
108    depends_lib \
109        port:gettext
110
111    configure.dir   ${workpath}/build
112    configure.cmd   ${worksrcpath}/configure
113
114    configure.ldflags-append \
115        -lintl
116
117    configure.args \
118        --target=${target} \
119        --program-prefix=${target}-
120
121    build.dir ${workpath}/build
122
123    destroot.violate_mtree yes
124
125    post-destroot {
126        set docdir ${prefix}/share/doc/${name}
127        xinstall -d ${destroot}${docdir}
128        eval xinstall -m 644 \
129            [glob -type f ${worksrcpath}/{COPYING*,ChangeLog,MAINTAINERS,README*}] \
130            ${destroot}${docdir}
131    }
132
133    universal_variant no
134
135    livecheck.type  regex
136    livecheck.url   [lindex ${master_sites} 1]
137    livecheck.regex "binutils-((?!.*binutils.*|\\${extract.suffix}).*)\\${extract.suffix}"
138}
Note: See TracBrowser for help on using the repository browser.