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

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

use eq and ne instead of == and != when comparing ${os.arch}, ${configure.build_arch}, ${build_arch}, and some port-specific variables for referring to architectures

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