source: trunk/dports/cross/powerpc-rtems-binutils/Portfile @ 41424

Last change on this file since 41424 was 41424, checked in by pguyot@…, 9 years ago

cross/powerpc-rtems-binutils: update to 2.18

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 41424 2008-11-02 10:53:06Z pguyot@kallisys.net $
2
3PortSystem                      1.0
4
5name                            powerpc-rtems-binutils
6version                         2.18
7
8# Parameters for this port.
9set crossgcc-target powerpc-rtems
10set rtemsversion        4.9
11
12description                     FSF Binutils for powerpc-rtems cross development
13long_description        Free Software Foundation development toolchain ("binutils") for \
14                                        powerpc-rtems cross development (IBM and Motorola PowerPC 4xx, \
15                                        5xx, 6xx, 7xx, 8xx, 74xx, and 75xx)
16platforms                       darwin
17categories                      cross devel
18maintainers                     pguyot@kallisys.net openmaintainer
19homepage                        http://www.gnu.org/software/binutils/binutils.html
20master_sites            gnu:binutils:binutils \
21                                        http://www.rtems.com/ftp/pub/rtems/SOURCES/${rtemsversion}/:rtems \
22                                        ftp://ftp.rtems.com/pub/rtems/SOURCES/${rtemsversion}/:rtems \
23                                        macports:pguyot:rtems
24distname                        binutils-${version}
25distfiles                       binutils-${version}.tar.bz2:binutils
26use_bzip2                       yes
27checksums                       md5 e26e2e06b6e4bf3acf1dc8688a94c0d1 \
28                                        sha1 a557686eef68362ea31a3aa41ce274e3eeae1ef0 \
29                                        rmd160 3995d7ed97f115e76ce55b4c1f5256d53559c84f
30checksums           binutils-${version}.tar.bz2 \
31                        md5     9d22ee4dafa3a194457caf4706f9cf01 \
32                        sha1    fdec92e9dfc6c32155869f3910f47041c78e2277 \
33                        rmd160  78d07475667c55ecbf9068dbb90362a3445b2a99 \
34                    binutils-${version}-rtems${rtemsversion}-20080211.diff \
35                        md5     5417bb3ff14da49c87c05a881a405166 \
36                        sha1    ddc5236c3c627596df2426b78c770ae958fbb4c7 \
37                        rmd160  73c6a64b322fcd35ff13a0254b416dce19428c8b
38patchfiles                      binutils-${version}-rtems${rtemsversion}-20080211.diff:rtems
39patch.pre_args          -p1
40
41depends_lib                     port:gettext
42
43# All cross ports violate the mtree layout.
44destroot.violate_mtree  yes
45
46# Download everything to binutils/
47dist_subdir                     binutils
48
49# Build in a different directory, as advised in the README file.
50pre-configure           { system "cd ${workpath} && mkdir -p build"}
51configure.dir           ${workpath}/build
52configure.cmd           ${worksrcpath}/configure
53configure.cc            "cc -no-cpp-precomp"
54configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
55                                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man'
56build.dir               ${workpath}/build
57
58# We don't want the etc module.
59post-extract {
60        system "rm -rf ${worksrcpath}/etc"
61}
62
63post-patch {
64        namespace eval crossgcc {}
65
66        # Fix the info pages and related stuff.
67        #
68        # path: path to the doc directory (e.g. gas/doc/)
69        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
70        # name: name of the info page (e.g. as)
71        # suffix: suffix of the souce page (texinfo or texi)
72        proc crossgcc::fixinfo { path makefile name suffix } {
73                global crossgcc-target worksrcpath
74
75                # Fix the source
76                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
77                        ${worksrcpath}/${path}/${name}.${suffix}
78                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
79                        ${worksrcpath}/${path}/${name}.${suffix}
80                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
81                        ${worksrcpath}/${path}/${name}.${suffix}
82
83                # Fix the Makefile
84                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
85                        ${worksrcpath}/${makefile}
86                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
87                        ${worksrcpath}/${makefile}
88
89                # Rename the source
90                file rename ${worksrcpath}/${path}/${name}.${suffix} \
91                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
92
93                # Fix install-info's dir.
94                # (note: this may be effectless if there was no info dir to be fixed)
95                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
96                        "${worksrcpath}/${makefile}"
97        }
98
99        # Fix the gettext files and related stuff.
100        #
101        # module: name of the module (e.g. gas)
102        proc crossgcc::fixgettext { module } {
103                global crossgcc-target worksrcpath
104
105                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
106                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
107                                "${worksrcpath}/${module}/Makefile.in"
108                }
109                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
110                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
111                                "${worksrcpath}/${module}/doc/Makefile.in"
112                }
113                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
114                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
115                                "${worksrcpath}/${module}/po/Make-in"
116                }
117        }
118
119        # gas/doc/as.texinfo
120        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
121
122        # bfd/doc/bfd.texinfo
123        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
124
125        # binutils/doc/binutils.texi
126        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
127
128        # gprof/gprof.texi
129        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
130
131        # ld/ld.texinfo
132        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
133
134        # gettext stuff.
135        crossgcc::fixgettext bfd
136        crossgcc::fixgettext binutils
137        crossgcc::fixgettext gas
138        crossgcc::fixgettext gprof
139        crossgcc::fixgettext ld
140        crossgcc::fixgettext opcodes
141}
142
143post-destroot {
144        # Installing (host) libiberty was a mistake.
145        file delete "${destroot}/${prefix}/lib/libiberty.a"
146}
147
148livecheck.check freshmeat
149livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.