source: trunk/dports/cross/sh-rtems-binutils/Portfile @ 41423

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

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