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

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

Rename freshmeat to freecode in Portfiles, closes #32026

See http://lists.macosforge.org/pipermail/macports-dev/2012-February/017983.html.

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