# -*- 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 # $Id: Portfile 134323 2015-03-22 21:58:46Z ryandesign@macports.org $ PortSystem 1.0 name icu set my_name icu4c # Don't forget to increase the revision number of the dependents (e.g. boost) # whenever the library version number changes. Thanks. # To find dependencies, use: # port file all | sort -u | xargs grep -E ':icu( |$)' | cut -d / -f 12 | sort -u version 54.1 categories devel textproc platforms darwin freebsd maintainers ryandesign openmaintainer license MIT description International Components for Unicode long_description \ The International Components for Unicode (ICU) libraries provide robust \ and full-featured Unicode services on a wide variety of platforms. ICU \ supports the most current version of the Unicode standard, and they provide \ support for supplementary Unicode characters (needed for GB 18030 repertoire support). homepage http://www.icu-project.org/ master_sites http://download.icu-project.org/files/${my_name}/${version}/ distname ${my_name}-[join [split ${version} .] _] worksrcdir ${name}/source set docdir ${prefix}/share/doc/${name} subport ${name}-docs { conflicts ${name}-doxygen-docs supported_archs noarch description-append (documentation) long_description-append Documentation. distfiles ${distname}-docs.zip checksums rmd160 30fa1ba3c579f65aa59bbf80854f6c302be42fa4 \ sha256 879fbfc4f0609c1ed113496ebea7dc5e531b95f2d8507ec50b2262adbe96b2e8 use_zip yes extract.suffix .zip extract.dir ${worksrcpath}/doc/html use_configure no build {} destroot { xinstall -m 755 -d ${destroot}${docdir} copy ${worksrcpath}/doc/html ${destroot}${docdir} } } subport ${name}-doxygen-docs { conflicts ${name}-docs supported_archs noarch depends_build port:doxygen description-append (build documentation) long_description-append Build documentation. build.target doc destroot.target install-doc } if { ${subport} ne "${name}-docs" } { if { ${supported_archs} ne "noarch" } { PortGroup muniversal 1.0 } extract.suffix .tgz distfiles ${distname}-src${extract.suffix} checksums rmd160 b1440e1a3330b12336742c881863a8de6a6d2235 \ sha256 d42bc9a8ca6a91c55eb0925c279f49e5b508d51ef26ac9850d9be55de5bb8ab3 patchfiles patch-config-mh-darwin.diff # icu appends -O2 to the cflags and cxxflags configure.optflags-delete -Os # ICU has three mechanisms to aid other projects in building properly # 1) .pc files for pkg-config # 2) shell script icu-config that can output compiler flags # 3) Makefile include files Makefile.inc and pkgdata.inc # For a time, all three assumed other projects would want to be # built as ICU had been built, regardless of whether it was appropriate. # For the most part, the extraneous flags have been removed. # 1) They have been removed completely from the .pc files. # pkg-config is the recommended way of building against ICU. # 2) icu-config does not print them out, but they are still contained in the script itself. # 3) They still exist in the Makefile include files. # # for descriptions of the problem, see # r101578 # #40069 # https://bugs.gentoo.org/show_bug.cgi?id=202059 # # for upstream reports and discussion, see # http://bugs.icu-project.org/trac/ticket/10308 # http://bugs.icu-project.org/trac/ticket/6102 if { [variant_exists universal] && [variant_isset universal]} { merger-post-destroot { set rebuilton "" foreach arch ${universal_archs_to_use} { set dir ${destroot}-${arch} # SIZEOF_VOID_P is no longer used in icu-config, so remove it to facilitate merging of the shell script reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/bin/icu-config # icu-config contains the exact time it was built, which makes merging difficult # ensure that all versions of icu-config have the same build timestamp if { ${rebuilton} eq "" } { set rebuilton [exec /usr/bin/tail -n 1 ${dir}${prefix}/bin/icu-config] } else { reinplace "s|^# Rebuilt on .*|${rebuilton}|" ${dir}${prefix}/bin/icu-config } # Removing architecture specific information from the Makefile include files is necessary to merge them correctly. # It is conceivable that this could cause problems for certain projects. # The developers of ICU suggest using pkg-config over both icu-config and the Makefile includes. reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/lib/icu/${version}/Makefile.inc reinplace -E {s:-arch +[^ ]+::g} ${dir}${prefix}/lib/icu/${version}/pkgdata.inc } } } else { post-destroot { # stay consistent with the universal build (see comments above) if { [file exists ${destroot}${prefix}/bin/icu-config] } { reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/bin/icu-config } if { [file exists ${destroot}${prefix}/lib/icu/${version}/Makefile.inc] } { reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/lib/icu/${version}/Makefile.inc } if { [file exists ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc] } { reinplace -E {s:-arch +[^ ]+::g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc } } } set platform [switch ${os.platform} {darwin {format MacOSX} freebsd {format FreeBSD}}] configure.cmd ./runConfigureICU ${platform} configure.args --enable-static \ --disable-samples configure.universal_args-delete --disable-dependency-tracking if {[variant_isset universal]} { # ICU detects cross compiling by trying to run binaries. # r73849 and #29904 indicate that cross compiling is a problem. # Of the solutions tried (r79660, r73865, and r73849), simply disallowing cross compiling is by far the simplest. # Note that #29904 should not show up again because universal now better recognizes 32/64-bit cross compiling (r79658) set merger_must_run_binaries "yes" } # Fix bug #11981 that prevents ICU from building when upgrading. # The default configure flags causes utilisation of outdated ICU # headers/libs instead of the right ones. configure.cppflags configure.ldflags build.type gnu build.args VERBOSE=1 use_parallel_build yes test.run yes test.target check test.args VERBOSE=1 if { ${name} eq ${subport} } { post-destroot { xinstall -d ${destroot}${docdir} xinstall -m 0644 {*}[glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir} } if { [variant_isset doc] } { ui_warn "You have requested an obsolete variant. Replaced by port ${name}-docs" depends_build-append port:${name}-docs } if { [variant_isset doxygen] } { ui_warn "You have requested an obsolete variant. Replaced by port ${name}-doxygen-docs" depends_build-append port:${name}-doxygen-docs } } platform freebsd { build.env MAKE=/usr/local/bin/gmake destroot.env MAKE=/usr/local/bin/gmake } platform darwin 8 { patchfiles-append patch-common-putil.cpp.diff } } livecheck.url http://site.icu-project.org/download livecheck.regex {>ICU4C \((\d+(?:\.\d+)*)\)<}