How to handle ports that are still broken because of the icu upgrade

Ryan Schmidt ryandesign at macports.org
Wed Oct 23 01:49:45 UTC 2019


icu was recently updated to a new major version. As a result its install_name changed and anything that links with it needs to be rebuilt against the new version.

All ports that declare a dependency on icu already had their revisions increased for this reason. So if you are encountering a port that rev-upgrade identifies as broken due to linking with an older icu, please take a moment to investigate why and perform the correct fix, and don't only increase the revision to rebuild it, which just kicks the can down the road until the next time icu is updated.

Does the port directly use icu but it does not declare a dependency on it? (Search the project's source code for mentions of icu.) If so, add the icu dependency and increase the revision.

Or does the port use libxml2? If so, it may be using a bad method of finding libxml2. One bad method of finding libxml2 is using the xml2-config script. The correct way is to use pkg-config instead. See https://trac.macports.org/ticket/59400 and https://trac.macports.org/ticket/59439 for examples of this. Projects should be patched to use pkg-config instead and patches should be sent upstream. Another bad method is to use libxml2-config.cmake. Using FindLibXml2.cmake may be a better method. See https://trac.macports.org/ticket/59436 for an example of this.

Then there's the problem that a port may not build with the new version of icu. Check with upstream if a new version is available or if they already have a patch. If so, update the port or use their patch. Otherwise you may need to develop a patch yourself, which you should send upstream.

The new icu requires C++11 (or newer). Ports that use icu must indicate this by setting `compiler.cxx_standard 2011` (or newer) to ensure that MacPorts selects a C++11-capable compiler. If the build system does not already arrange to add the `-std=c++11` (or newer) flag to CXXFLAGS (for example by getting the flags from icu's pkg-config file), you'll need to add that to configure.cxxflags in the Portfile, or patch the build system and send the patch upstream.



More information about the macports-dev mailing list