Page MenuHomeFreeBSD

textproc/libxml2: Hide private libs, Add --static support in xml2-config
Needs RevisionPublic

Authored by koobs on Jul 31 2015, 2:29 PM.
Tags
Referenced Files
Unknown Object (File)
Wed, Jul 3, 12:27 AM
Unknown Object (File)
Tue, Jul 2, 11:33 PM
Unknown Object (File)
Tue, Jul 2, 11:17 PM
Unknown Object (File)
Tue, Jul 2, 10:42 PM
Unknown Object (File)
Tue, Jul 2, 10:42 PM
Unknown Object (File)
Tue, Jul 2, 7:38 PM
Unknown Object (File)
Tue, Jul 2, 5:49 PM
Unknown Object (File)
Mon, Jul 1, 9:50 PM

Details

Reviewers
antoine
kwm
Group Reviewers
gnome
Summary

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

Test Plan
  • portlint: Appears OK. Weird FATAL error (possibly due to MASTER/SLAVE setup).
  • unittest: I think it passed? Worst test suite output ever.
  • testport: OK 93amd64, 101i386, 11amd64. 84amd64 fails with:
 ====>> Checking for filesystem violations... done
====>> Error: Filesystem touched during build:
extra: root/.history
build of textproc/libxml2 ended at Sat Aug  1 00:57:42 AEST 2015
build time: 00:00:23
!!! build failure encountered !!!
[00:00:30] ====>> Error: Build failed in phase: build_fs_violation

Appears unrelated.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

koobs retitled this revision from to textproc/libxml2: Hide private libs in xml2-config.
koobs updated this object.
koobs edited the test plan for this revision. (Show Details)
koobs added reviewers: gnome, kwm.

Add regression-test: target and TEST_DEPENDS (tests need runtest(8))

Remove dejagnu (runtest), has its own runtest.c

koobs edited the test plan for this revision. (Show Details)
koobs updated this object.

Pet portlint (space -> tab), Add LICENSE/LICENSE_FILE

koobs retitled this revision from textproc/libxml2: Hide private libs in xml2-config to textproc/libxml2: Hide private libs, Add --static support in xml2-config.Jul 31 2015, 3:53 PM
koobs added a subscriber: tijl.
koobs added a subscriber: portmgr.

Requesting exp-run cc portmgr

koobs updated this object.

Fix typo: CONFIGURE_ARGS

antoine requested changes to this revision.Aug 29 2015, 1:06 PM
antoine added a reviewer: antoine.
antoine added a subscriber: antoine.
antoine added inline comments.
textproc/libxml2/Makefile
30

This doesn't work, THREAD_LIBS is not nulled out with this (contrary to with files/patch-configure)

75

This should be ${MAKE_CMD} instead of ${GMAKE}

Also, did you verify it works for the slave ports? (slave ports have BUILD_WRKSRC different from WRKSRC)

textproc/libxml2/files/patch-xml2-config.in
17

"xml2-config --libs --static" doesn't work (missing shift?)

Also, this new option is not documented in the usage string or the man page

This revision now requires changes to proceed.Aug 29 2015, 1:06 PM