source: trunk/dports/cross/arm-none-linux-gnueabi-binutils/Portfile

Last change on this file was 125285, checked in by mf2k@…, 3 years ago

arm-none-linux-gnueabi-binutils: Add maintainer. Fix lint issues. (#44961)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1# $Id: Portfile 125285 2014-09-12 19:22:34Z ryandesign@macports.org $
2
3PortSystem                      1.0
4
5name                            arm-none-linux-gnueabi-binutils
6version                         2005q3-2
7
8# Parameters for this port.
9set crossgcc-target arm-none-linux-gnueabi
10
11description                     FSF Binutils for arm-none-linux-gnueabi cross development, with Code Sourcery patches (for Nokia Internet Tablet)
12long_description        Free Software Foundation development toolchain ("binutils") for \
13                                        arm-none-linux-gnueabi cross development (for Nokia Internet Tablet).
14platforms                       darwin
15categories                      cross devel
16license                         GPL-2+
17maintainers                     gmail.com:stuartwesterman openmaintainer
18homepage                        http://www.codesourcery.com/gnu_toolchains/arm
19master_sites                    macports:pguyot
20distname                        binutils-${version}
21worksrcdir                      binutils-2.17pre
22use_bzip2                       yes
23checksums                       md5 4c68f4c9b5623ddd5289cb223fac0be2 \
24                                        sha1 051e49e4b3e1b752beddb628ea9d4c2b5ed8edda \
25                                        rmd160 39bd5f92476daed7f0292e98449e7cfdc7d0910f
26
27# We need msgfmt
28depends_build           bin:msgfmt:gettext
29
30# All cross ports violate the mtree layout.
31destroot.violate_mtree  yes
32
33# Download everything to binutils/
34dist_subdir                     binutils
35
36# Build in a different directory, as advised in the README file.
37pre-configure           { system "cd ${workpath} && mkdir -p build"}
38configure.dir           ${workpath}/build
39configure.cmd           ${worksrcpath}/configure
40configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
41                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man' --with-sysroots \
42                        --disable-werror
43if {${os.platform} eq "darwin" && (${build_arch} eq "x86_64" || ${build_arch} eq "ppc64")} {
44    configure.args-append --build=${build_arch}-apple-darwin${os.version} \
45                          --host=${build_arch}-apple-darwin${os.version}
46}
47build.dir               ${workpath}/build
48                                       
49# We don't want the etc module.
50post-extract {
51        system "rm -rf ${worksrcpath}/etc"
52}
53
54patchfiles          patch-configure.diff
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.