source: trunk/dports/cross/i386-mingw32-binutils/Portfile

Last change on this file was 142698, checked in by landonf@…, 22 months ago

Drop maintainership of (almost) all my ports, as I'm no longer using Mac OS X as my desktop OS.

The dict port here dates back to ~2002; it was the first port used as a test case when we were developing MacPorts.

  • 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 142698 2015-11-20 16:55:09Z ryandesign@macports.org $
3PortSystem          1.0
4
5name                i386-mingw32-binutils
6version             2.21-3
7maintainers         nomaintainer
8description         Mingw32 Binutils for i386-mingw32 cross development
9long_description    Mingw32 development toolchain ("binutils") \
10                    for i386-mingw32 (Windows) cross development.
11homepage            http://www.mingw.org
12categories          cross devel
13
14depends_lib         port:gettext
15
16# Parameters for this port.
17set crossgcc-target i386-mingw32
18
19platforms           darwin
20master_sites        sourceforge:project/mingw/MinGW/BaseSystem/GNU-Binutils/binutils-[lindex [split ${version} -] 0]
21use_lzma            yes
22distname            binutils-${version}-mingw32-src
23worksrcdir          binutils-[lindex [split ${version} -] 0]
24
25checksums           sha1   ad67d8f010b87643087f77390aebef287b00a189 \
26                    rmd160 0774cd01e36e0dfabafd73950cc071754fbe8d1a
27
28# Build in a different directory, as advised in the README file.
29pre-configure       { system "cd ${workpath} && mkdir -p build"}
30configure.dir       ${workpath}/build
31configure.cmd       ${worksrcpath}/configure
32configure.args      --infodir='${prefix}/share/info' --target=${crossgcc-target} \
33                    --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man' \
34                    --disable-werror
35if {${os.platform} eq "darwin" && ${build_arch} ne ""} {
36    configure.args-append --build=${build_arch}-apple-darwin${os.major}
37}
38# Append CPPFLAGS to CFLAGS and CXXFLAGS as CPPFLAGS seems to be ignored
39configure.cflags-append     ${configure.cppflags}
40configure.cxxflags-append   ${configure.cppflags}
41build.dir                   ${workpath}/build
42
43# We don't want the etc module.
44post-extract {
45    system "rm -rf ${worksrcpath}/etc"
46}
47
48post-patch {
49    namespace eval crossgcc {}
50
51    # Fix the info pages and related stuff.
52    #   
53    # path: path to the doc directory (e.g. gas/doc/)
54    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
55    # name: name of the info page (e.g. as)
56    # suffix: suffix of the souce page (texinfo or texi)
57    proc crossgcc::fixinfo { path makefile name suffix } {
58        global crossgcc-target worksrcpath
59
60        # Fix the source
61        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
62            ${worksrcpath}/${path}/${name}.${suffix}
63        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
64            ${worksrcpath}/${path}/${name}.${suffix}
65        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
66            ${worksrcpath}/${path}/${name}.${suffix}
67       
68        # Fix the Makefile
69        reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
70            ${worksrcpath}/${makefile}
71        reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
72            ${worksrcpath}/${makefile}
73       
74        # Rename the source
75        file rename ${worksrcpath}/${path}/${name}.${suffix} \
76            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
77       
78        # Fix install-info's dir.
79        # (note: this may be effectless if there was no info dir to be fixed)
80        reinplace "s|__TARGET|${crossgcc-target}|g" \
81            "${worksrcpath}/${makefile}"
82    }
83
84    # Fix the gettext files and related stuff.
85    #   
86    # module: name of the module (e.g. gas)
87    proc crossgcc::fixgettext { module } {
88        global crossgcc-target worksrcpath
89
90        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
91            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
92                "${worksrcpath}/${module}/Makefile.in"
93        }
94        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
95            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
96                "${worksrcpath}/${module}/doc/Makefile.in"
97        }
98        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
99            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
100                "${worksrcpath}/${module}/po/Make-in"
101        }
102    }
103
104    # gas/doc/as.texinfo
105    crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
106
107    # bfd/doc/bfd.texinfo
108    crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
109
110    # binutils/doc/binutils.texi
111    crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
112
113    # gprof/gprof.texi
114    crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
115
116    # ld/ld.texinfo
117    crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
118   
119    # gettext stuff.
120    crossgcc::fixgettext bfd
121    crossgcc::fixgettext binutils
122    crossgcc::fixgettext gas
123    crossgcc::fixgettext gprof
124    crossgcc::fixgettext ld
125    crossgcc::fixgettext opcodes
126}
127
128destroot.violate_mtree  yes
129post-destroot {
130    # Installing (host) libiberty was a mistake.
131    foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
132        file delete $f
133    }
134}
Note: See TracBrowser for help on using the repository browser.