net/asterisk was found to be linking to libiconv.so even after *many*
attempts to disable it. Investigation revealed the following xml2-config
output as the root cause, evidenced in config.log:
LIBXML2_LIB='-L/usr/local/lib -lxml2 -lz -L/usr/local/lib -liconv -lm'
libxml2 ships a pkg-config file (libxml-2.0.pc) that correctly doesn't
list its private library dependencies in --libs output.
Unfortunately, xml2-config does (can) not, returning the full output of the
XML_LIBS value provided in the Makefile, derived from ./configure
output.
This overlinking issue affects any dependent ports that use xml2-config
to obtain compile / link flags.
This change adapts a debian libxml2 package patch [1] that returns
sanity to xml2-config's output. It however 'does not' replace the
value of XML_LIBS in configure.ac (unlike the debian patch), as other
files within the source utilise it.
While I'm here:
- Remove noop patches. LZMA_LIBS is in the upstream source [2]
patch-libxml-2.0.pc.in patch-libxml-2.0-uninstalled.pc.in
A weird issue was identified when patching these files:
Patch stated:
-Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ +Libs.private: @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
Post-patch result:
-Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ +Libs.private: @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
Note the removal of @ICU_LIBS@ in the post-patch output. Possible
patch(8) bug?
- Move the nulling out of THREAD_LIBS from a patch to port Makefile
- Make the build verbose by default
- Pet portlint (spaces -> tabs)
- Add LICENSE (MIT) & LICENSE_FILE
References:
[1] 0001-modify-xml2-config-and-pkgconfig-behaviour.patch
[2] https://bugzilla.gnome.org/show_bug.cgi?id=711026
[3] https://bugs.debian.org/374017
PR: 202006