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

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

crossbinutils:
Added support for version numbers with letter in the end.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1# $Id: crossbinutils-1.0.tcl 91815 2012-04-11 12:03:25Z g5pw@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    worksrcdir      binutils-[string trimright ${version} {[a-zA-Z]}]
65    use_bzip2       yes
66
67    post-extract {
68        delete ${worksrcpath}/etc
69        file mkdir ${workpath}/build
70    }
71
72    post-patch {
73        set infopages {
74            gas/doc         as
75            bfd/doc         bfd
76            binutils/doc    binutils
77            gprof           gprof
78            ld              ld
79        }
80
81        foreach {dir page} ${infopages} {
82            # Fix texinfo source file
83            set tex [glob -directory ${worksrcpath}/${dir} ${page}.texi*]
84            reinplace \
85                /setfilename/s/${page}/${crossbinutils.target}-${page}/ ${tex}
86            reinplace s/(${page})/(${crossbinutils.target}-${page})/g ${tex}
87            reinplace \
88                "s/@file{${page}}/@file{${crossbinutils.target}-${page}}/g" \
89                ${tex}
90            move ${tex} \
91                ${worksrcpath}/${dir}/${crossbinutils.target}-${page}[file extension ${tex}]
92
93            # Fix Makefile
94            reinplace -E \
95                s/\[\[:<:\]\]${page}\\.(info|texi)/${crossbinutils.target}-&/g \
96                ${worksrcpath}/${dir}/Makefile.in
97        }
98
99        # Fix packages' names.
100        foreach dir {bfd binutils gas gold gprof ld opcodes} {
101            reinplace "/^ PACKAGE=/s/=.*/=${crossbinutils.target}-${dir}/" \
102                ${worksrcpath}/${dir}/configure
103        }
104
105        # Do not install libiberty
106        reinplace {/^install:/s/ .*//} ${worksrcpath}/libiberty/Makefile.in
107    }
108
109    depends_lib \
110        port:gettext
111
112    configure.dir   ${workpath}/build
113    configure.cmd   ${worksrcpath}/configure
114
115    configure.ldflags-append \
116        -lintl
117
118    configure.args \
119        --target=${target} \
120        --program-prefix=${target}-
121
122    build.dir ${workpath}/build
123
124    destroot.violate_mtree yes
125
126    post-destroot {
127        set docdir ${prefix}/share/doc/${name}
128        xinstall -d ${destroot}${docdir}
129        eval xinstall -m 644 \
130            [glob -type f ${worksrcpath}/{COPYING*,ChangeLog,MAINTAINERS,README*}] \
131            ${destroot}${docdir}
132    }
133
134    universal_variant no
135
136    livecheck.type  regex
137    livecheck.url   [lindex ${master_sites} 1]
138    livecheck.regex "binutils-((?!.*binutils.*|\\${extract.suffix}).*)\\${extract.suffix}"
139}
Note: See TracBrowser for help on using the repository browser.