source: trunk/dports/devel/icu/Portfile

Last change on this file was 154403, checked in by ryandesign@…, 11 months ago

icu: Only livecheck the main port

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.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 154403 2016-10-28 22:36:59Z ryandesign@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         55.1
13categories      devel textproc
14platforms       darwin freebsd
15maintainers     ryandesign openmaintainer
16license         MIT
17
18description     International Components for Unicode
19
20long_description \
21    The International Components for Unicode (ICU) libraries provide robust \
22    and full-featured Unicode services on a wide variety of platforms. ICU \
23    supports the most current version of the Unicode standard, and they provide \
24    support for supplementary Unicode characters (needed for GB 18030 repertoire support).
25
26homepage        http://www.icu-project.org/
27master_sites    http://download.icu-project.org/files/${my_name}/${version}/
28
29distname        ${my_name}-[join [split ${version} .] _]
30
31worksrcdir      ${name}/source
32set docdir      ${prefix}/share/doc/${name}
33
34subport ${name}-docs {
35    conflicts           ${name}-doxygen-docs
36    supported_archs     noarch
37
38    description-append  (documentation)
39    long_description-append Documentation.
40   
41    distfiles           ${distname}-docs.zip
42    checksums           rmd160  d5ee9d13b90516c1722e25fd75b62119dbe99f12 \
43                        sha256  1c70c2283655e1d502baa32e4d087f8ce8f07b6230e6baed3567e74c42e5ffcc
44   
45    use_zip             yes
46    extract.suffix      .zip
47    extract.dir         ${worksrcpath}/doc/html
48
49    use_configure       no
50
51    build {}
52
53    destroot {
54        xinstall -m 755 -d ${destroot}${docdir}
55        copy ${worksrcpath}/doc/html ${destroot}${docdir}
56    }
57}
58
59subport ${name}-doxygen-docs {
60    conflicts           ${name}-docs
61    supported_archs     noarch
62   
63    depends_build       port:doxygen
64
65    description-append  (build documentation)
66    long_description-append Build documentation.
67   
68    build.target     doc
69    destroot.target  install-doc
70}
71
72if { ${subport} ne "${name}-docs" } {
73    if { ${supported_archs} ne "noarch" } {
74        PortGroup       muniversal 1.0
75    }
76   
77    extract.suffix  .tgz
78    distfiles       ${distname}-src${extract.suffix}
79   
80    checksums           rmd160  94dcaaac13b41de3588b01f39febe1b1cbd5765d \
81                        sha256  e16b22cbefdd354bec114541f7849a12f8fc2015320ca5282ee4fd787571457b
82   
83    patchfiles-append   patch-Makefile.in.diff
84    patchfiles-append   patch-config-mh-darwin.diff
85   
86    # ICU has three mechanisms to aid other projects in building properly
87    #     1) .pc files for pkg-config
88    #     2) shell script icu-config that can output compiler flags
89    #     3) Makefile include files Makefile.inc and pkgdata.inc
90    # For a time, all three assumed other projects would want to be
91    #     built as ICU had been built, regardless of whether it was appropriate.
92    # For the most part, the extraneous flags have been removed.
93    #     1) They have been removed completely from the .pc files.
94    #        pkg-config is the recommended way of building against ICU.
95    #     2) icu-config does not print them out, but they are still contained in the script itself.
96    #     3) They still exist in the Makefile include files.
97    #
98    # for descriptions of the problem, see
99    #     r101578
100    #     #40069
101    #     https://bugs.gentoo.org/show_bug.cgi?id=202059
102    #
103    # for upstream reports and discussion, see
104    #    http://bugs.icu-project.org/trac/ticket/10308
105    #    http://bugs.icu-project.org/trac/ticket/6102
106    post-build {
107        if {[variant_exists universal] && [variant_isset universal]} {
108            set dirs {}
109            foreach arch ${universal_archs_to_use} {
110                lappend dirs ${worksrcpath}-${arch}
111            }
112        } else {
113            set dirs ${worksrcpath}
114        }
115        foreach dir ${dirs} {
116            # Removing architecture-specific differences is necessary to facilitate merging.
117            # This should not be a problem for projects using icu-config because we do not
118            # believe icu-config uses SIZEOF_VOID_P anyway. Projects using the Makefile
119            # include files may experience problems. The developers of ICU suggest using
120            # pkg-config over both icu-config and the Makefile includes.
121            reinplace {s| -DSIZEOF_VOID_P=[48]||g} \
122                ${dir}/config/Makefile.inc \
123                ${dir}/config/icu-config
124            reinplace -E {s| -arch +[^ ]+||g} \
125                ${dir}/config/pkgdata.inc
126        }
127    }
128   
129    set platform [switch ${os.platform} {darwin {format MacOSX} freebsd {format FreeBSD}}]
130    configure.cmd   ./runConfigureICU ${platform}
131   
132    configure.args  --enable-static \
133                    --disable-samples
134   
135    configure.universal_args-delete --disable-dependency-tracking
136    if {[variant_isset universal]} {
137        # ICU detects cross compiling by trying to run binaries.
138        # r73849 and #29904 indicate that cross compiling is a problem.
139        # Of the solutions tried (r79660, r73865, and r73849), simply disallowing cross compiling is by far the simplest.
140        # Note that #29904 should not show up again because universal now better recognizes 32/64-bit cross compiling (r79658)
141        set merger_must_run_binaries "yes"
142    }
143   
144    # Fix bug #11981 that prevents ICU from building when upgrading.
145    # The default configure flags causes utilisation of outdated ICU
146    # headers/libs instead of the right ones.
147    configure.cppflags
148    configure.ldflags
149   
150    build.type      gnu
151    build.args      VERBOSE=1
152   
153    use_parallel_build  yes
154   
155    test.run        yes
156    test.target     check
157    test.args       VERBOSE=1
158   
159    if { ${name} eq ${subport} } {
160        post-destroot {
161            xinstall -d ${destroot}${docdir}
162            xinstall -m 0644 {*}[glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir}
163        }
164       
165        if { [variant_isset doc] } {
166            ui_warn "You have requested an obsolete variant. Replaced by port ${name}-docs"
167            depends_build-append port:${name}-docs
168        }
169        if { [variant_isset doxygen] } {
170            ui_warn "You have requested an obsolete variant. Replaced by port ${name}-doxygen-docs"
171            depends_build-append port:${name}-doxygen-docs
172        }
173    }
174   
175    platform freebsd {
176        build.env       MAKE=/usr/local/bin/gmake
177        destroot.env    MAKE=/usr/local/bin/gmake
178    }
179   
180    platform darwin 8 {
181        patchfiles-append patch-common-putil.cpp.diff
182    }
183}
184
185if {${subport} eq ${name}} {
186    livecheck.url       http://site.icu-project.org/download
187    livecheck.regex     {>ICU4C \((\d+(?:\.\d+)*)\)<}
188} else {
189    livecheck.type      none
190}
Note: See TracBrowser for help on using the repository browser.