Bug 256078

Summary: textproc/libxml2: Update to 2.9.12 - WIP
Product: Ports & Packages Reporter: Daniel Engberg <diizzy>
Component: Individual Port(s)Assignee: freebsd-desktop (Team) <desktop>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: tcberner
Priority: --- Flags: tcberner: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
URL: http://www.xmlsoft.org/news.html
Attachments:
Description Flags
Patch for libxml2 (WIP)
none
Patch for libxml2 (WIP) v2 none

Description Daniel Engberg freebsd_committer freebsd_triage 2021-05-22 11:38:02 UTC
Created attachment 225170 [details]
Patch for libxml2 (WIP)

Hi,

I've been hacking on libxml2 a bit including converting it to CMake and would like some input, there are some differences between current version and the new version that I'm not sure about on how to handle.

./work/stage/usr/local/lib/xml2Conf.sh
 -- CMAKE --
prefix is expanded
XML2_LIBS="-lxml2 -lz -llzma -pthread   -lm"

 -- Autotools --
XML2_LIBS="-lxml2 -lz  -L/usr/lib -llzma  -L/usr/lib  -lm"


./work/stage/usr/local/libdata/pkgconfig/libxml-2.0.pc
 -- CMAKE --
Libs.private:  -pthread -lz -llzma  -lm

 -- Autotools --
Libs.private:  -lz  -L/usr/lib -llzma -L/usr/lib -lm


Questions:
Is -L/usr/lib needed? From what I can tell CMake doesn't have a variable for this, suggestions are welcome. In worst case we can hardcode it.

Current version in ports forces -DPIC cflag, is this needed?
https://cgit.freebsd.org/ports/tree/textproc/libxml2/files/patch-Makefile.in

make test passes on 13-STABLE (amd64)

Motivation for moving to CMake is mainly because it's faster and much easier to debug, I do plan to upstream as many changes as possible but perhaps it's futile effort?

I'm not sure how to handle py-libxml2 in a sane way. :/

Note for users:
https://gitlab.gnome.org/GNOME/libxslt/-/issues/51
https://git.alpinelinux.org/aports/diff/main/libxslt/APKBUILD?id=3ec3aafa689b134df3f999baf8841099c6e8c422

Changes for 2.9.12
https://gitlab.gnome.org/GNOME/libxml2/-/commit/b48e77cf4f6fa0792c5f4b639707a2b0675e461b

Thanks in advance,
Daniel
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2021-05-23 14:14:22 UTC
Moin moin

I think it is generally a good idea to move the ports to use a more modern build system.


Also the -L/usr/lib should be there by default anyways, so, no loss there.


What's the issue you're having with the python variant?


mfg Tobias
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2021-05-23 17:41:16 UTC
Hi,

Thanks for the reply! I'll drop that and ${CMAKE_INSTALL_OLDINCLUDEDIR}.

The issue with the python port is that it currently works as it's own project ( https://github.com/freebsd/freebsd-ports/blob/main/textproc/py-libxml2/Makefile#L10 ) unless I've misunderstood how it works. This approach isn't possible with at least the current upstream version of CMakeLists.txt and I'm not sure how to handle it properly being a python port.

Best regards,
Daniel
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2021-05-23 22:10:44 UTC
Created attachment 225208 [details]
Patch for libxml2 (WIP) v2

Clean up Makefile a bit more, remove CMAKE_INSTALL_OLDINCLUDEDIR
Still not sure how to handle py-libxml2
There are a few patches left that wont be needed depending on how we end up doing python port.
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2021-06-05 09:22:40 UTC
I don't have time/ability to hack on this within a reasonable timeframe so just stick to autotools for now.