diff options
| author | Michal Privoznik <michal.privoznik@gmail.com> | 2025-10-09 16:02:35 +0200 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2025-10-09 18:32:03 +0100 |
| commit | f8d188daee9adf814f377a17c17f8779205b780e (patch) | |
| tree | bdd8d6f082a30c49f4a7cefbf2f906fc35a7f9f5 /dev-php | |
| parent | d86802630b385e45c5a4468834c4e0cedbb5d90c (diff) | |
| download | gentoo-f8d188daee9adf814f377a17c17f8779205b780e.tar.gz gentoo-f8d188daee9adf814f377a17c17f8779205b780e.tar.bz2 gentoo-f8d188daee9adf814f377a17c17f8779205b780e.zip | |
dev-php/libvirt-php: Don't rely on libxml2 to provide ATTRIBUTE_UNUSED
In the past, libxml2 used to declare some attributes in its
headers, with ATTRIBUTE_UNUSED being one of them. Some projects
(like libvirt-php) misused this. But after libxml2 was cleaned up
and stopped polluting header files (see commit in backported
patch), these projects have to redefine the macro themselves.
Closes: https://bugs.gentoo.org/963308
Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44111
Closes: https://github.com/gentoo/gentoo/pull/44111
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-php')
| -rw-r--r-- | dev-php/libvirt-php/files/libvirt-php-0.5.8-attribute_unused.patch | 42 | ||||
| -rw-r--r-- | dev-php/libvirt-php/libvirt-php-0.5.8-r2.ebuild (renamed from dev-php/libvirt-php/libvirt-php-0.5.8-r1.ebuild) | 4 |
2 files changed, 46 insertions, 0 deletions
diff --git a/dev-php/libvirt-php/files/libvirt-php-0.5.8-attribute_unused.patch b/dev-php/libvirt-php/files/libvirt-php-0.5.8-attribute_unused.patch new file mode 100644 index 000000000000..2047acb04c6a --- /dev/null +++ b/dev-php/libvirt-php/files/libvirt-php-0.5.8-attribute_unused.patch @@ -0,0 +1,42 @@ +From 64b28253bb25933b74978906042aa07874500beb Mon Sep 17 00:00:00 2001 +Message-ID: <64b28253bb25933b74978906042aa07874500beb.1760018492.git.mprivozn@redhat.com> +From: Michal Privoznik <mprivozn@redhat.com> +Date: Thu, 14 Aug 2025 16:39:44 +0200 +Subject: [libvirt-php][PATCH] src: Don't rely on libxml2 to provide + ATTRIBUTE_UNUSED macro + +From: Michal Privoznik <mprivozn@redhat.com> + +One of the libxml2 header files used to provide ATTRIBUTE_UNUSED +macro definition (it used to be libxml/xmlexports.h but then it +was moved to libxml/xmlversion.h). But as of [1] this is no +longer the case. Thus, declare the macro on our own. + +1: https://gitlab.gnome.org/GNOME/libxml2/-/commit/208f27f9641a59863ce1f7d4992df77f7eb0ea9d + +Signed-off-by: Michal Privoznik <mprivozn@redhat.com> +(cherry picked from commit 5f78512c0eb139660d0a644895e07f83259cda37) +Resolves: https://bugs.gentoo.org/963308 +Signed-off-by: Michal Privoznik <mprivozn@redhat.com> +--- + src/util.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/util.h b/src/util.h +index 9839c3a..a677477 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -46,6 +46,10 @@ + + # define IS_BIGENDIAN (*(uint16_t *)"\0\xff" < 0x100) + ++# ifndef ATTRIBUTE_UNUSED ++# define ATTRIBUTE_UNUSED __attribute__((__unused__)) ++# endif ++ + # define SWAP2_BY_ENDIAN(le, v1, v2) \ + (((le && IS_BIGENDIAN) || (!le && !IS_BIGENDIAN)) ? ((v2 << 8) + v1) : ((v1 << 8) + v2)) + +-- +2.49.1 + diff --git a/dev-php/libvirt-php/libvirt-php-0.5.8-r1.ebuild b/dev-php/libvirt-php/libvirt-php-0.5.8-r2.ebuild index f327a76933ac..48ef43f49233 100644 --- a/dev-php/libvirt-php/libvirt-php-0.5.8-r1.ebuild +++ b/dev-php/libvirt-php/libvirt-php-0.5.8-r2.ebuild @@ -28,6 +28,10 @@ DEPEND="${RDEPEND} DOCS=( ChangeLog NEWS README ) +PATCHES=( + "${FILESDIR}"/${PN}-0.5.8-attribute_unused.patch +) + src_unpack() { default |
