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

Last change on this file was 90445, checked in by cal@…, 5 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: 5.0 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 90445 2012-03-05 22:08:09Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                lm32-rtems-binutils
7version             2.21.1
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    f188490772cc902ec44a76545887bff60dbfa22d \
30                        rmd160  1b36120beda5efddc3194ee56c3099421ca5ca07
31
32depends_lib         port:gettext port:zlib
33
34# All cross ports violate the mtree layout.
35destroot.violate_mtree  yes
36
37# Download everything to binutils/
38dist_subdir         binutils
39
40# We don't want the etc module.
41post-extract {
42    delete ${worksrcpath}/etc
43}
44
45post-patch {
46    namespace eval crossgcc {}
47
48    # Fix the info pages and related stuff.
49    #
50    # path: path to the doc directory (e.g. gas/doc/)
51    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
52    # name: name of the info page (e.g. as)
53    # suffix: suffix of the souce page (texinfo or texi)
54    proc crossgcc::fixinfo { path makefile name suffix } {
55        global crossgcc-target worksrcpath
56
57        # Fix the source
58        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
59            ${worksrcpath}/${path}/${name}.${suffix}
60        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
61            ${worksrcpath}/${path}/${name}.${suffix}
62        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
63            ${worksrcpath}/${path}/${name}.${suffix}
64       
65        # Fix the Makefile
66        reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
67            ${worksrcpath}/${makefile}
68        reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
69            ${worksrcpath}/${makefile}
70       
71        # Rename the source
72        file rename ${worksrcpath}/${path}/${name}.${suffix} \
73            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
74       
75        # Fix install-info's dir.
76        # (note: this may be effectless if there was no info dir to be fixed)
77        reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
78            "${worksrcpath}/${makefile}"
79    }
80
81    # Fix the gettext files and related stuff.
82    #
83    # module: name of the module (e.g. gas)
84    proc crossgcc::fixgettext { module } {
85        global crossgcc-target worksrcpath
86
87        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
88            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
89                "${worksrcpath}/${module}/Makefile.in"
90        }
91        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
92            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
93                "${worksrcpath}/${module}/doc/Makefile.in"
94        }
95        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
96            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
97                "${worksrcpath}/${module}/po/Make-in"
98        }
99    }
100
101    # gas/doc/as.texinfo
102    crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
103
104    # bfd/doc/bfd.texinfo
105    crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
106
107    # binutils/doc/binutils.texi
108    crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
109
110    # gprof/gprof.texi
111    crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
112
113    # ld/ld.texinfo
114    crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
115   
116    # gettext stuff.
117    crossgcc::fixgettext bfd
118    crossgcc::fixgettext binutils
119    crossgcc::fixgettext gas
120    crossgcc::fixgettext gprof
121    crossgcc::fixgettext ld
122    crossgcc::fixgettext opcodes
123}
124
125# Build in a different directory, as advised in the README file.
126configure.dir       ${workpath}/build
127pre-configure {
128    file mkdir ${configure.dir}
129}
130configure.cmd       ${worksrcpath}/configure
131configure.args      --infodir=${prefix}/share/info \
132                    --target=${crossgcc-target}${rtemsversion} \
133                    --mandir=${prefix}/share/man \
134                    --disable-werror
135
136build.dir           ${configure.dir}
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.