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

Last change on this file was 114325, checked in by ryandesign@…, 4 years ago

use eq and ne instead of == and != when comparing ${os.platform} and ${os.subplatform}

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