source: trunk/dports/cross/mips-elf-binutils/Portfile @ 71533

Last change on this file since 71533 was 71533, checked in by ryandesign@…, 9 years ago

In the interest that all portfiles exemplify correct portfile writing techniques, remove slash before ${prefix} which is not needed because ${prefix} already begins with a slash

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