source: trunk/dports/cross/mips-elf-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: 4.5 KB
Line 
1# $Id: Portfile 114328 2013-12-05 10:21:52Z ryandesign@macports.org $
2
3PortSystem                      1.0
4
5name                            mips-elf-binutils
6version                         2.17
7
8# Parameters for this port.
9set crossgcc-target mips-elf
10
11description                     FSF Binutils for mips-elf cross development
12long_description        Free Software Foundation development toolchain ("binutils") for \
13                                        mips-elf cross development.
14platforms                       darwin
15categories                      cross devel
16license                         GPL-2+
17maintainers                     nomaintainer
18homepage                        http://www.gnu.org/software/binutils/binutils.html
19# gnu:binutils removed, tarball modified in 2011
20master_sites            macports:binutils
21distname                        binutils-${version}
22use_bzip2                       yes
23checksums                       md5 e26e2e06b6e4bf3acf1dc8688a94c0d1 \
24                                        sha1 a557686eef68362ea31a3aa41ce274e3eeae1ef0 \
25                                        rmd160 3995d7ed97f115e76ce55b4c1f5256d53559c84f
26
27# All cross ports violate the mtree layout.
28destroot.violate_mtree  yes
29
30# Download everything to binutils/
31dist_subdir                     binutils
32
33patchfiles                      patch-configure.diff
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' \
41                                        --disable-werror
42
43platform darwin {
44        if {${build_arch} eq "i386"} {
45                configure.args-append --build=i686-apple-${os.platform}${os.version} \
46                                                          --host=i686-apple-${os.platform}${os.version}
47        } else {
48                configure.args-append --build=${build_arch}-apple-${os.platform}${os.version} \
49                                                          --host=${build_arch}-apple-${os.platform}${os.version}
50        }
51}
52
53build.dir                       ${workpath}/build
54
55# We don't want the etc module.
56post-extract {
57        system "rm -rf ${worksrcpath}/etc"
58}
59
60post-patch {
61        namespace eval crossgcc {}
62
63        # Fix the info pages and related stuff.
64        #       
65        # path: path to the doc directory (e.g. gas/doc/)
66        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
67        # name: name of the info page (e.g. as)
68        # suffix: suffix of the souce page (texinfo or texi)
69        proc crossgcc::fixinfo { path makefile name suffix } {
70                global crossgcc-target worksrcpath
71
72                # Fix the source
73                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
74                        ${worksrcpath}/${path}/${name}.${suffix}
75                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
76                        ${worksrcpath}/${path}/${name}.${suffix}
77                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
78                        ${worksrcpath}/${path}/${name}.${suffix}
79               
80                # Fix the Makefile
81                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
82                        ${worksrcpath}/${makefile}
83                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
84                        ${worksrcpath}/${makefile}
85               
86                # Rename the source
87                file rename ${worksrcpath}/${path}/${name}.${suffix} \
88                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
89               
90                # Fix install-info's dir.
91                # (note: this may be effectless if there was no info dir to be fixed)
92                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
93                        "${worksrcpath}/${makefile}"
94        }
95
96        # Fix the gettext files and related stuff.
97        #       
98        # module: name of the module (e.g. gas)
99        proc crossgcc::fixgettext { module } {
100                global crossgcc-target worksrcpath
101
102                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
103                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
104                                "${worksrcpath}/${module}/Makefile.in"
105                }
106                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
107                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
108                                "${worksrcpath}/${module}/doc/Makefile.in"
109                }
110                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
111                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
112                                "${worksrcpath}/${module}/po/Make-in"
113                }
114        }
115
116        # gas/doc/as.texinfo
117        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
118
119        # bfd/doc/bfd.texinfo
120        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
121
122        # binutils/doc/binutils.texi
123        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
124
125        # gprof/gprof.texi
126        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
127
128        # ld/ld.texinfo
129        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
130       
131        # gettext stuff.
132        crossgcc::fixgettext bfd
133        crossgcc::fixgettext binutils
134        crossgcc::fixgettext gas
135        crossgcc::fixgettext gprof
136        crossgcc::fixgettext ld
137        crossgcc::fixgettext opcodes
138}
139
140post-destroot {
141        # Installing (host) libiberty was a mistake.
142        foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
143        file delete $f
144    }
145}
146
147livecheck.type  freecode
148livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.