source: trunk/dports/cross/i960-rtems-binutils/Portfile @ 89849

Last change on this file since 89849 was 89849, checked in by and.damore@…, 8 years ago

port i960-rtems-binutils: handling stealth update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: Portfile 89849 2012-02-13 08:21:37Z and.damore@macports.org $
2
3PortSystem                      1.0
4name                            i960-rtems-binutils
5version                         2.16.1
6revision            1
7
8# Parameters for this port.
9set crossgcc-target i960-rtems
10
11description                     FSF Binutils for i960-rtems cross development
12long_description        Free Software Foundation development toolchain ("binutils") for \
13                                        i960-rtems cross development (Intel i960 family).
14platforms                       darwin
15categories                      cross devel
16maintainers                     nomaintainer
17homepage                        http://www.gnu.org/software/binutils/binutils.html
18master_sites            gnu:binutils
19distname                        binutils-${version}
20use_bzip2                       yes
21checksums           md5     f4f3d732697af0368ecfdadb8ea77285 \
22                    sha1    1c7952e78d0c4a959274f155202f248d49aab528 \
23                    rmd160  d2c962c6762e7b34b40a895534b6c3cc3c71ad18
24
25# All cross ports violate the mtree layout.
26destroot.violate_mtree  yes
27
28# Download everything to binutils/
29#dist_subdir                    binutils
30# MEMO: stealth update, revert to "binutils" when version is updated
31dist_subdir                     binutils/${version}_1
32
33# Build in a different directory, as advised in the README file.
34pre-configure           { system "cd ${workpath} && mkdir -p build"}
35configure.dir           ${workpath}/build
36configure.cmd           ${worksrcpath}/configure
37configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
38                                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man'
39build.dir               ${workpath}/build
40
41# We don't want the etc module.
42post-extract {
43        system "rm -rf ${worksrcpath}/etc"
44}
45
46patch {
47        namespace eval crossgcc {}
48
49        # Fix the info pages and related stuff.
50        #       
51        # path: path to the doc directory (e.g. gas/doc/)
52        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
53        # name: name of the info page (e.g. as)
54        # suffix: suffix of the souce page (texinfo or texi)
55        proc crossgcc::fixinfo { path makefile name suffix } {
56                global crossgcc-target worksrcpath
57
58                # Fix the source
59                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
60                        ${worksrcpath}/${path}/${name}.${suffix}
61                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
62                        ${worksrcpath}/${path}/${name}.${suffix}
63                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
64                        ${worksrcpath}/${path}/${name}.${suffix}
65               
66                # Fix the Makefile
67                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
68                        ${worksrcpath}/${makefile}
69                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
70                        ${worksrcpath}/${makefile}
71               
72                # Rename the source
73                file rename ${worksrcpath}/${path}/${name}.${suffix} \
74                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
75               
76                # Fix install-info's dir.
77                # (note: this may be effectless if there was no info dir to be fixed)
78                reinplace "s|__TARGET|${crossgcc-target}|g" \
79                        "${worksrcpath}/${makefile}"
80        }
81
82        # Fix the gettext files and related stuff.
83        #       
84        # module: name of the module (e.g. gas)
85        proc crossgcc::fixgettext { module } {
86                global crossgcc-target worksrcpath
87
88                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
89                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
90                                "${worksrcpath}/${module}/Makefile.in"
91                }
92                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
93                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
94                                "${worksrcpath}/${module}/doc/Makefile.in"
95                }
96                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
97                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
98                                "${worksrcpath}/${module}/po/Make-in"
99                }
100        }
101
102        # gas/doc/as.texinfo
103        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
104
105        # bfd/doc/bfd.texinfo
106        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
107
108        # binutils/doc/binutils.texi
109        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
110
111        # gprof/gprof.texi
112        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
113
114        # ld/ld.texinfo
115        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
116       
117        # gettext stuff.
118        crossgcc::fixgettext bfd
119        crossgcc::fixgettext binutils
120        crossgcc::fixgettext gas
121        crossgcc::fixgettext gprof
122        crossgcc::fixgettext ld
123        crossgcc::fixgettext opcodes
124}
125
126post-destroot {
127        # Installing (host) libiberty was a mistake.
128        foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
129        file delete $f
130    }
131}
132
133# This target has been abandonned upstream.
134pre-fetch {
135        if {${os.platform} == "darwin" && [vercmp 9.0 ${os.version}] < 0} {
136                ui_warn "i960-rtems-gcc does not build on darwin 9+ (Mac OS X 10.5+) and it has been abandonned upstream."
137        }
138}
139
140# livecheck.type                freshmeat
141# livecheck.name                binutils
142# livecheck.version     2.17
Note: See TracBrowser for help on using the repository browser.