source: trunk/dports/cross/i386-elf-binutils/Portfile @ 90736

Last change on this file since 90736 was 90736, checked in by jmr@…, 8 years ago

i386-elf-binutils: update to 2.20 (#22395, maintainer timeout), use correct compiler, apply darwin 10 patch on darwin > 10 as well

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