Changeset 120843


Ignore:
Timestamp:
Jun 9, 2014, 9:08:40 PM (6 years ago)
Author:
mcalhoun@…
Message:

icu

  • update version 51.2 -> 53.1
  • simplify Portfile to reflect upstream improvements in ICU build mechanism
  • allow ICU to choose the optimization level
  • simplify universal build process
  • remove cross compiling ability to simplify code
  • as there is no maintainer, add copious comments
Location:
trunk/dports/devel/icu
Files:
4 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/devel/icu/Portfile

    r114328 r120843  
    99# Don't forget to increase the revision number of the dependents (e.g. boost)
    1010# whenever the library version number changes. Thanks.
    11 version         51.2
    12 revision        1
     11# port echo depends:icu finds dependencies
     12version         53.1
    1313categories      devel textproc
    1414platforms       darwin freebsd
     
    2929extract.suffix  .tgz
    3030distfiles       ${distname}-src${extract.suffix}
    31 patchfiles      patch-configure.diff \
    32                 patch-config-mh-darwin.diff \
    33                 inline.patch
    3431
    3532checksums       ${distname}-src.tgz \
    36                 rmd160  ef1256bb87b3dcec1cf40b32b11c5c3f1bd48af6 \
    37                 sha256  deb027a05f1b3bec03298b96fb93b28c84e9683c22e6f94effa67fdc7bd704cc
     33                rmd160  9bd1b4bdc2010545c76a927dcf46049686beeab9 \
     34                sha256  6fa74fb5aac070c23eaba1711a7178fe582c59867484c5ec07c49002787a9a28
    3835
    3936worksrcdir      ${name}/source
    4037set docdir      ${prefix}/share/doc/${name}
    4138
     39# icu appends -O2 to the cflags and cxxflags
     40configure.optflags-delete -Os
     41
     42# ICU has three mechanisms to aid other projects in building properly
     43#     1) .pc files for pkg-config
     44#     2) shell script icu-config that can output compiler flags
     45#     3) Makefile include files Makefile.inc and pkgdata.inc
     46# For a time, all three assumed other projects would want to be
     47#     built as ICU had been built, regardless of whether it was appropriate.
     48# For the most part, the extraneous flags have been removed.
     49#     1) They have been removed completely from the .pc files.
     50#        pkg-config is the recommended way of building against ICU.
     51#     2) icu-config does not print them out, but they are still contained in the script itself.
     52#     3) They still exist in the Makefile include files.
     53#
     54# for descriptions of the problem, see
     55#     r101578
     56#     #40069
     57#     https://bugs.gentoo.org/show_bug.cgi?id=202059
     58#
     59# for upstream reports and discussion, see
     60#    http://bugs.icu-project.org/trac/ticket/10308
     61#    http://bugs.icu-project.org/trac/ticket/6102
    4262if {[variant_isset universal]} {
    43     patchfiles-append   patch-universal.diff
    44 
    45     # weirdly, icu needs a separate source dir built for the build
    46     # machine in order to cross-compile
    47     pre-configure {
    48         global merger_configure_args
    49         set cross 0
    50         set 32bit 0
    51         set crosspath ${worksrcpath}-cross
    52         if {${os.major} < 9 || [sysctl hw.cpu64bit_capable] == 0} {
    53             set 32bit 1
     63    merger-post-destroot {
     64        set rebuilton ""
     65        foreach arch ${universal_archs_to_use} {
     66            set dir ${destroot}-${arch}
     67           
     68            # SIZEOF_VOID_P is no longer used in icu-config, so remove it to facilitate merging of the shell script
     69            reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/bin/icu-config
     70           
     71            # icu-config contains the exact time it was built, which makes merging difficult
     72            # ensure that all versions of icu-config have the same build timestamp
     73            if { ${rebuilton} eq "" } {
     74                set rebuilton [exec /usr/bin/tail -n 1 ${dir}${prefix}/bin/icu-config]
     75            } else {
     76                reinplace "s|^# Rebuilt on .*|${rebuilton}|" ${dir}${prefix}/bin/icu-config
     77            }
     78           
     79            # Removing architecture specific information from the Makefile include files is necessary to merge them correctly.
     80            # It is concivable that this could cause problems for certain projects.
     81            # The developers of ICU suggest using pkg-config over both icu-config and the Makefile includes.
     82            reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/lib/icu/${version}/Makefile.inc
     83            reinplace -E {s:-arch +[^ ]+::g} ${dir}${prefix}/lib/icu/${version}/pkgdata.inc
    5484        }
    55         foreach a $universal_archs_to_use {
    56             if {($32bit && ($a eq "x86_64" || $a eq "ppc64"))
    57                 || (${os.arch} eq "powerpc" && ($a eq "x86_64" || $a eq "i386"))
    58                 || (${os.arch} eq "i386" && ($a eq "ppc" || $a eq "ppc64"))} {
    59                 set cross 1
    60                 set merger_configure_args($a) --with-cross-build=${crosspath}
    61             }
    62         }
    63         if {$cross} {
    64             copy ${worksrcpath} ${crosspath}
    65             set configure_dir_save  ${configure.dir}
    66             configure.dir ${crosspath}
    67             portconfigure::configure_main
    68             configure.dir $configure_dir_save
    69             system -W ${crosspath} "${build.cmd}[portbuild::build_getjobsarg]"
    70         }
     85    }
     86} else {
     87    post-destroot {
     88        # stay consistent with the universal build (see comments above)
     89        reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/bin/icu-config
     90        reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/lib/icu/${version}/Makefile.inc
     91        reinplace -E {s:-arch +[^ ]+::g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc
    7192    }
    7293}
    7394
    74 post-patch {
    75     reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/config/mh-darwin
     95post-destroot {
     96    # The ICU build mechanism passes rpath to the linker, but this should not be necessary if the shared libraries were built correctly.
     97    reinplace {s|^default_ENABLE_RPATH="YES"$|default_ENABLE_RPATH="NO"|g} ${destroot}${prefix}/bin/icu-config
     98    reinplace -E {s| -Wl,-rpath,.+/lib||g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc
    7699}
    77100
     
    79102configure.cmd   ./runConfigureICU ${platform}
    80103
     104# enable-rpath forces ICU to build the shared library correctly (with directory name in -install_name)
    81105configure.args  --enable-static \
    82                 --disable-samples
     106                --disable-samples \
     107                --enable-rpath
    83108
    84109configure.universal_args-delete --disable-dependency-tracking
     110if {[variant_isset universal]} {
     111    # ICU detects cross compiling by trying to run binaries.
     112    # r73849 and #29904 indicate that cross compiling is a problem.
     113    # Of the solutions tried (r79660, r73865, and r73849), simply disallowing cross compiling is by far the simplest.
     114    # Note that #29904 should not show up again because universal now better recognizes 32/64-bit cross compiling (r79658)
     115    set merger_must_run_binaries "yes"
     116}
    85117
    86118# Fix bug #11981 that prevents ICU from building when upgrading.
     
    90122configure.ldflags
    91123
    92 post-configure {
    93     if {[variant_isset universal]} {
    94         # Ticket #23773
    95         foreach a ${universal_archs_to_use} {
    96             reinplace "s|__ARCH__|${a}|g" ${worksrcpath}-${a}/Makefile
    97         }
    98     }
    99 }
    100 
    101124build.type      gnu
    102125
    103126use_parallel_build  yes
    104 
    105 post-build {
    106     if {[variant_isset universal]} {
    107         set dirs {}
    108         foreach arch ${universal_archs_to_use} {
    109             lappend dirs ${worksrcpath}-${arch}
    110         }
    111     } else {
    112         set dirs ${worksrcpath}
    113     }
    114     foreach dir ${dirs} {
    115         foreach f {Makefile.inc icu-config icu-i18n.pc icu-io.pc icu-le.pc icu-lx.pc icu-uc.pc icu.pc pkgdata.inc} {
    116             reinplace -E {s|-arch [a-z0-9_]+||g} ${dir}/config/${f}
    117         }
    118     }
    119 }
    120127
    121128test.run        yes
     
    125132    xinstall -d ${destroot}${docdir}
    126133    eval xinstall -m 0644 [glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir}
    127 
    128     if {[variant_isset universal]} {
    129         # Ticket #23773
    130         foreach a ${universal_archs_to_use} {
    131             reinplace "s|/Makefile.inc|/Makefile-${a}.inc|g" ${destroot}${prefix}/bin/icu-config-${a}
    132         }
    133         ln -s current/Makefile.inc ${destroot}${prefix}/lib/icu/Makefile.inc
    134     }
    135 }
    136 
    137 post-activate {
    138     if {[variant_isset universal]} {
    139         # Ticket #23773
    140         set a ${configure.build_arch}
    141         if {$a == "ppc64"} {
    142             if {![file exists ${prefix}/bin/icu-config-${a}]} {
    143                 set a "ppc"
    144             }
    145         } elseif {$a == "x86_64"} {
    146             if {![file exists ${prefix}/bin/icu-config-${a}]} {
    147                 set a "i386"
    148                 if {![file exists ${prefix}/bin/icu-config-${a}]} {
    149                     set a "ppc"
    150                 }
    151             }
    152         } elseif {$a == "i386"} {
    153             if {![file exists ${prefix}/bin/icu-config-${a}]} {
    154                 set a "ppc"
    155             }
    156         }
    157         foreach {p q} [list "${prefix}/bin/icu-config-${a}" "${prefix}/bin/icu-config" \
    158                             "${prefix}/lib/icu/${version}/Makefile-${a}.inc" "${prefix}/lib/icu/${version}/Makefile.inc" \
    159                             "${prefix}/lib/pkgconfig/icu-i18n-${a}.pc" "${prefix}/lib/pkgconfig/icu-i18n.pc" \
    160                             "${prefix}/lib/pkgconfig/icu-io-${a}.pc" "${prefix}/lib/pkgconfig/icu-io.pc" \
    161                             "${prefix}/lib/pkgconfig/icu-le-${a}.pc" "${prefix}/lib/pkgconfig/icu-le.pc" \
    162                             "${prefix}/lib/pkgconfig/icu-lx-${a}.pc" "${prefix}/lib/pkgconfig/icu-lx.pc" \
    163                             "${prefix}/lib/pkgconfig/icu-uc-${a}.pc" "${prefix}/lib/pkgconfig/icu-uc.pc"] {
    164             if {[file exists ${p}]} {
    165                 ln -s ${p} ${q}
    166             }
    167         }
    168     }
    169134}
    170135
     
    193158    distfiles-append    ${distname}-docs.zip
    194159    checksums-append    ${distname}-docs.zip \
    195                         rmd160  87f332c1c2e4c5322cd110f93e8ccb288d0303a9 \
    196                         sha256  c488b3ddbb99a4a368cfc74e725d6a9e491ae6ac0169caba2197c15ffb85b7c5
     160                        rmd160  60ce19f8633c18d670ad2f0b8d7920cd6ed0a314 \
     161                        sha256  2c700534d52b98615b4baffcf0502f37540604e67817625f05d6e2fbf98d0c0b
    197162
    198163    post-extract {
Note: See TracChangeset for help on using the changeset viewer.