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

Last change on this file since 41444 was 41444, checked in by pguyot@…, 11 years ago

cross/i386-elf-binutils: Declare dependency on gettext

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# $Id: Portfile 41444 2008-11-03 12:12:10Z pguyot@kallisys.net $
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
15maintainers                     stepan@coresystems.de pguyot@kallisys.net openmaintainer
16homepage                        http://www.gnu.org/software/binutils/binutils.html
17master_sites            ftp://ftp.kernel.org/pub/linux/devel/binutils/ \
18                                        http://ftp.kernel.org/pub/linux/devel/binutils/
19distname                        binutils-${version}
20use_bzip2                       yes
21checksums                       md5     68e3510d9c790b134450c0a243c251cd \
22                                        sha1    369b21b07e06ec44005603acaa046b2ea69831bd \
23                                        rmd160  edbb31cfd6e0c1756618532064a46d03779bfadb
24
25depends_lib                     port:gettext
26
27# All cross ports violate the mtree layout.
28destroot.violate_mtree  yes
29
30# Download everything to binutils/
31dist_subdir                     binutils
32
33# Build in a different directory, as advised in the README file.
34pre-configure           { system "cd ${workpath} && mkdir -p build"}
35configure.dir           ${workpath}/build
36configure.cmd           ${worksrcpath}/configure
37configure.cc            "cc -no-cpp-precomp -I${prefix}/include"
38configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
39                                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man'
40build.dir               ${workpath}/build
41                                       
42# We don't want the etc module.
43post-extract {
44        system "rm -rf ${worksrcpath}/etc"
45}
46
47post-patch {
48        namespace eval crossgcc {}
49
50        # Fix the info pages and related stuff.
51        #       
52        # path: path to the doc directory (e.g. gas/doc/)
53        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
54        # name: name of the info page (e.g. as)
55        # suffix: suffix of the souce page (texinfo or texi)
56        proc crossgcc::fixinfo { path makefile name suffix } {
57                global crossgcc-target worksrcpath
58
59                # Fix the source
60                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
61                        ${worksrcpath}/${path}/${name}.${suffix}
62                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
63                        ${worksrcpath}/${path}/${name}.${suffix}
64                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
65                        ${worksrcpath}/${path}/${name}.${suffix}
66               
67                # Fix the Makefile
68                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
69                        ${worksrcpath}/${makefile}
70                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
71                        ${worksrcpath}/${makefile}
72               
73                # Rename the source
74                file rename ${worksrcpath}/${path}/${name}.${suffix} \
75                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
76               
77                # Fix install-info's dir.
78                # (note: this may be effectless if there was no info dir to be fixed)
79                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
80                        "${worksrcpath}/${makefile}"
81        }
82
83        # Fix the gettext files and related stuff.
84        #       
85        # module: name of the module (e.g. gas)
86        proc crossgcc::fixgettext { module } {
87                global crossgcc-target worksrcpath
88
89                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
90                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
91                                "${worksrcpath}/${module}/Makefile.in"
92                }
93                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
94                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
95                                "${worksrcpath}/${module}/doc/Makefile.in"
96                }
97                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
98                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
99                                "${worksrcpath}/${module}/po/Make-in"
100                }
101        }
102
103        # gas/doc/as.texinfo
104        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
105
106        # bfd/doc/bfd.texinfo
107        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
108
109        # binutils/doc/binutils.texi
110        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
111
112        # gprof/gprof.texi
113        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
114
115        # ld/ld.texinfo
116        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
117       
118        # gettext stuff.
119        crossgcc::fixgettext bfd
120        crossgcc::fixgettext binutils
121        crossgcc::fixgettext gas
122        crossgcc::fixgettext gprof
123        crossgcc::fixgettext ld
124        crossgcc::fixgettext opcodes
125}
126
127post-destroot {
128        # Installing (host) libiberty was a mistake.
129        file delete "${destroot}/${prefix}/lib/libiberty.a"
130}
131
132livecheck.check freshmeat
133livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.