-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ext/tidy to pkg-config #14997
base: master
Are you sure you want to change the base?
Move ext/tidy to pkg-config #14997
Conversation
It seems most distributions i.e. Debian/Gentoo/Fedora have all moved over to html-tidy as the tidy library they ship. It ships a pkg-config file, so we can just simply check for that and omit the various alternatives to check for. I'm not sure if the checks for library functionality are needed anymore if we assume the html5 tidy fork either.
CI issue seems related, but I can't seem to reproduce it locally on macOS w/ MacPorts and Alpine. |
This HAVE_TIDYBUFFIO_H macro is also used elsewhere in the code. And tidy headers should be included like this then: index f012d8466f..aa58281e56 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -26,8 +26,8 @@
#include "php_ini.h"
#include "ext/standard/info.h"
-#include "tidy.h"
-#include "tidybuffio.h"
+#include <tidy/tidy.h>
+#include <tidy/tidybuffio.h>
#include "tidy_arginfo.h"
Edit: Windows library sources are these: https://github.com/winlibs/libtidy (GitHub can't seem to search for "tidy" keyword among the repositories obviously). |
The bit about
Alpine is the same way. That said, I checked Debian’s package layout and it does seem to put it in a subdirectory. That’s a little annoying to deal with. |
Indeed. The Debian package doesn't update the .pc file: https://salsa.debian.org/debian/tidy-html5/-/blob/master/debian/libtidy-dev.install?ref_type=heads and the headers are installed in the tidy namespace/subdirectory. Otherwise the headers are intended to be included like So, then I think that this include directory will need to be adjusted based on whether there is a tidy subdirectory or not. |
I'd suggest to move this perhaps to the version after PHP-8.4. I think it will be a bit too big of a change at once to:
FreeBSD still has tidyp package, and also PHP is installing the tidyp in .cirrus.yml file for FreeBSD. Although could be replaced with tidy-html5 package on current FreeBSD versions. 🤔 |
Yeah, I agree that this turned out to be more ugly than expected. I'll check what tidyp is doing. |
Otherwise, these can be adjusted to use pkg-config also at some point: gmp, tidy, ldap, snmp. In dba extension (cdb, lmdb, TokyoCabinet, and QDBM). And ACL library in FPM. |
I had posted in the PHP Foundation Slack with what I found, and it mostly overlaps yours (didn't know gmp shipped one), though some caveats.
|
The readline should be removed from php-src #13184 because its license is not compatible with PHP. Yes, that ldap is quite complex one. According to my checks, the Oracle's LDAP should be removed also from php-src because it doesn't work anyhow and cannot be built. It lacks a lot of features that was integrated in ldap extension unconditionally with OpenLDAP in mind only. MM library integration I think is also targeted for removal in PHP 9: #14019 |
Debian tidy-html5 issue about the missing include flag (-I/usr/include/tidy) has been reported at https://salsa.debian.org/debian/debpkg-metadata/-/issues/2 |
It seems most distributions i.e. Debian/Gentoo/Fedora have all moved over to html-tidy as the tidy library they ship. It ships a pkg-config file, so we can just simply check for that and omit the various alternatives to check for.
I'm not sure if the checks for library functionality are needed anymore if we assume the html5 tidy fork either.