source: trunk/dports/cross/lm32-rtems-binutils/Portfile @ 75895

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

lm32-rtems-binutils: new port, version 2.20.90; see #27420

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 75895 2011-02-12 02:24:50Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                lm32-rtems-binutils
7version             2.20.90
8
9# Parameters for this port.
10set crossgcc-target lm32-rtems
11set rtemsversion    4.11
12
13categories          cross devel
14platforms           darwin
15maintainers         gmail.com:yann.sionneau
16
17description         FSF Binutils for lm32-rtems cross development
18long_description    Free Software Foundation development toolchain ("binutils") for \
19                    lm32-rtems cross development tools (for Milkymist & lm32_evr platforms).
20
21homepage            http://www.gnu.org/software/binutils/binutils.html
22master_sites        http://www.rtems.com/ftp/pub/rtems/SOURCES/${rtemsversion}/ \
23                    ftp://ftp.rtems.com/pub/rtems/SOURCES/${rtemsversion}/
24
25distname            binutils-${version}
26use_bzip2           yes
27
28checksums           binutils-${version}.tar.bz2 \
29                        sha1    ee0124f6e597fc4d5ccc1c423aa470e51a28f20d \
30                        rmd160  462ed7213461cc47f3a5bf5365c422818e7bd577 \
31                    binutils-${version}-rtems${rtemsversion}-20101109.diff \
32                        sha1    6c24112556957d4a9b5720ebb98c3a98524c3fc5 \
33                        rmd160  26a0c4f0a0c15de816f0e162dfcc8bddb2044a2e
34
35patchfiles          binutils-${version}-rtems${rtemsversion}-20101109.diff
36patch.pre_args      -p1
37
38depends_lib         port:gettext port:zlib
39
40# All cross ports violate the mtree layout.
41destroot.violate_mtree  yes
42
43# Download everything to binutils/
44dist_subdir         binutils
45
46# We don't want the etc module.
47post-extract {
48    delete ${worksrcpath}/etc
49}
50
51post-patch {
52    namespace eval crossgcc {}
53
54    # Fix the info pages and related stuff.
55    #
56    # path: path to the doc directory (e.g. gas/doc/)
57    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
58    # name: name of the info page (e.g. as)
59    # suffix: suffix of the souce page (texinfo or texi)
60    proc crossgcc::fixinfo { path makefile name suffix } {
61        global crossgcc-target worksrcpath
62
63        # Fix the source
64        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
65            ${worksrcpath}/${path}/${name}.${suffix}
66        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
67            ${worksrcpath}/${path}/${name}.${suffix}
68        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
69            ${worksrcpath}/${path}/${name}.${suffix}
70       
71        # Fix the Makefile
72        reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
73            ${worksrcpath}/${makefile}
74        reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
75            ${worksrcpath}/${makefile}
76       
77        # Rename the source
78        file rename ${worksrcpath}/${path}/${name}.${suffix} \
79            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
80       
81        # Fix install-info's dir.
82        # (note: this may be effectless if there was no info dir to be fixed)
83        reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
84            "${worksrcpath}/${makefile}"
85    }
86
87    # Fix the gettext files and related stuff.
88    #
89    # module: name of the module (e.g. gas)
90    proc crossgcc::fixgettext { module } {
91        global crossgcc-target worksrcpath
92
93        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
94            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
95                "${worksrcpath}/${module}/Makefile.in"
96        }
97        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
98            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
99                "${worksrcpath}/${module}/doc/Makefile.in"
100        }
101        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
102            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
103                "${worksrcpath}/${module}/po/Make-in"
104        }
105    }
106
107    # gas/doc/as.texinfo
108    crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
109
110    # bfd/doc/bfd.texinfo
111    crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
112
113    # binutils/doc/binutils.texi
114    crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
115
116    # gprof/gprof.texi
117    crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
118
119    # ld/ld.texinfo
120    crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
121   
122    # gettext stuff.
123    crossgcc::fixgettext bfd
124    crossgcc::fixgettext binutils
125    crossgcc::fixgettext gas
126    crossgcc::fixgettext gprof
127    crossgcc::fixgettext ld
128    crossgcc::fixgettext opcodes
129}
130
131# Build in a different directory, as advised in the README file.
132configure.dir       ${workpath}/build
133pre-configure {
134    file mkdir ${configure.dir}
135}
136configure.cmd       ${worksrcpath}/configure
137configure.args      --infodir=${prefix}/share/info \
138                    --target=${crossgcc-target}${rtemsversion} \
139                    --mandir=${prefix}/share/man \
140                    --disable-werror
141
142build.dir           ${configure.dir}
143
144post-destroot {
145    # Installing (host) libiberty was a mistake.
146    foreach f [glob -directory ${destroot}${prefix}/lib libiberty.a */libiberty.a] {
147        file delete $f
148    }
149}
150
151livecheck.type  freshmeat
152livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.