source: trunk/dports/devel/icu/Portfile @ 127942

Last change on this file since 127942 was 127942, checked in by mcalhoun@…, 4 years ago

icu: version bump 53.1->54.1. revision bump for all dependents of icu. fixes #45322.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 127942 2014-11-08 18:51:13Z mcalhoun@macports.org $
3
4PortSystem      1.0
5
6name            icu
7set my_name     icu4c
8# Don't forget to increase the revision number of the dependents (e.g. boost)
9# whenever the library version number changes. Thanks.
10# To find dependencies, use:
11# port file all | sort -u | xargs grep -E ':icu( |$)' | cut -d / -f 12 | sort -u
12version         54.1
13categories      devel textproc
14platforms       darwin freebsd
15license         MIT
16maintainers     nomaintainer
17description     International Components for Unicode
18
19long_description \
20    The International Components for Unicode (ICU) libraries provide robust \
21    and full-featured Unicode services on a wide variety of platforms. ICU \
22    supports the most current version of the Unicode standard, and they provide \
23    support for supplementary Unicode characters (needed for GB 18030 repertoire support).
24
25homepage        http://www.icu-project.org/
26master_sites    http://download.icu-project.org/files/${my_name}/${version}/
27
28distname        ${my_name}-[join [split ${version} .] _]
29
30worksrcdir      ${name}/source
31set docdir      ${prefix}/share/doc/${name}
32
33subport ${name}-docs {
34    conflicts           ${name}-doxygen-docs
35    supported_archs     noarch
36
37    description-append  (documentation)
38    long_description-append Documentation.
39   
40    distfiles           ${distname}-docs.zip
41    checksums           rmd160  30fa1ba3c579f65aa59bbf80854f6c302be42fa4 \
42                        sha256  879fbfc4f0609c1ed113496ebea7dc5e531b95f2d8507ec50b2262adbe96b2e8
43   
44    use_zip             yes
45    extract.suffix      .zip
46    extract.dir         ${worksrcpath}/doc/html
47
48    use_configure       no
49
50    build {}
51
52    destroot {
53        xinstall -m 755 -d ${destroot}${docdir}
54        copy ${worksrcpath}/doc/html ${destroot}${docdir}
55    }
56}
57
58subport ${name}-doxygen-docs {
59    conflicts           ${name}-docs
60    supported_archs     noarch
61   
62    depends_build       port:doxygen
63
64    description-append  (build documentation)
65    long_description-append Build documentation.
66   
67    build.target     doc
68    destroot.target  install-doc
69}
70
71if { ${subport} ne "${name}-docs" } {
72    if { ${supported_archs} ne "noarch" } {
73        PortGroup       muniversal 1.0
74    }
75   
76    extract.suffix  .tgz
77    distfiles       ${distname}-src${extract.suffix}
78   
79    checksums       rmd160  b1440e1a3330b12336742c881863a8de6a6d2235 \
80                    sha256  d42bc9a8ca6a91c55eb0925c279f49e5b508d51ef26ac9850d9be55de5bb8ab3
81   
82    patchfiles      patch-config-mh-darwin.diff
83   
84    # icu appends -O2 to the cflags and cxxflags
85    configure.optflags-delete -Os
86   
87    # ICU has three mechanisms to aid other projects in building properly
88    #     1) .pc files for pkg-config
89    #     2) shell script icu-config that can output compiler flags
90    #     3) Makefile include files Makefile.inc and pkgdata.inc
91    # For a time, all three assumed other projects would want to be
92    #     built as ICU had been built, regardless of whether it was appropriate.
93    # For the most part, the extraneous flags have been removed.
94    #     1) They have been removed completely from the .pc files.
95    #        pkg-config is the recommended way of building against ICU.
96    #     2) icu-config does not print them out, but they are still contained in the script itself.
97    #     3) They still exist in the Makefile include files.
98    #
99    # for descriptions of the problem, see
100    #     r101578
101    #     #40069
102    #     https://bugs.gentoo.org/show_bug.cgi?id=202059
103    #
104    # for upstream reports and discussion, see
105    #    http://bugs.icu-project.org/trac/ticket/10308
106    #    http://bugs.icu-project.org/trac/ticket/6102
107    if { [variant_exists universal] && [variant_isset universal]} {
108        merger-post-destroot {
109            set rebuilton ""
110            foreach arch ${universal_archs_to_use} {
111                set dir ${destroot}-${arch}
112               
113                # SIZEOF_VOID_P is no longer used in icu-config, so remove it to facilitate merging of the shell script
114                reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/bin/icu-config
115               
116                # icu-config contains the exact time it was built, which makes merging difficult
117                # ensure that all versions of icu-config have the same build timestamp
118                if { ${rebuilton} eq "" } {
119                    set rebuilton [exec /usr/bin/tail -n 1 ${dir}${prefix}/bin/icu-config]
120                } else {
121                    reinplace "s|^# Rebuilt on .*|${rebuilton}|" ${dir}${prefix}/bin/icu-config
122                }
123               
124                # Removing architecture specific information from the Makefile include files is necessary to merge them correctly.
125                # It is conceivable that this could cause problems for certain projects.
126                # The developers of ICU suggest using pkg-config over both icu-config and the Makefile includes.
127                reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/lib/icu/${version}/Makefile.inc
128                reinplace -E {s:-arch +[^ ]+::g} ${dir}${prefix}/lib/icu/${version}/pkgdata.inc
129            }
130        }
131    } else {
132        post-destroot {
133            # stay consistent with the universal build (see comments above)
134            if { [file exists ${destroot}${prefix}/bin/icu-config] } {
135                reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/bin/icu-config
136            }
137            if { [file exists ${destroot}${prefix}/lib/icu/${version}/Makefile.inc] } {
138                reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/lib/icu/${version}/Makefile.inc
139            }
140            if { [file exists ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc] } {
141                reinplace -E {s:-arch +[^ ]+::g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc
142            }
143        }
144    }
145   
146    set platform [switch ${os.platform} {darwin {format MacOSX} freebsd {format FreeBSD}}]
147    configure.cmd   ./runConfigureICU ${platform}
148   
149    configure.args  --enable-static \
150                    --disable-samples
151   
152    configure.universal_args-delete --disable-dependency-tracking
153    if {[variant_isset universal]} {
154        # ICU detects cross compiling by trying to run binaries.
155        # r73849 and #29904 indicate that cross compiling is a problem.
156        # Of the solutions tried (r79660, r73865, and r73849), simply disallowing cross compiling is by far the simplest.
157        # Note that #29904 should not show up again because universal now better recognizes 32/64-bit cross compiling (r79658)
158        set merger_must_run_binaries "yes"
159    }
160   
161    # Fix bug #11981 that prevents ICU from building when upgrading.
162    # The default configure flags causes utilisation of outdated ICU
163    # headers/libs instead of the right ones.
164    configure.cppflags
165    configure.ldflags
166   
167    build.type      gnu
168    build.args      VERBOSE=1
169   
170    use_parallel_build  yes
171   
172    test.run        yes
173    test.target     check
174    test.args       VERBOSE=1
175   
176    if { ${name} eq ${subport} } {
177        post-destroot {
178            xinstall -d ${destroot}${docdir}
179            eval xinstall -m 0644 [glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir}
180        }
181       
182        if { [variant_isset doc] } {
183            ui_warn "You have requested an obsolete variant. Replaced by port ${name}-docs"
184            depends_build-append port:${name}-docs
185        }
186        if { [variant_isset doxygen] } {
187            ui_warn "You have requested an obsolete variant. Replaced by port ${name}-doxygen-docs"
188            depends_build-append port:${name}-doxygen-docs
189        }
190    }
191   
192    # icu @51.2_0 and earlier also installed the following files directly, bypassing destroot:
193    #   ${prefix}/lib/icu/${version}/pkgdata.inc
194    # These files can be removed from the below deactivation block after August 2014.
195    pre-deactivate {
196        if {[variant_isset universal]} {
197            # Ticket #23773
198            foreach f [list "${prefix}/bin/icu-config" \
199                           "${prefix}/lib/icu/${version}/Makefile.inc" \
200                           "${prefix}/lib/icu/${version}/pkgdata.inc" \
201                           "${prefix}/lib/pkgconfig/icu-i18n.pc" \
202                           "${prefix}/lib/pkgconfig/icu-io.pc" \
203                           "${prefix}/lib/pkgconfig/icu-le.pc" \
204                           "${prefix}/lib/pkgconfig/icu-lx.pc" \
205                           "${prefix}/lib/pkgconfig/icu-uc.pc"] {
206                delete ${f}
207            }
208        }
209    }
210   
211    platform freebsd {
212        build.env       MAKE=/usr/local/bin/gmake
213        destroot.env    MAKE=/usr/local/bin/gmake
214    }
215   
216    platform darwin 8 {
217        patchfiles-append patch-common-putil.cpp.diff
218    }
219}
220
221livecheck.url   http://site.icu-project.org/download
222livecheck.regex {>ICU4C \((\d+(?:\.\d+)*)\)<}
Note: See TracBrowser for help on using the repository browser.